sysmocom-archiver: Make it somehow work with python3

Yocto master has switched to use python3 and this means all of
our bbclasses must work with it. The cmp function has been removed
and the closest is this dropin routine. Start to use it.
This commit is contained in:
Holger Hans Peter Freyther 2016-07-02 21:49:21 +02:00
parent 7c07fdaa46
commit 959ae40f34
1 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,10 @@ ARCHIVE_TYPE ?= "TAR SRPM"
DISTRO ?= "poky"
PATCHES_ARCHIVE_WITH_SERIES = 'TRUE'
def compat_cmp(a, b):
return (a>b)-(a<b)
def get_bb_inc(d):
'''create a directory "script-logs" including .bb and .inc file in ${WORKDIR}'''
import re
@ -83,7 +87,7 @@ def get_series(d):
locals = (fetch.localpath(url) for url in fetch.urls)
for local in locals:
src_patches.append(local)
if not cmp(work_dir,s):
if not compat_cmp(work_dir,s):
tmp_list = src_patches
else:
tmp_list = src_patches[1:]
@ -178,7 +182,7 @@ def archive_sources_from_directory(d,stage_name):
try:
source_dir = os.path.join(work_dir,[ i for i in s.replace(work_dir,'').split('/') if i][0])
except IndexError:
if not cmp(s,work_dir):
if not compat_cmp(s,work_dir):
return ''
else:
return ''