summaryrefslogtreecommitdiff
path: root/cron-jobs/check_archlinux/check_packages.py
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-09-06 21:36:42 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-09-18 13:19:58 -0700
commit7eccf95bb5d53cb1b4f8c1d363cd5645ca4e567e (patch)
treec71943bd009ba4f703011e4f808e1a597af7f447 /cron-jobs/check_archlinux/check_packages.py
parentb36b754497df69778273f6a6e7b0d91679646565 (diff)
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 <shiningxc@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'cron-jobs/check_archlinux/check_packages.py')
-rwxr-xr-xcron-jobs/check_archlinux/check_packages.py10
1 files 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