summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-22 08:47:02 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-22 08:47:02 +0000
commite8fa32b8a6342ba4dff2333abd2af0a89fb25ca2 (patch)
treefa24058ed5db4a7048107712701ba31ea7a6ef1e /pym
parent83878c034e3d6be49165f4e06afe97a5084af2e6 (diff)
downloadportage-e8fa32b8a6342ba4dff2333abd2af0a89fb25ca2.tar.gz
portage-e8fa32b8a6342ba4dff2333abd2af0a89fb25ca2.tar.bz2
portage-e8fa32b8a6342ba4dff2333abd2af0a89fb25ca2.zip
For bug #182428, make quickpkg exclude config files that are protected by CONFIG_PROTECT. Add a --include-config option that includes all config files and a --include-unmodified-config that includes config files that have not been modified since installation (matching md5sum).
svn path=/main/trunk/; revision=6945
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 50b9d9d94..641d4942b 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2127,8 +2127,8 @@ class dblink(object):
"Is this a regular package (does it have a CATEGORY file? A dblink can be virtual *and* regular)"
return os.path.exists(os.path.join(self.dbdir, "CATEGORY"))
-def tar_contents(contents, root, tar, onProgress=None):
- from portage import normalize_path
+def tar_contents(contents, root, tar, protect=None, onProgress=None):
+ from portage.util import normalize_path
root = normalize_path(root).rstrip(os.path.sep) + os.path.sep
id_strings = {}
maxval = len(contents)
@@ -2168,11 +2168,17 @@ def tar_contents(contents, root, tar, onProgress=None):
tarinfo.gname = id_strings.setdefault(tarinfo.gid, str(tarinfo.gid))
if stat.S_ISREG(lst.st_mode):
- f = file(path)
- try:
- tar.addfile(tarinfo, f)
- finally:
- f.close()
+ if protect and protect(path):
+ # Create an empty file as a place holder in order to avoid
+ # potential collision-protect issues.
+ tarinfo.size = 0
+ tar.addfile(tarinfo)
+ else:
+ f = open(path)
+ try:
+ tar.addfile(tarinfo, f)
+ finally:
+ f.close()
else:
tar.addfile(tarinfo)
if onProgress: