]> arthur.barton.de Git - bup.git/blobdiff - cmd/index-cmd.py
Add initial test-list-idx.sh
[bup.git] / cmd / index-cmd.py
index 6f2adf4e581c1dc288babe4bee3525c2f61ea004..73ef55820b5dd95e56e8b7245aea27868d140e14 100755 (executable)
@@ -1,4 +1,9 @@
-#!/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, stat, time, os, errno, re
 from bup import metadata, options, git, index, drecurse, hlinkdb
@@ -57,7 +62,7 @@ def clear_index(indexfile):
             os.remove(path)
             if opt.verbose:
                 log('clear: removed %s\n' % path)
-        except OSError, e:
+        except OSError as e:
             if e.errno != errno.ENOENT:
                 raise
 
@@ -106,7 +111,7 @@ def update_index(top, excluded_paths, exclude_rxs):
         if rig.cur and rig.cur.name == path:    # paths that already existed
             try:
                 meta = metadata.from_path(path, statinfo=pst)
-            except (OSError, IOError), e:
+            except (OSError, IOError) as e:
                 add_error(e)
                 rig.next()
                 continue
@@ -141,7 +146,7 @@ def update_index(top, excluded_paths, exclude_rxs):
         else:  # new paths
             try:
                 meta = metadata.from_path(path, statinfo=pst)
-            except (OSError, IOError), e:
+            except (OSError, IOError) as e:
                 add_error(e)
                 continue
             # See same assignment to 0, above, for rationale.