From 7ac2e599f7f132ce63b933872b9c6649b94e06e3 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 25 Jun 2012 21:11:57 -0700 Subject: Use a directory prefix --- packages/tar-me | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/tar-me b/packages/tar-me index b15399a1..4a4a0253 100755 --- a/packages/tar-me +++ b/packages/tar-me @@ -61,12 +61,18 @@ def main(args): if not fn or fn.startswith("."): continue fns.append(fn) - bfn = 'cloud-init-%s-%s' % (version, revno) + os.makedirs(join(td, bfn)) + + for fn in fns: + if os.path.isfile(fn): + shutil.copy(fn, join(td, bfn, fn)) + else: + shutil.copytree(fn, join(td, bfn, fn)) + fn = '%s.tar.gz' % (bfn) o_fn = join(td, fn) - cmd = ['tar', '-czf', o_fn] - cmd.extend(fns) + cmd = ['tar', '-czf', o_fn, '-C', join(td), bfn] tiny_p(cmd) os.chdir(owcd) -- cgit v1.2.3