]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- unlock tree on exception
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 12 Feb 2011 19:18:09 +0000 (19:18 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Sat, 12 Feb 2011 19:18:09 +0000 (19:18 +0000)
Changed files:
    bin/pfa-lintpkg -> 1.10

bin/pfa-lintpkg

index e62182e4f8a0e62a2a0fe842bcac8589264f6484..19f560983bc7c0d7a3a697d993912c3ba5f3e7ab 100644 (file)
@@ -145,22 +145,26 @@ class LintPkg:
             rc = 1
         return rc == 0
 
-lock = 'rpmlint:'+treename
-if not ftpio.lock(lock, True):
-    print >>sys.stderr, "ERR: %s tree already locked for rpmlint" % treename
-    sys.exit(1)
+try:
+    lock = 'rpmlint:'+treename
+    if not ftpio.lock(lock, True):
+        print >>sys.stderr, "ERR: %s tree already locked for rpmlint" % treename
+        sys.exit(1)
 
-if not quiet:
-    print "rpmlint of %d files from %d packages" % (len(files), len(tree.loadedpkgs))
-lint = LintPkg("~/tmp/rpmlint")
-for file in files:
-    lint.rpmlint(file)
     if not quiet:
-        lint.print_stats(file)
-    if show:
-        lint.show_results(file)
+        print "rpmlint of %d files from %d packages" % (len(files), len(tree.loadedpkgs))
+    lint = LintPkg("~/tmp/rpmlint")
+    for file in files:
+        lint.rpmlint(file)
+        if not quiet:
+            lint.print_stats(file)
+        if show:
+            lint.show_results(file)
 
-if not quiet:
-    lint.print_stats()
+    if not quiet:
+        lint.print_stats()
 
-ftpio.unlock(lock)
+    ftpio.unlock(lock)
+except Exception:
+    ftpio.unlock(lock)
+    raise
This page took 0.102671 seconds and 4 git commands to generate.