Filtering out '~/'

master
Lertsenem 2015-09-13 12:21:59 +02:00
parent 20b0632d0b
commit 421354e9c9
1 changed files with 4 additions and 2 deletions

View File

@ -412,10 +412,12 @@ if args.command == "package":
pkg = tarfile.open(pkgname, "w:gz")
for f in appmeta.files:
# TODO remove leading '~'
filename = args.rootdir +"/"+ appmeta.name +"/"+ f
filedest = appmeta.files[f]["dest"].replace("~/", "", 1)
# TODO save and restore owners and permissions
try:
pkg.add(args.rootdir +"/"+ appmeta.name +"/"+ f, arcname=appmeta.files[f]["dest"])
pkg.add(filename, arcname=filedest)
log.info("Adding %s to package" % f)
except:
log.warning("Failed to add %s to tar package %s" % (f, pkgname))