From bbe9f180abd551b6ebee978cbbab9adbc5eb70a4 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Thu, 11 Nov 2010 18:22:39 +0000 Subject: updated checkpackages.py and introduced massupdate_linhes.py. massupdate will scan /var/abs and tell you which linhes pkg's are outdated when comared against arch src. --- build_tools/bin/check_repo.sh | 2 +- build_tools/bin/check_repo/check_packages.py | 6 +- build_tools/bin/massupdate_linhes.py | 170 +++++++++++++++++++++ .../linhes-local-disk-testing-i686/addedpacks | 1 + .../post_process/home/mythtv/.fluxbox/apps | 3 +- .../linhes-local-mirror-testing-i686/addedpacks | 1 + .../post_process/home/mythtv/.fluxbox/apps | 3 +- 7 files changed, 180 insertions(+), 6 deletions(-) create mode 100644 build_tools/bin/massupdate_linhes.py diff --git a/build_tools/bin/check_repo.sh b/build_tools/bin/check_repo.sh index d8e61fc..9c95d02 100755 --- a/build_tools/bin/check_repo.sh +++ b/build_tools/bin/check_repo.sh @@ -2,5 +2,5 @@ cd /build_tools/bin #extra-testing will do both core and extra -testing #check_repo/check_packages.py --abs-tree=/data/LinHES-PKGBUILD/abs --repos=extra --repo-dir=/data/pkg_repo/i686 -check_repo/check_packages.py --abs-tree=/data/LinHES-PKGBUILD/abs --repos=extra-testing --repo-dir=/data/pkg_repo/i686 +check_repo/check_packages.py --abs-tree=/data/linhes_pkgbuild/abs --repos=extra --repo-dir=/data/pkg_repo/i686 cd - diff --git a/build_tools/bin/check_repo/check_packages.py b/build_tools/bin/check_repo/check_packages.py index 39ac4fb..101e14e 100755 --- a/build_tools/bin/check_repo/check_packages.py +++ b/build_tools/bin/check_repo/check_packages.py @@ -114,7 +114,7 @@ def parse_dbs(repos,arch): dbpkgs = {} for repo in repos: pkgs = set([]) - db = tarfile.open(os.path.join(repodir,repo,repo + DBEXT)) + db = tarfile.open(os.path.join(repodir,repo+"-testing",repo+"-testing" + DBEXT)) for line in db.getnames(): if not '/' in line: pkgs.add(line.rsplit('-',2)[0]) @@ -406,7 +406,7 @@ for absroot in absroots: print "Error : the abs tree " + absroot + " does not exist" sys.exit() for repo in repos: - repopath = absroot + "/" + repo + repopath = absroot + "/" + repo if not os.path.isdir(repopath): print "Error : the repository " + repo + " does not exist in " + absroot sys.exit() @@ -415,7 +415,7 @@ if not os.path.isdir(repodir): sys.exit() for repo in repos: #path = os.path.join(repodir,repo,repo + DBEXT) - path = os.path.join(repodir,repo,repo + DBEXT) + path = os.path.join(repodir,repo+"-testing",repo+"-testing" + DBEXT) if not os.path.isfile(path): print "Error : repo DB %s : File not found" % path sys.exit() diff --git a/build_tools/bin/massupdate_linhes.py b/build_tools/bin/massupdate_linhes.py new file mode 100644 index 0000000..3202964 --- /dev/null +++ b/build_tools/bin/massupdate_linhes.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +import os +import re +import commands + +def create_pkglist(repodir): + group_list={} + os.chdir(str(repodir)) + dir_list = os.listdir(".") + for dir in dir_list: + if os.path.isdir(dir): + #print "found a dir:%s" %dir + + dir_walk = dir + for root, dirs, files in os.walk(dir_walk): + #print "walking %s,%s" %(root,dirs) + for file in [f for f in files]: + if file == "PKGBUILD" : + topdir="%s/%s" %(repodir, root) + if "linhes_pkgbuild" in topdir: + if ("core" in topdir) or ("extra" in topdir): + pass + else: + print "%s not LINHES" %topdir + print "skipping" + continue + + currentfile = topdir + "/PKGBUILD" + if os.path.isfile(currentfile): + pkgname="unknown" + pkgversion="unknown" + pkgdescription="unknown" + pkggroup=[] + try: + f= open(currentfile,"r") + file_contents= f.readlines() + f.close() + for line in file_contents: + if line.strip().startswith("pkgname"): + pkgname=line.partition("=")[2].strip() + + elif line.strip().startswith("pkgver"): + pkgversion=line.partition("=")[2] + + elif line.strip().startswith("pkgdesc"): + pkgdescription=line.partition("=")[2] + + elif line.strip().startswith("groups"): + l=line.partition("=")[2].strip() + for c in ['(',')',"'"]: + l = l.replace( c, '' ) + pkggroup=l.split() + except: + pass + + #temptuple=(pkgname,topdir) + #group_list.append(temptuple) + group_list[pkgname] = topdir + #print repodir + #print root + #print dirs + #print file + os.chdir("..") + return group_list + +def updatepkg(abslocation,linheslocation): + print "\n\n" + print "%s - > %s " %(abslocation, linheslocation) + print "---------------------------------------------------------------" + cmd = '''rsync -avchp -delete-after --stats --exclude="src" %s/ %s''' %(abslocation, linheslocation) + totalfiles=0 + global updated + global failed + global no_update + rc,output = commands.getstatusoutput(cmd) + # print output + for line in output.split("\n"): + #print line + sline=line.strip() + if line.startswith("Number of files transferred"): + totalfiles=line.split(":")[1].strip() + if rc == 0: + #print totalfiles + totalfiles = int(totalfiles.strip()) + if totalfiles >= 1 : + # print "total files transferred is more then 0" + cmd = "touch %s/.updated" %linheslocation + os.system(cmd) + updated = updated + 1 + else: + cmd = "touch %s/.no_update" %linheslocation + os.system(cmd) + no_update = no_update +1 + else: + cmd = "touch %s/.updated_failed" %linheslocation + os.system(cmd) + failed = failed + 1 + + print " updated: %s " %updated + print "no_update: %s " %no_update + print " failed: %s " %failed + + + + +skip_changelist="/tmp/update_list/changelist" +updatedlist="/tmp/update_list/updatedlist" +not_in_abs="/tmp/update_list/not_in_abs" + +skipfile = open(skip_changelist,"w") +updatefile = open(updatedlist,"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 +updated=0 +failed=0 +no_update=0 + +for pkgname, pkglocation in linheslist.iteritems(): + + #print pkgname, pkglocation + if "mv-core" in pkglocation : + continue + if "mythtv" in pkglocation : + continue + if ("core" in pkglocation) or ("extra" in pkglocation): + pass + else: + continue + + + abslocation = '' + try: + abslocation = abslist[pkgname] + except: + # print "pkg is not found in abs %s" %pkgname + outline = "%s : %s \n" %(pkgname, pkglocation) + not_absfile.write(outline) + continue + + + #print "ABSLOCATION %s" %abslocation + #print "LINHES LOCATION %s" %pkglocation + changelog = pkglocation + "/__changelog" + if os.path.isfile(changelog): + # print "%s: pkg has linhes changelog, skipping" %pkgname + 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) + + + +skipfile.close() +updatefile.close() +not_absfile.close() + + + + + diff --git a/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/addedpacks b/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/addedpacks index 9c26d02..72758e0 100755 --- a/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/addedpacks +++ b/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/addedpacks @@ -226,3 +226,4 @@ linux-firmware larch-live mkinitcpio-busybox +windowmaker-crm-git diff --git a/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/post_process/home/mythtv/.fluxbox/apps b/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/post_process/home/mythtv/.fluxbox/apps index 994daf7..37e48ad 100755 --- a/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/post_process/home/mythtv/.fluxbox/apps +++ b/build_tools/larch7/larch0/profiles/linhes-local-disk-testing-i686/post_process/home/mythtv/.fluxbox/apps @@ -1,4 +1,5 @@ #Uncomment below if you are using firewire #[startup] {/usr/bin/plugctl -n 0 "oPCR[0].n_p2pconnections=1"} -[startup] {feh --bg-scale ~/.fluxbox/wallpaper.png} +#[startup] {feh --bg-scale ~/.fluxbox/wallpaper.png} +[startup] {wmsetbg ~/.fluxbox/wallpaper.png} [startup] {/usr/LH/bin/LinHES-run} diff --git a/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/addedpacks b/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/addedpacks index 9c26d02..72758e0 100755 --- a/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/addedpacks +++ b/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/addedpacks @@ -226,3 +226,4 @@ linux-firmware larch-live mkinitcpio-busybox +windowmaker-crm-git diff --git a/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/post_process/home/mythtv/.fluxbox/apps b/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/post_process/home/mythtv/.fluxbox/apps index 994daf7..d976fe8 100755 --- a/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/post_process/home/mythtv/.fluxbox/apps +++ b/build_tools/larch7/larch0/profiles/linhes-local-mirror-testing-i686/post_process/home/mythtv/.fluxbox/apps @@ -1,4 +1,5 @@ #Uncomment below if you are using firewire #[startup] {/usr/bin/plugctl -n 0 "oPCR[0].n_p2pconnections=1"} -[startup] {feh --bg-scale ~/.fluxbox/wallpaper.png} +#[startup] {feh --bg-scale ~/.fluxbox/wallpaper.png} +[startup] {wmsetbg ~/.fluxbox/wallpaper.png} [startup] {/usr/LH/bin/LinHES-run} -- cgit v0.12