* fix: donot fail if no old package has a build no
* fix: use join
This commit is contained in:
+24
-23
@@ -538,32 +538,33 @@ class Builder:
|
|||||||
a.sort(lambda x,y : cmp(x[1],y[1]))
|
a.sort(lambda x,y : cmp(x[1],y[1]))
|
||||||
old_package_fn = a[-1][0] # get the last one
|
old_package_fn = a[-1][0] # get the last one
|
||||||
old_build = a[-1][1]
|
old_build = a[-1][1]
|
||||||
else:
|
|
||||||
old_build = None
|
|
||||||
|
|
||||||
# compare old files.xml with the new one..
|
# compare old files.xml with the new one..
|
||||||
old_pkg = Package(old_package_fn, 'r')
|
old_pkg = Package(old_package_fn, 'r')
|
||||||
old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
|
old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
|
||||||
|
|
||||||
# FIXME: TAKE INTO ACCOUNT MINOR CHANGES IN METADATA
|
# FIXME: TAKE INTO ACCOUNT MINOR CHANGES IN METADATA
|
||||||
changed = False
|
changed = False
|
||||||
fnew = self.files.list
|
fnew = self.files.list
|
||||||
fold = old_pkg.files.list
|
fold = old_pkg.files.list
|
||||||
fold.sort(lambda x,y : cmp(x.path,y.path))
|
fold.sort(lambda x,y : cmp(x.path,y.path))
|
||||||
fnew.sort(lambda x,y : cmp(x.path,y.path))
|
fnew.sort(lambda x,y : cmp(x.path,y.path))
|
||||||
if len(fnew) != len(fold):
|
if len(fnew) != len(fold):
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
for i in range(len(fold)):
|
for i in range(len(fold)):
|
||||||
fo = fold.pop(0)
|
fo = fold.pop(0)
|
||||||
fn = fnew.pop(0)
|
fn = fnew.pop(0)
|
||||||
if fo.path != fn.path:
|
if fo.path != fn.path:
|
||||||
changed = True
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
if fo.hash != fn.hash:
|
|
||||||
changed = True
|
changed = True
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
if fo.hash != fn.hash:
|
||||||
|
changed = True
|
||||||
|
break
|
||||||
|
else: # no old build had a build number
|
||||||
|
old_build = None
|
||||||
|
|
||||||
ctx.ui.debug('old build number: %s' % old_build)
|
ctx.ui.debug('old build number: %s' % old_build)
|
||||||
|
|
||||||
# set build number
|
# set build number
|
||||||
@@ -650,7 +651,7 @@ class Builder:
|
|||||||
files = Files()
|
files = Files()
|
||||||
files.read(ctx.const.files_xml)
|
files.read(ctx.const.files_xml)
|
||||||
for finfo in files.list:
|
for finfo in files.list:
|
||||||
pkg.add_to_package("install/" + finfo.path)
|
pkg.add_to_package(join("install", finfo.path))
|
||||||
|
|
||||||
pkg.close()
|
pkg.close()
|
||||||
os.chdir(c)
|
os.chdir(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user