diff options
-rwxr-xr-x | apps/patchwork/bin/update-committed-patches.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/patchwork/bin/update-committed-patches.py b/apps/patchwork/bin/update-committed-patches.py index c10aad3..5fe1755 100755 --- a/apps/patchwork/bin/update-committed-patches.py +++ b/apps/patchwork/bin/update-committed-patches.py @@ -50,12 +50,15 @@ def main(): projects = Project.objects.exclude( Q(source_tree__isnull=True) | Q(source_tree='')) + rc = 1 with cache_db: - _update(crwd, projects, cache_db) + rc = _update(crwd, projects, cache_db) + return rc def _update(crwd, projects, cache_db): print "Total number of projects: {0}".format(len(projects)) + rc = 0 for project in projects: print "=" * 80 @@ -65,6 +68,7 @@ def _update(crwd, projects, cache_db): root = ensure_source_checkout_for_project(project) except GitException, e: sys.stderr.write(str(e) + "\n") + rc = 1 continue patches_accepted = 0 @@ -136,6 +140,7 @@ def _update(crwd, projects, cache_db): print "{0} patches marked as accepted".format(patches_accepted) print "{0} patches marked as superseded".format(patches_superseded) print "=" * 80, "\n" + return rc lock = FileLock('/var/lock/update-committed-patches') @@ -148,6 +153,6 @@ except LockTimeout: "can't acquire lock.\n") else: try: - main() + sys.exit(main()) finally: lock.release() |