]> arthur.barton.de Git - bup.git/commitdiff
cmd/fsck: correctly catch nonzero return codes of 'par2 create'. bup-0.13a
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 1 Apr 2010 19:43:05 +0000 (15:43 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 1 Apr 2010 19:43:05 +0000 (15:43 -0400)
Oops; we weren't checking the return value like we should.  Reported by
Sitaram Chamarty.

cmd/fsck-cmd.py

index bfd045cb966da4c1da92ef614abe3dc82aceb077..aa78d88320af16624f1ccd8d59e9fad3ba6fa6e3 100755 (executable)
@@ -104,8 +104,14 @@ def do_pack(base, last):
             code = gresult
         else:
             if par2_ok and opt.generate:
-                par2_generate(base)
-            print '%s ok' % last
+                presult = par2_generate(base)
+                if presult != 0:
+                    print '%s par2 create: failed (%d)' % (last, presult)
+                    code = presult
+                else:
+                    print '%s ok' % last
+            else:
+                print '%s ok' % last
     else:
         assert(opt.generate and (not par2_ok or par2_exists))
         debug('    skipped: par2 file already generated.\n')