1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00
Fix for python26, since it does not support an epath/xpath like
.//entry[@hash].

Fixes: #385 ("osc 0.162.x does not work anymore on SLE11")
This commit is contained in:
Marcus Huewe 2018-02-23 13:29:11 +01:00
commit 5fb71aa6d4

View File

@ -1503,9 +1503,10 @@ class Package:
print('Transmitting file data', end=' ')
filelist = self.__generate_commitlist(todo_send)
sfilelist = self.__send_commitlog(msg, filelist, validate=True)
if sfilelist.get('error') and sfilelist.findall('.//entry[@hash]'):
hash_entries = [e for e in sfilelist.findall('entry') if e.get('hash') is not None]
if sfilelist.get('error') and hash_entries:
name2elem = dict([(e.get('name'), e) for e in filelist.findall('entry')])
for entry in sfilelist.findall('.//entry[@hash]'):
for entry in hash_entries:
filename = entry.get('name')
fileelem = name2elem.get(filename)
if filename not in sha256sums: