packages: hplip/hplip-binary-fixup.patch - better errors

arekm arekm at pld-linux.org
Wed Nov 30 20:51:25 CET 2011


Author: arekm                        Date: Wed Nov 30 19:51:25 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- better errors

---- Files affected:
packages/hplip:
   hplip-binary-fixup.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: packages/hplip/hplip-binary-fixup.patch
diff -u packages/hplip/hplip-binary-fixup.patch:1.4 packages/hplip/hplip-binary-fixup.patch:1.5
--- packages/hplip/hplip-binary-fixup.patch:1.4	Wed Nov 30 20:19:01 2011
+++ packages/hplip/hplip-binary-fixup.patch	Wed Nov 30 20:51:20 2011
@@ -12,7 +12,7 @@
  # Local
  from base.logger import *
  from base.g import *
-@@ -318,7 +323,31 @@
+@@ -318,7 +323,32 @@
              log.debug("shutdown: %s" % str(e))
              return False
  
@@ -27,32 +27,31 @@
 +                                       # https://bugs.launchpad.net/hplip/+bug/666780
 +                                       'replace' : [ (0xD0D0, 0x10) ] }
 +                  }
-+        if f in patches:
++        fs = os.path.basename(f)
++        if fs in patches:
 +            d = open(f, 'rb').read()
 +            m = md5()
 +            m.update(d)
 +            m.digest()
-+            if patches[f]['md5'] == m.hexdigest():
++            if patches[fs]['md5'] == m.hexdigest():
 +                file = open(f, 'rb+')
-+                for (addr, val) in patches[f]['replace']:
++                for (addr, val) in patches[fs]['replace']:
 +                    file.seek(addr)
 +                    file.write(chr(val))
 +                file.close()
 +    except Exception, e:
-+        log.debug("binaryPatch: %s" % str(e))
++        log.error("Could not patch binary `%s' for known issues." % str(e))
 +        return False
 +    return True
  
  def copyPluginFiles(src_dir):
      os.chdir(src_dir)
-@@ -411,6 +440,11 @@
+@@ -411,6 +441,9 @@
              continue
  
          else:
 +            
-+            if not binaryPatch(trg):
-+                log.error("Target file %s could not be binary patched to fixup bugs." % trg)
-+                continue
++            binaryPatch(trg):
 +
              if not os.path.exists(trg):
                  log.error("Target file %s does not exist. File copy failed." % trg)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/hplip/hplip-binary-fixup.patch?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list