git » abk » commit 1e629a8

Allow metadata updates to fail.

author
2005-03-02 17:58:02 UTC
committer
2005-03-02 17:58:02 UTC
parent 249d82d7b0f1e8bebedde8d7365c57104b728756

Allow metadata updates to fail.

abk +10 -2

diff --git a/abk b/abk
index ca3f57f..383145e 100644
--- a/abk
+++ b/abk
@@ -225,7 +225,7 @@ class index_file:
 		"Get the file_info object for the given filename."
 		return self.db[filename]
 	
-	def del_file(self, filename):
+	def UNUSED_del_file(self, filename):
 		"Remove a file from the index."
 		del(self.db[filename])
 
@@ -311,6 +311,7 @@ for f in srcidx.names:
 		updated_files.append((f, dst))
 	elif not srcidx.db[f].cmp_mdata(dstidx.db[f]):
 		# metadata changed
+		dst = os.path.join(dst_path, f)
 		updated_files.append((f, dst))
 		
 for f in dstidx.names:
@@ -323,5 +324,12 @@ for f in dstidx.names:
 # update metadata
 for f, dst in updated_files:
 	print 'update', f, dst
-	srcidx.db[f].update_mdata(dst)
+	try:
+		srcidx.db[f].update_mdata(dst)
+	except:
+		# it can fail if the destination doesn't have the file, ignore
+		# TODO: output some kind of script so people can run it later
+		# when they get all back together
+		pass
+