diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-03-02 18:24:31 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-03-02 18:24:31 +0000 |
commit | 18792ea70cb833bdc999de27bb45637ea750f49f (patch) | |
tree | 4ac7c4caf6d850848dd8dc297e9da12fa15cf5a7 | |
parent | 31817a261d29908d5cb2892c9c94130cf8d90618 (diff) | |
download | portage-18792ea70cb833bdc999de27bb45637ea750f49f.tar.gz portage-18792ea70cb833bdc999de27bb45637ea750f49f.tar.bz2 portage-18792ea70cb833bdc999de27bb45637ea750f49f.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 (trunk r15278)
svn path=/main/branches/2.1.7/; revision=15517
-rw-r--r-- | pym/portage/dbapi/vartree.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 75558a12f..56694a348 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 @@ -3432,8 +3433,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'), |