Make repoman tolerate errors from utime() when fetching metadata.dtd.
authorZac Medico <zmedico@gentoo.org>
Sun, 19 Sep 2010 21:50:51 +0000 (14:50 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 19 Sep 2010 21:50:51 +0000 (14:50 -0700)
bin/repoman

index 9cbd58bc945a75e4bb04067dc80bc9c7534c0f32..f2f16f25cf9c583ac41797eb96be65c64e89f7f5 100755 (executable)
@@ -907,8 +907,15 @@ def fetch_metadata_dtd():
                                local_f.write(url_f.read())
                                local_f.close()
                                if last_modified is not None:
-                                       os.utime(metadata_dtd_tmp,
-                                               (int(last_modified), int(last_modified)))
+                                       try:
+                                               os.utime(metadata_dtd_tmp,
+                                                       (int(last_modified), int(last_modified)))
+                                       except OSError:
+                                               # This fails on some odd non-unix-like filesystems.
+                                               # We don't really need the mtime to be preserved
+                                               # anyway here (currently we use ctime to trigger
+                                               # fetch), so just ignore it.
+                                               pass
                                os.rename(metadata_dtd_tmp, metadata_dtd)
                        finally:
                                try: