* [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support
@ 2013-06-17 7:21 Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 1/3] Distinguish between portage prefix and package prefix Ruud Koolen
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Ruud Koolen @ 2013-06-17 7:21 UTC (permalink / raw
To: gentoo-portage-dev
This patch series adds support for using a portage installed in one prefix
to build packages with a different prefix.
The current portage has a single EPREFIX variable specifying both the prefix
of the portage installation, and the prefix of the packages portage is
building. This patch series splits it into two parts: the
portage.const.EPREFIX variable specifying the prefix of the portage
installation, used for constructing the PATH as well as the paths to files
belonging to a portage installation itself rather than a target root; and the
EPREFIX setting in config instances, specifying the prefix of the
to-be-built packages and being used for almost everything else.
The EPREFIX config setting defaults to const.EPREFIX, but can be overridden
by the EPREFIX environment variable, as well as the emerge --prefix option.
This allows one to install systems with different prefixes using
`EPREFIX=/foo emerge @system`, though some unrelated changes need to happen
elsewhere first in order to make that a reality.
Ruud Koolen (3):
Distinguish between portage prefix and package prefix
Based GLOBAL_CONFIG_PATH and DEPCACHE_PATH on portage prefix
Pick up EPREFIX environment variable
bin/dispatch-conf | 2 +-
bin/portageq | 2 +-
pym/_emerge/actions.py | 9 +----
pym/_emerge/main.py | 7 ++++
pym/portage/_legacy_globals.py | 3 +-
pym/portage/_sets/__init__.py | 3 --
pym/portage/const.py | 34 ++++++++++----------
pym/portage/dispatch_conf.py | 2 +-
.../package/ebuild/_config/LocationsManager.py | 22 -------------
pym/portage/package/ebuild/config.py | 21 ------------
pym/portage/package/ebuild/doebuild.py | 2 +-
pym/portage/package/ebuild/fetch.py | 4 --
pym/portage/tests/resolver/ResolverPlayground.py | 3 +-
pym/portage/util/env_update.py | 3 +-
14 files changed, 34 insertions(+), 83 deletions(-)
--
1.7.2.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] [PATCH 1/3] Distinguish between portage prefix and package prefix
2013-06-17 7:21 [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Ruud Koolen
@ 2013-06-17 7:23 ` Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 2/3] Based GLOBAL_CONFIG_PATH and DEPCACHE_PATH on portage prefix Ruud Koolen
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Ruud Koolen @ 2013-06-17 7:23 UTC (permalink / raw
To: gentoo-portage-dev
This lets portage distinguish between the prefix where portage itself is
installed, and the prefix of the packages it is installing. The former is
stored in portage.const.EPREFIX and should rarely be overridden (though the
PORTAGE_OVERRIDE_EPREFIX environment variable remains), whereas the latter
can be found in the EPREFIX variable of a config instance and is much more
readily changed.
---
bin/dispatch-conf | 2 +-
bin/portageq | 2 +-
pym/portage/dispatch_conf.py | 2 +-
pym/portage/package/ebuild/doebuild.py | 2 +-
pym/portage/util/env_update.py | 3 +--
5 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index a41464f..10455f4 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -79,7 +79,7 @@ class dispatch:
confs = []
count = 0
- config_root = portage.const.EPREFIX or os.sep
+ config_root = portage.settings["EPREFIX"] or os.sep
self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
if "log-file" in self.options:
diff --git a/bin/portageq b/bin/portageq
index c88ee88..1ae1fe1 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1232,7 +1232,7 @@ def main(argv):
sys.stderr.write("Run portageq with --help for info\n")
sys.stderr.flush()
sys.exit(os.EX_USAGE)
- eprefix = portage.const.EPREFIX
+ eprefix = portage.settings["EPREFIX"]
eroot = portage.util.normalize_path(argv[2])
if eprefix:
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index 4c68dfc..570bd8c 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -43,7 +43,7 @@ def diffstatusoutput(cmd, file1, file2):
return (proc.wait(), output)
def read_config(mandatory_opts):
- eprefix = portage.const.EPREFIX
+ eprefix = portage.settings["EPREFIX"]
config_path = os.path.join(eprefix or os.sep, "etc/dispatch-conf.conf")
loader = KeyValuePairFileLoader(config_path, None)
opts, errors = loader.load()
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 6de47bb..69463d2 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -159,7 +159,7 @@ def _doebuild_path(settings, eapi=None):
# Note: PORTAGE_BIN_PATH may differ from the global constant
# when portage is reinstalling itself.
portage_bin_path = settings["PORTAGE_BIN_PATH"]
- eprefix = settings["EPREFIX"]
+ eprefix = portage.const.EPREFIX
prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x]
rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x]
overrides = [x for x in settings.get(
diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update.py
index e9c06c5..289842c 100644
--- a/pym/portage/util/env_update.py
+++ b/pym/portage/util/env_update.py
@@ -46,12 +46,11 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None,
if isinstance(env, config):
vardbapi = vartree(settings=env).dbapi
else:
+ eprefix = portage.settings["EPREFIX"]
if target_root is None:
- eprefix = portage.settings["EPREFIX"]
target_root = portage.settings["ROOT"]
target_eroot = portage.settings['EROOT']
else:
- eprefix = portage.const.EPREFIX
target_eroot = os.path.join(target_root,
eprefix.lstrip(os.sep))
target_eroot = target_eroot.rstrip(os.sep) + os.sep
--
1.7.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] [PATCH 2/3] Based GLOBAL_CONFIG_PATH and DEPCACHE_PATH on portage prefix
2013-06-17 7:21 [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 1/3] Distinguish between portage prefix and package prefix Ruud Koolen
@ 2013-06-17 7:23 ` Ruud Koolen
2013-06-17 7:24 ` [gentoo-portage-dev] [PATCH 3/3] Pick up EPREFIX environment variable Ruud Koolen
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Ruud Koolen @ 2013-06-17 7:23 UTC (permalink / raw
To: gentoo-portage-dev
The GLOBAL_CONFIG_PATH constants and DEPCACHE_PATH constants should be
relative to the installation prefix of portage itself, not the installation
prefix of packages it is installing.
---
pym/_emerge/actions.py | 6 ---
pym/portage/_sets/__init__.py | 3 --
pym/portage/const.py | 34 ++++++++++----------
.../package/ebuild/_config/LocationsManager.py | 22 -------------
pym/portage/package/ebuild/config.py | 15 ---------
pym/portage/package/ebuild/fetch.py | 4 --
pym/portage/tests/resolver/ResolverPlayground.py | 3 +-
7 files changed, 18 insertions(+), 69 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 767a614..c76aefc 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2019,9 +2019,6 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
myportdir = None
out = portage.output.EOutput()
global_config_path = GLOBAL_CONFIG_PATH
- if settings['EPREFIX']:
- global_config_path = os.path.join(settings['EPREFIX'],
- GLOBAL_CONFIG_PATH.lstrip(os.sep))
if not myportdir:
sys.stderr.write("!!! PORTDIR is undefined. " + \
"Is %s/make.globals missing?\n" % global_config_path)
@@ -3332,9 +3329,6 @@ def missing_sets_warning(root_config, missing_sets):
if root_config.sets:
msg.append(" sets defined: %s" % ", ".join(root_config.sets))
global_config_path = portage.const.GLOBAL_CONFIG_PATH
- if root_config.settings['EPREFIX']:
- global_config_path = os.path.join(root_config.settings['EPREFIX'],
- portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
msg.append(" This usually means that '%s'" % \
(os.path.join(global_config_path, "sets/portage.conf"),))
msg.append(" is missing or corrupt.")
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index c196a70..8123af7 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -295,9 +295,6 @@ def load_default_config(settings, trees):
return SetConfig(None, settings, trees)
global_config_path = GLOBAL_CONFIG_PATH
- if settings['EPREFIX']:
- global_config_path = os.path.join(settings['EPREFIX'],
- GLOBAL_CONFIG_PATH.lstrip(os.sep))
def _getfiles():
for path, dirs, files in os.walk(os.path.join(global_config_path, "sets")):
for f in files:
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 5e960d9..d22d144 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -52,10 +52,23 @@ WORLD_SETS_FILE = PRIVATE_PATH + "/world_sets"
CONFIG_MEMORY_FILE = PRIVATE_PATH + "/config"
NEWS_LIB_PATH = "var/lib/gentoo"
-# these variables get EPREFIX prepended automagically when they are
-# translated into their lowercase variants
-DEPCACHE_PATH = "/var/cache/edb/dep"
-GLOBAL_CONFIG_PATH = "/usr/share/portage/config"
+# The EPREFIX for the current install is hardcoded here, but access to this
+# constant should be minimal, in favor of access via the EPREFIX setting of
+# a config instance (since it's possible to contruct a config instance with
+# a different EPREFIX).
+EPREFIX=""
+
+# pick up EPREFIX from the environment if set
+if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
+ EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
+ if EPREFIX:
+ EPREFIX = os.path.normpath(EPREFIX)
+
+# these variables are based on the prefix of the portage installation, not
+# the prefix of the installed packages, and as such use the builtin EPREFIX
+# rather than the EPREFIX setting in a config instance.
+DEPCACHE_PATH = EPREFIX + "/var/cache/edb/dep"
+GLOBAL_CONFIG_PATH = EPREFIX + "/usr/share/portage/config"
# these variables are not used with target_root or config_root
# NOTE: Use realpath(__file__) so that python module symlinks in site-packages
@@ -152,19 +165,6 @@ MANIFEST2_REQUIRED_HASH = "SHA256"
MANIFEST2_IDENTIFIERS = ("AUX", "MISC", "DIST", "EBUILD")
-# The EPREFIX for the current install is hardcoded here, but access to this
-# constant should be minimal, in favor of access via the EPREFIX setting of
-# a config instance (since it's possible to contruct a config instance with
-# a different EPREFIX). Therefore, the EPREFIX constant should *NOT* be used
-# in the definition of any other constants within this file.
-EPREFIX=""
-
-# pick up EPREFIX from the environment if set
-if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
- EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
- if EPREFIX:
- EPREFIX = os.path.normpath(EPREFIX)
-
VCS_DIRS = ("CVS", "RCS", "SCCS", ".bzr", ".git", ".hg", ".svn")
# ===========================================================================
diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py
index 5057f95..4171807 100644
--- a/pym/portage/package/ebuild/_config/LocationsManager.py
+++ b/pym/portage/package/ebuild/_config/LocationsManager.py
@@ -275,29 +275,7 @@ class LocationsManager(object):
self.eroot = self.target_root.rstrip(os.sep) + self.eprefix + os.sep
- # make.globals should not be relative to config_root
- # because it only contains constants. However, if EPREFIX
- # is set then there are two possible scenarios:
- # 1) If $ROOT == "/" then make.globals should be
- # relative to EPREFIX.
- # 2) If $ROOT != "/" then the correct location of
- # make.globals needs to be specified in the constructor
- # parameters, since it's a property of the host system
- # (and the current config represents the target system).
self.global_config_path = GLOBAL_CONFIG_PATH
- if self.eprefix:
- if self.target_root == "/":
- # case (1) above
- self.global_config_path = os.path.join(self.eprefix,
- GLOBAL_CONFIG_PATH.lstrip(os.sep))
- else:
- # case (2) above
- # For now, just assume make.globals is relative
- # to EPREFIX.
- # TODO: Pass in more info to the constructor,
- # so we know the host system configuration.
- self.global_config_path = os.path.join(self.eprefix,
- GLOBAL_CONFIG_PATH.lstrip(os.sep))
def set_port_dirs(self, portdir, portdir_overlay):
self.portdir = portdir
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 1c29af9..ea3839f 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -781,21 +781,6 @@ class config(object):
self.backupenv["USE_ORDER"] = "env:pkg:conf:defaults:pkginternal:repo:env.d"
self.depcachedir = DEPCACHE_PATH
- if eprefix:
- # See comments about make.globals and EPREFIX
- # above. DEPCACHE_PATH is similar.
- if target_root == "/":
- # case (1) above
- self.depcachedir = os.path.join(eprefix,
- DEPCACHE_PATH.lstrip(os.sep))
- else:
- # case (2) above
- # For now, just assume DEPCACHE_PATH is relative
- # to EPREFIX.
- # TODO: Pass in more info to the constructor,
- # so we know the host system configuration.
- self.depcachedir = os.path.join(eprefix,
- DEPCACHE_PATH.lstrip(os.sep))
if self.get("PORTAGE_DEPCACHEDIR", None):
self.depcachedir = self["PORTAGE_DEPCACHEDIR"]
diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py
index 50a1b72..4cdf326 100644
--- a/pym/portage/package/ebuild/fetch.py
+++ b/pym/portage/package/ebuild/fetch.py
@@ -865,10 +865,6 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
protocol = loc[0:loc.find("://")]
global_config_path = GLOBAL_CONFIG_PATH
- if mysettings['EPREFIX']:
- global_config_path = os.path.join(mysettings['EPREFIX'],
- GLOBAL_CONFIG_PATH.lstrip(os.sep))
-
missing_file_param = False
fetchcommand_var = "FETCHCOMMAND_" + protocol.upper()
fetchcommand = mysettings.get(fetchcommand_var)
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index bff4512..eb15e1c 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -426,8 +426,7 @@ class ResolverPlayground(object):
f.close()
#Create /usr/share/portage/config/make.globals
- make_globals_path = os.path.join(self.eroot,
- GLOBAL_CONFIG_PATH.lstrip(os.sep), "make.globals")
+ make_globals_path = os.path.join(GLOBAL_CONFIG_PATH, "make.globals")
ensure_dirs(os.path.dirname(make_globals_path))
os.symlink(os.path.join(PORTAGE_BASE_PATH, "cnf", "make.globals"),
make_globals_path)
--
1.7.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] [PATCH 3/3] Pick up EPREFIX environment variable
2013-06-17 7:21 [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 1/3] Distinguish between portage prefix and package prefix Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 2/3] Based GLOBAL_CONFIG_PATH and DEPCACHE_PATH on portage prefix Ruud Koolen
@ 2013-06-17 7:24 ` Ruud Koolen
2013-06-17 7:53 ` [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Fabian Groffen
2013-06-18 21:07 ` Zac Medico
4 siblings, 0 replies; 8+ messages in thread
From: Ruud Koolen @ 2013-06-17 7:24 UTC (permalink / raw
To: gentoo-portage-dev
This adds support for picking up the EPREFIX config setting from the EPREFIX
environment variable. An emerge --prefix option is added to specify it,
analogous to --root and --config-root options.
---
pym/_emerge/actions.py | 3 ++-
pym/_emerge/main.py | 7 +++++++
pym/portage/_legacy_globals.py | 3 ++-
pym/portage/package/ebuild/config.py | 6 ------
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c76aefc..89766f1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3148,7 +3148,8 @@ def load_emerge_config(emerge_config=None, **kargs):
emerge_config = _emerge_config(**kargs)
kwargs = {}
- for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")):
+ for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT"),
+ ("eprefix", "EPREFIX")):
v = os.environ.get(envvar, None)
if v and v.strip():
kwargs[k] = v
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 689d136..c67f70b 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -541,6 +541,11 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : true_y_or_n
},
+ "--prefix": {
+ "help" : "specify the installation prefix",
+ "action" : "store"
+ },
+
"--quiet": {
"shortopt" : "-q",
"help" : "reduced or condensed output",
@@ -1024,6 +1029,8 @@ def emerge_main(args=None):
os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"]
if "--root" in myopts:
os.environ["ROOT"] = myopts["--root"]
+ if "--prefix" in myopts:
+ os.environ["EPREFIX"] = myopts["--prefix"]
if "--accept-properties" in myopts:
os.environ["ACCEPT_PROPERTIES"] = myopts["--accept-properties"]
if "--accept-restrict" in myopts:
diff --git a/pym/portage/_legacy_globals.py b/pym/portage/_legacy_globals.py
index abffa0e..bb9691a 100644
--- a/pym/portage/_legacy_globals.py
+++ b/pym/portage/_legacy_globals.py
@@ -27,7 +27,8 @@ def _get_legacy_global(name):
os.umask(0o22)
kwargs = {}
- for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")):
+ for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"),
+ ("target_root", "ROOT"), ("eprefix", "EPREFIX")):
kwargs[k] = os.environ.get(envvar)
portage._initializing_globals = True
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index ea3839f..199a0f5 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -594,14 +594,8 @@ class config(object):
self.backup_changes("PORTAGE_CONFIGROOT")
self["ROOT"] = target_root
self.backup_changes("ROOT")
-
- # The PORTAGE_OVERRIDE_EPREFIX variable propagates the EPREFIX
- # of this config instance to any portage commands or API
- # consumers running in subprocesses.
self["EPREFIX"] = eprefix
self.backup_changes("EPREFIX")
- self["PORTAGE_OVERRIDE_EPREFIX"] = eprefix
- self.backup_changes("PORTAGE_OVERRIDE_EPREFIX")
self["EROOT"] = eroot
self.backup_changes("EROOT")
--
1.7.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support
2013-06-17 7:21 [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Ruud Koolen
` (2 preceding siblings ...)
2013-06-17 7:24 ` [gentoo-portage-dev] [PATCH 3/3] Pick up EPREFIX environment variable Ruud Koolen
@ 2013-06-17 7:53 ` Fabian Groffen
2013-06-17 8:00 ` Ruud Koolen
2013-06-18 21:07 ` Zac Medico
4 siblings, 1 reply; 8+ messages in thread
From: Fabian Groffen @ 2013-06-17 7:53 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
Hi Ruud,
On 17-06-2013 09:21:41 +0200, Ruud Koolen wrote:
> This patch series adds support for using a portage installed in one prefix
> to build packages with a different prefix.
Thanks so much for your work. I hope to have a look at this soon, and
merge this. From your work I assume your patches don't "break" normal
installs/bootstraps, right? (You tested that?)
Fabian
--
Fabian Groffen
Gentoo on a different level
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support
2013-06-17 7:53 ` [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Fabian Groffen
@ 2013-06-17 8:00 ` Ruud Koolen
2013-06-17 11:44 ` gmt
0 siblings, 1 reply; 8+ messages in thread
From: Ruud Koolen @ 2013-06-17 8:00 UTC (permalink / raw
To: gentoo-portage-dev
On Monday 17 June 2013 09:53:11 Fabian Groffen wrote:
> Hi Ruud,
>
> Thanks so much for your work. I hope to have a look at this soon, and
> merge this. From your work I assume your patches don't "break" normal
> installs/bootstraps, right? (You tested that?)
>
> Fabian
I tested emerge -e @world on both gx86 and prefix, and the ability to
cross-eprefix build packages. I did not test bootstrapping.
I also didn't test whether these patches work on the prefix-portage branch. I
don't really know much far prefix-portage diverges from mainline portage, so
I don't know whether I should expect it to just work.
-- Ruud
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support
2013-06-17 8:00 ` Ruud Koolen
@ 2013-06-17 11:44 ` gmt
0 siblings, 0 replies; 8+ messages in thread
From: gmt @ 2013-06-17 11:44 UTC (permalink / raw
To: gentoo-portage-dev
On Mon, 17 Jun 2013, at 01:00, Ruud Koolen thusly quipped:
> I also didn't test whether these patches work on the prefix-portage branch. I
> don't really know much far prefix-portage diverges from mainline portage, so I
> don't know whether I should expect it to just work.
Prefix portage is literally a branch -- in the git sense of the term -- of the regular portage git repo on g.o.g.o. So, a good place to start is to check out that branch and see if your diffs apply. When I am doing work that I expect to flow into both branches, I typically maintain a "master" and prefix_master private branch, with the latter set to pull from origin/prefix, i.e.:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = /usr/src/repos/git/portage.git
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "prefix_master"]
remote = origin
merge = refs/heads/prefix
[branch "cygwin_master"]
remote = .
merge = refs/heads/prefix_master
Guess I didn't use very consistent naming. The basic plan is, with the arrows representing flows of information to the right-hand side on "git pull":
[upstream repo] -> /usr/src/repos/git/portage.git -- a bare, vanilla clone of upstream
[portage.git/master] -> master (which is a private branch with upstreamable patches)
[portage.git/prefix] -> prefix_master (also a private branch, analogous to master, with forward-ported versions of my patches in master; upstreamable to "origin/prefix")
[prefix_master] -> cygwin (an experimental prefix portage "fork", downstream to all of the above)
Usually I cherry-pick patches from master into prefix_master and perform up any merges at that phase, and then just "git checkout cygwin ; git pull" to merge those (vs.-vanilla-prefix-portage) patches into my experimental prefix portage fork.
I do that way because my eyes simply glaze over when I try to read that whole business about prune-and-graft in git merge --help; however if you end up with a huge pile of patches to merge, the prune-graft approach should work perfectly fine to move deltas from master to prefix-master.
-gmt
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support
2013-06-17 7:21 [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Ruud Koolen
` (3 preceding siblings ...)
2013-06-17 7:53 ` [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Fabian Groffen
@ 2013-06-18 21:07 ` Zac Medico
4 siblings, 0 replies; 8+ messages in thread
From: Zac Medico @ 2013-06-18 21:07 UTC (permalink / raw
To: gentoo-portage-dev
On 06/17/2013 12:21 AM, Ruud Koolen wrote:
> This patch series adds support for using a portage installed in one prefix
> to build packages with a different prefix.
>
> The current portage has a single EPREFIX variable specifying both the prefix
> of the portage installation, and the prefix of the packages portage is
> building. This patch series splits it into two parts: the
> portage.const.EPREFIX variable specifying the prefix of the portage
> installation, used for constructing the PATH as well as the paths to files
> belonging to a portage installation itself rather than a target root; and the
> EPREFIX setting in config instances, specifying the prefix of the
> to-be-built packages and being used for almost everything else.
>
> The EPREFIX config setting defaults to const.EPREFIX, but can be overridden
> by the EPREFIX environment variable, as well as the emerge --prefix option.
> This allows one to install systems with different prefixes using
> `EPREFIX=/foo emerge @system`, though some unrelated changes need to happen
> elsewhere first in order to make that a reality.
>
> Ruud Koolen (3):
> Distinguish between portage prefix and package prefix
> Based GLOBAL_CONFIG_PATH and DEPCACHE_PATH on portage prefix
> Pick up EPREFIX environment variable
>
> bin/dispatch-conf | 2 +-
> bin/portageq | 2 +-
> pym/_emerge/actions.py | 9 +----
> pym/_emerge/main.py | 7 ++++
> pym/portage/_legacy_globals.py | 3 +-
> pym/portage/_sets/__init__.py | 3 --
> pym/portage/const.py | 34 ++++++++++----------
> pym/portage/dispatch_conf.py | 2 +-
> .../package/ebuild/_config/LocationsManager.py | 22 -------------
> pym/portage/package/ebuild/config.py | 21 ------------
> pym/portage/package/ebuild/doebuild.py | 2 +-
> pym/portage/package/ebuild/fetch.py | 4 --
> pym/portage/tests/resolver/ResolverPlayground.py | 3 +-
> pym/portage/util/env_update.py | 3 +-
> 14 files changed, 34 insertions(+), 83 deletions(-)
>
I've committed your patches with a few trivial modifications, as noted here:
http://bugs.gentoo.org/show_bug.cgi?id=395633#c37
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-06-18 21:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17 7:21 [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 1/3] Distinguish between portage prefix and package prefix Ruud Koolen
2013-06-17 7:23 ` [gentoo-portage-dev] [PATCH 2/3] Based GLOBAL_CONFIG_PATH and DEPCACHE_PATH on portage prefix Ruud Koolen
2013-06-17 7:24 ` [gentoo-portage-dev] [PATCH 3/3] Pick up EPREFIX environment variable Ruud Koolen
2013-06-17 7:53 ` [gentoo-portage-dev] [PATCH 0/3] Add cross-prefix support Fabian Groffen
2013-06-17 8:00 ` Ruud Koolen
2013-06-17 11:44 ` gmt
2013-06-18 21:07 ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox