[mirrorbrain-commits] r7784 - /trunk/tools/metalink-hasher.py

From: <poeml_at_mirrorbrain.org>
Date: Thu, 03 Sep 2009 09:38:05 -0000
Author: poeml
Date: Thu Sep  3 11:38:03 2009
New Revision: 7784

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7784&view=rev
Log:
metalink-hasher:
- report proper error message when the directory given on the commandline (for
  which to create metalinks for)  does not exist 
- fix a little bug (wrongly used variable) for another error message

Modified:
    trunk/tools/metalink-hasher.py

Modified: trunk/tools/metalink-hasher.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/metalink-hasher.py?rev=7784&r1=7783&r2=7784&view=diff
==============================================================================
--- trunk/tools/metalink-hasher.py (original)
+++ trunk/tools/metalink-hasher.py Thu Sep  3 11:38:03 2009
_at_@ -158,6 +158,9 @@
         opts.target_dir = opts.target_dir.rstrip('/')
         opts.base_dir = opts.base_dir.rstrip('/')
 
+        if not os.path.exists(startdir):
+            sys.exit('STARTDIR %r does not exist' % startdir) 
+
         directories_todo = [startdir]
 
         if opts.ignore_mask: 
_at_@ -174,7 +177,7 @@
                 src_dir_mode = os.stat(src_dir).st_mode
             except OSError, e:
                 if e.errno == errno.ENOENT:
-                    sys.stderr.write('Directory vanished: %r\n' % src)
+                    sys.stderr.write('Directory vanished: %r\n' % src_dir)
                     continue
 
             dst_dir = os.path.join(opts.target_dir, src_dir[len(opts.base_dir):].lstrip('/'))




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Thu Sep 03 2009 - 09:38:07 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT