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