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) ] }
30 + fs = os.path.basename(f)
32 + d = open(f, 'rb').read()
36 + if patches[fs]['md5'] == m.hexdigest():
37 + file = open(f, 'rb+')
38 + for (addr, val) in patches[fs]['replace']:
40 + file.write(chr(val))
42 + except Exception, e:
43 + log.error("Could not patch binary `%s' for known issues." % str(e))
47 def copyPluginFiles(src_dir):
56 if not os.path.exists(trg):
57 log.error("Target file %s does not exist. File copy failed." % trg)