summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2017-12-29 14:06:43 +0100
committerFabian Groffen <grobian@gentoo.org>2017-12-29 14:06:43 +0100
commit2790e4405fc6cbeb3e5e6e138f357d09cbc4b46f (patch)
treed24b1aa507ec9c54541bc83d03a697419a069057
parentdev-lang/python: cleanup ebuilds (diff)
downloadprefix-2790e440.tar.gz
prefix-2790e440.tar.bz2
prefix-2790e440.zip
sys-apps/portage: add/update patch for prefix-chaining, bug #642456
Closes: https://bugs.gentoo.org/642456 Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6
-rw-r--r--sys-apps/portage/files/portage-2.2.00.15801-prefix-chaining.patch693
-rw-r--r--sys-apps/portage/files/portage-2.2.01.18826-aix-preservelibs.patch32
-rw-r--r--sys-apps/portage/files/portage-2.2.01.19247-aix-preserve-libs.patch163
-rw-r--r--sys-apps/portage/files/portage-2.2.10.1-brokentty-more-platforms.patch35
-rw-r--r--sys-apps/portage/files/portage-2.2.10.1-case-insensitive-fs.patch375
-rw-r--r--sys-apps/portage/files/portage-2.2.7-macho-relative-install_names.patch68
-rw-r--r--sys-apps/portage/files/portage-2.2.7-sandbox.patch21
-rw-r--r--sys-apps/portage/files/portage-2.2.7-shebang-fixes.patch153
-rw-r--r--sys-apps/portage/files/portage-2.3.18-prefix-chaining.patch (renamed from sys-apps/portage/files/portage-2.3.5-prefix-chaining.patch)182
-rw-r--r--sys-apps/portage/files/portage-2.3.4-mj-safe-econf.patch39
-rw-r--r--sys-apps/portage/portage-2.3.18.ebuild2
11 files changed, 80 insertions, 1683 deletions
diff --git a/sys-apps/portage/files/portage-2.2.00.15801-prefix-chaining.patch b/sys-apps/portage/files/portage-2.2.00.15801-prefix-chaining.patch
deleted file mode 100644
index 01e5934448..0000000000
--- a/sys-apps/portage/files/portage-2.2.00.15801-prefix-chaining.patch
+++ /dev/null
@@ -1,693 +0,0 @@
-diff -ru prefix-portage-2.2.00.15801.orig/bin/ebuild.sh prefix-portage-2.2.00.15801/bin/ebuild.sh
---- prefix-portage-2.2.00.15801.orig/bin/ebuild.sh 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/bin/ebuild.sh 2010-03-11 10:38:21 +0100
-@@ -123,6 +123,83 @@
- # Unset some variables that break things.
- unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
-
-+if [[ -n "${PORTAGE_READONLY_EPREFIXES}" ]]; then
-+ new_PATH=${PATH}
-+
-+ prefixes="${PORTAGE_READONLY_EPREFIXES}:${EPREFIX}"
-+
-+ # build up a PATH for the current environment. the path has to
-+ # contain all the paths the start with $EPREFIX _first_, and
-+ # after that, all the others. We have to re-order the new_PATH,
-+ # so that EPREFIX paths move to the front. after that, the paths
-+ # of all parent prefixes are added, and finally, after that, the
-+ # paths not containing any prefix are added.
-+
-+ save_IFS=$IFS
-+ IFS=':'
-+ pth_pfx=
-+ pth_nopfx=
-+ for pth in ${new_PATH}; do
-+ IFS=$save_IFS
-+ if [[ "${pth#${EPREFIX}}" == "${pth}" ]]; then
-+ [[ ":${pth_nopfx}:" == *":${pth}:"* ]] && continue
-+ if [[ -z "${pth_nopfx}" ]]; then
-+ pth_nopfx="${pth}"
-+ else
-+ pth_nopfx="${pth_nopfx}:${pth}"
-+ fi
-+ else
-+ [[ ":${pth_pfx}:" == *":${pth}:"* ]] && continue
-+ if [[ -z "${pth_pfx}" ]]; then
-+ pth_pfx="${pth}"
-+ else
-+ pth_pfx="${pth_pfx}:${pth}"
-+ fi
-+ fi
-+ done
-+ IFS=$save_IFS
-+
-+ new_PATH=
-+
-+ save_IFS=$IFS
-+ IFS=':'
-+ for eroot in ${prefixes}; do
-+ IFS=$save_IFS
-+ if [[ -f ${eroot}/usr/share/portage/config/make.globals ]]; then
-+ # ok, there is a portage instance installed in this prefix,
-+ # so we can ask (politely) for the DEFAULT_PATH of it :)
-+
-+ defpath="$(. ${eroot}/etc/make.globals && echo $DEFAULT_PATH)"
-+ okpath=
-+ save_IFS2=$IFS
-+ IFS=':'
-+ for p in $defpath; do
-+ IFS=$save_IFS2
-+ # we have that one already...
-+ [[ ":${new_PATH}:" == *":$p:"* ]] && continue
-+ # we skip paths, that are outside our prefix ...
-+ [[ "${p#${eroot}}" == "${p}" ]] && continue
-+ if [[ -z "${okpath}" ]]; then
-+ okpath="${p}"
-+ else
-+ okpath="${okpath}:${p}"
-+ fi
-+ done
-+ IFS=$save_IFS2
-+
-+ new_PATH="${okpath}:${new_PATH}"
-+ else
-+ # no portage installed in this prefix. this means we have to
-+ # somehow fiddle together a sane path for that prefix for at
-+ # least the standard things to work.
-+ new_PATH="${eroot}/usr/bin:${eroot}/usr/sbin:${eroot}/bin:${eroot}/sbin:${new_PATH}"
-+ fi
-+ done
-+ IFS=$save_IFS
-+
-+ export PATH=${pth_pfx}:$new_PATH:${pth_nopfx}
-+fi
-+
- source "${PORTAGE_BIN_PATH}/isolated-functions.sh" &>/dev/null
-
- [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
-@@ -1988,7 +2065,11 @@
-
- #PATH=$_ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
- # PREFIX: same notes apply as at the top of this file
-- PATH="$_ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}${ROOTPATH:+:}$ROOTPATH${EXTRA_PATH:+:}${EXTRA_PATH}"
-+ #PATH="$_ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}${ROOTPATH:+:}$ROOTPATH${EXTRA_PATH:+:}${EXTRA_PATH}"
-+ # PREFIX (with CHAINING!): why the heck not simply pre-pend the paths? hell,
-+ # this shot down prefix-chaining, and made me search a while...
-+ # PATH has been set up at the top of the file already.
-+ PATH="${ebuild_helpers_path}:${PATH}"
- unset _ebuild_helpers_path
-
- if hasq distcc $FEATURES ; then
-diff -ru prefix-portage-2.2.00.15801.orig/pym/_emerge/actions.py prefix-portage-2.2.00.15801/pym/_emerge/actions.py
---- prefix-portage-2.2.00.15801.orig/pym/_emerge/actions.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/_emerge/actions.py 2010-03-11 10:38:21 +0100
-@@ -1783,8 +1783,9 @@
- "control (contains %s).\n!!! Aborting rsync sync.\n") % \
- (myportdir, vcs_dir), level=logging.ERROR, noiselevel=-1)
- return 1
-- if not os.path.exists(EPREFIX + "/usr/bin/rsync"):
-- print("!!! " + EPREFIX + "/usr/bin/rsync does not exist, so rsync support is disabled.")
-+ rsync_bin = portage.readonly_pathmatch_any(settings, "/usr/bin/rsync")
-+ if not os.path.exists(rsync_bin):
-+ print("!!! rsync binary does not exist, so rsync support is disabled.")
- print("!!! Type \"emerge net-misc/rsync\" to enable rsync support.")
- sys.exit(1)
- mytimeout=180
-@@ -1957,7 +1958,7 @@
- if mytimestamp != 0 and "--quiet" not in myopts:
- print(">>> Checking server timestamp ...")
-
-- rsynccommand = [EPREFIX + "/usr/bin/rsync"] + rsync_opts + extra_rsync_opts
-+ rsynccommand = [rsync_bin] + rsync_opts + extra_rsync_opts
-
- if "--debug" in myopts:
- print(rsynccommand)
-@@ -2108,8 +2109,9 @@
- out.eerror(line)
- sys.exit(exitcode)
- elif syncuri[:6]=="cvs://":
-- if not os.path.exists(EPREFIX + "/usr/bin/cvs"):
-- print("!!! " + EPREFIX + "/usr/bin/cvs does not exist, so CVS support is disabled.")
-+ cvs_bin = portage.readonly_pathmatch_any(settings, "/usr/bin/cvs")
-+ if not os.path.exists(cvs_bin):
-+ print("!!! cvs binary does not exist, so CVS support is disabled.")
- print("!!! Type \"emerge dev-util/cvs\" to enable CVS support.")
- sys.exit(1)
- cvsroot=syncuri[6:]
-@@ -2128,7 +2130,7 @@
- "!!! existing '%s' directory; exiting.\n" % myportdir)
- sys.exit(1)
- del e
-- if portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co -P gentoo-x86",settings,free=1):
-+ if portage.spawn("cd "+cvsdir+"; "+cvs_bin+" -z0 -d "+cvsroot+" co -P gentoo-x86",settings,free=1):
- print("!!! cvs checkout error; exiting.")
- sys.exit(1)
- os.rename(os.path.join(cvsdir, "gentoo-x86"), myportdir)
-@@ -2136,15 +2138,16 @@
- #cvs update
- print(">>> Starting cvs update with "+syncuri+"...")
- retval = portage.process.spawn_bash(
-- "cd %s; cvs -z0 -q update -dP" % \
-- (portage._shell_quote(myportdir),), **spawn_kwargs)
-+ "cd %s; %s -z0 -q update -dP" % \
-+ (portage._shell_quote(myportdir),cvs_bin), **spawn_kwargs)
- if retval != os.EX_OK:
- sys.exit(retval)
- dosyncuri = syncuri
- elif syncuri[:11]=="svn+http://" or syncuri[:6]=="svn://" or syncuri[:12]=="svn+https://":
- # Gentoo Prefix hardcoded SVN support
-- if not os.path.exists(EPREFIX + "/usr/bin/svn"):
-- print("!!! " + EPREFIX + "/usr/bin/svn does not exist, so SVN support is disabled.")
-+ svn_bin = portage.readonly_pathmatch_any(settings, "/usr/bin/svn")
-+ if not os.path.exists(svn_bin):
-+ print("!!! svn binary does not exist, so SVN support is disabled.")
- print("!!! Type \"emerge dev-util/subversion\" to enable SVN support.")
- sys.exit(1)
- svndir=os.path.dirname(myportdir)
-@@ -2171,7 +2174,7 @@
- else:
- #svn update
- print(">>> Starting svn update...")
-- retval = portage.spawn("cd '%s'; svn update" % myportdir, \
-+ retval = portage.spawn("cd '%s'; %s update" % (myportdir,svn_bin), \
- settings, free=1)
- if retval != os.EX_OK:
- sys.exit(retval)
-diff -ru prefix-portage-2.2.00.15801.orig/pym/_emerge/depgraph.py prefix-portage-2.2.00.15801/pym/_emerge/depgraph.py
---- prefix-portage-2.2.00.15801.orig/pym/_emerge/depgraph.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/_emerge/depgraph.py 2010-03-11 10:39:49 +0100
-@@ -17,6 +17,7 @@
- from portage.dbapi import dbapi
- from portage.dbapi.dep_expand import dep_expand
- from portage.dep import Atom
-+from portage.dep.dep_check import ro_selected
- from portage.output import bold, blue, colorize, create_color_func, darkblue, \
- darkgreen, green, nc_len, red, teal, turquoise, yellow
- bad = create_color_func("BAD")
-@@ -1143,14 +1144,14 @@
- edepend["DEPEND"] = ""
-
- deps = (
-- (bdeps_root, edepend["DEPEND"],
-+ (bdeps_root, "DEPEND",
- self._priority(buildtime=(not bdeps_optional),
- optional=bdeps_optional),
- pkg.built),
-- (myroot, edepend["RDEPEND"],
-+ (myroot, "RDEPEND",
- self._priority(runtime=True),
- False),
-- (myroot, edepend["PDEPEND"],
-+ (myroot, "PDEPEND",
- self._priority(runtime_post=True),
- False)
- )
-@@ -1161,7 +1162,8 @@
- if not strict:
- portage.dep._dep_check_strict = False
-
-- for dep_root, dep_string, dep_priority, ignore_blockers in deps:
-+ for dep_root, dep_type, dep_priority, ignore_blockers in deps:
-+ dep_string = edepend[dep_type]
- if not dep_string:
- continue
- if debug:
-@@ -1180,7 +1182,7 @@
- uselist=pkg.use.enabled))
-
- dep_string = list(self._queue_disjunctive_deps(
-- pkg, dep_root, dep_priority, dep_string))
-+ pkg, dep_root, dep_priority, dep_string, dep_type))
-
- except portage.exception.InvalidDependString as e:
- if pkg.installed:
-@@ -1196,7 +1198,7 @@
-
- if not self._add_pkg_dep_string(
- pkg, dep_root, dep_priority, dep_string,
-- allow_unsatisfied, ignore_blockers=ignore_blockers):
-+ allow_unsatisfied, ignore_blockers=ignore_blockers, dep_type=dep_type):
- return 0
-
- except portage.exception.AmbiguousPackageName as e:
-@@ -1224,7 +1226,7 @@
- return 1
-
- def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string,
-- allow_unsatisfied, ignore_blockers=False):
-+ allow_unsatisfied, ignore_blockers=False, dep_type=None):
- depth = pkg.depth + 1
- debug = "--debug" in self._frozen_config.myopts
- strict = pkg.type_name != "installed"
-@@ -1240,7 +1242,7 @@
- try:
- selected_atoms = self._select_atoms(dep_root,
- dep_string, myuse=pkg.use.enabled, parent=pkg,
-- strict=strict, priority=dep_priority)
-+ strict=strict, priority=dep_priority, dep_type=dep_type)
- except portage.exception.InvalidDependString as e:
- show_invalid_depstring_notice(pkg, dep_string, str(e))
- del e
-@@ -1395,7 +1397,7 @@
- child_pkgs = atom_pkg_graph.child_nodes(atom)
- yield (atom, child_pkgs[0])
-
-- def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct):
-+ def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct, dep_type=None):
- """
- Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack.
- Yields non-disjunctive deps. Raises InvalidDependString when
-@@ -1406,11 +1408,11 @@
- x = dep_struct[i]
- if isinstance(x, list):
- for y in self._queue_disjunctive_deps(
-- pkg, dep_root, dep_priority, x):
-+ pkg, dep_root, dep_priority, x, dep_type):
- yield y
- elif x == "||":
- self._queue_disjunction(pkg, dep_root, dep_priority,
-- [ x, dep_struct[ i + 1 ] ] )
-+ [ x, dep_struct[ i + 1 ] ] , dep_type)
- i += 1
- else:
- try:
-@@ -1425,25 +1427,25 @@
- # purpose.
- if x.cp.startswith('virtual/'):
- self._queue_disjunction( pkg, dep_root,
-- dep_priority, [ str(x) ] )
-+ dep_priority, [ str(x) ] , dep_type)
- else:
- yield str(x)
- i += 1
-
-- def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct):
-+ def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct, dep_type=None):
- self._dynamic_config._dep_disjunctive_stack.append(
-- (pkg, dep_root, dep_priority, dep_struct))
-+ (pkg, dep_root, dep_priority, dep_struct, dep_type))
-
- def _pop_disjunction(self, allow_unsatisfied):
- """
- Pop one disjunctive dep from self._dynamic_config._dep_disjunctive_stack, and use it to
- populate self._dynamic_config._dep_stack.
- """
-- pkg, dep_root, dep_priority, dep_struct = \
-+ pkg, dep_root, dep_priority, dep_struct, dep_type = \
- self._dynamic_config._dep_disjunctive_stack.pop()
- dep_string = portage.dep.paren_enclose(dep_struct)
- if not self._add_pkg_dep_string(
-- pkg, dep_root, dep_priority, dep_string, allow_unsatisfied):
-+ pkg, dep_root, dep_priority, dep_string, allow_unsatisfied, dep_type):
- return 0
- return 1
-
-@@ -2063,12 +2065,18 @@
- return self._select_atoms_highest_available(*pargs, **kwargs)
-
- def _select_atoms_highest_available(self, root, depstring,
-- myuse=None, parent=None, strict=True, trees=None, priority=None):
-+ myuse=None, parent=None, strict=True, trees=None, priority=None, dep_type=None):
- """This will raise InvalidDependString if necessary. If trees is
- None then self._dynamic_config._filtered_trees is used."""
- pkgsettings = self._frozen_config.pkgsettings[root]
- if trees is None:
- trees = self._dynamic_config._filtered_trees
-+
-+ # this one is needed to guarantee good readonly root
-+ # resolution display in the merge list. required since
-+ # parent (below) can be None
-+ trees[root]["disp_parent"] = parent
-+
- atom_graph = digraph()
- if True:
- try:
-@@ -2081,7 +2089,7 @@
- portage.dep._dep_check_strict = False
- mycheck = portage.dep_check(depstring, None,
- pkgsettings, myuse=myuse,
-- myroot=root, trees=trees)
-+ myroot=root, trees=trees, dep_type=dep_type)
- finally:
- if parent is not None:
- trees[root].pop("parent")
-@@ -2116,6 +2124,7 @@
- selected_atoms[pkg] = [atom for atom in \
- atom_graph.child_nodes(node) if atom in chosen_atoms]
-
-+ trees[root].pop("disp_parent")
- return selected_atoms
-
- def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None,
-@@ -4633,6 +4642,37 @@
- for x in blockers:
- print(x)
-
-+ # print readonly selected packages
-+ if len(ro_selected) > 0:
-+ out.write("\n%s\n\n" % (darkgreen("Packages resolved from readonly installations:")))
-+
-+ ro_mismatch_warning = False
-+ ro_dupcheck = []
-+ for x in ro_selected:
-+ tmp_type = x["type"].replace("END","")
-+ while len(tmp_type) < 4:
-+ tmp_type += " "
-+ if str(x["atom"]) not in ro_dupcheck:
-+ out.write("[%s %s] %s %s %s (%s by %s)" % (teal("readonly"),
-+ green(tmp_type), green(str(x["matches"][0])), yellow("from"),
-+ blue(x["ro_root"]), turquoise(str(x["atom"])), green(x["parent"].cpv)))
-+
-+ ro_dupcheck.append(str(x["atom"]))
-+
-+ if x["host_mismatch"]:
-+ ro_mismatch_warning = True
-+ out.write(" %s\n" % (red("**")))
-+ else:
-+ out.write("\n")
-+
-+ if ro_mismatch_warning:
-+ out.write("\n%s:" % (red("**")))
-+ out.write(yellow(" WARNING: packages marked with ** have been resolved as a\n"))
-+ out.write(yellow(" runtime dependency, but the CHOST variable for the parent\n"))
-+ out.write(yellow(" and dependency package don't match. This could cause link\n"))
-+ out.write(yellow(" errors. It is recommended to use RDEPEND READONLY_EPREFIX's\n"))
-+ out.write(yellow(" only with matching CHOST portage instances.\n"))
-+
- if verbosity == 3:
- print()
- print(counters)
-diff -ru prefix-portage-2.2.00.15801.orig/pym/portage/__init__.py prefix-portage-2.2.00.15801/pym/portage/__init__.py
---- prefix-portage-2.2.00.15801.orig/pym/portage/__init__.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/portage/__init__.py 2010-03-11 10:40:37 +0100
-@@ -85,7 +85,7 @@
- 'portage.dep:best_match_to_list,dep_getcpv,dep_getkey,' + \
- 'flatten,get_operator,isjustname,isspecific,isvalidatom,' + \
- 'match_from_list,match_to_list',
-- 'portage.dep.dep_check:dep_check,dep_eval,dep_wordreduce,dep_zapdeps',
-+ 'portage.dep.dep_check:dep_check,dep_eval,dep_wordreduce,dep_zapdeps,dep_wordreduce_readonly',
- 'portage.eclass_cache',
- 'portage.env.loaders',
- 'portage.exception',
-diff -ru prefix-portage-2.2.00.15801.orig/pym/portage/dbapi/vartree.py prefix-portage-2.2.00.15801/pym/portage/dbapi/vartree.py
---- prefix-portage-2.2.00.15801.orig/pym/portage/dbapi/vartree.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/portage/dbapi/vartree.py 2010-03-11 10:38:21 +0100
-@@ -1837,9 +1837,20 @@
- self._counter_path = os.path.join(root,
- CACHE_PATH, "counter")
-
-+ plibreg_path = os.path.join(self.root, PRIVATE_PATH, "preserved_libs_registry")
-+
-+ if vartree:
-+ self._kill_eprefix = vartree._kill_eprefix
-+ else:
-+ self._kill_eprefix = False
-+
-+ if self._kill_eprefix:
-+ self._aux_cache_filename = os.path.join(self.root, self._aux_cache_filename.replace(EPREFIX, ""))
-+ self._counter_path = os.path.join(self.root, self._counter_path.replace(EPREFIX, ""))
-+ plibreg_path = os.path.join(self.root, plibreg_path.replace(EPREFIX, ""))
-+
- try:
-- self.plib_registry = PreservedLibsRegistry(self.root,
-- os.path.join(self.root, PRIVATE_PATH, "preserved_libs_registry"))
-+ self.plib_registry = PreservedLibsRegistry(self.root, plibreg_path)
- except PermissionDenied:
- # apparently this user isn't allowed to access PRIVATE_PATH
- self.plib_registry = None
-@@ -1861,6 +1872,9 @@
- # This is an optimized hotspot, so don't use unicode-wrapped
- # os module and don't use os.path.join().
- rValue = self.root + _os.sep + VDB_PATH + _os.sep + mykey
-+ if self._kill_eprefix:
-+ rValue = rValue.replace(EPREFIX, "")
-+
- if filename is not None:
- # If filename is always relative, we can do just
- # rValue += _os.sep + filename
-@@ -2012,6 +2026,9 @@
- returnme = []
- basepath = os.path.join(self.root, VDB_PATH) + os.path.sep
-
-+ if self._kill_eprefix:
-+ basepath = os.path.join(self.root, basepath.replace(EPREFIX, ""))
-+
- if use_cache:
- from portage import listdir
- else:
-@@ -2102,7 +2119,12 @@
- return list(self._iter_match(mydep,
- self.cp_list(mydep.cp, use_cache=use_cache)))
- try:
-- curmtime = os.stat(os.path.join(self.root, VDB_PATH, mycat)).st_mtime
-+ _tmp_path = os.path.join(self.root, VDB_PATH, mycat)
-+
-+ if self._kill_eprefix:
-+ _tmp_path = os.path.join(self.root, _tmp_path.replace(EPREFIX, ""))
-+
-+ curmtime = os.stat(_tmp_path).st_mtime
- except (IOError, OSError):
- curmtime=0
-
-@@ -2689,7 +2711,7 @@
- class vartree(object):
- "this tree will scan a var/db/pkg database located at root (passed to init)"
- def __init__(self, root="/", virtual=None, clone=None, categories=None,
-- settings=None):
-+ settings=None, kill_eprefix=False):
- if clone:
- writemsg("vartree.__init__(): deprecated " + \
- "use of clone parameter\n", noiselevel=-1)
-@@ -2698,6 +2720,7 @@
- self.populated = 1
- from portage import config
- self.settings = config(clone=clone.settings)
-+ self._kill_eprefix = clone._kill_eprefix
- else:
- self.root = root[:]
- if settings is None:
-@@ -2705,6 +2728,7 @@
- self.settings = settings
- if categories is None:
- categories = settings.categories
-+ self._kill_eprefix=kill_eprefix
- self.dbapi = vardbapi(self.root, categories=categories,
- settings=settings, vartree=self)
- self.populated = 1
-@@ -2736,6 +2760,10 @@
- raise
- except Exception as e:
- mydir = os.path.join(self.root, VDB_PATH, mycpv)
-+
-+ if self._kill_eprefix:
-+ mydir = os.path.join(self.root, mydir.replace(EPREFIX, ""))
-+
- writemsg(_("\nParse Error reading PROVIDE and USE in '%s'\n") % mydir,
- noiselevel=-1)
- if mylines:
-diff -ru prefix-portage-2.2.00.15801.orig/pym/portage/dep/dep_check.py prefix-portage-2.2.00.15801/pym/portage/dep/dep_check.py
---- prefix-portage-2.2.00.15801.orig/pym/portage/dep/dep_check.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/portage/dep/dep_check.py 2010-03-11 10:40:52 +0100
-@@ -244,6 +244,95 @@
- return 0
- return 1
-
-+ro_trees={}
-+ro_vartrees={}
-+ro_selected=[]
-+
-+def dep_match_readonly_roots(settings, atom, dep_type, parent=None):
-+ if len(ro_trees) < len(settings.readonly_roots):
-+ # MDUFT: create additional vartrees for every readonly root here.
-+ # the ro_vartrees instances are created below as they are needed to
-+ # avoid reading vartrees of portage instances which aren't required
-+ # while resolving this dependencies.
-+ for type in ("DEPEND","RDEPEND", "PDEPEND"):
-+ ro_trees[type] = []
-+
-+ for ro_root, ro_dep_types in settings.readonly_roots.items():
-+ if type in ro_dep_types:
-+ ro_trees[type].append(ro_root)
-+
-+ if len(ro_trees) == 0:
-+ return []
-+
-+ matches = []
-+
-+ for ro_root in ro_trees[dep_type]:
-+ if not ro_vartrees.has_key(ro_root):
-+ # target_root=ro_root ok? or should it be the real target_root?
-+ _tmp_settings = portage.config(config_root=ro_root, target_root=ro_root,
-+ config_incrementals=portage.const.INCREMENTALS)
-+
-+ ro_vartrees[ro_root] = portage.vartree(root=ro_root,
-+ categories=_tmp_settings.categories,
-+ settings=_tmp_settings, kill_eprefix=True)
-+
-+ ro_matches = ro_vartrees[ro_root].dbapi.match(atom)
-+
-+ if ro_matches:
-+ ro_host_mismatch = False
-+ if dep_type is "RDEPEND":
-+ # we need to assure binary compatability, so it needs to be
-+ # the same CHOST! But how? for now i cannot do anything...
-+ if parent and parent.metadata["CHOST"] != ro_vartrees[ro_root].settings.get("CHOST", ""):
-+ # provocate a big fat warning in the list of external packages.
-+ ro_host_mismatch = True
-+ pass
-+
-+ matches.append({ "ro_root": ro_root, "atom": atom, "matches": ro_matches,
-+ "type": dep_type, "parent": parent, "host_mismatch": ro_host_mismatch })
-+
-+ return matches
-+
-+def dep_wordreduce_readonly(reduced, unreduced, settings, dep_type, parent):
-+ for mypos, token in enumerate(unreduced):
-+ # recurse if it's a list.
-+ if isinstance(reduced[mypos], list):
-+ reduced[mypos] = dep_wordreduce_readonly(reduced[mypos],
-+ unreduced[mypos], settings, dep_type, parent)
-+ # do nothing if it's satisfied already.
-+ elif not reduced[mypos]:
-+ ro_matches = dep_match_readonly_roots(settings, unreduced[mypos], dep_type, parent)
-+
-+ if ro_matches:
-+ # TODO: select a match if there are more than one?
-+ # for now, the first match is taken...
-+ ro_selected.append(ro_matches[0])
-+ reduced[mypos] = True
-+
-+ return reduced
-+
-+# this may be better placed somewhere else, but i put it here for now, to
-+# keep all functions in the patch on one big heap.
-+def readonly_pathmatch_any(settings, path):
-+ path = path.lstrip('/')
-+ # first try locally, and match that if it exists.
-+ if os.path.exists(os.path.join(EPREFIX,path)):
-+ return os.path.join(EPREFIX,path)
-+
-+ # after that try all readonly roots where DEPEND is allowed. this makes
-+ # sure that executing binaries is possible from there.
-+ for ro_root, ro_deps in settings.readonly_roots.items():
-+ if "DEPEND" in ro_deps:
-+ print(" --- checking %s --- " % (os.path.join(ro_root,path)))
-+ if os.path.exists(os.path.join(ro_root,path)):
-+ return os.path.join(ro_root,path)
-+ break
-+
-+ # as a fallback make the string the same as it was originally.
-+ # even though this path doesn't exist.
-+ return os.path.join(EPREFIX,path)
-+
-+
- def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
- """
- Takes an unreduced and reduced deplist and removes satisfied dependencies.
-@@ -501,7 +590,7 @@
- assert(False) # This point should not be reachable
-
- def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
-- use_cache=1, use_binaries=0, myroot="/", trees=None):
-+ use_cache=1, use_binaries=0, myroot="/", trees=None , dep_type=None):
- """Takes a depend string and parses the condition."""
- edebug = mysettings.get("PORTAGE_DEBUG", None) == "1"
- #check_config_instance(mysettings)
-@@ -579,6 +668,14 @@
- writemsg("mysplit: %s\n" % (mysplit), 1)
- writemsg("mysplit2: %s\n" % (mysplit2), 1)
-
-+ if dep_type is not None:
-+ mysplit2=dep_wordreduce_readonly(unreduced=mysplit[:],
-+ reduced=mysplit2, settings=mysettings,
-+ dep_type=dep_type, parent=trees[myroot].get("disp_parent"))
-+
-+ writemsg("\n", 1)
-+ writemsg("mysplit2 after readonly reduce: %s\n" % (mysplit2), 1)
-+
- try:
- selected_atoms = dep_zapdeps(mysplit, mysplit2, myroot,
- use_binaries=use_binaries, trees=trees)
-diff -ru prefix-portage-2.2.00.15801.orig/pym/portage/exception.py prefix-portage-2.2.00.15801/pym/portage/exception.py
---- prefix-portage-2.2.00.15801.orig/pym/portage/exception.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/portage/exception.py 2010-03-11 10:38:21 +0100
-@@ -128,3 +128,6 @@
- class UntrustedSignature(SignatureException):
- """Signature was not certified to the desired security level"""
-
-+class InvalidReadonlyERoot(PortageException):
-+ """Readonly EROOT definition string in make.conf invalid."""
-+
-diff -ru prefix-portage-2.2.00.15801.orig/pym/portage/package/ebuild/config.py prefix-portage-2.2.00.15801/pym/portage/package/ebuild/config.py
---- prefix-portage-2.2.00.15801.orig/pym/portage/package/ebuild/config.py 2010-03-11 10:39:16 +0100
-+++ prefix-portage-2.2.00.15801/pym/portage/package/ebuild/config.py 2010-03-11 10:38:21 +0100
-@@ -427,6 +427,7 @@
- self.prevmaskdict = copy.deepcopy(clone.prevmaskdict)
- self.pprovideddict = copy.deepcopy(clone.pprovideddict)
- self.features = copy.deepcopy(clone.features)
-+ self.readonly_roots = copy.deepcopy(clone.readonly_roots)
-
- self._accept_license = copy.deepcopy(clone._accept_license)
- self._plicensedict = copy.deepcopy(clone._plicensedict)
-@@ -1017,6 +1018,50 @@
- _validate_cache_for_unsupported_eapis = False
- _glep_55_enabled = True
-
-+ # expand READONLY_EPREFIX to a list of all readonly portage instances
-+ # all the way down to the last one. beware that ATM a deeper instance
-+ # in the chain can provide more than the toplevel! this means that
-+ # if you only inherit DEPENDS from one instance, that instance may
-+ # inherit RDEPENDs from another one, making the top-level instance
-+ # inherit RDEPENDs from there too - even if the intermediate prefix
-+ # does not do this.
-+ self.readonly_roots = {}
-+ my_ro_current_instance = config_root
-+ my_ro_widest_depset = set(['DEPEND', 'RDEPEND', 'PDEPEND'])
-+
-+ while True:
-+ my_ro_current_make_conf_file = os.path.join(my_ro_current_instance,MAKE_CONF_FILE.lstrip(os.path.sep))
-+
-+ if os.path.exists(my_ro_current_make_conf_file):
-+ my_ro_cfg = getconfig(my_ro_current_make_conf_file, tolerant=1)
-+
-+ if my_ro_cfg.has_key("READONLY_EPREFIX"):
-+ if not my_ro_cfg["READONLY_EPREFIX"].find(":"):
-+ raise portage.exception.InvalidReadonlyERoot("ERROR: malformed READONLY_EPREFIX in %s" % (my_ro_current_make_conf_file))
-+
-+ (my_ro_cfg_root,my_ro_cfg_root_deps) = my_ro_cfg["READONLY_EPREFIX"].rsplit(":",1)
-+
-+ if not os.path.exists(my_ro_cfg_root):
-+ raise portage.exception.InvalidReadonlyERoot("ERROR: malformed READONLY_EPREFIX in %s: path does not exist!" % (my_ro_current_instance))
-+
-+ if self.readonly_roots.has_key(my_ro_cfg_root):
-+ raise portage.exception.InvalidReadonlyERoot("ERROR: circular READONLY_EPREFIX's in %s. %s already checked for %s" % (my_ro_current_make_conf_file, my_ro_cfg_root, self.readonly_roots[my_ro_cfg_root]))
-+
-+ if my_ro_cfg_root == config_root:
-+ raise portage.exception.InvalidReadonlyERoot("ERROR: cannot add this instance as READONLY_EPREFIX in %s." % (my_ro_current_make_conf_file))
-+
-+ # intersect the widest depset with the current one to strip down
-+ # the allowed dependency resolution to not be wider than the
-+ # next higher one. this way we can prevent for a given prefix
-+ # to resolve RDEPENDs from a prefix with a different CHOST that
-+ # is a few levels deeper in the chain.
-+ my_ro_widest_depset = set(my_ro_cfg_root_deps.split(",")) & my_ro_widest_depset
-+ self.readonly_roots[my_ro_cfg_root] = my_ro_widest_depset
-+ my_ro_current_instance = my_ro_cfg_root
-+ continue
-+
-+ break
-+
- for k in self._case_insensitive_vars:
- if k in self:
- self[k] = self[k].lower()
-@@ -2574,6 +2619,10 @@
- if eapi not in ("0", "1", "2", "3", "3_pre2"):
- mydict.pop("AA", None)
-
-+ # populate with PORTAGE_READONLY_EPREFIXES
-+ if self.readonly_roots and len(self.readonly_roots) > 0:
-+ mydict["PORTAGE_READONLY_EPREFIXES"] = ':'.join(self.readonly_roots)
-+
- # Prefix variables are supported starting with EAPI 3.
- # but during transition, we just support them anywhere
- #if phase == 'depend' or eapi in (None, "0", "1", "2"):
diff --git a/sys-apps/portage/files/portage-2.2.01.18826-aix-preservelibs.patch b/sys-apps/portage/files/portage-2.2.01.18826-aix-preservelibs.patch
deleted file mode 100644
index 002f11ce42..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.18826-aix-preservelibs.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Need to list executables in NEEDED.XCOFF.1 too for preserve-libs.
-
-Do not prepend filenames with '.' twice when calculating the preserve-lib
-helper-filenames. Can't say which commit triggers this problem, as this
-did work before.
---- bin/misc-functions.sh.orig 2011-06-16 17:15:47 +0200
-+++ bin/misc-functions.sh 2011-06-16 17:17:13 +0200
-@@ -1178,7 +1178,9 @@
- fi
- prev_FILE=${FILE}
-
-- [[ " ${FLAGS} " == *" SHROBJ "* ]] || continue
-+ # shared objects have both EXEC and SHROBJ flags,
-+ # while executables have EXEC flag only.
-+ [[ " ${FLAGS} " == *" EXEC "* ]] || continue
-
- # Make sure we disallow insecure RUNPATH's
- # Don't want paths that point to the tree where the package was built
---- pym/portage/util/_dyn_libs/LinkageMapXCoff.py.orig 2011-06-17 11:26:45 +0200
-+++ pym/portage/util/_dyn_libs/LinkageMapXCoff.py 2011-06-17 11:32:13 +0200
-@@ -255,7 +255,11 @@
- def as_contentmember(obj):
- if obj.endswith("]"):
- if obj.find("/") >= 0:
-+ if obj[obj.rfind("/")+1] == ".":
-+ return obj
- return obj[:obj.rfind("/")] + "/." + obj[obj.rfind("/")+1:]
-+ if obj[0] == ".":
-+ return obj
- return "." + obj
- return obj
-
diff --git a/sys-apps/portage/files/portage-2.2.01.19247-aix-preserve-libs.patch b/sys-apps/portage/files/portage-2.2.01.19247-aix-preserve-libs.patch
deleted file mode 100644
index ecc42fd07c..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.19247-aix-preserve-libs.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-Drop code identical to and inheritable from LinkageMapELF.
-
-Update code that is duplicated from LinkageMapELF.
-
-Actually query information for /all/ preserved shared objects,
-not the last one only.
-Maybe the KeyError-problem is gone for AIX due to this fix,
-even if that workaround was inherited from LinkageMapELF.
-
-Deal with existing helper files in a binpkg created with 'quickpkg'.
-Eventually improve performance when creating helper files.
-
---- pym/portage/util/_dyn_libs/LinkageMapXCoff.py.orig 2011-09-14 16:02:34 +0200
-+++ pym/portage/util/_dyn_libs/LinkageMapXCoff.py 2011-09-14 16:34:43 +0200
-@@ -71,21 +71,10 @@
- # filesystem.
- return os.path.realpath(abs_path)
- # Return a tuple of the device and inode, as well as the basename,
-- # because of hardlinks the device and inode might be identical.
-+ # because of hardlinks (notably for the .libNAME[shr.o] helpers)
-+ # the device and inode might be identical.
- return (object_stat.st_dev, object_stat.st_ino, os.path.basename(abs_path.rstrip(os.sep)))
-
-- def file_exists(self):
-- """
-- Determine if the file for this key exists on the filesystem.
--
-- @rtype: Boolean
-- @return:
-- 1. True if the file exists.
-- 2. False if the file does not exist or is a broken symlink.
--
-- """
-- return isinstance(self._key, tuple)
--
- class _LibGraphNode(_ObjectKey):
- __slots__ = ("alt_paths",)
-
-@@ -175,10 +164,9 @@
- continue
- plibs.update((x, cpv) for x in items)
- if plibs:
-- for x in plibs:
-- args = [BASH_BINARY, "-c", ':'
-- + '; member="' + x + '"'
-- + '; archive=${member}'
-+ args = [BASH_BINARY , "-c" , ':'
-+ + '; for member in "$@"'
-+ + '; do archive=${member}'
- + '; if [[ ${member##*/} == .*"["*"]" ]]'
- + '; then member=${member%/.*}/${member##*/.}'
- + '; archive=${member%[*}'
-@@ -195,9 +183,21 @@
- + '; done'
- + '; [[ -n ${MEMBER} ]] && MEMBER="[${MEMBER}]"'
- + '; [[ " ${FLAGS} " == *" SHROBJ "* ]] && soname=${FILE##*/}${MEMBER} || soname='
-- + '; echo "${FORMAT##* }${FORMAT%%-*};${FILE#${ROOT%/}}${MEMBER};${soname};${RUNPATH};${needed}"'
-- + '; [[ -z ${member} && -n ${MEMBER} ]] && echo "${FORMAT##* }${FORMAT%%-*};${FILE#${ROOT%/}};${FILE##*/};;"'
-- ]
-+ + '; case ${member:+y}:${MEMBER:+y}'
-+ # member requested, member found: show shared archive member
-+ + ' in y:y) echo "${FORMAT##* }${FORMAT%%-*};${FILE#${ROOT%/}}${MEMBER};${soname};${RUNPATH};${needed}"'
-+ # no member requested, member found: show archive
-+ + ' ;; :y) echo "${FORMAT##* }${FORMAT%%-*};${FILE#${ROOT%/}};${FILE##*/};;"'
-+ # no member requested, no member found: show standalone shared object
-+ + ' ;; : ) echo "${FORMAT##* }${FORMAT%%-*};${FILE#${ROOT%/}};${FILE##*/};${RUNPATH};${needed}"'
-+ # member requested, no member found: ignore archive replaced by standalone shared object
-+ + ' ;; y: )'
-+ + ' ;; esac'
-+ + '; done'
-+ , 'aixdll-query'
-+ ]
-+ args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
-+ for x in plibs)
- try:
- proc = subprocess.Popen(args, stdout=subprocess.PIPE)
- except EnvironmentError as e:
-@@ -228,17 +228,8 @@
- owner = plibs.pop(fields[1], None)
- lines.append((owner, "aixdll-query", ";".join(fields)))
- proc.wait()
-+ proc.stdout.close()
-
-- if plibs:
-- # Preserved libraries that did not appear in the bash
-- # aixdll-query code output. This is known to happen with
-- # statically linked libraries. Generate dummy lines for
-- # these, so we can assume that every preserved library has
-- # an entry in self._obj_properties. This is important in
-- # order to prevent findConsumers from raising an unwanted
-- # KeyError.
-- for x, cpv in plibs.items():
-- lines.append((cpv, "plibs", ";".join(['', x, '', '', ''])))
- # Share identical frozenset instances when available,
- # in order to conserve memory.
- frozensets = {}
-@@ -318,23 +309,4 @@
- soname_node.providers = tuple(set(soname_node.providers))
- soname_node.consumers = tuple(set(soname_node.consumers))
-
-- def getSoname(self, obj):
-- """
-- Return the soname associated with an object.
--
-- @param obj: absolute path to an object
-- @type obj: string (example: '/usr/bin/bar')
-- @rtype: string
-- @return: soname as a string
--
-- """
-- if not self._libs:
-- self.rebuild()
-- if isinstance(obj, self._ObjectKey):
-- obj_key = obj
-- if obj_key not in self._obj_properties:
-- raise KeyError("%s not in object list" % obj_key)
-- return self._obj_properties[obj_key].soname
-- if obj not in self._obj_key_cache:
-- raise KeyError("%s not in object list" % obj)
-- return self._obj_properties[self._obj_key_cache[obj]].soname
-+ pass
---- bin/misc-functions.sh.orig 2011-09-14 17:53:45 +0200
-+++ bin/misc-functions.sh 2011-09-14 18:21:01 +0200
-@@ -1297,7 +1297,7 @@
- else
- die "cannot find where to use 'ar' and 'strip' from"
- fi
-- local archives_members= archives=() chmod400files=()
-+ local archives_members= archives=() helperfiles=()
- local archive_member soname runpath needed archive contentmember
- while read archive_member; do
- archive_member=${archive_member#*;${EPREFIX}/} # drop "^type;EPREFIX/"
-@@ -1321,13 +1321,24 @@
- # portage does os.lstat() on merged files every now
- # and then, so keep stamp-files for archive members
- # around to get the preserve-libs feature working.
-- { echo "Please leave this file alone, it is an important helper"
-- echo "for portage to implement the 'preserve-libs' feature on AIX."
-- } > "${ED}${contentmember}" || die "cannot create ${contentmember}"
-- chmod400files[${#chmod400files[@]}]=${ED}${contentmember}
-+ helperfiles[${#helperfiles[@]}]=${ED}${contentmember}
- done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1
-- [[ ${#chmod400files[@]} == 0 ]] ||
-- chmod 0400 "${chmod400files[@]}" || die "cannot chmod ${chmod400files[@]}"
-+ if [[ ${#helperfiles[@]} > 0 ]]; then
-+ rm -f "${helperfiles[@]}" || die "cannot prune ${helperfiles[@]}"
-+ local f prev=
-+ for f in "${helperfiles[@]}"
-+ do
-+ if [[ -z ${prev} ]]; then
-+ { echo "Please leave this file alone, it is an important helper"
-+ echo "for portage to implement the 'preserve-libs' feature on AIX."
-+ } > "${f}" || die "cannot create ${f}"
-+ chmod 0400 "${f}" || die "cannot chmod ${f}"
-+ prev=${f}
-+ else
-+ ln "${prev}" "${f}" || die "cannot create hardlink ${f}"
-+ fi
-+ done
-+ fi
-
- local preservemembers libmetadir prunedirs=()
- local FILE MEMBER FLAGS
diff --git a/sys-apps/portage/files/portage-2.2.10.1-brokentty-more-platforms.patch b/sys-apps/portage/files/portage-2.2.10.1-brokentty-more-platforms.patch
deleted file mode 100644
index bd7ab7ffcb..0000000000
--- a/sys-apps/portage/files/portage-2.2.10.1-brokentty-more-platforms.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-https://gitweb.gentoo.org/proj/portage.git/commit/?h=prefix&id=9607fb432f1333774bf6994166e2fa7e96616b6d
-
-From 9556da42590eecaafe126473aff04c2cee59d833 Mon Sep 17 00:00:00 2001
-From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
-Date: Thu, 18 Jun 2015 18:39:58 +0200
-Subject: [PATCH] disable openpty on more unices
-
----
- pym/portage/util/_pty.py | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/pym/portage/util/_pty.py b/pym/portage/util/_pty.py
-index 11c8b92..a92f575 100644
---- a/pym/portage/util/_pty.py
-+++ b/pym/portage/util/_pty.py
-@@ -9,12 +9,12 @@ from portage import os
- from portage.output import get_term_size, set_term_size
- from portage.util import writemsg
-
--# Disable the use of openpty on Solaris as it seems Python's openpty
--# implementation doesn't play nice on Solaris with Portage's
--# behaviour causing hangs/deadlocks.
-+# Disable the use of openpty on Solaris (and others) as it seems Python's
-+# openpty implementation doesn't play nice with Portage's behaviour,
-+# causing hangs/deadlocks.
- # Additional note for the future: on Interix, pipes do NOT work, so
- # _disable_openpty on Interix must *never* be True
--_disable_openpty = platform.system() in ("SunOS","FreeMiNT",)
-+_disable_openpty = platform.system() in ("AIX","FreeMiNT","HP-UX","SunOS",)
-
- _fbsd_test_pty = platform.system() == 'FreeBSD'
-
---
-2.0.5
-
diff --git a/sys-apps/portage/files/portage-2.2.10.1-case-insensitive-fs.patch b/sys-apps/portage/files/portage-2.2.10.1-case-insensitive-fs.patch
deleted file mode 100644
index 7f69cd64b5..0000000000
--- a/sys-apps/portage/files/portage-2.2.10.1-case-insensitive-fs.patch
+++ /dev/null
@@ -1,375 +0,0 @@
-From fc3e0fafac889586ad85b12f414bcd10d30d7021 Mon Sep 17 00:00:00 2001
-From: Zac Medico <zmedico@gentoo.org>
-Date: Thu, 2 Oct 2014 10:57:11 -0700
-Subject: [PATCH] FEATURES=case-insensitive-fs for bug #524236
-
-When case-insensitive-fs is enabled in FEATURES, the dblink.isowner
-method, _owners_db class, and ConfigProtect class will be
-case-insensitive. This causes the collision-protect and unmerge code
-to behave correctly for a case-insensitive file system. If the file
-system is case-insensitive but case-preserving, then case is preserved
-in the CONTENTS data of installed packages.
-
-X-Gentoo-Bug: 524236
-X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=524236
----
- bin/dispatch-conf | 8 +++++++-
- bin/etc-update | 14 +++++++++++---
- bin/portageq | 7 ++++---
- bin/quickpkg | 4 +++-
- man/make.conf.5 | 4 ++++
- pym/_emerge/depgraph.py | 4 +++-
- pym/portage/_global_updates.py | 4 +++-
- pym/portage/const.py | 1 +
- pym/portage/dbapi/vartree.py | 32 +++++++++++++++++++++++++++++++-
- pym/portage/update.py | 6 ++++--
- pym/portage/util/__init__.py | 10 +++++++++-
- 11 files changed, 80 insertions(+), 14 deletions(-)
-
-diff --git a/bin/dispatch-conf b/bin/dispatch-conf
-index fb0a8af..7946415 100755
---- a/bin/dispatch-conf
-+++ b/bin/dispatch-conf
-@@ -29,6 +29,10 @@ from portage.process import find_binary, spawn
- FIND_EXTANT_CONFIGS = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname '.*.bak' -print"
- DIFF_CONTENTS = "diff -Nu '%s' '%s'"
-
-+if "case-insensitive-fs" in portage.settings.features:
-+ FIND_EXTANT_CONFIGS = \
-+ FIND_EXTANT_CONFIGS.replace("-name '._cfg", "-iname '._cfg")
-+
- # We need a secure scratch dir and python does silly verbose errors on the use of tempnam
- oldmask = os.umask(0o077)
- SCRATCH_DIR = None
-@@ -144,7 +148,9 @@ class dispatch:
- protect_obj = portage.util.ConfigProtect(
- config_root, config_paths,
- portage.util.shlex_split(
-- portage.settings.get('CONFIG_PROTECT_MASK', '')))
-+ portage.settings.get('CONFIG_PROTECT_MASK', '')),
-+ case_insensitive = ("case-insensitive-fs"
-+ in portage.settings.features))
-
- def diff(file1, file2):
- return diffstatusoutput(DIFF_CONTENTS, file1, file2)
-diff --git a/bin/etc-update b/bin/etc-update
-index 1a99231..c27379b 100755
---- a/bin/etc-update
-+++ b/bin/etc-update
-@@ -67,6 +67,7 @@ scan() {
- mkdir "${TMP}"/files || die "Failed mkdir command!"
- count=0
- input=0
-+ local basename
- local find_opts
- local path
-
-@@ -75,13 +76,17 @@ scan() {
-
- if [[ ! -d ${path} ]] ; then
- [[ ! -f ${path} ]] && continue
-- local my_basename="${path##*/}"
-+ basename="${path##*/}"
- path="${path%/*}"
-- find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
-+ find_opts=( -maxdepth 1 )
- else
-+ basename=*
- # Do not traverse hidden directories such as .svn or .git.
-- find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
-+ find_opts=( -name '.*' -type d -prune -o )
- fi
-+ ${case_insensitive} && \
-+ find_opts+=( -iname ) || find_opts+=( -name )
-+ find_opts+=( "._cfg????_${basename}" )
- find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
-
- if [ ! -w "${path}" ] ; then
-@@ -623,6 +628,7 @@ ${SET_X} && set -x
- type -P portageq >/dev/null || die "missing portageq"
- portage_vars=(
- CONFIG_PROTECT{,_MASK}
-+ FEATURES
- PORTAGE_CONFIGROOT
- PORTAGE_INST_{G,U}ID
- PORTAGE_TMPDIR
-@@ -633,6 +639,8 @@ portage_vars=(
- eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
- export PORTAGE_TMPDIR
- SCAN_PATHS=${*:-${CONFIG_PROTECT}}
-+[[ " ${FEATURES} " == *" case-insensitive-fs "* ]] && \
-+ case_insensitive=true || case_insensitive=false
-
- TMP="${PORTAGE_TMPDIR}/etc-update-$$"
- trap "die terminated" SIGTERM
-diff --git a/bin/portageq b/bin/portageq
-index 009f116..552cff6 100755
---- a/bin/portageq
-+++ b/bin/portageq
-@@ -379,8 +379,8 @@ def is_protected(argv):
- protect = portage.util.shlex_split(settings.get("CONFIG_PROTECT", ""))
- protect_mask = portage.util.shlex_split(
- settings.get("CONFIG_PROTECT_MASK", ""))
-- protect_obj = ConfigProtect(root, protect, protect_mask)
--
-+ protect_obj = ConfigProtect(root, protect, protect_mask,
-+ case_insensitive = ("case-insensitive-fs" in settings.features))
- if protect_obj.isprotected(f):
- return 0
- return 1
-@@ -414,7 +414,8 @@ def filter_protected(argv):
- protect = portage.util.shlex_split(settings.get("CONFIG_PROTECT", ""))
- protect_mask = portage.util.shlex_split(
- settings.get("CONFIG_PROTECT_MASK", ""))
-- protect_obj = ConfigProtect(root, protect, protect_mask)
-+ protect_obj = ConfigProtect(root, protect, protect_mask,
-+ case_insensitive = ("case-insensitive-fs" in settings.features))
-
- errors = 0
-
-diff --git a/bin/quickpkg b/bin/quickpkg
-index cf75791..4d6bc87 100755
---- a/bin/quickpkg
-+++ b/bin/quickpkg
-@@ -102,7 +102,9 @@ def quickpkg_atom(options, infos, arg, eout):
- if not include_config:
- confprot = ConfigProtect(eroot,
- shlex_split(settings.get("CONFIG_PROTECT", "")),
-- shlex_split(settings.get("CONFIG_PROTECT_MASK", "")))
-+ shlex_split(settings.get("CONFIG_PROTECT_MASK", "")),
-+ case_insensitive = ("case-insensitive-fs"
-+ in settings.features))
- def protect(filename):
- if not confprot.isprotected(filename):
- return False
-diff --git a/man/make.conf.5 b/man/make.conf.5
-index 84e894b..7b7daa4 100644
---- a/man/make.conf.5
-+++ b/man/make.conf.5
-@@ -265,6 +265,10 @@ Build binary packages for just packages in the system set.
- Enable a special progress indicator when \fBemerge\fR(1) is calculating
- dependencies.
- .TP
-+.B case\-insensitive\-fs
-+Use case\-insensitive file name comparisions when merging and unmerging
-+files.
-+.TP
- .B ccache
- Enable portage support for the ccache package. If the ccache dir is not
- present in the user's environment, then portage will default to
-diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
-index 5180db5..cae8c32 100644
---- a/pym/_emerge/depgraph.py
-+++ b/pym/_emerge/depgraph.py
-@@ -7799,7 +7799,9 @@ class depgraph(object):
- settings = self._frozen_config.roots[root].settings
- protect_obj[root] = ConfigProtect(settings["EROOT"], \
- shlex_split(settings.get("CONFIG_PROTECT", "")),
-- shlex_split(settings.get("CONFIG_PROTECT_MASK", "")))
-+ shlex_split(settings.get("CONFIG_PROTECT_MASK", "")),
-+ case_insensitive = ("case-insensitive-fs"
-+ in settings.features))
-
- def write_changes(root, changes, file_to_write_to):
- file_contents = None
-diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py
-index 17dc080..bb39f7a 100644
---- a/pym/portage/_global_updates.py
-+++ b/pym/portage/_global_updates.py
-@@ -208,7 +208,9 @@ def _do_global_updates(trees, prev_mtimes, quiet=False, if_mtime_changed=True):
- update_config_files(root,
- shlex_split(mysettings.get("CONFIG_PROTECT", "")),
- shlex_split(mysettings.get("CONFIG_PROTECT_MASK", "")),
-- repo_map, match_callback=_config_repo_match)
-+ repo_map, match_callback = _config_repo_match,
-+ case_insensitive = "case-insensitive-fs"
-+ in mysettings.features)
-
- # The above global updates proceed quickly, so they
- # are considered a single mtimedb transaction.
-diff --git a/pym/portage/const.py b/pym/portage/const.py
-index acb90f9..5545a84 100644
---- a/pym/portage/const.py
-+++ b/pym/portage/const.py
-@@ -125,6 +125,7 @@ SUPPORTED_FEATURES = frozenset([
- "buildpkg",
- "buildsyspkg",
- "candy",
-+ "case-insensitive-fs",
- "ccache",
- "cgroup",
- "chflags",
-diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
-index b46ba0b..8a68f4e 100644
---- a/pym/portage/dbapi/vartree.py
-+++ b/pym/portage/dbapi/vartree.py
-@@ -1052,6 +1052,11 @@ class vardbapi(dbapi):
- def add(self, cpv):
- eroot_len = len(self._vardb._eroot)
- contents = self._vardb._dblink(cpv).getcontents()
-+
-+ if "case-insensitive-fs" in self._vardb.settings.features:
-+ contents = dict((k.lower(), v)
-+ for k, v in contents.items())
-+
- pkg_hash = self._hash_pkg(cpv)
- if not contents:
- # Empty path is a code used to represent empty contents.
-@@ -1189,6 +1194,8 @@ class vardbapi(dbapi):
- hash_pkg = owners_cache._hash_pkg
- hash_str = owners_cache._hash_str
- base_names = self._vardb._aux_cache["owners"]["base_names"]
-+ case_insensitive = "case-insensitive-fs" \
-+ in vardb.settings.features
-
- dblink_cache = {}
-
-@@ -1205,6 +1212,8 @@ class vardbapi(dbapi):
- while path_iter:
-
- path = path_iter.pop()
-+ if case_insensitive:
-+ path = path.lower()
- is_basename = os.sep != path[:1]
- if is_basename:
- name = path
-@@ -1236,6 +1245,8 @@ class vardbapi(dbapi):
-
- if is_basename:
- for p in dblink(cpv).getcontents():
-+ if case_insensitive:
-+ p = p.lower()
- if os.path.basename(p) == name:
- owners.append((cpv, p[len(root):]))
- else:
-@@ -1265,8 +1276,12 @@ class vardbapi(dbapi):
- if not path_list:
- return
-
-+ case_insensitive = "case-insensitive-fs" \
-+ in self._vardb.settings.features
- path_info_list = []
- for path in path_list:
-+ if case_insensitive:
-+ path = path.lower()
- is_basename = os.sep != path[:1]
- if is_basename:
- name = path
-@@ -1285,6 +1300,8 @@ class vardbapi(dbapi):
- for path, name, is_basename in path_info_list:
- if is_basename:
- for p in dblnk.getcontents():
-+ if case_insensitive:
-+ p = p.lower()
- if os.path.basename(p) == name:
- search_pkg.results.append((dblnk, p[len(root):]))
- else:
-@@ -1540,7 +1557,9 @@ class dblink(object):
- portage.util.shlex_split(
- self.settings.get("CONFIG_PROTECT", "")),
- portage.util.shlex_split(
-- self.settings.get("CONFIG_PROTECT_MASK", "")))
-+ self.settings.get("CONFIG_PROTECT_MASK", "")),
-+ case_insensitive = ("case-insensitive-fs"
-+ in self.settings.features))
-
- return self._protect_obj
-
-@@ -2762,7 +2781,16 @@ class dblink(object):
- filename.lstrip(os_filename_arg.path.sep)))
-
- pkgfiles = self.getcontents()
-+
-+ preserve_case = None
-+ if "case-insensitive-fs" in self.settings.features:
-+ destfile = destfile.lower()
-+ preserve_case = dict((k.lower(), k) for k in pkgfiles)
-+ pkgfiles = dict((k.lower(), v) for k, v in pkgfiles.items())
-+
- if pkgfiles and destfile in pkgfiles:
-+ if preserve_case is not None:
-+ return preserve_case[destfile]
- return destfile
- if pkgfiles:
- basename = os_filename_arg.path.basename(destfile)
-@@ -2855,6 +2883,8 @@ class dblink(object):
- for p_path in p_path_list:
- x = os_filename_arg.path.join(p_path, basename)
- if x in pkgfiles:
-+ if preserve_case is not None:
-+ return preserve_case[x]
- return x
-
- return False
-diff --git a/pym/portage/update.py b/pym/portage/update.py
-index df4e11b..7a71092 100644
---- a/pym/portage/update.py
-+++ b/pym/portage/update.py
-@@ -282,7 +282,8 @@ def parse_updates(mycontent):
- myupd.append(mysplit)
- return myupd, errors
-
--def update_config_files(config_root, protect, protect_mask, update_iter, match_callback = None):
-+def update_config_files(config_root, protect, protect_mask, update_iter,
-+ match_callback = None, case_insensitive = False):
- """Perform global updates on /etc/portage/package.*, /etc/portage/profile/package.*,
- /etc/portage/profile/packages and /etc/portage/sets.
- config_root - location of files to update
-@@ -406,7 +407,8 @@ def update_config_files(config_root, protect, protect_mask, update_iter, match_c
- sys.stdout.flush()
-
- protect_obj = ConfigProtect(
-- config_root, protect, protect_mask)
-+ config_root, protect, protect_mask,
-+ case_insensitive = case_insensitive)
- for x in update_files:
- updating_file = os.path.join(abs_user_config, x)
- if protect_obj.isprotected(updating_file):
-diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
-index 4105c19..707b001 100644
---- a/pym/portage/util/__init__.py
-+++ b/pym/portage/util/__init__.py
-@@ -1555,10 +1555,12 @@ class LazyItemsDict(UserDict):
- return result
-
- class ConfigProtect(object):
-- def __init__(self, myroot, protect_list, mask_list):
-+ def __init__(self, myroot, protect_list, mask_list,
-+ case_insensitive = False):
- self.myroot = myroot
- self.protect_list = protect_list
- self.mask_list = mask_list
-+ self.case_insensitive = case_insensitive
- self.updateprotect()
-
- def updateprotect(self):
-@@ -1572,6 +1574,8 @@ class ConfigProtect(object):
- for x in self.protect_list:
- ppath = normalize_path(
- os.path.join(self.myroot, x.lstrip(os.path.sep)))
-+ if self.case_insensitive:
-+ ppath = ppath.lower()
- try:
- if stat.S_ISDIR(os.stat(ppath).st_mode):
- self._dirs.add(ppath)
-@@ -1584,6 +1588,8 @@ class ConfigProtect(object):
- for x in self.mask_list:
- ppath = normalize_path(
- os.path.join(self.myroot, x.lstrip(os.path.sep)))
-+ if self.case_insensitive:
-+ ppath = ppath.lower()
- try:
- """Use lstat so that anything, even a broken symlink can be
- protected."""
-@@ -1604,6 +1610,8 @@ class ConfigProtect(object):
- masked = 0
- protected = 0
- sep = os.path.sep
-+ if self.case_insensitive:
-+ obj = obj.lower()
- for ppath in self.protect:
- if len(ppath) > masked and obj.startswith(ppath):
- if ppath in self._dirs:
---
-1.8.5.5
-
diff --git a/sys-apps/portage/files/portage-2.2.7-macho-relative-install_names.patch b/sys-apps/portage/files/portage-2.2.7-macho-relative-install_names.patch
deleted file mode 100644
index d38d966836..0000000000
--- a/sys-apps/portage/files/portage-2.2.7-macho-relative-install_names.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-commit e1fbd70801e93a5b77febc6c9e95ad43d0ecabbb
-Author: Fabian Groffen <grobian@gentoo.org>
-Date: Sun Dec 22 14:45:31 2013 +0100
-
- install_qa_check_macho: allow relative install_names
-
- relative install_names (@..../) will be used in binaries a lot, and if
- they are provided as such, there is nothing wrong with it. Since they
- disallow us to do any checks, we just do the least check we can do,
- which is for the install_name self-reference. We want to find the
- library that points to in the install image, if not, it must be wrong.
-
-diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
-index 129f7d3..83004df 100644
---- a/bin/misc-functions.sh
-+++ b/bin/misc-functions.sh
-@@ -1049,6 +1049,15 @@ install_qa_check_macho() {
- rm -f "${T}/mach-o.check"
- fi
-
-+ install_name_is_relative() {
-+ case $1 in
-+ "@executable_path/"*) return 0 ;;
-+ "@loader_path"/*) return 0 ;;
-+ "@rpath/"*) return 0 ;;
-+ *) return 1 ;;
-+ esac
-+ }
-+
- # While we generate the NEEDED files, check that we don't get kernel
- # traps at runtime because of broken install_names on Darwin.
- rm -f "${T}"/.install_name_check_failed
-@@ -1061,6 +1070,17 @@ install_qa_check_macho() {
- # See if the self-reference install_name points to an existing
- # and to be installed file. This usually is a symlink for the
- # major version.
-+ if install_name_is_relative ${install_name} ; then
-+ # try to locate the library in the installed image
-+ local inpath=${install_name#@*/}
-+ local libl
-+ for libl in $(find "${ED}" -name "${inpath##*/}") ; do
-+ if [[ ${libl} == */${inpath} ]] ; then
-+ install_name=/${libl#${D}}
-+ break
-+ fi
-+ done
-+ fi
- if [[ ! -e ${D}${install_name} ]] ; then
- eqawarn "QA Notice: invalid self-reference install_name ${install_name} in ${obj}"
- # remember we are in an implicit subshell, that's
-@@ -1077,7 +1097,7 @@ install_qa_check_macho() {
- elif [[ ${lib} == ${S}* ]] ; then
- eqawarn "QA Notice: install_name references \${S}: ${lib} in ${obj}"
- touch "${T}"/.install_name_check_failed
-- elif [[ ! -e ${lib} && ! -e ${D}${lib} && ${lib} != "@executable_path/"* && ${lib} != "@loader_path/"* ]] ; then
-+ elif ! install_name_is_relative ${lib} && [[ ! -e ${lib} && ! -e ${D}${lib} ]] ; then
- eqawarn "QA Notice: invalid reference to ${lib} in ${obj}"
- # remember we are in an implicit subshell, that's
- # why we touch a file here ... ideally we should be
-@@ -1086,7 +1106,7 @@ install_qa_check_macho() {
- fi
- done
-
-- # backwards compatability
-+ # backwards compatibility
- echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
- # what we use
- echo "${arch};${obj};${install_name};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.MACHO.3
diff --git a/sys-apps/portage/files/portage-2.2.7-sandbox.patch b/sys-apps/portage/files/portage-2.2.7-sandbox.patch
deleted file mode 100644
index 9797d3165b..0000000000
--- a/sys-apps/portage/files/portage-2.2.7-sandbox.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-candidate patch to be included in the next revision
-
-https://bugs.gentoo.org/show_bug.cgi?id=490016
-
-diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
-index 691ef97..7a000b1 100644
---- a/pym/portage/package/ebuild/doebuild.py
-+++ b/pym/portage/package/ebuild/doebuild.py
-@@ -1311,10 +1311,8 @@ def _spawn_actionmap(settings):
- nosandbox = ("sandbox" not in features and \
- "usersandbox" not in features)
-
-- if not portage.process.sandbox_capable:
-- nosandbox = True
--
-- if not portage.process.macossandbox_capable:
-+ if not (portage.process.sandbox_capable or \
-+ portage.process.macossandbox_capable):
- nosandbox = True
-
- sesandbox = settings.selinux_enabled() and \
diff --git a/sys-apps/portage/files/portage-2.2.7-shebang-fixes.patch b/sys-apps/portage/files/portage-2.2.7-shebang-fixes.patch
deleted file mode 100644
index afb00c15aa..0000000000
--- a/sys-apps/portage/files/portage-2.2.7-shebang-fixes.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-Hi Fabian,
-
-when /bin/bash is some bash-3.x, things break miserably:
-/tools/gentoo/buildslave/sauxz3-f_pfx-10.0/build/gentoo-prefix/usr/lib/portage/bin/eapi.sh: line 8: syntax error in conditional expression: unexpected token `('
-/tools/gentoo/buildslave/sauxz3-f_pfx-10.0/build/gentoo-prefix/usr/lib/portage/bin/eapi.sh: line 8: syntax error near `^(0'
-/tools/gentoo/buildslave/sauxz3-f_pfx-10.0/build/gentoo-prefix/usr/lib/portage/bin/eapi.sh: line 8: ` [[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]'
-/tools/gentoo/buildslave/sauxz3-f_pfx-10.0/build/gentoo-prefix/usr/lib/portage/bin/ebuild-helpers/keepdir: line 7: ___eapi_has_prefix_variables: command not found
-
-There are still some scripts in 2.2.7 that need to get the shebangs fixed:
-$ git grep '#!/'
-
-Thanks!
-/haubi/
----
- bin/bashrc-functions.sh | 2 +-
- bin/eapi.sh | 2 +-
- bin/ebuild-helpers/doheader | 2 +-
- bin/ebuild-helpers/keepdir | 2 +-
- bin/ebuild-helpers/newins | 1 -
- bin/ebuild-helpers/xattr/install | 2 +-
- bin/helper-functions.sh | 2 +-
- bin/install.py | 2 +-
- bin/phase-functions.sh | 2 +-
- bin/phase-helpers.sh | 2 +-
- bin/xattr-helper.py | 2 +-
- misc/emerge-delta-webrsync | 2 +-
- 12 files changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
-index 69a5eb9..1a92738 100644
---- a/bin/bashrc-functions.sh
-+++ b/bin/bashrc-functions.sh
-@@ -1,4 +1,4 @@
--#!@PREFIX_PORTAGE_BASH@
-+#!@PORTAGE_BASH@
- # Copyright 1999-2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/eapi.sh b/bin/eapi.sh
-index 623b89f..670f884 100644
---- a/bin/eapi.sh
-+++ b/bin/eapi.sh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!@PORTAGE_BASH@
- # Copyright 2012 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/ebuild-helpers/doheader b/bin/ebuild-helpers/doheader
-index 3795365..5b6b169 100755
---- a/bin/ebuild-helpers/doheader
-+++ b/bin/ebuild-helpers/doheader
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!@PORTAGE_BASH@
- # Copyright 1999-2012 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/ebuild-helpers/keepdir b/bin/ebuild-helpers/keepdir
-index bec2feb..7167981 100755
---- a/bin/ebuild-helpers/keepdir
-+++ b/bin/ebuild-helpers/keepdir
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!@PORTAGE_BASH@
- # Copyright 1999-2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/ebuild-helpers/newins b/bin/ebuild-helpers/newins
-index 26dd049..2638a38 100755
---- a/bin/ebuild-helpers/newins
-+++ b/bin/ebuild-helpers/newins
-@@ -1,5 +1,4 @@
- #!@PORTAGE_BASH@
--#!/bin/bash
- # Copyright 1999-2012 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/ebuild-helpers/xattr/install b/bin/ebuild-helpers/xattr/install
-index f51f621..b1d2315 100755
---- a/bin/ebuild-helpers/xattr/install
-+++ b/bin/ebuild-helpers/xattr/install
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!@PORTAGE_BASH@
- # Copyright 2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
-index c574612..864d5fe 100644
---- a/bin/helper-functions.sh
-+++ b/bin/helper-functions.sh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!@PORTAGE_BASH@
- # Copyright 1999-2012 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/install.py b/bin/install.py
-index 2c6dfbe..9bd38c7 100755
---- a/bin/install.py
-+++ b/bin/install.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
-index 80e7cc6..4650e14 100644
---- a/bin/phase-functions.sh
-+++ b/bin/phase-functions.sh
-@@ -1,4 +1,4 @@
--#!@PREFIX_PORTAGE_BASH@
-+#!@PORTAGE_BASH@
- # Copyright 1999-2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
-index 12238c6..dc20991 100644
---- a/bin/phase-helpers.sh
-+++ b/bin/phase-helpers.sh
-@@ -1,4 +1,4 @@
--#!@PREFIX_PORTAGE_BASH@
-+#!@PORTAGE_BASH@
- # Copyright 1999-2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
-index a85309f..d6cef4f 100755
---- a/bin/xattr-helper.py
-+++ b/bin/xattr-helper.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2012-2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
-
-diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync
-index b16982b..66e9275 100755
---- a/misc/emerge-delta-webrsync
-+++ b/misc/emerge-delta-webrsync
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!@PORTAGE_BASH@
- # Copyright 1999-2013 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
- # Author: Brian Harring <ferringb@gentoo.org>, karltk@gentoo.org originally.
---
-1.8.1.5
-
-
-
diff --git a/sys-apps/portage/files/portage-2.3.5-prefix-chaining.patch b/sys-apps/portage/files/portage-2.3.18-prefix-chaining.patch
index fa6ee5f690..1c2537eb00 100644
--- a/sys-apps/portage/files/portage-2.3.5-prefix-chaining.patch
+++ b/sys-apps/portage/files/portage-2.3.18-prefix-chaining.patch
@@ -1,8 +1,10 @@
-From d5990d439a42a5195bf8b2f8df16da532674c3f2 Mon Sep 17 00:00:00 2001
+From: hanetzer@startmail.com
From: Michael Haubenwallner <haubi@gentoo.org>
Date: Thu, 23 Mar 2017 13:52:32 +0100
Subject: [PATCH] add prefix-chaining support
+updated for 2.3.18
+
---
bin/install-qa-check.d/05prefix | 30 ++++++-
bin/phase-helpers.sh | 28 ++++++
@@ -15,14 +17,12 @@ Subject: [PATCH] add prefix-chaining support
pym/portage/dep/dep_check.py | 99 +++++++++++++++++++++-
.../package/ebuild/_config/LocationsManager.py | 3 +
pym/portage/package/ebuild/config.py | 62 ++++++++++++++
- pym/portage/package/ebuild/doebuild.py | 25 +++++-
+ pym/portage/package/ebuild/doebuild.py | 24 +++++-
pym/portage/package/ebuild/fetch.py | 4 +
pym/portage/sync/controller.py | 27 +++---
pym/portage/util/_dyn_libs/LinkageMapELF.py | 4 +-
- 15 files changed, 376 insertions(+), 48 deletions(-)
+ 15 files changed, 376 insertions(+), 47 deletions(-)
-diff --git a/bin/install-qa-check.d/05prefix b/bin/install-qa-check.d/05prefix
-index 32561e2..0c11473 100644
--- a/bin/install-qa-check.d/05prefix
+++ b/bin/install-qa-check.d/05prefix
@@ -79,16 +79,42 @@ install_qa_check_prefix() {
@@ -70,11 +70,9 @@ index 32561e2..0c11473 100644
continue
else
# this is definitely wrong: script in $PATH and invalid shebang
-diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
-index 349cd20..5d2a735 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
-@@ -867,6 +867,10 @@ has_version() {
+@@ -868,6 +868,10 @@ has_version() {
"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" has_version "${eroot}" "${atom}"
fi
local retval=$?
@@ -85,7 +83,7 @@ index 349cd20..5d2a735 100644
case "${retval}" in
0|1)
return ${retval}
-@@ -926,6 +930,10 @@ best_version() {
+@@ -927,6 +931,10 @@ best_version() {
"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" best_version "${eroot}" "${atom}"
fi
local retval=$?
@@ -96,7 +94,7 @@ index 349cd20..5d2a735 100644
case "${retval}" in
0|1)
return ${retval}
-@@ -1145,6 +1153,10 @@ if ___eapi_has_master_repositories; then
+@@ -1167,6 +1175,10 @@ if ___eapi_has_master_repositories; then
output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" master_repositories "${EROOT}" "${repository}")
fi
retval=$?
@@ -107,7 +105,7 @@ index 349cd20..5d2a735 100644
[[ -n ${output} ]] && echo "${output}"
case "${retval}" in
0|1)
-@@ -1176,6 +1188,10 @@ if ___eapi_has_repository_path; then
+@@ -1198,6 +1210,10 @@ if ___eapi_has_repository_path; then
output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" get_repo_path "${EROOT}" "${repository}")
fi
retval=$?
@@ -118,7 +116,7 @@ index 349cd20..5d2a735 100644
[[ -n ${output} ]] && echo "${output}"
case "${retval}" in
0|1)
-@@ -1206,6 +1222,10 @@ if ___eapi_has_available_eclasses; then
+@@ -1228,6 +1244,10 @@ if ___eapi_has_available_eclasses; then
output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" available_eclasses "${EROOT}" "${repository}")
fi
retval=$?
@@ -129,7 +127,7 @@ index 349cd20..5d2a735 100644
[[ -n ${output} ]] && echo "${output}"
case "${retval}" in
0|1)
-@@ -1236,6 +1256,10 @@ if ___eapi_has_eclass_path; then
+@@ -1258,6 +1278,10 @@ if ___eapi_has_eclass_path; then
else
output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" eclass_path "${EROOT}" "${repository}" "${eclass}")
fi
@@ -140,7 +138,7 @@ index 349cd20..5d2a735 100644
retval=$?
[[ -n ${output} ]] && echo "${output}"
case "${retval}" in
-@@ -1267,6 +1291,10 @@ if ___eapi_has_license_path; then
+@@ -1289,6 +1313,10 @@ if ___eapi_has_license_path; then
else
output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" license_path "${EROOT}" "${repository}" "${license}")
fi
@@ -151,8 +149,6 @@ index 349cd20..5d2a735 100644
retval=$?
[[ -n ${output} ]] && echo "${output}"
case "${retval}" in
-diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
-index 704243a..c1b9c06 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -39,7 +39,7 @@ from portage import os
@@ -164,7 +160,7 @@ index 704243a..c1b9c06 100644
from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFAULT
from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
from portage.dbapi.dep_expand import dep_expand
-@@ -65,6 +65,7 @@ from portage.util.SlotObject import SlotObject
+@@ -65,6 +65,7 @@ from portage.util.SlotObject import Slot
from portage.util._async.run_main_scheduler import run_main_scheduler
from portage.util._async.SchedulerInterface import SchedulerInterface
from portage.util._eventloop.global_event_loop import global_event_loop
@@ -172,7 +168,7 @@ index 704243a..c1b9c06 100644
from portage._global_updates import _global_updates
from portage.sync.old_tree_timestamp import old_tree_timestamp_warn
from portage.localization import _
-@@ -2633,6 +2634,9 @@ def missing_sets_warning(root_config, missing_sets):
+@@ -2659,6 +2660,9 @@ def missing_sets_warning(root_config, mi
if portage.const.EPREFIX:
global_config_path = os.path.join(portage.const.EPREFIX,
portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
@@ -182,14 +178,18 @@ index 704243a..c1b9c06 100644
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/_emerge/depgraph.py b/pym/_emerge/depgraph.py
-index 53881c5..8198fe1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
-@@ -3097,23 +3097,24 @@ class depgraph(object):
- edepend["HDEPEND"] = ""
-
+@@ -3239,15 +3239,15 @@ class depgraph(object):
+ # _dep_disjunctive_stack first, so that choices for build-time
+ # deps influence choices for run-time deps (bug 639346).
deps = (
+- (myroot, edepend["RDEPEND"],
++ (myroot, "RDEPEND",
+ self._priority(runtime=True)),
+- (myroot, edepend["PDEPEND"],
++ (myroot, "PDEPEND",
+ self._priority(runtime_post=True)),
- (depend_root, edepend["DEPEND"],
+ (depend_root, "DEPEND",
self._priority(buildtime=True,
@@ -200,23 +200,18 @@ index 53881c5..8198fe1 100644
self._priority(buildtime=True,
optional=(pkg.built or ignore_hdepend_deps),
ignored=ignore_hdepend_deps)),
-- (myroot, edepend["RDEPEND"],
-+ (myroot, "RDEPEND",
- self._priority(runtime=True)),
-- (myroot, edepend["PDEPEND"],
-+ (myroot, "PDEPEND",
- self._priority(runtime_post=True))
- )
+@@ -3255,8 +3255,8 @@ class depgraph(object):
debug = "--debug" in self._frozen_config.myopts
- for dep_root, dep_string, dep_priority in deps:
+- if not dep_string:
+ for dep_root, dep_type, dep_priority in deps:
-+ dep_string = edepend[dep_type]
- if not dep_string:
++ if not dep_string:
continue
if debug:
-@@ -3151,7 +3152,7 @@ class depgraph(object):
+ writemsg_level("\nParent: %s\n" % (pkg,),
+@@ -3293,7 +3293,7 @@ class depgraph(object):
try:
dep_string = list(self._queue_disjunctive_deps(
@@ -225,7 +220,7 @@ index 53881c5..8198fe1 100644
except portage.exception.InvalidDependString as e:
if pkg.installed:
self._dynamic_config._masked_installed.add(pkg)
-@@ -3166,14 +3167,14 @@ class depgraph(object):
+@@ -3308,14 +3308,14 @@ class depgraph(object):
if not self._add_pkg_dep_string(
pkg, dep_root, dep_priority, dep_string,
@@ -242,7 +237,7 @@ index 53881c5..8198fe1 100644
_autounmask_backup = self._dynamic_config._autounmask
if dep_priority.optional or dep_priority.ignored:
# Temporarily disable autounmask for deps that
-@@ -3182,7 +3183,7 @@ class depgraph(object):
+@@ -3324,7 +3324,7 @@ class depgraph(object):
try:
return self._wrapped_add_pkg_dep_string(
pkg, dep_root, dep_priority, dep_string,
@@ -251,7 +246,7 @@ index 53881c5..8198fe1 100644
finally:
self._dynamic_config._autounmask = _autounmask_backup
-@@ -3218,7 +3219,7 @@ class depgraph(object):
+@@ -3360,7 +3360,7 @@ class depgraph(object):
not slot_operator_rebuild
def _wrapped_add_pkg_dep_string(self, pkg, dep_root, dep_priority,
@@ -260,7 +255,7 @@ index 53881c5..8198fe1 100644
if isinstance(pkg.depth, int):
depth = pkg.depth + 1
else:
-@@ -3242,7 +3243,7 @@ class depgraph(object):
+@@ -3384,7 +3384,7 @@ class depgraph(object):
try:
selected_atoms = self._select_atoms(dep_root,
dep_string, myuse=self._pkg_use_enabled(pkg), parent=pkg,
@@ -269,7 +264,7 @@ index 53881c5..8198fe1 100644
except portage.exception.InvalidDependString:
if pkg.installed:
self._dynamic_config._masked_installed.add(pkg)
-@@ -3540,7 +3541,7 @@ class depgraph(object):
+@@ -3691,7 +3691,7 @@ class depgraph(object):
child_pkgs.sort()
yield (atom, child_pkgs[-1])
@@ -278,7 +273,7 @@ index 53881c5..8198fe1 100644
"""
Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack.
Yields non-disjunctive deps. Raises InvalidDependString when
-@@ -3549,33 +3550,33 @@ class depgraph(object):
+@@ -3700,33 +3700,33 @@ class depgraph(object):
for x in dep_struct:
if isinstance(x, list):
if x and x[0] == "||":
@@ -319,7 +314,7 @@ index 53881c5..8198fe1 100644
return 0
return 1
-@@ -4428,7 +4429,7 @@ class depgraph(object):
+@@ -4579,7 +4579,7 @@ class depgraph(object):
return self._select_atoms_highest_available(*pargs, **kwargs)
def _select_atoms_highest_available(self, root, depstring,
@@ -328,7 +323,7 @@ index 53881c5..8198fe1 100644
"""This will raise InvalidDependString if necessary. If trees is
None then self._dynamic_config._filtered_trees is used."""
-@@ -4451,6 +4452,13 @@ class depgraph(object):
+@@ -4602,6 +4602,13 @@ class depgraph(object):
pkgsettings = self._frozen_config.pkgsettings[root]
if trees is None:
trees = self._dynamic_config._filtered_trees
@@ -342,7 +337,7 @@ index 53881c5..8198fe1 100644
mytrees = trees[root]
atom_graph = digraph()
if True:
-@@ -4482,7 +4490,7 @@ class depgraph(object):
+@@ -4633,7 +4640,7 @@ class depgraph(object):
mycheck = portage.dep_check(depstring, None,
pkgsettings, myuse=myuse,
@@ -351,7 +346,7 @@ index 53881c5..8198fe1 100644
finally:
# restore state
self._dynamic_config._autounmask = _autounmask_backup
-@@ -4558,6 +4566,7 @@ class depgraph(object):
+@@ -4709,6 +4716,7 @@ class depgraph(object):
continue
node_stack.append((child_node, node, child_atom))
@@ -359,11 +354,9 @@ index 53881c5..8198fe1 100644
return selected_atoms
def _expand_virt_from_graph(self, root, atom):
-diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
-index e993ce1..32a942c 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
-@@ -22,11 +22,12 @@ from portage.localization import localized_size
+@@ -22,11 +22,12 @@ from portage.localization import localiz
from portage.package.ebuild.config import _get_feature_flags
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
from portage.output import ( blue, colorize, create_color_func,
@@ -428,11 +421,9 @@ index e993ce1..32a942c 100644
self.print_messages(show_repos)
self.print_blockers()
if self.conf.verbosity == 3:
-diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
-index 2c9bf97..6a27842 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
-@@ -21,6 +21,7 @@ from portage.const import _ENABLE_SET_CONFIG
+@@ -21,6 +21,7 @@ from portage.const import _ENABLE_SET_CO
from portage.exception import PackageSetNotFound
from portage.localization import _
from portage.util import writemsg_level
@@ -440,7 +431,7 @@ index 2c9bf97..6a27842 100644
from portage.util.configparser import (SafeConfigParser,
NoOptionError, ParsingError, read_configs)
-@@ -281,6 +282,10 @@ def load_default_config(settings, trees):
+@@ -281,6 +282,10 @@ def load_default_config(settings, trees)
if portage.const.EPREFIX:
global_config_path = os.path.join(portage.const.EPREFIX,
GLOBAL_CONFIG_PATH.lstrip(os.sep))
@@ -451,11 +442,9 @@ index 2c9bf97..6a27842 100644
vcs_dirs = [_unicode_encode(x, encoding=_encodings['fs']) for x in VCS_DIRS]
def _getfiles():
for path, dirs, files in os.walk(os.path.join(global_config_path, "sets")):
-diff --git a/pym/portage/const.py b/pym/portage/const.py
-index 952b33c..351b499 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
-@@ -191,6 +191,7 @@ SUPPORTED_FEATURES = frozenset([
+@@ -189,6 +189,7 @@ SUPPORTED_FEATURES = frozenset([
"notitles",
"parallel-fetch",
"parallel-install",
@@ -463,7 +452,7 @@ index 952b33c..351b499 100644
"prelink-checksums",
"preserve-libs",
"protect-owned",
-@@ -269,6 +270,11 @@ MANIFEST2_IDENTIFIERS = ("AUX", "MISC", "DIST", "EBUILD")
+@@ -239,6 +240,11 @@ MANIFEST2_IDENTIFIERS = ("AUX", "MISC
#EPREFIX = ""
# END PREFIX LOCAL
@@ -475,11 +464,9 @@ index 952b33c..351b499 100644
# pick up EPREFIX from the environment if set
if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
-diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
-index 83fe5d3..e4b2491 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
-@@ -194,8 +194,19 @@ class vardbapi(dbapi):
+@@ -195,8 +195,19 @@ class vardbapi(dbapi):
self._counter_path = os.path.join(self._eroot,
CACHE_PATH, "counter")
@@ -501,7 +488,7 @@ index 83fe5d3..e4b2491 100644
self._linkmap = LinkageMap(self)
chost = self.settings.get('CHOST')
if not chost:
-@@ -236,6 +247,9 @@ class vardbapi(dbapi):
+@@ -237,6 +248,9 @@ class vardbapi(dbapi):
# This is an optimized hotspot, so don't use unicode-wrapped
# os module and don't use os.path.join().
rValue = self._eroot + VDB_PATH + _os.sep + mykey
@@ -511,7 +498,7 @@ index 83fe5d3..e4b2491 100644
if filename is not None:
# If filename is always relative, we can do just
# rValue += _os.sep + filename
-@@ -499,6 +513,9 @@ class vardbapi(dbapi):
+@@ -500,6 +514,9 @@ class vardbapi(dbapi):
returnme = []
basepath = os.path.join(self._eroot, VDB_PATH) + os.path.sep
@@ -521,7 +508,7 @@ index 83fe5d3..e4b2491 100644
if use_cache:
from portage import listdir
else:
-@@ -595,11 +612,17 @@ class vardbapi(dbapi):
+@@ -596,11 +613,17 @@ class vardbapi(dbapi):
del self.matchcache[mycat]
return list(self._iter_match(mydep,
self.cp_list(mydep.cp, use_cache=use_cache)))
@@ -541,7 +528,7 @@ index 83fe5d3..e4b2491 100644
except (IOError, OSError):
curmtime=0
-@@ -1421,7 +1444,7 @@ class vardbapi(dbapi):
+@@ -1448,7 +1471,7 @@ class vardbapi(dbapi):
class vartree(object):
"this tree will scan a var/db/pkg database located at root (passed to init)"
def __init__(self, root=None, virtual=DeprecationWarning, categories=None,
@@ -550,7 +537,7 @@ index 83fe5d3..e4b2491 100644
if settings is None:
settings = portage.settings
-@@ -1439,6 +1462,7 @@ class vartree(object):
+@@ -1466,6 +1489,7 @@ class vartree(object):
" constructor is unused",
DeprecationWarning, stacklevel=2)
@@ -558,11 +545,9 @@ index 83fe5d3..e4b2491 100644
self.settings = settings
self.dbapi = vardbapi(settings=settings, vartree=self)
self.populated = 1
-diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
-index 737d2b1..7ca883a 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
-@@ -255,6 +255,95 @@ class _dep_choice(SlotObject):
+@@ -298,6 +298,95 @@ class _dep_choice(SlotObject):
__slots__ = ('atoms', 'slot_map', 'cp_map', 'all_available',
'all_installed_slots')
@@ -658,7 +643,7 @@ index 737d2b1..7ca883a 100644
def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
"""
Takes an unreduced and reduced deplist and removes satisfied dependencies.
-@@ -643,7 +732,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
+@@ -695,7 +784,7 @@ def dep_zapdeps(unreduced, reduced, myro
assert(False) # This point should not be reachable
def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
@@ -667,7 +652,7 @@ index 737d2b1..7ca883a 100644
"""
Takes a depend string, parses it, and selects atoms.
The myroot parameter is unused (use mysettings['EROOT'] instead).
-@@ -741,6 +830,14 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
+@@ -796,6 +885,14 @@ def dep_check(depstring, mydbapi, mysett
writemsg("mysplit: %s\n" % (mysplit), 1)
writemsg("mysplit2: %s\n" % (mysplit2), 1)
@@ -682,8 +667,6 @@ index 737d2b1..7ca883a 100644
selected_atoms = dep_zapdeps(mysplit, mysplit2, myroot,
use_binaries=use_binaries, trees=trees)
-diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py
-index 55b8c08..32e969e 100644
--- a/pym/portage/package/ebuild/_config/LocationsManager.py
+++ b/pym/portage/package/ebuild/_config/LocationsManager.py
@@ -307,6 +307,9 @@ class LocationsManager(object):
@@ -696,11 +679,9 @@ index 55b8c08..32e969e 100644
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 1ac2cb1..2e31cf0 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
-@@ -305,6 +305,7 @@ class config(object):
+@@ -306,6 +306,7 @@ class config(object):
self.features = features_set(self)
self.features._features = copy.deepcopy(clone.features._features)
self._features_overrides = copy.deepcopy(clone._features_overrides)
@@ -708,7 +689,7 @@ index 1ac2cb1..2e31cf0 100644
#Strictly speaking _license_manager is not immutable. Users need to ensure that
#extract_global_changes() is called right after __init__ (if at all).
-@@ -944,6 +945,63 @@ class config(object):
+@@ -945,6 +946,63 @@ class config(object):
self._validate_commands()
@@ -772,7 +753,7 @@ index 1ac2cb1..2e31cf0 100644
for k in self._case_insensitive_vars:
if k in self:
self[k] = self[k].lower()
-@@ -2778,6 +2836,10 @@ class config(object):
+@@ -2813,6 +2871,10 @@ class config(object):
if not eapi_exports_merge_type(eapi):
mydict.pop("MERGE_TYPE", None)
@@ -783,8 +764,6 @@ index 1ac2cb1..2e31cf0 100644
# Prefix variables are supported beginning with EAPI 3, or when
# force-prefix is in FEATURES, since older EAPIs would otherwise be
# useless with prefix configurations. This brings compatibility with
-diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
-index 1878d1f..9fc17f7 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -51,6 +51,7 @@ from portage import bsd_chflags, \
@@ -795,17 +774,23 @@ index 1878d1f..9fc17f7 100644
EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, PORTAGE_PYM_PACKAGES, EPREFIX, MACOSSANDBOX_PROFILE
from portage.data import portage_gid, portage_uid, secpass, \
uid, userpriv_groups
-@@ -71,7 +72,8 @@ from portage.output import colormap
- from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
- from portage.util import apply_recursive_permissions, \
- apply_secpass_permissions, noiselimit, \
-- writemsg, writemsg_stdout, write_atomic
-+ writemsg, writemsg_stdout, write_atomic, getconfig
+@@ -72,6 +73,7 @@ from portage.package.ebuild.prepare_buil
+ from portage.process import find_binary
+ from portage.util import ( apply_recursive_permissions,
+ apply_secpass_permissions,
++ getconfig,
+ noiselimit,
+ shlex_split,
+ varexpand,
+@@ -79,6 +81,7 @@ from portage.util import ( apply_recursi
+ writemsg_stdout,
+ write_atomic
+ )
+from portage.util._path import exists_raise_eaccess
from portage.util.cpuinfo import get_cpu_count
from portage.util.lafilefixer import rewrite_lafile
- from portage.util.socks5 import get_socks5_proxy
-@@ -233,8 +235,27 @@ def _doebuild_path(settings, eapi=None):
+ from portage.util.compression_probe import _compressors
+@@ -241,8 +244,27 @@ def _doebuild_path(settings, eapi=None):
for x in portage_bin_path:
path.append(os.path.join(x, "ebuild-helpers"))
@@ -834,11 +819,9 @@ index 1878d1f..9fc17f7 100644
path.extend(rootpath)
path.extend(extrapath)
# END PREFIX LOCAL
-diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py
-index 265d0c9..2ec6ff4 100644
--- a/pym/portage/package/ebuild/fetch.py
+++ b/pym/portage/package/ebuild/fetch.py
-@@ -43,6 +43,7 @@ from portage.output import colorize, EOutput
+@@ -43,6 +43,7 @@ from portage.output import colorize, EOu
from portage.util import apply_recursive_permissions, \
apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, \
varexpand, writemsg, writemsg_level, writemsg_stdout
@@ -846,7 +829,7 @@ index 265d0c9..2ec6ff4 100644
from portage.process import spawn
_userpriv_spawn_kwargs = (
-@@ -874,6 +875,9 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
+@@ -874,6 +875,9 @@ def fetch(myuris, mysettings, listonly=0
global_config_path = GLOBAL_CONFIG_PATH
if portage.const.EPREFIX:
global_config_path = os.path.join(portage.const.EPREFIX,
@@ -856,8 +839,6 @@ index 265d0c9..2ec6ff4 100644
GLOBAL_CONFIG_PATH.lstrip(os.sep))
missing_file_param = False
-diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py
-index 3bccf6f..cacd637 100644
--- a/pym/portage/sync/controller.py
+++ b/pym/portage/sync/controller.py
@@ -94,19 +94,20 @@ class SyncManager(object):
@@ -894,20 +875,18 @@ index 3bccf6f..cacd637 100644
def __getattr__(self, name):
if name == 'async':
-diff --git a/pym/portage/util/_dyn_libs/LinkageMapELF.py b/pym/portage/util/_dyn_libs/LinkageMapELF.py
-index 54a25e0..0296d3f 100644
--- a/pym/portage/util/_dyn_libs/LinkageMapELF.py
+++ b/pym/portage/util/_dyn_libs/LinkageMapELF.py
-@@ -23,7 +23,7 @@ from portage.util import varexpand
- from portage.util import writemsg_level
- from portage.util._dyn_libs.NeededEntry import NeededEntry
- from portage.util.elf.header import ELFHeader
+@@ -12,7 +12,7 @@ from portage import _os_merge
+ from portage import _unicode_decode
+ from portage import _unicode_encode
+ from portage.cache.mappings import slot_dict_class
-from portage.const import EPREFIX
+from portage.const import BPREFIX
-
- if sys.hexversion >= 0x3000000:
- _unicode = str
-@@ -269,7 +269,7 @@ class LinkageMapELF(object):
+ from portage.dep.soname.multilib_category import compute_multilib_category
+ from portage.exception import CommandNotFound, InvalidData
+ from portage.localization import _
+@@ -268,7 +268,7 @@ class LinkageMapELF(object):
continue
plibs.update((x, cpv) for x in items)
if plibs:
@@ -916,6 +895,3 @@ index 54a25e0..0296d3f 100644
args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
for x in plibs)
try:
---
-2.10.2
-
diff --git a/sys-apps/portage/files/portage-2.3.4-mj-safe-econf.patch b/sys-apps/portage/files/portage-2.3.4-mj-safe-econf.patch
deleted file mode 100644
index 9cb9020bfc..0000000000
--- a/sys-apps/portage/files/portage-2.3.4-mj-safe-econf.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From c0153776be692d11a4af156e77bad50aa8c7bd12 Mon Sep 17 00:00:00 2001
-From: Michael Haubenwallner <haubi@gentoo.org>
-Date: Thu, 2 Mar 2017 10:37:19 +0100
-Subject: [PATCH] econf: multijob-safe shebang tweaking
-
-Using econf in parallel for multiple configurations (multilib, or
-ncurses' wide+narrow), both may try to fix configure's shebang.
-On Cygwin at least, this may cause 'sed -i' to fail with:
- sed: cannot rename /.../work/ncurses-6.0/sedXZsjI6: Permission denied
-Instead of 'sed -i', better use 'mv -f' towards the original file.
----
- bin/phase-helpers.sh | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
-index 9e4e6a2..b72cb1a 100644
---- a/bin/phase-helpers.sh
-+++ b/bin/phase-helpers.sh
-@@ -573,13 +573,13 @@ econf() {
- if [[ -n $CONFIG_SHELL && \
- "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
- # preserve timestamp, see bug #440304
-- touch -r "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die
-+ cp "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die
- sed -i \
- -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \
-- "${ECONF_SOURCE}/configure" \
-+ "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" \
- || die "Substition of shebang in '${ECONF_SOURCE}/configure' failed"
-- touch -r "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" "${ECONF_SOURCE}/configure" || die
-- rm -f "${ECONF_SOURCE}/configure._portage_tmp_.${pid}"
-+ touch -r "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die
-+ mv -f "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" "${ECONF_SOURCE}/configure" || die
- fi
- if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
- find "${WORKDIR}" -type f '(' \
---
-2.10.2
-
diff --git a/sys-apps/portage/portage-2.3.18.ebuild b/sys-apps/portage/portage-2.3.18.ebuild
index a7abe3406a..7e4bf1ab37 100644
--- a/sys-apps/portage/portage-2.3.18.ebuild
+++ b/sys-apps/portage/portage-2.3.18.ebuild
@@ -93,7 +93,7 @@ python_prepare_all() {
epatch "${FILESDIR}"/${PN}-2.3.10-ebuildshell.patch # 155161
use prefix-chaining &&
- epatch "${FILESDIR}"/${PN}-2.3.8-prefix-chaining.patch
+ epatch "${FILESDIR}"/${PN}-2.3.18-prefix-chaining.patch
if use native-extensions; then
printf "[build_ext]\nportage-ext-modules=true\n" >> \