public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH 1/6] self-update: Copy only relevant packages from PORTAGE_PYM_PATH
  @ 2014-08-21 20:19 99% ` Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2014-08-21 20:19 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Update the self-update code to copy only packages relevant to Portage,
to avoid copying other packages when Portage is installed alongside
them.
---
 pym/portage/const.py                   | 3 +++
 pym/portage/package/ebuild/doebuild.py | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/portage/const.py b/pym/portage/const.py
index aab6e8a..4b01ff9 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -270,6 +270,9 @@ SUPPORTED_BINPKG_FORMATS = ("tar", "rpm")
 # Time formats used in various places like metadata.chk.
 TIMESTAMP_FORMAT = "%a, %d %b %Y %H:%M:%S +0000"	# to be used with time.gmtime()
 
+# Top-level names of Python packages installed by Portage.
+PORTAGE_PYM_PACKAGES = ("_emerge", "portage", "repoman")
+
 # ===========================================================================
 # END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANT
 # ===========================================================================
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 01707ae..d3e3f5a 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -45,7 +45,7 @@ from portage import auxdbkeys, bsd_chflags, \
 	unmerge, _encodings, _os_merge, \
 	_shell_quote, _unicode_decode, _unicode_encode
 from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \
-	EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY
+	EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, PORTAGE_PYM_PACKAGES
 from portage.data import portage_gid, portage_uid, secpass, \
 	uid, userpriv_groups
 from portage.dbapi.porttree import _parse_uri_map
@@ -2327,7 +2327,11 @@ def _prepare_self_update(settings):
 
 	orig_pym_path = portage._pym_path
 	portage._pym_path = os.path.join(base_path_tmp, "pym")
-	shutil.copytree(orig_pym_path, portage._pym_path, symlinks=True)
+	os.mkdir(portage._pym_path)
+	for pmod in PORTAGE_PYM_PACKAGES:
+		shutil.copytree(os.path.join(orig_pym_path, pmod),
+			os.path.join(portage._pym_path, pmod),
+			symlinks=True)
 
 	for dir_path in (base_path_tmp, portage._bin_path, portage._pym_path):
 		os.chmod(dir_path, 0o755)
-- 
2.0.4



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-08-21 20:19     [gentoo-portage-dev] [PATCHES] setup.py install for Portage Michał Górny
2014-08-21 20:19 99% ` [gentoo-portage-dev] [PATCH 1/6] self-update: Copy only relevant packages from PORTAGE_PYM_PATH Michał Górny

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