]> git.pld-linux.org Git - packages/hplip.git/commitdiff
- patch binary plugin to fix https://bugs.launchpad.net/hplip/+bug/666780 (32bit...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 30 Nov 2011 18:09:28 +0000 (18:09 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    hplip-binary-fixup.patch -> 1.1
    hplip.spec -> 1.92

hplip-binary-fixup.patch [new file with mode: 0644]
hplip.spec

diff --git a/hplip-binary-fixup.patch b/hplip-binary-fixup.patch
new file mode 100644 (file)
index 0000000..6bf1056
--- /dev/null
@@ -0,0 +1,44 @@
+--- hplip-3.11.10/base/pkit.py~        2011-10-02 05:06:15.000000000 +0200
++++ hplip-3.11.10/base/pkit.py 2011-11-30 19:07:51.344925378 +0100
+@@ -318,7 +318,28 @@
+             log.debug("shutdown: %s" % str(e))
+             return False
+-
++def binaryPatch(f):
++    try
++        # file, md5sum, replace content at address with specified byte
++        patches = { 'lj-x86_32.so' : { 'md5': '30bdf8c844508a53d80362f9eba670c5',
++                                       # https://bugs.launchpad.net/hplip/+bug/666780
++                                       'replace' : [ (0xA068, 0x10) ]
++                } }
++        if f in patches:
++            d = open(f, 'rb').read()
++            m = hashlib.md5()
++            m.update(d)
++            m.digest()
++            if patches[f]['md5'] == m.hexdigest():
++                file = open(f, 'rb+')
++                for (addr, val) in patches[f]['replace']:
++                    file.seek(addr)
++                    file.write(chr(val))
++                file.close()
++    except Exception, e:
++        log.debug("binaryPatch: %s" % str(e))
++        return False
++    return True
+ def copyPluginFiles(src_dir):
+     os.chdir(src_dir)
+@@ -411,6 +432,11 @@
+             continue
+         else:
++            
++            if not binaryPatch(trg):
++                log.error("Target file %s could not be binary patched to fixup bugs." % trg)
++                continue
++
+             if not os.path.exists(trg):
+                 log.error("Target file %s does not exist. File copy failed." % trg)
+                 continue
index c2e8854bb67476b8026b8751617662f4654bcba6..99664b1e7691ce72e69cb14b4a2bbe60ba9525e6 100644 (file)
@@ -11,7 +11,7 @@ Summary:      Hewlett-Packard Linux Imaging and Printing suite - printing and scannin
 Summary(pl.UTF-8):     Narzędzia Hewlett-Packard Linux Imaging and Printing - drukowanie i skanowanie przy użyciu urządzeń HP
 Name:          hplip
 Version:       3.11.10
-Release:       1
+Release:       1.2
 License:       BSD (hpijs), MIT (low-level scanning and printing code), GPL v2 (the rest)
 Group:         Applications/System
 Source0:       http://downloads.sourceforge.net/hplip/%{name}-%{version}.tar.gz
@@ -19,6 +19,7 @@ Source0:      http://downloads.sourceforge.net/hplip/%{name}-%{version}.tar.gz
 Patch0:                %{name}-desktop.patch
 Patch1:                unresolved.patch
 Patch2:                pld-distro.patch
+Patch3:                %{name}-binary-fixup.patch
 URL:           http://hplipopensource.com/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -156,6 +157,7 @@ urządzenia HP AiO.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %{__sed} -i -e's,^#!/usr/bin/env python$,#!/usr/bin/python,' *.py
 %{__sed} -i -e 's#test -d /usr/share/polkit-1#true#' configure.in
This page took 0.605647 seconds and 4 git commands to generate.