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

From: <poeml_at_mirrorbrain.org>
Date: Tue, 08 Sep 2009 18:56:19 -0000
Author: poeml
Date: Tue Sep  8 20:56:18 2009
New Revision: 7796

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7796&view=rev
Log:
metalink-hasher:
- in r7793, the following change wasn't committed by accident:
  - ignore if a file that is supposed to be unlinked doesn't exist, which occurs
    for instance in the above mentioned scenario, where the hash files are
    renamed to a different name.

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=7796&r1=7795&r2=7796&view=diff
==============================================================================
--- trunk/tools/metalink-hasher.py (original)
+++ trunk/tools/metalink-hasher.py Tue Sep  8 20:56:18 2009
@@ -344,8 +344,9 @@
                         try:
                             os.unlink(i_path)
                         except OSError, e:
-                            sys.stderr.write('Unlink failed for %r: %s\n' \
-                                                % (i_path, os.strerror(e.errno)))
+                            if e.errno != errno.ENOENT:
+                                sys.stderr.write('Unlink failed for %r: %s\n' \
+                                                    % (i_path, os.strerror(e.errno)))
                     unlinked_files += 1
 
             if opts.verbose:




_______________________________________________
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 Tue Sep 08 2009 - 18:56:19 GMT

This archive was generated by hypermail 2.2.0 : Tue Sep 08 2009 - 19:45:07 GMT