From 3c4c3c28e501675a3ff568d0ae976becc157dfdd Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@cd1c1023-2f26-0410-ae45-c471fc1f0318> Date: Mon, 3 Mar 2008 08:43:49 +0000 Subject: [PATCH] shiftpath should be ok now git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1367 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropyTools.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libraries/entropyTools.py b/libraries/entropyTools.py index 4cc12f89c..856eeca37 100644 --- a/libraries/entropyTools.py +++ b/libraries/entropyTools.py @@ -1670,26 +1670,29 @@ def quickpkg(pkgdata, dirpath, edb = True, portdbPath = None, fake = False, comp for path in contents: # convert back to filesystem str encoded_path = path + path = shiftpath+path path = path.encode('raw_unicode_escape') try: - exist = os.lstat(shiftpath+path) + exist = os.lstat(path) except OSError, e: continue # skip file - arcname = path[1:] # remove trailing / + arcname = path[len(shiftpath):] # remove shiftpath + if arcname.startswith("/"): + arcname = arcname[1:] # remove trailing / ftype = pkgdata['content'][encoded_path] if str(ftype) == '0': ftype = 'dir' # force match below, '0' means databases without ftype if 'dir' == ftype and \ not stat.S_ISDIR(exist.st_mode) and \ - os.path.isdir(shiftpath+path): # workaround for directory symlink issues - path = os.path.realpath(shiftpath+path) + os.path.isdir(path): # workaround for directory symlink issues + path = os.path.realpath(path) - tarinfo = tar.gettarinfo(shiftpath+path, arcname) + tarinfo = tar.gettarinfo(path, arcname) tarinfo.uname = id_strings.setdefault(tarinfo.uid, str(tarinfo.uid)) tarinfo.gname = id_strings.setdefault(tarinfo.gid, str(tarinfo.gid)) if stat.S_ISREG(exist.st_mode): tarinfo.type = tarfile.REGTYPE - f = open(shiftpath+path) + f = open(path) try: tar.addfile(tarinfo, f) finally: