1 --- hplip-3.11.10/base/pkit.py.org 2011-11-30 20:01:59.640469386 +0100
2 +++ hplip-3.11.10/base/pkit.py 2011-11-30 20:06:43.216664960 +0100
8 + from hashlib import md5 as md5
13 from base.logger import *
16 log.debug("shutdown: %s" % str(e))
22 + # file, md5sum, replace content at address with specified byte
23 + patches = { 'lj-x86_32.so' : { 'md5': '30bdf8c844508a53d80362f9eba670c5',
24 + # https://bugs.launchpad.net/hplip/+bug/666780
25 + 'replace' : [ (0xA068, 0x10) ] },
26 + 'lj-x86_64.so' : { 'md5': '28e1b2cde011cbbcd4b5c85c1866c893',
27 + # https://bugs.launchpad.net/hplip/+bug/666780
28 + 'replace' : [ (0xD0D0, 0x10) ] }
31 + d = open(f, 'rb').read()
35 + if patches[f]['md5'] == m.hexdigest():
36 + file = open(f, 'rb+')
37 + for (addr, val) in patches[f]['replace']:
39 + file.write(chr(val))
41 + except Exception, e:
42 + log.debug("binaryPatch: %s" % str(e))
46 def copyPluginFiles(src_dir):
53 + if not binaryPatch(trg):
54 + log.error("Target file %s could not be binary patched to fixup bugs." % trg)
57 if not os.path.exists(trg):
58 log.error("Target file %s does not exist. File copy failed." % trg)