From aa1353347767b50ff844c862fd5d00aed012a3d2 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Thu, 11 Nov 2010 23:36:24 +0000 Subject: mass_update: added version numbers to output --- build_tools/bin/massupdate_linhes.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/build_tools/bin/massupdate_linhes.py b/build_tools/bin/massupdate_linhes.py index 3202964..2063f7b 100644 --- a/build_tools/bin/massupdate_linhes.py +++ b/build_tools/bin/massupdate_linhes.py @@ -55,7 +55,7 @@ def create_pkglist(repodir): #temptuple=(pkgname,topdir) #group_list.append(temptuple) - group_list[pkgname] = topdir + group_list[pkgname] = (topdir,pkgversion) #print repodir #print root #print dirs @@ -106,15 +106,16 @@ def updatepkg(abslocation,linheslocation): skip_changelist="/tmp/update_list/changelist" updatedlist="/tmp/update_list/updatedlist" not_in_abs="/tmp/update_list/not_in_abs" +matchlist="/tmp/update_list/matched" skipfile = open(skip_changelist,"w") updatefile = open(updatedlist,"w") +matchfile = open(matchlist,"w") not_absfile = open(not_in_abs,"w") abslist = create_pkglist("/var/abs") linheslist = create_pkglist("/data/linhes_pkgbuild/abs") - global updated global failed global no_update @@ -122,8 +123,10 @@ updated=0 failed=0 no_update=0 -for pkgname, pkglocation in linheslist.iteritems(): +for pkgname, pkglocation_t in linheslist.iteritems(): + pkglocation=pkglocation_t[0] + pkgversion=pkglocation_t[1].strip().rstrip('\n') #print pkgname, pkglocation if "mv-core" in pkglocation : continue @@ -137,7 +140,8 @@ for pkgname, pkglocation in linheslist.iteritems(): abslocation = '' try: - abslocation = abslist[pkgname] + abslocation = abslist[pkgname][0] + absversion = abslist[pkgname][1].strip().rstrip('\n') except: # print "pkg is not found in abs %s" %pkgname outline = "%s : %s \n" %(pkgname, pkglocation) @@ -153,10 +157,15 @@ for pkgname, pkglocation in linheslist.iteritems(): outline = "%s : %s \n" %(pkgname, pkglocation) skipfile.write(outline) else: - #print "%s: updating from ABS" %pkgname - outline = "%s : %s | %s \n" %(pkgname, pkglocation, abslocation) - updatefile.write(outline) -# updatepkg(abslocation,pkglocation) + if absversion == pkgversion: + outline = "%s: matched %s \n" %(pkgname,pkgversion) + matchfile.write(outline) + else: + #print "%s: updating from ABS" %pkgname + outline = '%s:\n %s,%s | %s,%s \n' %(pkgname, pkglocation, pkgversion, abslocation, absversion) + print outline + updatefile.write(outline) +# updatepkg(abslocation,pkglocation) -- cgit v0.12