summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-01-30 09:46:28 +0000
committerZac Medico <zmedico@gentoo.org>2010-01-30 09:46:28 +0000
commit06526eaa253ddcdec167462a12cb834f3e5f198e (patch)
tree3684ad95482cd59419460fb3d22145e4a11ef643
parentfc323d93e380fa9e95c5af7fc9683146c5152272 (diff)
downloadportage-06526eaa253ddcdec167462a12cb834f3e5f198e.tar.gz
portage-06526eaa253ddcdec167462a12cb834f3e5f198e.tar.bz2
portage-06526eaa253ddcdec167462a12cb834f3e5f198e.zip
Bug #277902 - When excluding config files, instead of using an empty file as a
placeholder, use a file containing a comment like this: # empty file because --include-config=n when `quickpkg` was used svn path=/main/trunk/; revision=15278
-rw-r--r--pym/portage/dbapi/vartree.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 46b7f8333..33967e21b 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -53,6 +53,7 @@ import logging
import os as _os
import stat
import sys
+import tempfile
import time
import warnings
@@ -4591,8 +4592,14 @@ def tar_contents(contents, root, tar, protect=None, onProgress=None):
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)
+ f = tempfile.TemporaryFile()
+ f.write("# empty file because --include-config=n " + \
+ "when `quickpkg` was used\n")
+ f.flush()
+ f.seek(0)
+ tarinfo.size = os.fstat(f.fileno()).st_size
+ tar.addfile(tarinfo, f)
+ f.close()
else:
f = open(_unicode_encode(path,
encoding=object.__getattribute__(os, '_encoding'),