[projects/git-slug: 119/170] Print information about problematic file and continue to run

glen glen at pld-linux.org
Mon Sep 21 21:48:49 CEST 2015


commit e95041b42ceaee2343a406b6c1e6047bfabd7cbd
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Jun 25 14:26:11 2012 +0100

    Print information about problematic file and continue to run

 slug_watch | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/slug_watch b/slug_watch
index ea2cee1..ce7478e 100755
--- a/slug_watch
+++ b/slug_watch
@@ -7,6 +7,7 @@ import os
 import pwd
 import pyinotify
 import signal
+import sys
 
 from contextlib import contextmanager
 
@@ -63,14 +64,18 @@ def process_file(pathname):
         refrepo = GitRepo(git_dir=REFREPO_GDIR)
         process = refrepo.showfile(REFFILE, 'master')
         headfile = process.stdout
-        for (repo, ref, number, sha1) in heapq.merge(sorted(processnewfile(newfile)), convertstream(headfile)):
-            if (repo, ref) == oldtuple:
-                continue
-            if sha1 != EMPTYSHA1:
-                print(sha1, ref, repo, file=headfile_new)
-                if repo != oldtuple[0]:
-                    print('packages/'+repo+'.git', file=projects)
-            oldtuple = (repo, ref)
+        try:
+            for (repo, ref, number, sha1) in heapq.merge(sorted(processnewfile(newfile)), convertstream(headfile)):
+                if (repo, ref) == oldtuple:
+                    continue
+                if sha1 != EMPTYSHA1:
+                    print(sha1, ref, repo, file=headfile_new)
+                    if repo != oldtuple[0]:
+                        print('packages/'+repo+'.git', file=projects)
+                oldtuple = (repo, ref)
+        except ValueError:
+            print("Problem with file: ", pathname, file=sys.stderr)
+            return
         process.wait()
 
     os.rename(PROJECTS_LIST_NEW, PROJECTS_LIST)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list