public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r15278 - main/trunk/pym/portage/dbapi
@ 2010-01-30  9:46 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2010-01-30  9:46 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2010-01-30 09:46:28 +0000 (Sat, 30 Jan 2010)
New Revision: 15278

Modified:
   main/trunk/pym/portage/dbapi/vartree.py
Log:
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


Modified: main/trunk/pym/portage/dbapi/vartree.py
===================================================================
--- main/trunk/pym/portage/dbapi/vartree.py	2010-01-29 21:59:41 UTC (rev 15277)
+++ main/trunk/pym/portage/dbapi/vartree.py	2010-01-30 09:46:28 UTC (rev 15278)
@@ -53,6 +53,7 @@
 import os as _os
 import stat
 import sys
+import tempfile
 import time
 import warnings
 
@@ -4591,8 +4592,14 @@
 			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'),




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-30  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-30  9:46 [gentoo-commits] portage r15278 - main/trunk/pym/portage/dbapi Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox