From 63a7d9308df828cba8e050f753079db4bb8c9cf6 Mon Sep 17 00:00:00 2001 From: Michael Hanson Date: Wed, 12 Jan 2011 13:07:50 -0800 Subject: mp.py: Script clean up and add code to remove old symlinks --- build_tools/bin/mp.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build_tools/bin/mp.py b/build_tools/bin/mp.py index 5c20011..5dab22e 100755 --- a/build_tools/bin/mp.py +++ b/build_tools/bin/mp.py @@ -213,10 +213,6 @@ def find_repo(): def update_repo(): # pkgname could be a list of several pkgs. Since bash array format is # loose, let bash parse the pkgname(s) first, then return a list for us. - #b = subprocess.Popen(['/bin/bash','-c', 'source ' + pkgfile + '; echo ${pkgname[@]}'], stdout = subprocess.PIPE,) - #output = b.communicate()[0].strip('\n') - #print "Pkglist:",output - #pkglist = list(output.split()) os.chdir(DOCROOT) print @@ -237,6 +233,9 @@ def update_repo(): DELPKG = OLDPKG.pop() print "DELPKG:",DELPKG os.remove(DELPKG) + # Remove any symlinks to old packages + if os.path.islink(mydir + "/" + DELPKG): + os.remove(mydir + "/" + DELPKG) # Copy in new package print "############################################" print "Updating " + DOCROOT + "/" + CARCH + "/" + REPO + " with " + TOTALPKG @@ -334,18 +333,18 @@ def config_file(): if item == "pkgbase": pkgbase = value print "pkgbase:",pkgbase - if item == "pkgname": + elif item == "pkgname": pkgname = value print "pkgname:",pkgname pkglist = list(value.split()) print "pkglist:",pkglist - if item == "pkgver": + elif item == "pkgver": pkgver = value print "pkgver:",pkgver - if item == "pkgrel": + elif item == "pkgrel": pkgrel = value print "pkgrel:",pkgrel - if item == "arch": + elif item == "arch": arch = value print "arch:",arch -- cgit v0.12