comparison carton.py @ 26:e6ee0410ceef

fix bug where os.path.sep is wrongly interpreted
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 10 Jul 2011 18:37:42 -0700
parents bb19d3dac4c5
children dace84448c25
comparison
equal deleted inserted replaced
25:e2db2913123d 26:e6ee0410ceef
206 buffer = file(source).read() 206 buffer = file(source).read()
207 else: 207 else:
208 # add other sources (files and directories) to the archive 208 # add other sources (files and directories) to the archive
209 source_buffer = StringIO() 209 source_buffer = StringIO()
210 source_tar = tarfile.open(mode="w:gz", fileobj=source_buffer) 210 source_tar = tarfile.open(mode="w:gz", fileobj=source_buffer)
211 source_tar.add(source, arcname=os.path.basename(source)) 211 source_tar.add(source, arcname=os.path.basename(source.rstrip(os.path.sep)))
212 source_tar.close() 212 source_tar.close()
213 buffer = source_buffer.getvalue() 213 buffer = source_buffer.getvalue()
214 214
215 # could use git, hg, etc repos. but probably shouldn't 215 # could use git, hg, etc repos. but probably shouldn't
216 216