git » libjio » commit ba56930

Fix the exporter script to handle '/' in patch names.

author Alberto Bertogli
2005-03-10 05:14:58 UTC
committer Alberto Bertogli
2007-07-15 13:47:35 UTC
parent e0aa4327f6655786cea7aef87b91a789826dc817

Fix the exporter script to handle '/' in patch names.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

utils/exporter +8 -1

diff --git a/utils/exporter b/utils/exporter
index 3c1a46a..5e57713 100644
--- a/utils/exporter
+++ b/utils/exporter
@@ -23,7 +23,14 @@ class Patch:
 		return s
 
 	def export(self, order, path):
-		file = "%s/%.2d-%s.patch" % (path, order, self.name)
+		# '/'s are not allowed in filenames
+		name = self.name.replace('/', '-')
+
+		# avoid 'name..patch'
+		if name[-1] == '.':
+			name = name[:-1]
+			
+		file = "%s/%.2d - %s.patch" % (path, order, name)
 		cmd = 'darcs diff -u --match "hash %s" > "%s"' % \
 				(self.hash, file)
 		if os.system(cmd):