From 7eccf95bb5d53cb1b4f8c1d363cd5645ca4e567e Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sun, 6 Sep 2009 21:36:42 +0200 Subject: improve the way parse_pkgbuilds.sh is called 1) check the return value. before a failed call to parse_pkgbuilds.sh was completely silent.. not good :) 2) call realpath on check_packages.py before determining the directory name, to figure out where parse_pkgbuilds.sh is. This allows to symlink check_packages.py and use the symlink without moving parse_pkgbuilds.sh . for example : /foo/bar/ contains check_packages.py and parse_pkgbuilds.sh ln -s /foo/bar/check_packages.py /bin/check_package dirname(/bin/check_package) returns /bin/ so not good dirname(realpath(/bin/check_package)) returns /foo/bar/ so good Signed-off-by: Xavier Chantry Signed-off-by: Aaron Griffin --- cron-jobs/check_archlinux/check_packages.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cron-jobs/check_archlinux/check_packages.py b/cron-jobs/check_archlinux/check_packages.py index 9ffdac5..cb7eae4 100755 --- a/cron-jobs/check_archlinux/check_packages.py +++ b/cron-jobs/check_archlinux/check_packages.py @@ -58,9 +58,13 @@ class Depend: def parse_pkgbuilds(repos,arch): for absroot in absroots: for repo in repos: - data = commands.getoutput(os.path.dirname(sys.argv[0]) + '/parse_pkgbuilds.sh ' - + arch + ' ' + absroot + '/' + repo) - parse_data(repo,data) + cmd = os.path.dirname(os.path.realpath(sys.argv[0])) + '/parse_pkgbuilds.sh ' + cmd += arch + ' ' + absroot + '/' + repo + (status,output) = commands.getstatusoutput(cmd) + if status != 0: + print "Error : failed to run '%s'" % cmd + sys.exit() + parse_data(repo,output) def parse_data(repo,data): attrname = None -- cgit v1.2.3-24-g4f1b