]> arthur.barton.de Git - bup.git/blobdiff - cmd/fsck-cmd.py
gc: move core code to bup.gc module
[bup.git] / cmd / fsck-cmd.py
index 794c755b4c424d468cae7210a8447b16c0b51c0e..8c4d0b7e842f8431a6d5315e2d802dcafede4691 100755 (executable)
@@ -1,7 +1,14 @@
-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/bup-python" || exit $?
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
+
 import sys, os, glob, subprocess
+
 from bup import options, git
-from bup.helpers import *
+from bup.helpers import Sha1, chunkyreader, istty2, log, progress
 
 par2_ok = 0
 nullf = open('/dev/null')
@@ -71,8 +78,8 @@ def git_verify(base):
     if opt.quick:
         try:
             quick_verify(base)
-        except Exception, e:
-            debug('error: %s\n' % e)
+        except Exception as e:
+            log('error: %s\n' % e)
             return 1
         return 0
     else:
@@ -196,7 +203,7 @@ for name in extra:
         else: # child
             try:
                 sys.exit(do_pack(base, last, par2_exists))
-            except Exception, e:
+            except Exception as e:
                 log('exception: %r\n' % e)
                 sys.exit(99)