public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-06 23:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-02-06 23:03 UTC (permalink / raw
  To: gentoo-commits

commit:     b766bd9e9d60bcbeef24d29d16873f5374e95310
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  6 23:00:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb  6 23:00:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b766bd9e

default_src_test: handle EAPI 4 emake failure

This will fix bug #353897.

---
 bin/ebuild.sh |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a8ed745..ebe2c65 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -626,15 +626,21 @@ _eapi0_src_compile() {
 }
 
 _eapi0_src_test() {
-	if emake -j1 check -n &> /dev/null; then
+	# Since we don't want emake's automatic die
+	# support (EAPI 4 and later), and we also don't
+	# want the warning messages that it produces if
+	# we call it in 'nonfatal' mode, we use emake_cmd
+	# to emulate the desired parts of emake behavior.
+	local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
+	if $emake_cmd -j1 check -n &> /dev/null; then
 		vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
-		if ! emake -j1 check; then
+		if ! $emake_cmd -j1 check; then
 			hasq test $FEATURES && die "Make check failed. See above for details."
 			hasq test $FEATURES || eerror "Make check failed. See above for details."
 		fi
-	elif emake -j1 test -n &> /dev/null; then
+	elif $emake_cmd -j1 test -n &> /dev/null; then
 		vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
-		if ! emake -j1 test; then
+		if ! $emake_cmd -j1 test; then
 			hasq test $FEATURES && die "Make test failed. See above for details."
 			hasq test $FEATURES || eerror "Make test failed. See above for details."
 		fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-13  8:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-02-13  8:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c8ca6cd53805162d5c8722e9519815152c993a3c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 08:33:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 13 08:33:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c8ca6cd5

egencache: don't ignore as much with --tolerant

Errors returned from --update-use-local-desc and --update-changelogs
are no longer ignored with --tolerant. This will fix part of
bug #354687.

---
 bin/egencache |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 76dd900..89d2fde 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -791,7 +791,10 @@ def egencache_main(args):
 			max_load=options.load_average,
 			rsync=options.rsync)
 		gen_cache.run()
-		ret.append(gen_cache.returncode)
+		if options.tolerant:
+			ret.append(os.EX_OK)
+		else:
+			ret.append(gen_cache.returncode)
 
 	if options.update_use_local_desc:
 		gen_desc = GenUseLocalDesc(portdb,
@@ -805,8 +808,6 @@ def egencache_main(args):
 		gen_clogs.run()
 		ret.append(gen_clogs.returncode)
 
-	if options.tolerant:
-		return ret[0]
 	return max(ret)
 
 if __name__ == "__main__":



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-13 14:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-02-13 14:19 UTC (permalink / raw
  To: gentoo-commits

commit:     ef41f7367c57a69fe88f37d2e31d48a59394aac4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 14:18:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 13 14:18:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ef41f736

egencache: --preserve-comments allow missing file

This will fix bug #354687.

---
 bin/egencache |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 89d2fde..e5685c4 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -396,11 +396,33 @@ class GenUseLocalDesc(object):
 						mode='w', encoding=_encodings['repo.content'],
 						errors='replace')
 			except IOError as e:
+				if not self._preserve_comments or \
+					os.path.isfile(desc_path):
+					writemsg_level(
+						"ERROR: failed to open output file %s: %s\n" \
+						% (desc_path, e), level=logging.ERROR, noiselevel=-1)
+					self.returncode |= 2
+					return
+
+				# Open in r+b mode failed because the file doesn't
+				# exist yet. We can probably recover if we disable
+				# preserve_comments mode now.
 				writemsg_level(
-					"ERROR: failed to open output file %s: %s\n" % (desc_path,e,),
-					level=logging.ERROR, noiselevel=-1)
-				self.returncode |= 2
-				return
+					"WARNING: --preserve-comments enabled, but " + \
+					"output file not found: %s\n" % (desc_path,),
+					level=logging.WARNING, noiselevel=-1)
+				self._preserve_comments = False
+				try:
+					output = codecs.open(_unicode_encode(desc_path,
+						encoding=_encodings['fs'], errors='strict'),
+						mode='w', encoding=_encodings['repo.content'],
+						errors='replace')
+				except IOError as e:
+					writemsg_level(
+						"ERROR: failed to open output file %s: %s\n" \
+						% (desc_path, e), level=logging.ERROR, noiselevel=-1)
+					self.returncode |= 2
+					return
 		else:
 			output = sys.stdout
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-18 15:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-02-18 15:38 UTC (permalink / raw
  To: gentoo-commits

commit:     98e11ed423ef33e433573fea51a941bc9e2f9d0d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 18 15:37:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 18 15:37:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=98e11ed4

egencache: fix cmp_func for python3

---
 bin/egencache |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index e5685c4..5307cd5 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -455,6 +455,14 @@ class GenUseLocalDesc(object):
 		# since we don't want any confusion given that we never
 		# want to rely on the builtin cmp function.
 		def cmp_func(a, b):
+			if a is None or b is None:
+				# None can't be compared with other types in python3.
+				if a is None and b is None:
+					return 0
+				elif a is None:
+					return -1
+				else:
+					return 1
 			return (a > b) - (a < b)
 
 		for cp in self._portdb.cp_all():



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-18 23:39 Ulrich Mueller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Mueller @ 2011-02-18 23:39 UTC (permalink / raw
  To: gentoo-commits

commit:     af19eb79093292db5e3bc9467f3cf0cd79c8513c
Author:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 18 23:42:36 2011 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Feb 18 23:45:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af19eb79

docompress, prepcompress: Add missing quotes.

---
 bin/ebuild.sh         |    4 ++--
 bin/misc-functions.sh |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index ebe2c65..d0cf84d 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -916,7 +916,7 @@ docompress() {
 			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
 			[[ ${f:0:1} = / ]] || f="/${f}"
 			for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
-				[[ ${f} = ${g} ]] && continue 2
+				[[ ${f} = "${g}" ]] && continue 2
 			done
 			PORTAGE_DOCOMPRESS_SKIP[${#PORTAGE_DOCOMPRESS_SKIP[@]}]=${f}
 		done
@@ -925,7 +925,7 @@ docompress() {
 			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
 			[[ ${f:0:1} = / ]] || f="/${f}"
 			for g in "${PORTAGE_DOCOMPRESS[@]}"; do
-				[[ ${f} = ${g} ]] && continue 2
+				[[ ${f} = "${g}" ]] && continue 2
 			done
 			PORTAGE_DOCOMPRESS[${#PORTAGE_DOCOMPRESS[@]}]=${f}
 		done

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 46be501..e1e5df1 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -103,7 +103,7 @@ prepcompress() {
 			fi
 		done
 		for g in "${exclude[@]}"; do
-			if [[ ${f} = ${g} || ${f} == "${g%/}"/* ]]; then
+			if [[ ${f} = "${g}" || ${f} == "${g%/}"/* ]]; then
 				unset include[i]
 				continue 2
 			fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-21 16:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-02-21 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     6b8945dda699ab81334b38790b6a046852de3184
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 21 16:17:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 21 16:17:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b8945dd

ebuild.sh: remove unused PWORKDIR variable

---
 bin/ebuild.sh             |    6 ------
 bin/isolated-functions.sh |    2 +-
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1764da1..59bf46e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1152,9 +1152,6 @@ dyn_install() {
 	#our custom version of libtool uses $S and $D to fix
 	#invalid paths in .la files
 	export S D
-	#some packages uses an alternative to $S to build in, cause
-	#our libtool to create problematic .la files
-	export PWORKDIR="$WORKDIR"
 
 	# Reset exeinto(), docinto(), insinto(), and into() state variables
 	# in case the user is running the install phase multiple times
@@ -2244,9 +2241,6 @@ ebuild_main() {
 			#our custom version of libtool uses $S and $D to fix
 			#invalid paths in .la files
 			export S D
-			#some packages use an alternative to $S to build in, cause
-			#our libtool to create problematic .la files
-			export PWORKDIR=$WORKDIR
 
 			;;
 		esac

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index f89c11e..b5bb73a 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -602,7 +602,7 @@ save_ebuild_env() {
 			PORTAGE_BASHRCS_SOURCED PORTAGE_NONFATAL PORTAGE_QUIET \
 			PORTAGE_SANDBOX_DENY PORTAGE_SANDBOX_PREDICT \
 			PORTAGE_SANDBOX_READ PORTAGE_SANDBOX_WRITE PREROOTPATH \
-			PWORKDIR QA_INTERCEPTORS \
+			QA_INTERCEPTORS \
 			RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL RC_INDENTATION  \
 			ROOT ROOTPATH RPMDIR TEMP TMP TMPDIR USE_EXPAND \
 			WARN XARGS _RC_GET_KV_CACHE



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-02-28 18:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-02-28 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     0b39d24bb8270e5c89eaddfd1f5a4181cf9e31d3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 18:57:53 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 28 18:57:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b39d24b

ebuild(1): apply package.env earlier

This makes it possible to override PORTAGE_TMPDIR.

---
 bin/ebuild |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 2c04200..a8296e8 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -220,20 +220,36 @@ portage.settings.validate() # generate warning messages if necessary
 tmpsettings = portage.config(clone=portage.settings)
 tmpsettings["PORTAGE_VERBOSE"] = "1"
 tmpsettings.backup_changes("PORTAGE_VERBOSE")
+
+if opts.skip_manifest:
+	tmpsettings["EBUILD_SKIP_MANIFEST"] = "1"
+	tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
+
+if opts.skip_manifest or \
+	"digest" in tmpsettings.features or \
+	"digest" in pargs or \
+	"manifest" in pargs:
+	portage._doebuild_manifest_exempt_depend += 1
+
 if "test" in pargs:
 	# This variable is a signal to config.regenerate() to
 	# indicate that the test phase should be enabled regardless
 	# of problems such as masked "test" USE flag.
 	tmpsettings["EBUILD_FORCE_TEST"] = "1"
 	tmpsettings.backup_changes("EBUILD_FORCE_TEST")
-	tmpsettings.features.add("test")
+	tmpsettings["FEATURES"] = tmpsettings.get("FEATURES", "") + " " + "test"
+	tmpsettings.backup_changes("FEATURES")
 
-tmpsettings.features.discard('fail-clean')
+tmpsettings["FEATURES"] = tmpsettings.get("FEATURES", "") + " " + "-fail-clean"
+tmpsettings.backup_changes("FEATURES")
 
-if opts.skip_manifest:
-	tmpsettings["EBUILD_SKIP_MANIFEST"] = "1"
-	tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
-	portage._doebuild_manifest_exempt_depend += 1
+# Apply package.env settings. This allows per-package FEATURES and other
+# variables (possibly PORTAGE_TMPDIR) to be available as soon as possible.
+try:
+	tmpsettings.setcpv(cpv, mydb=portage.db[portage.root][mytree].dbapi)
+except KeyError:
+	# aux_get failure, message should have been shown on stderr.
+	sys.exit(1)
 
 build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
 	"test", "install", "package", "rpm", "merge", "qmerge"])



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-02  0:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-02  0:53 UTC (permalink / raw
  To: gentoo-commits

commit:     fc48bb45e2c6ca331b1d1df7a57ea82e705b2439
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  2 00:53:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar  2 00:53:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc48bb45

ebuild(1): fix ebuild modification check

This has been broken since the setcpv call (triggering metadata
generation) was added before it in commit
0b39d24bb8270e5c89eaddfd1f5a4181cf9e31d3.

---
 bin/ebuild |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index a8296e8..d6cdc66 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -217,6 +217,19 @@ def discard_digests(myebuild, mysettings, mydbapi):
 		portage._doebuild_manifest_exempt_depend -= 1
 
 portage.settings.validate() # generate warning messages if necessary
+
+build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
+	"test", "install", "package", "rpm", "merge", "qmerge"])
+
+# If the current metadata is invalid then force the ebuild to be
+# sourced again even if $T/environment already exists.
+ebuild_changed = False
+if mytree == "porttree" and build_dir_phases.intersection(pargs):
+	metadata, st, emtime = \
+		portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)
+	if metadata is None:
+		ebuild_changed = True
+
 tmpsettings = portage.config(clone=portage.settings)
 tmpsettings["PORTAGE_VERBOSE"] = "1"
 tmpsettings.backup_changes("PORTAGE_VERBOSE")
@@ -251,18 +264,6 @@ except KeyError:
 	# aux_get failure, message should have been shown on stderr.
 	sys.exit(1)
 
-build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
-	"test", "install", "package", "rpm", "merge", "qmerge"])
-
-# If the current metadata is invalid then force the ebuild to be
-# sourced again even if $T/environment already exists.
-ebuild_changed = False
-if mytree == "porttree" and build_dir_phases.intersection(pargs):
-	metadata, st, emtime = \
-		portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)
-	if metadata is None:
-		ebuild_changed = True
-
 def stale_env_warning():
 	if "clean" not in pargs and \
 		"noauto" not in tmpsettings.features and \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-10 22:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-10 22:52 UTC (permalink / raw
  To: gentoo-commits

commit:     79589a4ab283e2cd76452141d0a004a1cb347f24
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 10 22:49:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 10 22:49:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=79589a4a

ebuild-ipc: use plain file read instead of array

Array.fromfile() seems to be more error prone. For example, see
bug 337465.

---
 bin/ebuild-ipc.py |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 45d7120..d8e7e55 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -1,11 +1,10 @@
 #!/usr/bin/python
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # This is a helper which ebuild processes can use
 # to communicate with portage's main python process.
 
-import array
 import logging
 import os
 import pickle
@@ -141,13 +140,11 @@ class EbuildIpc(object):
 		# read and write of whole pickles.
 		input_file = open(self.ipc_out_fifo, 'rb', 0)
 
-		# For maximum portability, us an array in order to force
-		# a single atomic read of a whole pickle (bug #337465).
-		buf = array.array('B')
-
+		# For maximum portability, use a single atomic read.
+		buf = None
 		try:
-			buf.fromfile(input_file, self._BUFSIZE)
-		except (EOFError, IOError) as e:
+			buf = input_file.read(self._BUFSIZE)
+		except IOError as e:
 			if not buf:
 				portage.util.writemsg_level(
 					"ebuild-ipc: %s\n" % (e,),
@@ -167,7 +164,7 @@ class EbuildIpc(object):
 		else:
 
 			try:
-				reply = pickle.loads(buf.tostring())
+				reply = pickle.loads(buf)
 			except SystemExit:
 				raise
 			except Exception as e:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-17 21:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-17 21:12 UTC (permalink / raw
  To: gentoo-commits

commit:     eff879ff0ce7dcc1ce68d5f16de1ec73051f8c18
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 21:12:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 17 21:12:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eff879ff

ebuild-ipc: use non-blocking read

This makes it possible for the daemon to send a reply without blocking,
thereby improving performance and also making it possible for the
daemon to do a non-blocking write without a race condition.

This reverts part of commit 81fc303212b8379219cf5d463c8717359b972dba,
which probably didn't help portability anyway. Now, ebuild-ipc is using
non-blocking read with os.read and EAGAIN handling, just like
EbuildIpcDaemon since commit 7e5b81da12dd7bd59f6620840dc0d824e3f4d69a
(known compatible with FreeBSD).

---
 bin/ebuild-ipc.py |   54 ++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index d8e7e55..cb77171 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -134,23 +134,43 @@ class EbuildIpc(object):
 
 		return os.WEXITSTATUS(wait_retval[1])
 
-	def _receive_reply(self):
+	def _receive_reply(self, input_fd):
 
-		# File streams are in unbuffered mode since we do atomic
-		# read and write of whole pickles.
-		input_file = open(self.ipc_out_fifo, 'rb', 0)
-
-		# For maximum portability, use a single atomic read.
+		# Timeouts are handled by the parent process, so just
+		# block until input is available. For maximum portability,
+		# use a single atomic read.
 		buf = None
-		try:
-			buf = input_file.read(self._BUFSIZE)
-		except IOError as e:
-			if not buf:
+		while True:
+			try:
+				events = select.select([input_fd], [], [])
+			except select.error as e:
 				portage.util.writemsg_level(
-					"ebuild-ipc: %s\n" % (e,),
+					"ebuild-ipc: %s: %s\n" % \
+					(portage.localization._('during select for read'), e),
 					level=logging.ERROR, noiselevel=-1)
+				continue
 
-		input_file.close()
+			if events[0]:
+				# For maximum portability, use os.read() here since
+				# array.fromfile() and file.read() are both known to
+				# erroneously return an empty string from this
+				# non-blocking fifo stream on FreeBSD (bug #337465).
+				try:
+					buf = os.read(input_fd, self._BUFSIZE)
+				except OSError as e:
+					if e.errno != errno.EAGAIN:
+						portage.util.writemsg_level(
+							"ebuild-ipc: %s: %s\n" % \
+							(portage.localization._('read error'), e),
+							level=logging.ERROR, noiselevel=-1)
+						break
+					# Assume that another event will be generated
+					# if there's any relevant data.
+					continue
+
+				# Only one (atomic) read should be necessary.
+				if buf:
+					break
 
 		retval = 2
 
@@ -192,6 +212,13 @@ class EbuildIpc(object):
 			self._no_daemon_msg()
 			return 2
 
+		# Open the input fifo before the output fifo, in order to make it
+		# possible for the daemon to send a reply without blocking. This
+		# improves performance, and also makes it possible for the daemon
+		# to do a non-blocking write without a race condition.
+		input_fd = os.open(self.ipc_out_fifo,
+			os.O_RDONLY|os.O_NONBLOCK)
+
 		# Use forks so that the child process can handle blocking IO
 		# un-interrupted, while the parent handles all timeout
 		# considerations. This helps to avoid possible race conditions
@@ -231,12 +258,13 @@ class EbuildIpc(object):
 
 		if pid == 0:
 			os.close(pr)
-			retval = self._receive_reply()
+			retval = self._receive_reply(input_fd)
 			os._exit(retval)
 
 		os.close(pw)
 		retval = self._wait(pid, pr, portage.localization._('during read'))
 		os.close(pr)
+		os.close(input_fd)
 		return retval
 
 def ebuild_ipc_main(args):



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-17 21:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-17 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     09c9eaf22ac7453ef8a6067711e27a7756dd3d92
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 21:52:41 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 17 21:52:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=09c9eaf2

ebuild-ipc: import errno

---
 bin/ebuild-ipc.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index cb77171..68ad985 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -5,6 +5,7 @@
 # This is a helper which ebuild processes can use
 # to communicate with portage's main python process.
 
+import errno
 import logging
 import os
 import pickle



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-20 17:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-20 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     de88819ff3240d31260a449d226037d1228a8d07
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 17:41:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 17:41:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=de88819f

portageq owners: list orphans via stderr

---
 bin/portageq |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 2f254ca..069ece2 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -255,6 +255,8 @@ def owners(argv):
 		pass
 
 	files = []
+	orphan_abs_paths = set()
+	orphan_basenames = set()
 	for f in argv[1:]:
 		f = portage.normalize_path(f)
 		is_basename = os.sep not in f
@@ -271,8 +273,10 @@ def owners(argv):
 			return 2
 		if is_basename:
 			files.append(f)
+			orphan_basenames.add(f)
 		else:
 			files.append(f[len(root)-1:])
+			orphan_abs_paths.add(f)
 
 	owners = vardb._owners.get_owners(files)
 
@@ -281,16 +285,28 @@ def owners(argv):
 		cpv = pkg.mycpv
 		msg.append("%s\n" % cpv)
 		for f in sorted(owned_files):
-			msg.append("\t%s\n" % \
-				os.path.join(root, f.lstrip(os.path.sep)))
+			f_abs = os.path.join(root, f.lstrip(os.path.sep))
+			msg.append("\t%s\n" % (f_abs,))
+			orphan_abs_paths.discard(f_abs)
+			if orphan_basenames:
+				orphan_basenames.discard(os.path.basename(f_abs))
 
 	writemsg_stdout(''.join(msg), noiselevel=-1)
 
+	if orphan_abs_paths or orphan_basenames:
+		orphans = []
+		orphans.extend(orphan_abs_paths)
+		orphans.extend(orphan_basenames)
+		orphans.sort()
+		msg = []
+		msg.append("None of the installed packages claim these files:\n")
+		for f in orphans:
+			msg.append("\t%s\n" % (f,))
+		sys.stderr.write("".join(msg))
+		sys.stderr.flush()
+
 	if owners:
 		return 0
-
-	sys.stderr.write("None of the installed packages claim the file(s).\n")
-	sys.stderr.flush()
 	return 1
 
 owners.uses_root = True



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-24  5:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-24  5:05 UTC (permalink / raw
  To: gentoo-commits

commit:     20fff13645e50ec68c5a56c064e66e11aad72256
Author:     David James <davidjames <AT> google <DOT> com>
AuthorDate: Thu Mar 24 05:05:15 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 24 05:05:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=20fff136

Optimize ebuild.sh to cache preprocessing output.

Right now ebuild.sh runs preprocessing steps multiple times during the
same build. It processes the same environment and produces the same
output every time. This slows down the build unnecessarily.

This optimization cuts build time for 50 binary packages with 16 jobs
from 3m22 to 2m33 (33%).

Change-Id: I72ac84cce2eb60d17736cc5f5343d4a858ec86f4

Review URL: http://codereview.chromium.org/6733008

---
 bin/ebuild.sh |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 59bf46e..c79d4c3 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1826,14 +1826,14 @@ filter_readonly_variables() {
 # interfering with the current environment. This is useful when an existing
 # environment needs to be loaded from a binary or installed package.
 preprocess_ebuild_env() {
-	local _portage_filter_opts=""
-	if [ -f "${T}/environment.raw" ] ; then
-		# This is a signal from the python side, indicating that the
-		# environment may contain stale SANDBOX_{DENY,PREDICT,READ,WRITE}
-		# and FEATURES variables that should be filtered out. Between
-		# phases, these variables are normally preserved.
-		_portage_filter_opts+=" --filter-features --filter-locale --filter-path --filter-sandbox"
-	fi
+	local _portage_filter_opts="--filter-features --filter-locale --filter-path --filter-sandbox"
+
+	# If environment.raw is present, this is a signal from the python side,
+	# indicating that the environment may contain stale FEATURES and
+	# SANDBOX_{DENY,PREDICT,READ,WRITE} variables that should be filtered out.
+	# Otherwise, we don't need to filter the environment.
+	[ -f "${T}/environment.raw" ] || return 0
+
 	filter_readonly_variables $_portage_filter_opts < "${T}"/environment \
 		>> "$T/environment.filtered" || return $?
 	unset _portage_filter_opts



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-27 20:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-03-27 20:01 UTC (permalink / raw
  To: gentoo-commits

commit:     3bfc88f2aed25d4289dafca6c069eae8e71971ea
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 20:01:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 20:01:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3bfc88f2

emerge-webrsync: drop lzma support

The lzma snapshots have been replaced by xz snapshots, as discussed in
the "RFC: Remove .lzma in favor of .xz portage snapshots" thread on the
gentoo-dev ml:

http://archives.gentoo.org/gentoo-dev/msg_7de1b57ce531fdf33d33b5b070006436.xml

---
 bin/emerge-webrsync |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 8279242..69cfc96 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -64,7 +64,6 @@ do_tar() {
 	local decompressor
 	case ${file} in
 		*.xz)   decompressor="xzcat" ;;
-		*.lzma) decompressor="lzcat" ;;
 		*.bz2)  decompressor="bzcat" ;;
 		*.gz)   decompressor="zcat"  ;;
 		*)      decompressor="cat"   ;;
@@ -227,16 +226,15 @@ do_snapshot() {
 	local mirror
 
 	local compressions=""
-	# lzma is not supported in app-arch/tarsync, so use
+	# xz is not supported in app-arch/tarsync, so use
 	# bz2 format if we have tarsync.
 	if ! type -P tarsync > /dev/null ; then
 		type -P xzcat > /dev/null && compressions="${compressions} xz"
-		type -P lzcat > /dev/null && compressions="${compressions} lzma"
 	fi
 	type -P bzcat > /dev/null && compressions="${compressions} bz2"
 	type -P  zcat > /dev/null && compressions="${compressions} gz"
 	if [[ -z ${compressions} ]] ; then
-		eecho "unable to locate any decompressors (lzcat or bzcat or zcat)"
+		eecho "unable to locate any decompressors (xzcat or bzcat or zcat)"
 		exit 1
 	fi
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-30 15:03 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-03-30 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     c86270de6ab77366d1bf354f569d2d7d636ca407
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Mar 30 15:03:22 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 15:03:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c86270de

Use os.path.expanduser() to simplify code.

---
 bin/repoman |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 1136068..d48b9d1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2427,10 +2427,7 @@ else:
 				logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"])
 			else:
 				raise portage.exception.MissingParameter("PORTAGE_GPG_DIR is unset!")
-		gpg_dir = repoman_settings["PORTAGE_GPG_DIR"]
-		if gpg_dir.startswith("~") and "HOME" in os.environ:
-			repoman_settings["PORTAGE_GPG_DIR"] = os.path.join(
-				os.environ["HOME"], gpg_dir[1:].lstrip(os.path.sep))
+		repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
 		if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
 			raise portage.exception.InvalidLocation(
 				"Unable to access directory: PORTAGE_GPG_DIR='%s'" % \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-30 20:35 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-03-30 20:35 UTC (permalink / raw
  To: gentoo-commits

commit:     54e35da1a38b1e3c94afc36f10edd97b999083db
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Mar 30 20:32:45 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 20:32:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=54e35da1

Simplify calculation of repoman_settings["PORTAGE_GPG_DIR"] in gpgsign().
os.path.expanduser() works even when HOME environment variable is not set.

---
 bin/repoman |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index d48b9d1..985b8ea 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2422,11 +2422,8 @@ else:
 		if "PORTAGE_GPG_KEY" not in repoman_settings:
 			raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!")
 		if "PORTAGE_GPG_DIR" not in repoman_settings:
-			if "HOME" in os.environ:
-				repoman_settings["PORTAGE_GPG_DIR"] = os.path.join(os.environ["HOME"], ".gnupg")
-				logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"])
-			else:
-				raise portage.exception.MissingParameter("PORTAGE_GPG_DIR is unset!")
+			repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser("~/.gnupg")
+			logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"])
 		repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
 		if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
 			raise portage.exception.InvalidLocation(



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-03-30 22:22 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-03-30 22:22 UTC (permalink / raw
  To: gentoo-commits

commit:     6f526bf9532b34434f2f5a6860901941ee86382c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Mar 30 22:19:54 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 22:19:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6f526bf9

Minor improvements in gpgsign().
repoman_settings["PORTAGE_GPG_DIR"] is always set.

---
 bin/repoman |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 985b8ea..8f36372 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2423,16 +2423,15 @@ else:
 			raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!")
 		if "PORTAGE_GPG_DIR" not in repoman_settings:
 			repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser("~/.gnupg")
-			logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"])
+			logging.info("Automatically setting PORTAGE_GPG_DIR to '%s'" % repoman_settings["PORTAGE_GPG_DIR"])
 		repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
 		if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
 			raise portage.exception.InvalidLocation(
 				"Unable to access directory: PORTAGE_GPG_DIR='%s'" % \
 				repoman_settings["PORTAGE_GPG_DIR"])
-		gpgcmd = "gpg --sign --clearsign --yes "
-		gpgcmd+= "--default-key "+repoman_settings["PORTAGE_GPG_KEY"]
-		if "PORTAGE_GPG_DIR" in repoman_settings:
-			gpgcmd += " --homedir "+repoman_settings["PORTAGE_GPG_DIR"]
+		gpgcmd = "gpg --sign --clearsign --yes"
+		gpgcmd += " --default-key " + repoman_settings["PORTAGE_GPG_KEY"]
+		gpgcmd += " --homedir " + repoman_settings["PORTAGE_GPG_DIR"]
 		if options.pretend:
 			print("("+gpgcmd+" "+filename+")")
 		else:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-04-03 15:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-04-03 15:56 UTC (permalink / raw
  To: gentoo-commits

commit:     85c176d5258b16eb5d1122218c23c62b978e304b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  3 15:54:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr  3 15:54:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=85c176d5

repoman: fix profiles.desc overlay path

Thanks to Alexey Shvetsov <alexxy <AT> gentoo.org> for reporting this issue
and testing the fix.

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 8f36372..9156a46 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -722,7 +722,7 @@ for path in portdb.porttrees:
 			elif arch[2] not in valid_profile_types:
 				err("invalid profile type: \"" + bad(arch[2]) + "\" in " + \
 					desc_path + " line %d" % (i+1, ))
-			profile_desc = ProfileDesc(arch[0], arch[2], arch[1], portdir)
+			profile_desc = ProfileDesc(arch[0], arch[2], arch[1], path)
 			if not os.path.isdir(profile_desc.abs_path):
 				logging.error(
 					"Invalid %s profile (%s) for arch %s in %s line %d",



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-04-14  1:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-04-14  1:55 UTC (permalink / raw
  To: gentoo-commits

commit:     505bd589ef19454119f6ed3e5d2440b562ff5ec2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 14 01:54:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 14 01:54:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=505bd589

repoman: cleanup gpgsign

---
 bin/repoman |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 654943c..f3956d6 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -66,7 +66,8 @@ import portage.checksum
 import portage.const
 from portage import cvstree, normalize_path
 from portage import util
-from portage.exception import FileNotFound, ParseError, PermissionDenied
+from portage.exception import (FileNotFound, MissingParameter,
+	ParseError, PermissionDenied)
 from portage.manifest import Manifest
 from portage.process import find_binary, spawn
 from portage.output import bold, create_color_func, \
@@ -2419,22 +2420,32 @@ else:
 
 	# Setup the GPG commands
 	def gpgsign(filename):
-		if "PORTAGE_GPG_KEY" not in repoman_settings and "${PORTAGE_GPG_KEY}" in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]:
-			raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!")
-		if "PORTAGE_GPG_DIR" not in repoman_settings and "${PORTAGE_GPG_DIR}" in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]:
-			repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser("~/.gnupg")
-			logging.info("Automatically setting PORTAGE_GPG_DIR to '%s'" % repoman_settings["PORTAGE_GPG_DIR"])
-		if "${PORTAGE_GPG_DIR}" in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]:
-			repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
+		gpgcmd = repoman_settings.get("PORTAGE_GPG_SIGNING_COMMAND")
+		if gpgcmd is None:
+			raise MissingParameter("PORTAGE_GPG_SIGNING_COMMAND is unset!" + \
+				" Is make.globals missing?")
+		if "${PORTAGE_GPG_KEY}" in gpgcmd and \
+			"PORTAGE_GPG_KEY" not in repoman_settings:
+			raise MissingParameter("PORTAGE_GPG_KEY is unset!")
+		if "${PORTAGE_GPG_DIR}" in gpgcmd:
+			if "PORTAGE_GPG_DIR" not in repoman_settings:
+				repoman_settings["PORTAGE_GPG_DIR"] = \
+					os.path.expanduser("~/.gnupg")
+				logging.info("Automatically setting PORTAGE_GPG_DIR to '%s'" \
+					% repoman_settings["PORTAGE_GPG_DIR"])
+			else:
+				repoman_settings["PORTAGE_GPG_DIR"] = \
+					os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
 			if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
 				raise portage.exception.InvalidLocation(
 					"Unable to access directory: PORTAGE_GPG_DIR='%s'" % \
 					repoman_settings["PORTAGE_GPG_DIR"])
 		gpgvars = {"FILE": filename}
-		for var in ("PORTAGE_GPG_DIR", "PORTAGE_GPG_KEY"):
-			if "${%s}" % var in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]:
-				gpgvars[var] = repoman_settings[var]
-		gpgcmd = portage.util.varexpand(repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"], mydict=gpgvars)
+		for k in ("PORTAGE_GPG_DIR", "PORTAGE_GPG_KEY"):
+			v = repoman_settings.get(k)
+			if v is not None:
+				gpgvars[k] = v
+		gpgcmd = portage.util.varexpand(gpgcmd, mydict=gpgvars)
 		if options.pretend:
 			print("("+gpgcmd+")")
 		else:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-04-23 15:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-04-23 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     9f9763896a887d375a59b167f96019a3c0a0b9bc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 23 15:41:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 23 15:41:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f976389

ebuild(1): fix env FEATURES overrides bug #364035

---
 bin/ebuild |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index d6cdc66..e3e8c6b 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -250,11 +250,9 @@ if "test" in pargs:
 	# of problems such as masked "test" USE flag.
 	tmpsettings["EBUILD_FORCE_TEST"] = "1"
 	tmpsettings.backup_changes("EBUILD_FORCE_TEST")
-	tmpsettings["FEATURES"] = tmpsettings.get("FEATURES", "") + " " + "test"
-	tmpsettings.backup_changes("FEATURES")
+	tmpsettings.features.add("test")
 
-tmpsettings["FEATURES"] = tmpsettings.get("FEATURES", "") + " " + "-fail-clean"
-tmpsettings.backup_changes("FEATURES")
+tmpsettings.features.discard("fail-clean")
 
 # Apply package.env settings. This allows per-package FEATURES and other
 # variables (possibly PORTAGE_TMPDIR) to be available as soon as possible.



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-04-26 21:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-04-26 21:18 UTC (permalink / raw
  To: gentoo-commits

commit:     75b6eb59e2015e1b776ccb3cc92260072a6b0fb6
Author:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 26 21:16:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 21:16:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=75b6eb59

Bug #364467 - handle gcc-4.6-style QA warnings

---
 bin/misc-functions.sh |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ae4cc9e..4c5b61a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -549,23 +549,23 @@ install_qa_check() {
 			reset_debug=1
 		fi
 		local m msgs=(
-			": warning: dereferencing type-punned pointer will break strict-aliasing rules$"
-			": warning: dereferencing pointer .* does break strict-aliasing rules$"
-			": warning: implicit declaration of function "
-			": warning: incompatible implicit declaration of built-in function "
-			": warning: is used uninitialized in this function$" # we'll ignore "may" and "might"
-			": warning: comparisons like X<=Y<=Z do not have their mathematical meaning$"
-			": warning: null argument where non-null required "
-			": warning: array subscript is below array bounds$"
-			": warning: array subscript is above array bounds$"
+			": warning: dereferencing type-punned pointer will break strict-aliasing rules"
+			": warning: dereferencing pointer .* does break strict-aliasing rules"
+			": warning: implicit declaration of function"
+			": warning: incompatible implicit declaration of built-in function"
+			": warning: is used uninitialized in this function" # we'll ignore "may" and "might"
+			": warning: comparisons like X<=Y<=Z do not have their mathematical meaning"
+			": warning: null argument where non-null required"
+			": warning: array subscript is below array bounds"
+			": warning: array subscript is above array bounds"
 			": warning: attempt to free a non-heap object"
-			": warning: .* called with .*bigger.* than .* destination buffer$"
-			": warning: call to .* will always overflow destination buffer$"
-			": warning: assuming pointer wraparound does not occur when comparing "
-			": warning: hex escape sequence out of range$"
-			": warning: [^ ]*-hand operand of comma .*has no effect$"
+			": warning: .* called with .*bigger.* than .* destination buffer"
+			": warning: call to .* will always overflow destination buffer"
+			": warning: assuming pointer wraparound does not occur when comparing"
+			": warning: hex escape sequence out of range"
+			": warning: [^ ]*-hand operand of comma .*has no effect"
 			": warning: converting to non-pointer type .* from NULL"
-			": warning: NULL used in arithmetic$"
+			": warning: NULL used in arithmetic"
 			": warning: passing NULL to non-pointer argument"
 			": warning: the address of [^ ]* will always evaluate as"
 			": warning: the address of [^ ]* will never be NULL"
@@ -574,9 +574,9 @@ install_qa_check() {
 			": warning: returning reference to temporary"
 			": warning: function returns address of local variable"
 			# this may be valid code :/
-			#": warning: multi-character character constant$"
+			#": warning: multi-character character constant"
 			# need to check these two ...
-			#": warning: assuming signed overflow does not occur when "
+			#": warning: assuming signed overflow does not occur when"
 			#": warning: comparison with string literal results in unspecified behav"
 			# yacc/lex likes to trigger this one
 			#": warning: extra tokens at end of .* directive"
@@ -598,7 +598,7 @@ install_qa_check() {
 				abort="yes"
 				# for now, don't make this fatal (see bug #337031)
 				#case "$m" in
-				#	": warning: call to .* will always overflow destination buffer$") always_overflow=yes ;;
+				#	": warning: call to .* will always overflow destination buffer") always_overflow=yes ;;
 				#esac
 				if [[ $always_overflow = yes ]] ; then
 					eerror



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-04-30  0:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-04-30  0:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e483cb18fde536893270e87aa39157da9ebda406
Author:     David James <davidjames <AT> google <DOT> com>
AuthorDate: Sat Apr 30 00:21:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 00:21:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e483cb18

Check for references to ${ROOT} in install_qa_checks.

When ROOT != /, binaries that reference ROOT will load their
dependencies from ROOT first rather than from the system-configured
path. This is a problem because the ROOT will be / on the target
system.

Besides the above, this patch also fixes incorrect parsing of scanelf
output, where we would treat the RPATHs returned by scanelf as the
names of binaries.

TEST=When "stricter" FEATURE is enabled, verify that emerge
fails when an ebuild references broken rpaths referencing
ROOT. When "stricter" FEATURE is not enabled, verify that such
references are automatically fixed. Also verify that ebuilds
with non-broken RPATHs (e.g. RPATHs referencing $ORIGIN/../lib)
are not touched by the change.

BUG=chromium-os:14271

Change-Id: I4f29cc4ea9195a1255f080284da1f676e4a2c26b

Review URL: http://codereview.chromium.org/6903153

---
 bin/misc-functions.sh |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index af0cc27..c310998 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -184,16 +184,37 @@ install_qa_check() {
 			unset PORTAGE_QUIET
 		fi
 
-		# Make sure we disallow insecure RUNPATH/RPATHs
-		# Don't want paths that point to the tree where the package was built
-		# (older, broken libtools would do this).  Also check for null paths
-		# because the loader will search $PWD when it finds null paths.
-		f=$(scanelf -qyRF '%r %p' "${D}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )")
+		# Make sure we disallow insecure RUNPATH/RPATHs.
+		#   1) References to PORTAGE_BUILDDIR are banned because it's a
+		#      security risk. We don't want to load files from a
+		#      temporary directory.
+		#   2) If ROOT != "/", references to ROOT are banned because
+		#      that directory won't exist on the target system.
+		#   3) Null paths are banned because the loader will search $PWD when
+		#      it finds null paths.
+		local forbidden_dirs="${PORTAGE_BUILDDIR}"
+		if [[ -n "$ROOT" ]] && [[ "$ROOT" != "/" ]]; then
+			forbidden_dirs="${forbidden_dirs} ${ROOT}"
+		fi
+		local dir="" rpath_files=$(scanelf -F '%F:%r' -qBR "${D}")
+		f=""
+		for dir in ${forbidden_dirs}; do
+			for l in $(echo "${rpath_files}" | grep -E ":${dir}|::|: "); do
+				f+="  ${l%%:*}\n"
+				if ! has stricter ${FEATURES}; then
+					vecho "Auto fixing rpaths for ${l%%:*}"
+					TMPDIR="${dir}" scanelf -BXr "${l%%:*}" -o /dev/null
+				fi
+			done
+		done
+
 		# Reject set*id binaries with $ORIGIN in RPATH #260331
 		x=$(
 			find "${D}" -type f \( -perm -u+s -o -perm -g+s \) -print0 | \
 			xargs -0 scanelf -qyRF '%r %p' | grep '$ORIGIN'
 		)
+
+		# Print QA notice.
 		if [[ -n ${f}${x} ]] ; then
 			vecho -ne '\n'
 			eqawarn "QA Notice: The following files contain insecure RUNPATHs"
@@ -203,9 +224,6 @@ install_qa_check() {
 			vecho -ne '\n'
 			if [[ -n ${x} ]] || has stricter ${FEATURES} ; then
 				insecure_rpath=1
-			else
-				vecho "Auto fixing rpaths for ${f}"
-				TMPDIR=${PORTAGE_BUILDDIR} scanelf -BXr ${f} -o /dev/null
 			fi
 		fi
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-04-30 16:32 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-04-30 16:32 UTC (permalink / raw
  To: gentoo-commits

commit:     15c7e8bd8c6ee7f57d18de6fb8f931059200dd4c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sat Apr 30 16:30:29 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 16:30:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=15c7e8bd

install_qa_check(): Simplify code and make 'l' a local variable.

---
 bin/misc-functions.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c310998..b28b73f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -193,10 +193,10 @@ install_qa_check() {
 		#   3) Null paths are banned because the loader will search $PWD when
 		#      it finds null paths.
 		local forbidden_dirs="${PORTAGE_BUILDDIR}"
-		if [[ -n "$ROOT" ]] && [[ "$ROOT" != "/" ]]; then
-			forbidden_dirs="${forbidden_dirs} ${ROOT}"
+		if [[ -n "${ROOT}" && "${ROOT}" != "/" ]]; then
+			forbidden_dirs+=" ${ROOT}"
 		fi
-		local dir="" rpath_files=$(scanelf -F '%F:%r' -qBR "${D}")
+		local dir l rpath_files=$(scanelf -F '%F:%r' -qBR "${D}")
 		f=""
 		for dir in ${forbidden_dirs}; do
 			for l in $(echo "${rpath_files}" | grep -E ":${dir}|::|: "); do



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-05-02 17:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-05-02 17:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e5977579376dd124bb341263f73a5d302dbc0863
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May  2 17:56:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May  2 17:56:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e5977579

ebuild.sh: make INHERITED independent of phase

When EBUILD_PHASE != depend, INHERITED comes pre-initialized
from cache. In order to make INHERITED content independent of
EBUILD_PHASE during inherit() calls, we unset INHERITED after
we make a backup copy for QA checks.

---
 bin/ebuild.sh |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 6593755..b610342 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1359,7 +1359,7 @@ inherit() {
 			# This is disabled in the *rm phases because they frequently give
 			# false alarms due to INHERITED in /var/db/pkg being outdated
 			# in comparison the the eclasses from the portage tree.
-			if ! hasq $ECLASS $INHERITED; then
+			if ! hasq $ECLASS $INHERITED $__INHERITED_QA_CACHE ; then
 				eqawarn "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF $EBUILD_PHASE"
 			fi
 		fi
@@ -2023,11 +2023,18 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
 		# during sourcing of ebuilds and eclasses.
 		source_all_bashrcs
 
+		# When EBUILD_PHASE != depend, INHERITED comes pre-initialized
+		# from cache. In order to make INHERITED content independent of
+		# EBUILD_PHASE during inherit() calls, we unset INHERITED after
+		# we make a backup copy for QA checks.
+		__INHERITED_QA_CACHE=$INHERITED
+
 		# *DEPEND and IUSE will be set during the sourcing of the ebuild.
 		# In order to ensure correct interaction between ebuilds and
 		# eclasses, they need to be unset before this process of
 		# interaction begins.
-		unset DEPEND RDEPEND PDEPEND IUSE REQUIRED_USE
+		unset DEPEND RDEPEND PDEPEND INHERITED IUSE REQUIRED_USE \
+			ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
 
 		if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
 			source "$EBUILD" || die "error sourcing ebuild"
@@ -2057,7 +2064,8 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
 		PDEPEND="${PDEPEND} ${E_PDEPEND}"
 		REQUIRED_USE="${REQUIRED_USE} ${E_REQUIRED_USE}"
 		
-		unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND 
+		unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND \
+			__INHERITED_QA_CACHE
 
 		# alphabetically ordered by $EBUILD_PHASE value
 		case "$EAPI" in



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-05-02 20:17 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-05-02 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     d724545334185679e9c7d13c8b3feaa735e1fd48
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon May  2 20:17:15 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon May  2 20:17:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7245453

Avoid evaluation of values of variables in set_unless_changed().

---
 bin/ebuild.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b610342..f3349ae 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1654,7 +1654,7 @@ set_unless_changed() {
 		variable="${argument%%=*}"
 		value="${argument#*=}"
 		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-			eval "${variable}=\"${value}\""
+			eval "${variable}=\"\${value}\""
 		fi
 	done
 }



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-05-05 13:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-05-05 13:47 UTC (permalink / raw
  To: gentoo-commits

commit:     b05abd2f5de54c05c5b9b41976300273cd3e7532
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May  5 06:44:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May  5 13:47:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b05abd2f

repoman: make virtual.oldstyle a warning for now

This will give third-party repoman users some time to migrate their
repos away old-style virtuals.

---
 bin/repoman |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ad620e2..dfcc0cb 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -413,6 +413,7 @@ qawarnings = set((
 "portage.internal",
 "usage.obsolete",
 "upstream.workaround",
+"virtual.oldstyle",
 "LIVEVCS.stable",
 "LIVEVCS.unmasked",
 ))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-05-18  3:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-05-18  3:46 UTC (permalink / raw
  To: gentoo-commits

commit:     5cfba96ca932266c7b50c9e432f13dd858e031db
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 03:46:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 18 03:46:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5cfba96c

etc-update: clear term when appropriate

This solves an issue like bug #142508, but involving etc-update instead
of dispatch-conf. This is also relevant to bug #70668, which is the
same issue, though the reporter suggested to use colors to delimit the
output instead of using clear.

---
 bin/etc-update |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 03e9dc9..73a1f5d 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -149,6 +149,7 @@ sel_file() {
 		elif [ "${DELETE_ALL}" == "yes" ]; then
 			input=0
 		else
+			clear
 			if [[ ${mode} == 0 ]] ; then
 				echo "The following is the list of files which need updating, each
 configuration file is followed by a list of possible replacement files."
@@ -316,6 +317,7 @@ do_cfg() {
 		elif [[ "${DELETE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
 			my_input=2
 		else
+			clear
 			if [ "${using_editor}" == 0 ]; then
 				(
 					echo "Showing differences between ${ofile} and ${file}"
@@ -418,7 +420,9 @@ Please select from the menu above (-1 to exit, losing this merge): "
 				   rm ${rm_opts} "${file}"
 				   return 255
 				   ;;
-				2)	if [ "${using_editor}" == 0 ]; then
+				2)
+					clear
+					if [ "${using_editor}" == 0 ]; then
 						(
 							echo "Showing differences between ${ofile} and ${mfile}"
 							diff_command "${ofile}" "${mfile}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-05-23  7:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-05-23  7:05 UTC (permalink / raw
  To: gentoo-commits

commit:     8597e3abb9e4748e1293e4af18396211f7b1176e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 07:05:05 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 23 07:05:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8597e3ab

repoman: pass type_name to Package constructor

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index dfcc0cb..9cf1f3a 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1167,7 +1167,7 @@ for x in scanlist:
 				fails["EAPI.unsupported"].append(os.path.join(x, y))
 				continue
 			pkgs[pf] = Package(cpv=cpv, metadata=myaux,
-				root_config=root_config)
+				root_config=root_config, type_name="ebuild")
 
 	# Sort ebuilds in ascending order for the KEYWORDS.dropped check.
 	pkgsplits = {}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-05-26  6:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-05-26  6:28 UTC (permalink / raw
  To: gentoo-commits

commit:     4f65eadb037440fd401831dcc3165d4a28246ec7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 06:27:41 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 06:27:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4f65eadb

Update timestamps in headers of modified files.

---
 bin/etc-update |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 73a1f5d..2369f04 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Author Brandon Low <lostlogic@gentoo.org>



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-02 13:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-02 13:06 UTC (permalink / raw
  To: gentoo-commits

commit:     1edf9e3bd37fede61a21d3b6a84542d29d8f3021
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  2 12:50:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  2 12:50:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1edf9e3b

portageq: add new expand_virtual function

Something like this was requested in bug #157357. Now that Gentoo has
migrated all virtuals to GLEP 37 new-style virtuals, this kind of
function may be helpful in order to resolve the currently installed
provider of a particular virtual in scripts like bootstrap.sh.

Usage:

	portageq expand_virtual <root> <atom>

		Returns a \n separated list of atoms expanded from a
		given virtual atom, excluding blocker atoms. Satisfied
		virtual atoms are not included in the output, since
		they are expanded to real atoms which are displayed.
		Unsatisfied virtual atoms are displayed without
		any expansion. The "match" command can be used to
		resolve the returned atoms to specific installed
		packages.

Example input/output:

	$ portageq expand_virtual / virtual/jre
	=dev-java/sun-jdk-1.6.0*

	$ portageq expand_virtual / virtual/jre:1.5
	dev-java/gcj-jdk

	$ portageq expand_virtual / virtual/package-manager
	sys-apps/portage

	$ portageq expand_virtual / virtual/libc
	sys-libs/glibc:2.2

	$ portageq expand_virtual / virtual/os-headers
	sys-kernel/linux-headers:0

---
 bin/portageq |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 069ece2..d6d9c17 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -43,6 +43,7 @@ except ImportError:
 del pym_path
 
 from portage import os
+from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.util import writemsg, writemsg_stdout
 
 def eval_atom_use(atom):
@@ -492,6 +493,40 @@ def match(argv):
 		print(cpv)
 match.uses_root = True
 
+def expand_virtual(argv):
+	"""<root> <atom>
+	Returns a \\n separated list of atoms expanded from a
+	given virtual atom, excluding blocker atoms. Satisfied
+	virtual atoms are not included in the output, since
+	they are expanded to real atoms which are displayed.
+	Unsatisfied virtual atoms are displayed without
+	any expansion. The "match" command can be used to
+	resolve the returned atoms to specific installed
+	packages.
+	"""
+	if len(argv) != 2:
+		writemsg("ERROR: expected 2 parameters, got %d!\n" % len(argv),
+			noiselevel=-1)
+		return 2
+
+	root, atom = argv
+
+	try:
+		results = list(expand_new_virt(
+			portage.db[root]["vartree"].dbapi, atom))
+	except portage.exception.InvalidAtom:
+		writemsg("ERROR: Invalid atom: '%s'\n" % atom,
+			noiselevel=-1)
+		return 2
+
+	results.sort()
+	for x in results:
+		if not x.blocker:
+			writemsg_stdout("%s\n" % (x,))
+
+	return os.EX_OK
+
+expand_virtual.uses_root = True
 
 def vdb_path(argv):
 	"""



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-02 21:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-02 21:02 UTC (permalink / raw
  To: gentoo-commits

commit:     c6edcb6ac16b7bd011ab196dab2722374b8e9cec
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  2 21:02:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  2 21:02:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6edcb6a

portageq: exclude expand_new_virt from commands

This is necessary since portage probes functions in globals() and
treats functions it finds as commands. Also, use lazy import to
minimize global scope imports.

---
 bin/portageq |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index d6d9c17..92719fb 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -21,7 +21,6 @@ except KeyboardInterrupt:
 	sys.exit(128 + signal.SIGINT)
 
 import os
-import subprocess
 import types
 
 # Avoid sandbox violations after python upgrade.
@@ -43,8 +42,11 @@ except ImportError:
 del pym_path
 
 from portage import os
-from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.util import writemsg, writemsg_stdout
+portage.proxy.lazyimport.lazyimport(globals(),
+	'subprocess',
+	'portage.dbapi._expand_new_virt:expand_new_virt',
+)
 
 def eval_atom_use(atom):
 	if 'USE' in os.environ:
@@ -656,10 +658,11 @@ list_preserved_libs.uses_root = True
 if not portage.const._ENABLE_PRESERVE_LIBS:
 	del list_preserved_libs
 
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main',
+non_commands = frozenset(['elog', 'eval_atom_use',
+	'exithandler', 'expand_new_virt', 'main',
 	'usage', 'writemsg', 'writemsg_stdout'])
 commands = sorted(k for k, v in globals().items() \
-	if type(v) is types.FunctionType and k not in non_commands)
+	if k not in non_commands and isinstance(v, types.FunctionType))
 
 def usage(argv):
 	print(">>> Portage information query tool")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-06  2:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-06  2:53 UTC (permalink / raw
  To: gentoo-commits

commit:     81bd25882a4e3dc39751e915fecadae7d7368662
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  6 02:52:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun  6 02:52:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=81bd2588

portageq: support --version

---
 bin/portageq |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 92719fb..fa71388 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -719,13 +719,18 @@ def main():
 	if nocolor in ('yes', 'true'):
 		portage.output.nocolor()
 
-	if "-h" in sys.argv or "--help" in sys.argv:
-		usage(sys.argv)
-		sys.exit(os.EX_OK)
-	elif len(sys.argv) < 2:
+	if len(sys.argv) < 2:
 		usage(sys.argv)
 		sys.exit(os.EX_USAGE)
 
+	for x in sys.argv:
+		if x in ("-h", "--help"):
+			usage(sys.argv)
+			sys.exit(os.EX_OK)
+		elif x == "--version":
+			print("Portage", portage.VERSION)
+			sys.exit(os.EX_OK)
+
 	cmd = sys.argv[1]
 	function = globals().get(cmd)
 	if function is None or cmd not in commands:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-09 14:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-09 14:36 UTC (permalink / raw
  To: gentoo-commits

commit:     12dd82b64c23764fab5a185bcfba446af3fcbf46
Author:     Jeremy Murphy <jeremy.william.murphy <AT> gmail <DOT> com>
AuthorDate: Thu Jun  9 14:34:35 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 14:34:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12dd82b6

ebuild.sh: don't hardcode distcc pump path

---
 bin/ebuild.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 37a3084..9ca41a6 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1073,8 +1073,8 @@ dyn_compile() {
 
 	if hasq distcc $FEATURES && hasq distcc-pump $FEATURES ; then
 		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
-			eval $(/usr/bin/pump --startup)
-			trap "/usr/bin/pump --shutdown" EXIT
+			eval $(pump --startup)
+			trap "pump --shutdown" EXIT
 		fi
 	fi
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-09 15:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-09 15:12 UTC (permalink / raw
  To: gentoo-commits

commit:     dbc9f3cc4c665af6d5db24bd9fb7544ed711d96f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 15:11:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 15:11:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dbc9f3cc

ebuild.sh: fix libdir for ccache/distcc

This will fix bug #355283.

---
 bin/ebuild.sh |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 9ca41a6..8c301d8 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -2118,13 +2118,17 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
 			PATH=$_ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
 			unset _ebuild_helpers_path
 
+			# Use default ABI libdir in accordance with bug #355283.
+			x=LIBDIR_${DEFAULT_ABI}
+			[[ -n $DEFAULT_ABI && -n ${!x} ]] && x=${!x} || x=lib
+
 			if hasq distcc $FEATURES ; then
-				PATH="/usr/lib/distcc/bin:$PATH"
+				PATH="/usr/$x/distcc/bin:$PATH"
 				[[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
 			fi
 
 			if hasq ccache $FEATURES ; then
-				PATH="/usr/lib/ccache/bin:$PATH"
+				PATH="/usr/$x/ccache/bin:$PATH"
 
 				if [[ -n $CCACHE_DIR ]] ; then
 					addread "$CCACHE_DIR"
@@ -2134,6 +2138,8 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
 				[[ -n $CCACHE_SIZE ]] && ccache -M $CCACHE_SIZE &> /dev/null
 			fi
 
+			unset x
+
 			if [[ -n $QA_PREBUILT ]] ; then
 
 				# these ones support fnmatch patterns



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-16 20:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-16 20:06 UTC (permalink / raw
  To: gentoo-commits

commit:     9a8cb932580156764e3c66b3e3d0b274a5a95fb6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 16 20:03:43 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 20:03:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9a8cb932

repoman: only report allmasked if ebuilds exist

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 9cf1f3a..164a127 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1942,7 +1942,7 @@ for x in scanlist:
 	#if not portage.portdb.xmatch("bestmatch-visible",x):
 	#    stats["ebuild.nostable"]+=1
 	#    fails["ebuild.nostable"].append(x)
-	if allmasked and repolevel == 3:
+	if ebuildlist and allmasked and repolevel == 3:
 		stats["ebuild.allmasked"]+=1
 		fails["ebuild.allmasked"].append(x)
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-18 17:54 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-18 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     fed6021192dd59eda1f6b9f3fb227597a83870de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 18 17:53:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 18 17:53:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fed60211

portageq: fix all_best_visible to fail early

This will fix bug #372193.

---
 bin/portageq |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index fa71388..a13ca99 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -461,9 +461,11 @@ def all_best_visible(argv):
 	"""<root>
 	Returns all best_visible packages (without .ebuild).
 	"""
-	if (len(argv) < 1):
-		print("ERROR: insufficient parameters!")
-	
+	if len(argv) < 1:
+		sys.stderr.write("ERROR: insufficient parameters!\n")
+		sys.stderr.flush()
+		return 2
+
 	#print portage.db[argv[0]]["porttree"].dbapi.cp_all()
 	for pkg in portage.db[argv[0]]["porttree"].dbapi.cp_all():
 		mybest=portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-18 19:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-18 19:51 UTC (permalink / raw
  To: gentoo-commits

commit:     aa1a33a58262c2982e43238ef6f7710115eba9a3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 18 19:51:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 18 19:51:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aa1a33a5

emaint binhost: check SIZE and MTIME

---
 bin/emaint |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/bin/emaint b/bin/emaint
index 1b1df71..7294d79 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -5,6 +5,7 @@ from __future__ import print_function
 
 import re
 import signal
+import stat
 import sys
 import textwrap
 import time
@@ -19,6 +20,9 @@ except ImportError:
 
 from portage import os
 
+if sys.hexversion >= 0x3000000:
+	long = int
+
 class WorldHandler(object):
 
 	short_desc = "Fix problems in the world file"
@@ -185,7 +189,23 @@ class BinhostHandler(object):
 				del missing[:]
 				for i, cpv in enumerate(cpv_all):
 					d = metadata.get(cpv)
-					if not d or "MD5" not in d:
+					if not d or \
+						"MD5" not in d or \
+						"SIZE" not in d or \
+						"MTIME" not in d:
+						missing.append(cpv)
+						continue
+
+					pkg_path = bintree.getname(cpv)
+					s = os.lstat(pkg_path)
+					try:
+						if long(d["MTIME"]) != s[stat.ST_MTIME]:
+							missing.append(cpv)
+							continue
+						if long(d["SIZE"]) != long(s.st_size):
+							missing.append(cpv)
+							continue
+					except ValueError:
 						missing.append(cpv)
 
 				maxval = len(missing)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-18 22:11 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-18 22:11 UTC (permalink / raw
  To: gentoo-commits

commit:     574fe329895fdc923d7554ea87e1cdc4c9f4d950
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 18 22:09:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 18 22:09:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=574fe329

emaint binhost: add method for SIZE/MTIME checks

---
 bin/emaint |   57 ++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 38 insertions(+), 19 deletions(-)

diff --git a/bin/emaint b/bin/emaint
index 7294d79..fdd01ed 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -3,6 +3,7 @@
 
 from __future__ import print_function
 
+import errno
 import re
 import signal
 import stat
@@ -19,6 +20,7 @@ except ImportError:
 	import portage
 
 from portage import os
+from portage.util import writemsg
 
 if sys.hexversion >= 0x3000000:
 	long = int
@@ -124,6 +126,39 @@ class BinhostHandler(object):
 		self._pkgindex_file = self._bintree._pkgindex_file
 		self._pkgindex = self._bintree._load_pkgindex()
 
+	def _need_update(self, cpv, data):
+
+		if "MD5" not in data:
+			return True
+
+		size = data.get("SIZE")
+		if size is None:
+			return True
+
+		mtime = data.get("MTIME")
+		if mtime is None:
+			return True
+
+		pkg_path = self._bintree.getname(cpv)
+		try:
+			s = os.lstat(pkg_path)
+		except OSError as e:
+			if e.errno not in (errno.ENOENT, errno.ESTALE):
+				raise
+			# We can't update the index for this one because
+			# it disappeared.
+			return False
+
+		try:
+			if long(mtime) != s[stat.ST_MTIME]:
+				return True
+			if long(size) != long(s.st_size):
+				return True
+		except ValueError:
+			return True
+
+		return False
+
 	def check(self, onProgress=None):
 		missing = []
 		cpv_all = self._bintree.dbapi.cpv_all()
@@ -138,7 +173,7 @@ class BinhostHandler(object):
 			metadata[d["CPV"]] = d
 		for i, cpv in enumerate(cpv_all):
 			d = metadata.get(cpv)
-			if not d or "MD5" not in d:
+			if not d or self._need_update(cpv, d):
 				missing.append(cpv)
 			if onProgress:
 				onProgress(maxval, i+1)
@@ -164,7 +199,7 @@ class BinhostHandler(object):
 
 		for i, cpv in enumerate(cpv_all):
 			d = metadata.get(cpv)
-			if not d or "MD5" not in d:
+			if not d or self._need_update(cpv, d):
 				missing.append(cpv)
 
 		stale = set(metadata).difference(cpv_all)
@@ -189,23 +224,7 @@ class BinhostHandler(object):
 				del missing[:]
 				for i, cpv in enumerate(cpv_all):
 					d = metadata.get(cpv)
-					if not d or \
-						"MD5" not in d or \
-						"SIZE" not in d or \
-						"MTIME" not in d:
-						missing.append(cpv)
-						continue
-
-					pkg_path = bintree.getname(cpv)
-					s = os.lstat(pkg_path)
-					try:
-						if long(d["MTIME"]) != s[stat.ST_MTIME]:
-							missing.append(cpv)
-							continue
-						if long(d["SIZE"]) != long(s.st_size):
-							missing.append(cpv)
-							continue
-					except ValueError:
+					if not d or self._need_update(cpv, d):
 						missing.append(cpv)
 
 				maxval = len(missing)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-24 10:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-24 10:29 UTC (permalink / raw
  To: gentoo-commits

commit:     0bd3f9cba502cbef281bae8721a2fcc3d52a0a8a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 24 10:28:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 10:28:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0bd3f9cb

repoman: fix broken set constructor usage

---
 bin/repoman |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 6145c89..0e3820f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1958,7 +1958,8 @@ for x in scanlist:
 								prof, repr(atoms)))
 
 		if not baddepsyntax and unknown_pkgs:
-			all_unknown = set(*unknown_pkgs.values())
+			all_unknown = set()
+			all_unknown.update(*unknown_pkgs.values())
 			type_map = {}
 			for mytype, atom in all_unknown:
 				type_map.setdefault(mytype, set()).add(atom)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-24 20:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-24 20:35 UTC (permalink / raw
  To: gentoo-commits

commit:     dd2d661078771a41d4fd554c2bc3b1188ce7b53e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 24 15:51:17 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 20:34:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd2d6610

Add a QA check for systemd unit file install.

---
 bin/misc-functions.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b28b73f..09decf3 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -714,6 +714,16 @@ install_qa_check() {
 		done
 		[[ ${abort} == yes ]] && die "multilib-strict check failed!"
 	fi
+
+	# ensure packages don't install systemd units automagically
+	if ! hasq systemd ${INHERITED} && \
+		[[ -d "${D}"/lib/systemd/system ]]
+	then
+		eqawarn "QA Notice: package installs systemd unit files (/lib/systemd/system)"
+		eqawarn "           but does not inherit systemd.eclass."
+		hasq stricter ${FEATURES} \
+			&& die "install aborted due to missing inherit of systemd.eclass"
+	fi
 }
 
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-30  4:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-30  4:13 UTC (permalink / raw
  To: gentoo-commits

commit:     fa9e85bbe7c513193756a2d13ce63a609138753d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 04:13:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 04:13:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fa9e85bb

ebuild(1): pass Package instance to setcpv

This should improve repo-level support, for bug #370693.

---
 bin/ebuild |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 9ad17e8..68e52e3 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -76,6 +76,8 @@ from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
 from portage.const import VDB_PATH
+from _emerge.Package import Package
+from _emerge.RootConfig import RootConfig
 
 if not opts.ignore_default_opts:
 	default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split()
@@ -171,6 +173,7 @@ if not portage.catpkgsplit(cpv):
 
 if ebuild.startswith(vdb_path):
 	mytree = "vartree"
+	pkg_type = "installed"
 
 	portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
 
@@ -180,6 +183,7 @@ if ebuild.startswith(vdb_path):
 
 else:
 	mytree = "porttree"
+	pkg_type = "ebuild"
 
 	portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
 
@@ -253,14 +257,26 @@ if "test" in pargs:
 
 tmpsettings.features.discard("fail-clean")
 
-# Apply package.env settings. This allows per-package FEATURES and other
-# variables (possibly PORTAGE_TMPDIR) to be available as soon as possible.
 try:
-	tmpsettings.setcpv(cpv, mydb=portage.db[portage.root][mytree].dbapi)
+	metadata = dict(zip(Package.metadata_keys,
+		portage.db[portage.settings["ROOT"]][mytree].dbapi.aux_get(
+		cpv, Package.metadata_keys)))
 except KeyError:
 	# aux_get failure, message should have been shown on stderr.
 	sys.exit(1)
 
+root_config = RootConfig(portage.settings,
+	portage.db[portage.settings["ROOT"]], None)
+
+pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv,
+	metadata=metadata, root_config=root_config,
+	type_name=pkg_type)
+
+# Apply package.env and repo-level settings. This allows per-package
+# FEATURES and other variables (possibly PORTAGE_TMPDIR) to be
+# available as soon as possible.
+tmpsettings.setcpv(pkg)
+
 def stale_env_warning():
 	if "clean" not in pargs and \
 		"noauto" not in tmpsettings.features and \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-30  4:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-30  4:27 UTC (permalink / raw
  To: gentoo-commits

commit:     b697387ccca333e7a4122b81a01b9c14332c3637
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 04:26:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 04:26:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b697387c

ebuild(1): pass "installed" arg to Package

---
 bin/ebuild |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 68e52e3..3884b3b 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -269,6 +269,7 @@ root_config = RootConfig(portage.settings,
 	portage.db[portage.settings["ROOT"]], None)
 
 pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv,
+	installed=(pkg_type=="installed"),
 	metadata=metadata, root_config=root_config,
 	type_name=pkg_type)
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-30  4:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-30  4:40 UTC (permalink / raw
  To: gentoo-commits

commit:     86c8167c2ef23655d8e45bd3f1f547332546b424
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 04:39:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 04:39:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=86c8167c

ebuild(1): pass missing myrepo arg to aux_get

---
 bin/ebuild |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 3884b3b..f8b6d79 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -260,7 +260,7 @@ tmpsettings.features.discard("fail-clean")
 try:
 	metadata = dict(zip(Package.metadata_keys,
 		portage.db[portage.settings["ROOT"]][mytree].dbapi.aux_get(
-		cpv, Package.metadata_keys)))
+		cpv, Package.metadata_keys, myrepo=myrepo)))
 except KeyError:
 	# aux_get failure, message should have been shown on stderr.
 	sys.exit(1)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-06-30  8:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-06-30  8:55 UTC (permalink / raw
  To: gentoo-commits

commit:     e033be0c91e5776b3eef31a02aed849696e73f45
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 08:53:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 08:53:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e033be0c

misc-functions.sh: remove stale NEEDED* files

---
 bin/misc-functions.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 09decf3..d708c1d 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -340,6 +340,7 @@ install_qa_check() {
 		fi
 
 		# Save NEEDED information after removing self-contained providers
+		rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2}
 		scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do
 			arch=${l%%;*}; l=${l#*;}
 			obj="/${l%%;*}"; l=${l#*;}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-01 13:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-01 13:27 UTC (permalink / raw
  To: gentoo-commits

commit:     ebb17308212806e44468f520268b3d1441133065
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  1 13:27:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  1 13:27:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ebb17308

portageq get_repo_path: output empty if unknown

It used to output "None" for unknown repos, which was not intended.

---
 bin/portageq |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index a13ca99..f0ecbfc 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -627,7 +627,10 @@ def get_repo_path(argv):
 		print("ERROR: insufficient parameters!")
 		sys.exit(2)
 	for arg in argv[1:]:
-		print(portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(arg))
+		path = portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(arg)
+		if path is None:
+			path = ""
+		print(path)
 
 def list_preserved_libs(argv):
 	"""<root>



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-03 15:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-03 15:53 UTC (permalink / raw
  To: gentoo-commits

commit:     816e20deb9320f98019d4553488c231e7ed2f5ec
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  3 15:52:37 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 15:52:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=816e20de

repoman: ElementTree.ParseError -> SyntaxError

The ElementTree.ParseError class is undocumented and isn't available
in python-2.6, so use its SyntaxError base class instead.

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 0e3820f..d1d393a 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1404,7 +1404,7 @@ for x in scanlist:
 				os.path.join(checkdir, "metadata.xml"),
 				parser=xml.etree.ElementTree.XMLParser(
 					target=_MetadataTreeBuilder()))
-		except (xml.etree.ElementTree.ParseError, ExpatError, EnvironmentError) as e:
+		except (ExpatError, SyntaxError, EnvironmentError) as e:
 			metadata_bad = True
 			stats["metadata.bad"] += 1
 			fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-08 16:54 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-08 16:54 UTC (permalink / raw
  To: gentoo-commits

commit:     cff6e7888af31d1db2519ce17d5b30baf5270002
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 16:54:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 16:54:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cff6e788

Invert has/hasq and use/useq implementations.

We need to migrate away from hasq and useq since they are deprecated
(bug #199722).

---
 bin/ebuild.sh             |    8 ++++----
 bin/isolated-functions.sh |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 8c301d8..f9a87af 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -127,19 +127,19 @@ esyslog() {
 	return 0
 }
 
-use() {
-	useq ${1}
+useq() {
+	use ${1}
 }
 
 usev() {
-	if useq ${1}; then
+	if use ${1}; then
 		echo "${1#!}"
 		return 0
 	fi
 	return 1
 }
 
-useq() {
+use() {
 	local u=$1
 	local found=0
 

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 24443ac..a4bd0a9 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -511,19 +511,19 @@ if [[ -z ${XARGS} ]] ; then
 	esac
 fi
 
-has() {
-	hasq "$@"
+hasq() {
+	has "$@"
 }
 
 hasv() {
-	if hasq "$@" ; then
+	if has "$@" ; then
 		echo "$1"
 		return 0
 	fi
 	return 1
 }
 
-hasq() {
+has() {
 	[[ " ${*:2} " == *" $1 "* ]]
 }
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-08 17:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-08 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     039439c2cc1546701cbb7403ea387581f08d5be0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 17:22:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 17:22:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=039439c2

Add QA Notice for hasq/useq calls (bug #199722).

---
 bin/ebuild.sh             |    1 +
 bin/isolated-functions.sh |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 77a21f7..2ef40cb 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -128,6 +128,7 @@ esyslog() {
 }
 
 useq() {
+	eqawarn "QA Notice: The 'useq' function is deprecated (replaced by 'use')"
 	use ${1}
 }
 

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5fbdd01..9d63397 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -512,6 +512,7 @@ if [[ -z ${XARGS} ]] ; then
 fi
 
 hasq() {
+	eqawarn "QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
 	has "$@"
 }
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-11 14:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-11 14:27 UTC (permalink / raw
  To: gentoo-commits

commit:     f8504d36c50bef4c1a982a4b9262d3e8e15f438b
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Mon Jul 11 08:33:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 14:26:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f8504d36

ebuild.sh: restore old has() implementation

The needle/haystack implementation handles whitespace as originally
intended (prior to commit 659eafddd5964820ce8bdc0d90f5fcf7df04b5b7),
as discussed in bug #374791.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

---
 bin/isolated-functions.sh |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 9d63397..574f949 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -525,7 +525,14 @@ hasv() {
 }
 
 has() {
-	[[ " ${*:2} " == *" $1 "* ]]
+	local needle=$1
+	shift
+
+	local x
+	for x in "$@"; do
+		[ "${x}" = "${needle}" ] && return 0
+	done
+	return 1
 }
 
 # @FUNCTION: save_ebuild_env



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-12 18:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-12 18:46 UTC (permalink / raw
  To: gentoo-commits

commit:     197ab88070b624296a9779da827fc194df95c32e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 18:45:41 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 18:45:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=197ab880

misc-functions.sh: fix incorrect has -o usage

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index a4f103d..8c191ff 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -773,7 +773,7 @@ preinst_mask() {
 	install_mask "${D}" "${INSTALL_MASK}"
 
 	# remove share dir if unnessesary
-	if has nodoc $FEATURES -o has noman $FEATURES -o has noinfo $FEATURES; then
+	if has nodoc $FEATURES || has noman $FEATURES || has noinfo $FEATURES; then
 		rmdir "${D}usr/share" &> /dev/null
 	fi
 }



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-12 20:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-12 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     f0b19822bace8a04fd2b5c2797ecfe387faf5ac7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 20:16:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 20:16:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f0b19822

filter-bash-environment.py: move imports to top

---
 bin/filter-bash-environment.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
index 5038c07..b9aec96 100755
--- a/bin/filter-bash-environment.py
+++ b/bin/filter-bash-environment.py
@@ -1,9 +1,13 @@
 #!/usr/bin/python
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import codecs
-import os, re, sys
+import io
+import optparse
+import os
+import re
+import sys
 
 here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
 func_start_re = re.compile(r'^[-\w]+\s*\(\)\s*$')
@@ -122,8 +126,7 @@ if __name__ == "__main__":
 		"intact. The PATTERN is a space separated list of variable names" + \
 		" and it supports python regular expression syntax."
 	usage = "usage: %s PATTERN" % os.path.basename(sys.argv[0])
-	from optparse import OptionParser
-	parser = OptionParser(description=description, usage=usage)
+	parser = optparse.OptionParser(description=description, usage=usage)
 	options, args = parser.parse_args(sys.argv[1:])
 	if len(args) != 1:
 		parser.error("Missing required PATTERN argument.")
@@ -132,7 +135,6 @@ if __name__ == "__main__":
 	if sys.hexversion >= 0x3000000:
 		file_in = codecs.iterdecode(sys.stdin.buffer.raw,
 			'utf_8', errors='replace')
-		import io
 		file_out = io.TextIOWrapper(sys.stdout.buffer,
 			'utf_8', errors='backslashreplace')
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-14 22:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-14 22:33 UTC (permalink / raw
  To: gentoo-commits

commit:     d911efc22d0c16c13899917d8998b4fba256afd9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 22:32:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 22:32:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d911efc2

portageq: reference GLEP 37 in expand_virtual doc

---
 bin/portageq |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index f0ecbfc..f614517 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -500,7 +500,8 @@ match.uses_root = True
 def expand_virtual(argv):
 	"""<root> <atom>
 	Returns a \\n separated list of atoms expanded from a
-	given virtual atom, excluding blocker atoms. Satisfied
+	given virtual atom (GLEP 37 virtuals only),
+	excluding blocker atoms. Satisfied
 	virtual atoms are not included in the output, since
 	they are expanded to real atoms which are displayed.
 	Unsatisfied virtual atoms are displayed without



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-07-15 17:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-07-15 17:06 UTC (permalink / raw
  To: gentoo-commits

commit:     6620e74643e0baf040488557b1fff7273654a44d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 17:06:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 17:06:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6620e746

Skip QA Notice for hasq/useq during *rm phases.

---
 bin/ebuild.sh             |    3 ++-
 bin/isolated-functions.sh |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2ef40cb..4aef413 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -128,7 +128,8 @@ esyslog() {
 }
 
 useq() {
-	eqawarn "QA Notice: The 'useq' function is deprecated (replaced by 'use')"
+	has $EBUILD_PHASE prerm postrm || eqawarn \
+		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"
 	use ${1}
 }
 

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 574f949..65bb1d5 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -512,7 +512,8 @@ if [[ -z ${XARGS} ]] ; then
 fi
 
 hasq() {
-	eqawarn "QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
+	has $EBUILD_PHASE prerm postrm || eqawarn \
+		"QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
 	has "$@"
 }
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-01 23:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-01 23:48 UTC (permalink / raw
  To: gentoo-commits

commit:     75a0cce2b6d7ecb8f369a65fbb047e3ce9d96b44
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 23:48:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  1 23:48:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=75a0cce2

unpack: always unpack to cwd (bug #376741)

This brings portage into agreement with PMS. Also, for existing EAPIs,
if the source file is in a writable directory then this will create a
symlink for backward-compatible emulation of tools like gunzip and
bunzip2.

---
 bin/ebuild.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 4aef413..3d4d557 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -370,7 +370,21 @@ unpack() {
 				$1 -c -- "$srcdir$x" | tar xof -
 				assert_sigpipe_ok "$myfail"
 			else
-				$1 -c -- "${srcdir}${x}" > ${x%.*} || die "$myfail"
+				local cwd_dest=${x##*/}
+				cwd_dest=${cwd_dest%.*}
+				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
+				case "$EAPI" in
+					0|1|2|3|4|4-python)
+						# If the source file is in a writable directory then
+						# create a symlink for backward-compatible emulation
+						# of tools like gunzip and bunzip2 (see bug #376741).
+						if [[ ! -e ${x%.*} && -w ${x%/*} ]] && \
+							[[ ${x} == "${PORTAGE_BUILDDIR}/"* ||
+							${x} == ./* || ${x} != /* ]] ; then
+							ln -snf "${PWD}/${cwd_dest}" "${x%.*}"
+						fi
+						;;
+				esac
 			fi
 		}
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-02 18:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-02 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     b33f68f8b3ade6531d45ad79c72acbd7f0cb9109
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  2 18:25:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug  2 18:25:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b33f68f8

unpack: remove backward compat for bug #376741

This case is extremely rare, since the most common practice is to
unpack source files that are already in the cwd. The only Gentoo
packages that needed to be fixed were games-arcade/tuxpuck and
www-plugins/google-talkplugin.

---
 bin/ebuild.sh |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 3d4d557..d68e54b 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -373,18 +373,6 @@ unpack() {
 				local cwd_dest=${x##*/}
 				cwd_dest=${cwd_dest%.*}
 				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
-				case "$EAPI" in
-					0|1|2|3|4|4-python)
-						# If the source file is in a writable directory then
-						# create a symlink for backward-compatible emulation
-						# of tools like gunzip and bunzip2 (see bug #376741).
-						if [[ ! -e ${x%.*} && -w ${x%/*} ]] && \
-							[[ ${x} == "${PORTAGE_BUILDDIR}/"* ||
-							${x} == ./* || ${x} != /* ]] ; then
-							ln -snf "${PWD}/${cwd_dest}" "${x%.*}"
-						fi
-						;;
-				esac
 			fi
 		}
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-04 21:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-04 21:26 UTC (permalink / raw
  To: gentoo-commits

commit:     03066476a2b3693467cd3ea00bf321c878a6c00f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 21:26:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 21:26:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=03066476

portageq best_visible: support optional pkgtype

---
 bin/portageq |   60 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 49 insertions(+), 11 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index f614517..fa3a0d0 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -45,6 +45,8 @@ from portage import os
 from portage.util import writemsg, writemsg_stdout
 portage.proxy.lazyimport.lazyimport(globals(),
 	'subprocess',
+	'_emerge.Package:Package',
+	'_emerge.RootConfig:RootConfig',
 	'portage.dbapi._expand_new_virt:expand_new_virt',
 )
 
@@ -422,22 +424,58 @@ def filter_protected(argv):
 filter_protected.uses_root = True
 
 def best_visible(argv):
-	"""<root> [<category/package>]+
+	"""<root> [pkgtype] <atom>
 	Returns category/package-version (without .ebuild).
+	The pkgtype argument defaults to "ebuild" if unspecified,
+	otherwise it must be one of ebuild, binary, or installed.
 	"""
 	if (len(argv) < 2):
-		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		writemsg("ERROR: insufficient parameters!\n", noiselevel=-1)
+		return 2
+
+	pkgtype = "ebuild"
+	if len(argv) > 2:
+		pkgtype = argv[1]
+		atom = argv[2]
+	else:
+		atom = argv[1]
+
+	type_map = {
+		"ebuild":"porttree",
+		"binary":"bintree",
+		"installed":"vartree"}
+
+	if pkgtype not in type_map:
+		writemsg("Unrecognized package type: '%s'\n" % pkgtype,
+			noiselevel=-1)
+		return 2
+
+	db = portage.db[portage.settings["ROOT"]][type_map[pkgtype]].dbapi
+
 	try:
-		mylist=portage.db[argv[0]]["porttree"].dbapi.match(argv[1])
-		visible=portage.best(mylist)
-		if visible:
-			print(visible)
-			sys.exit(0)
-		else:
-			sys.exit(1)
+		atom = portage.dep_expand(atom, mydb=db, settings=portage.settings)
+	except portage.exception.InvalidAtom:
+		writemsg("ERROR: Invalid atom: '%s'\n" % atom,
+			noiselevel=-1)
+		return 2
+
+	root_config = RootConfig(portage.settings,
+		portage.db[portage.settings["ROOT"]], None)
+
+	try:
+		# reversed, for descending order
+		for cpv in reversed(db.match(atom)):
+			metadata = dict(zip(Package.metadata_keys,
+				db.aux_get(cpv, Package.metadata_keys, myrepo=atom.repo)))
+			pkg = Package(built=(pkgtype != "ebuild"), cpv=cpv,
+				installed=(pkgtype=="installed"), metadata=metadata,
+				root_config=root_config, type_name=pkgtype)
+			if pkg.visible:
+				writemsg_stdout("%s\n" % (pkg.cpv,), noiselevel=-1)
+				return os.EX_OK
 	except KeyError:
-		sys.exit(1)
+		pass
+	return 1
 best_visible.uses_root = True
 
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-06  5:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-06  5:16 UTC (permalink / raw
  To: gentoo-commits

commit:     0db6b43feed351aaa47554f51bf46aa18a5009cc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  6 05:16:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 05:16:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0db6b43f

portageq: fix short help display for leading \n

---
 bin/portageq |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index fa3a0d0..57a7c39 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -731,7 +731,7 @@ def usage(argv):
 			print("")
 			continue
 
-		lines = doc.split("\n")
+		lines = doc.lstrip("\n").split("\n")
 		print("   " + name + " " + lines[0].strip())
 		if (len(sys.argv) > 1):
 			if (not help_mode):



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-12 11:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-12 11:23 UTC (permalink / raw
  To: gentoo-commits

commit:     c114ae3f89f41a05b3b695be7984b8300bd3c68b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 12 11:21:53 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 12 11:21:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c114ae3f

repoman: warn when --if-modified finds nothing

---
 bin/repoman |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index e806b31..91704ca 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1060,6 +1060,11 @@ except FileNotFound:
 	# disable for non-gentoo repoman users who may not have herds.
 	herd_base = None
 
+modified_pkgs = 0
+if options.if_modified == "y" and not vcs:
+	logging.info("Not in a version controlled repository; disabling --if-modified.")
+	options.if_modified = "n"
+
 for x in scanlist:
 	#ebuilds and digests added to cvs respectively.
 	logging.info("checking package %s" % x)
@@ -1073,12 +1078,13 @@ for x in scanlist:
 		checkdir_relative = os.path.join(catdir, checkdir_relative)
 	checkdir_relative = os.path.join(".", checkdir_relative)
 
-	if vcs and options.if_modified == "y":
+	if options.if_modified == "y":
 		checkdir_modified = False
 		checkdir_pattern = checkdir_relative.rstrip(os.sep) + os.sep
 		for f in chain(mychanged, mynew):
 			if f.startswith(checkdir_pattern):
 				checkdir_modified = True
+				modified_pkgs += 1
 				break
 		if not checkdir_modified:
 			continue
@@ -2000,6 +2006,9 @@ for x in scanlist:
 				"%s/metadata.xml: unused local USE-description: '%s'" % \
 				(x, myflag))
 
+if options.if_modified == "y" and modified_pkgs < 1:
+	logging.warn("--if-modified is enabled, but no modified packages were found!")
+
 if options.mode == "manifest":
 	sys.exit(dofail)
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-12 11:44 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-12 11:44 UTC (permalink / raw
  To: gentoo-commits

commit:     ebcf8975b37a8aae9735eb491a9b4cb63549bd5d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 12 11:43:40 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 12 11:43:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ebcf8975

repoman: tweak --if-modified help output

---
 bin/repoman |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 91704ca..10f603e 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -211,6 +211,7 @@ def ParseArgs(argv, qahelp):
 
 	parser.add_option(
 		'--if-modified', type='choice', choices=('y', 'n'), default='n',
+		metavar="<y|n>",
 		help='only check packages that have uncommitted modifications')
 
 	parser.add_option('-i', '--ignore-arches', dest='ignore_arches', action='store_true',



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-20 21:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-20 21:09 UTC (permalink / raw
  To: gentoo-commits

commit:     305acb6d016f36312344cc44a640fdbde8f4cd33
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 20 21:09:03 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 20 21:09:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=305acb6d

ebuild(1): show merge/noauto msg only if needed

---
 bin/ebuild |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index f8b6d79..db7e5e3 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -57,10 +57,6 @@ opts, pargs = parser.parse_args(args=sys.argv[1:])
 if len(pargs) < 2:
 	parser.error("missing required args")
 
-if "merge" in pargs:
-	print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
-	os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
-
 os.environ["PORTAGE_CALLER"]="ebuild"
 try:
 	import portage
@@ -257,6 +253,10 @@ if "test" in pargs:
 
 tmpsettings.features.discard("fail-clean")
 
+if "merge" in pargs and "noauto" in tmpsettings.features:
+	print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
+	tmpsettings.features.discard("noauto")
+
 try:
 	metadata = dict(zip(Package.metadata_keys,
 		portage.db[portage.settings["ROOT"]][mytree].dbapi.aux_get(



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-25 16:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-25 16:38 UTC (permalink / raw
  To: gentoo-commits

commit:     5970a41fc60fef89fd4b1bbe45a6c108452b267f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 25 16:37:11 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 25 16:37:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5970a41f

die: defer die hooks for EAPI 4 helpers_die

This will fix bug #380625.

---
 bin/isolated-functions.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 65bb1d5..1de1f7f 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -203,7 +203,12 @@ die() {
 		fi
 	fi
 
-	if [[ "${EBUILD_PHASE/depend}" == "${EBUILD_PHASE}" ]] ; then
+	# Only call die hooks here if we are executed via ebuild.sh or
+	# misc-functions.sh, since those are the only cases where the environment
+	# contains the hook functions. When necessary (like for helpers_die), die
+	# hooks are automatically called later by a misc-functions.sh invocation.
+	if has ${BASH_SOURCE[$main_index]##*/} ebuild.sh misc-functions.sh && \
+		[[ ${EBUILD_PHASE} != depend ]] ; then
 		local x
 		for x in $EBUILD_DEATH_HOOKS; do
 			${x} "$@" >&2 1>&2



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-25 23:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-25 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     0484dccadf2021fd288daccea881ee1d352b0f7d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 25 23:45:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 25 23:45:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0484dcca

python3.2 fixes: ResourceWarning: unclosed file

---
 bin/dispatch-conf |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 1e21a52..497927d 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -100,7 +100,9 @@ class dispatch:
                 path, basename = os.path.split(path)
                 find_opts = "-maxdepth 1"
 
-            confs += self.massage(os.popen(FIND_EXTANT_CONFIGS % (path, find_opts, basename)).readlines())
+            with os.popen(FIND_EXTANT_CONFIGS %
+                (path, find_opts, basename)) as proc:
+                confs += self.massage(proc.readlines())
 
         if self.options['use-rcs'] == 'yes':
             for rcs_util in ("rcs", "ci", "co", "rcsmerge"):



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-27 19:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-27 19:01 UTC (permalink / raw
  To: gentoo-commits

commit:     63035acd702ab0cdaac31e33676b5a20a91eae47
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 27 19:01:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 27 19:01:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=63035acd

egencache: implement XMLParser.doctype()

This is prevents "DeprecationWarning: This method of XMLParser is
deprecated.  Define doctype() method on the TreeBuilder target."
warnings. The code is copied from repoman, commit
5a5e51a2737a0855bb562683f50c57cc31587460.

---
 bin/egencache |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 6d8df35..a87394c 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -368,6 +368,14 @@ class GenCache(object):
 					"committing target: %s\n" % (ce,),
 					level=logging.ERROR, noiselevel=-1)
 
+class _MetadataTreeBuilder(ElementTree.TreeBuilder):
+	"""
+	Implements doctype() as required to avoid deprecation warnings with
+	>=python-2.7.
+	"""
+	def doctype(self, name, pubid, system):
+		pass
+
 class GenUseLocalDesc(object):
 	def __init__(self, portdb, output=None,
 			preserve_comments=False):
@@ -475,7 +483,9 @@ class GenUseLocalDesc(object):
 		for cp in self._portdb.cp_all():
 			metadata_path = os.path.join(repo_path, cp, 'metadata.xml')
 			try:
-				metadata = ElementTree.parse(metadata_path)
+				metadata = ElementTree.parse(metadata_path,
+					parser=ElementTree.XMLParser(
+					target=_MetadataTreeBuilder()))
 			except IOError:
 				pass
 			except (ExpatError, EnvironmentError) as e:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-08-27 19:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-08-27 19:04 UTC (permalink / raw
  To: gentoo-commits

commit:     676bfd9efb7ea50256d4caa1273e7c40e8f28511
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 27 19:04:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 27 19:04:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=676bfd9e

egencache: don't require xml in global scope

---
 bin/egencache |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index a87394c..53ae565 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -368,14 +368,6 @@ class GenCache(object):
 					"committing target: %s\n" % (ce,),
 					level=logging.ERROR, noiselevel=-1)
 
-class _MetadataTreeBuilder(ElementTree.TreeBuilder):
-	"""
-	Implements doctype() as required to avoid deprecation warnings with
-	>=python-2.7.
-	"""
-	def doctype(self, name, pubid, system):
-		pass
-
 class GenUseLocalDesc(object):
 	def __init__(self, portdb, output=None,
 			preserve_comments=False):
@@ -480,6 +472,14 @@ class GenUseLocalDesc(object):
 					return 1
 			return (a > b) - (a < b)
 
+		class _MetadataTreeBuilder(ElementTree.TreeBuilder):
+			"""
+			Implements doctype() as required to avoid deprecation warnings
+			since Python >=2.7
+			"""
+			def doctype(self, name, pubid, system):
+				pass
+
 		for cp in self._portdb.cp_all():
 			metadata_path = os.path.join(repo_path, cp, 'metadata.xml')
 			try:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-04  0:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-04  0:23 UTC (permalink / raw
  To: gentoo-commits

commit:     59991c66613e7a05e363e32d48bf6ac3918b31a6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  4 00:22:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  4 00:22:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=59991c66

Fix repoman dependency.unknown to use xmatch.

This solves the issues discussed in bug #381087, comment #8.

---
 bin/repoman |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 6ec84e5..6aaeef3 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1663,7 +1663,7 @@ for x in scanlist:
 				# packages that have empty KEYWORDS.
 				arches.append(['**', '**', ['**']])
 
-		unknown_pkgs = {}
+		unknown_pkgs = set()
 		baddepsyntax = False
 		badlicsyntax = False
 		badprovsyntax = False
@@ -1700,10 +1700,9 @@ for x in scanlist:
 					if atom == "||":
 						continue
 
-					if not portdb.cp_list(atom.cp) and \
+					if not portdb.xmatch("match-all", atom) and \
 						not atom.cp.startswith("virtual/"):
-						unknown_pkgs.setdefault(atom.cp, set()).add(
-							(mytype, atom.unevaluated_atom))
+						unknown_pkgs.add((mytype, atom.unevaluated_atom))
 
 					is_blocker = atom.blocker
 
@@ -1948,12 +1947,16 @@ for x in scanlist:
 
 						if success:
 							if atoms:
+
+								# Don't bother with dependency.unknown for
+								# cases in which *DEPEND.bad is triggered.
 								for atom in atoms:
+									# dep_check returns all blockers and they
+									# aren't counted for *DEPEND.bad, so we
+									# ignore them here.
 									if not atom.blocker:
-										# Don't bother with dependency.unknown
-										# for cases in which *DEPEND.bad is
-										# triggered.
-										unknown_pkgs.pop(atom.cp, None)
+										unknown_pkgs.discard(
+											(mytype, atom.unevaluated_atom))
 
 								if not prof.sub_path:
 									# old-style virtuals currently aren't
@@ -1984,10 +1987,8 @@ for x in scanlist:
 								prof, repr(atoms)))
 
 		if not baddepsyntax and unknown_pkgs:
-			all_unknown = set()
-			all_unknown.update(*unknown_pkgs.values())
 			type_map = {}
-			for mytype, atom in all_unknown:
+			for mytype, atom in unknown_pkgs:
 				type_map.setdefault(mytype, set()).add(atom)
 			for mytype, atoms in type_map.items():
 				stats["dependency.unknown"] += 1



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-07 16:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-07 16:30 UTC (permalink / raw
  To: gentoo-commits

commit:     d3aebd49c1a6b893b078f5593677f295a8e77903
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  7 16:29:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep  7 16:29:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3aebd49

egencache: validate cache dir more

---
 bin/egencache |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index bf29474..66854e1 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -163,9 +163,13 @@ def parse_args(args):
 		parser.error("Not a directory: --config-root='%s'" % \
 			(options.config_root,))
 
-	if options.cache_dir is not None and not os.path.isdir(options.cache_dir):
-		parser.error("Not a directory: --cache-dir='%s'" % \
-			(options.cache_dir,))
+	if options.cache_dir is not None:
+		if not os.path.isdir(options.cache_dir):
+			parser.error("Not a directory: --cache-dir='%s'" % \
+				(options.cache_dir,))
+		if not os.access(options.cache_dir, os.W_OK):
+			parser.error("Write access denied: --cache-dir='%s'" % \
+				(options.cache_dir,))
 
 	if options.portdir_overlay is not None and \
 		options.repo is None:
@@ -817,6 +821,18 @@ def egencache_main(args):
 			level=logging.WARNING, noiselevel=-1)
 		settings.features.add('metadata-transfer')
 
+	if options.update:
+		if options.cache_dir is not None:
+			# already validated earlier
+			pass
+		else:
+			if os.path.isdir(settings["PORTAGE_DEPCACHEDIR"]) and \
+				not os.access(settings["PORTAGE_DEPCACHEDIR"], os.W_OK):
+				writemsg_level("ecachegen: error: " + \
+					"write access denied: %s\n" % (settings["PORTAGE_DEPCACHEDIR"],),
+					level=logging.ERROR, noiselevel=-1)
+				return 1
+
 	settings.lock()
 
 	portdb = portage.portdbapi(mysettings=settings)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-07 18:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-07 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     4b8614d99da3e4d5ce46c70c944cce5d5d1d9a1f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  7 18:01:14 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep  7 18:01:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b8614d9

egencache: tweak cache dir write access check

---
 bin/egencache |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 6229ed6..7766e78 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -818,21 +818,25 @@ def egencache_main(args):
 	if options.update and 'metadata-transfer' not in settings.features:
 		settings.features.add('metadata-transfer')
 
+	settings.lock()
+
+	portdb = portage.portdbapi(mysettings=settings)
+
 	if options.update:
 		if options.cache_dir is not None:
 			# already validated earlier
 			pass
 		else:
-			if os.path.isdir(settings["PORTAGE_DEPCACHEDIR"]) and \
-				not os.access(settings["PORTAGE_DEPCACHEDIR"], os.W_OK):
+			# We check write access after the portdbapi constructor
+			# has had an opportunity to create it. This ensures that
+			# we don't use the cache in the "volatile" mode which is
+			# undesirable for egencache.
+			if not os.access(settings["PORTAGE_DEPCACHEDIR"], os.W_OK):
 				writemsg_level("ecachegen: error: " + \
 					"write access denied: %s\n" % (settings["PORTAGE_DEPCACHEDIR"],),
 					level=logging.ERROR, noiselevel=-1)
 				return 1
 
-	settings.lock()
-
-	portdb = portage.portdbapi(mysettings=settings)
 	if options.repo is not None:
 		repo_path = portdb.getRepositoryPath(options.repo)
 		if repo_path is None:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-10 19:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-10 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     5234db7c94a342347069f4a49202afa4e371b60c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 19:42:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 19:42:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5234db7c

repoman: fix a typo in the file.executable desc

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 6aaeef3..b40d2d1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -292,7 +292,7 @@ qahelp={
 	"ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety",
 	"changelog.notadded":"ChangeLogs that exist but have not been added to cvs",
 	"dependency.unknown" : "Ebuild has a dependency that refers to an unknown package (which may be valid if it is a blocker for a renamed/removed package, or is an alternative choice provided by an overlay)",
-	"file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do note need the executable bit",
+	"file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the executable bit",
 	"file.size":"Files in the files directory must be under 20 KiB",
 	"file.size.fatal":"Files in the files directory must be under 60 KiB",
 	"file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars,



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11  0:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11  0:25 UTC (permalink / raw
  To: gentoo-commits

commit:     2992864b6d33d014f7c011b9ae67fe00164ded47
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 00:24:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 00:24:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2992864b

ebuild.sh: split out phase-functions.sh

This relocates dyn_* and related functions that are needed for
execution of regular phases, but not for the "depend" phase. It
reduces the size of ebuild.sh by 23%, so there's less code to be
sourced during the "depend" phase.

---
 bin/ebuild.sh          |  610 +-----------------------------------------------
 bin/phase-functions.sh |  611 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 613 insertions(+), 608 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 23a1240..8df5eef 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -688,108 +688,6 @@ _eapi4_src_install() {
 	fi
 }
 
-ebuild_phase() {
-	declare -F "$1" >/dev/null && qa_call $1
-}
-
-ebuild_phase_with_hooks() {
-	local x phase_name=${1}
-	for x in {pre_,,post_}${phase_name} ; do
-		ebuild_phase ${x}
-	done
-}
-
-dyn_pretend() {
-	if [[ -e $PORTAGE_BUILDDIR/.pretended ]] ; then
-		vecho ">>> It appears that '$PF' is already pretended; skipping."
-		vecho ">>> Remove '$PORTAGE_BUILDDIR/.pretended' to force pretend."
-		return 0
-	fi
-	ebuild_phase pre_pkg_pretend
-	ebuild_phase pkg_pretend
-	>> "$PORTAGE_BUILDDIR/.pretended" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.pretended"
-	ebuild_phase post_pkg_pretend
-}
-
-dyn_setup() {
-	if [[ -e $PORTAGE_BUILDDIR/.setuped ]] ; then
-		vecho ">>> It appears that '$PF' is already setup; skipping."
-		vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped' to force setup."
-		return 0
-	fi
-	ebuild_phase pre_pkg_setup
-	ebuild_phase pkg_setup
-	>> "$PORTAGE_BUILDDIR/.setuped" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.setuped"
-	ebuild_phase post_pkg_setup
-}
-
-dyn_unpack() {
-	if [[ -f ${PORTAGE_BUILDDIR}/.unpacked ]] ; then
-		vecho ">>> WORKDIR is up-to-date, keeping..."
-		return 0
-	fi
-	if [ ! -d "${WORKDIR}" ]; then
-		install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
-	fi
-	cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
-	ebuild_phase pre_src_unpack
-	vecho ">>> Unpacking source..."
-	ebuild_phase src_unpack
-	>> "$PORTAGE_BUILDDIR/.unpacked" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.unpacked"
-	vecho ">>> Source unpacked in ${WORKDIR}"
-	ebuild_phase post_src_unpack
-}
-
-dyn_clean() {
-	if [ -z "${PORTAGE_BUILDDIR}" ]; then
-		echo "Aborting clean phase because PORTAGE_BUILDDIR is unset!"
-		return 1
-	elif [ ! -d "${PORTAGE_BUILDDIR}" ] ; then
-		return 0
-	fi
-	if has chflags $FEATURES ; then
-		chflags -R noschg,nouchg,nosappnd,nouappnd "${PORTAGE_BUILDDIR}"
-		chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
-	fi
-
-	rm -rf "${PORTAGE_BUILDDIR}/image" "${PORTAGE_BUILDDIR}/homedir"
-	rm -f "${PORTAGE_BUILDDIR}/.installed"
-
-	if [[ $EMERGE_FROM = binary ]] || \
-		! has keeptemp $FEATURES && ! has keepwork $FEATURES ; then
-		rm -rf "${T}"
-	fi
-
-	if [[ $EMERGE_FROM = binary ]] || ! has keepwork $FEATURES; then
-		rm -f "$PORTAGE_BUILDDIR"/.{ebuild_changed,logid,pretended,setuped,unpacked,prepared} \
-			"$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \
-			"$PORTAGE_BUILDDIR"/.die_hooks \
-			"$PORTAGE_BUILDDIR"/.ipc_{in,out,lock} \
-			"$PORTAGE_BUILDDIR"/.exit_status
-
-		rm -rf "${PORTAGE_BUILDDIR}/build-info"
-		rm -rf "${WORKDIR}"
-	fi
-
-	if [ -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then
-		find "${PORTAGE_BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null
-	fi
-
-	# do not bind this to doebuild defined DISTDIR; don't trust doebuild, and if mistakes are made it'll
-	# result in it wiping the users distfiles directory (bad).
-	rm -rf "${PORTAGE_BUILDDIR}/distdir"
-
-	# Some kernels, such as Solaris, return EINVAL when an attempt
-	# is made to remove the current working directory.
-	cd "$PORTAGE_BUILDDIR"/../..
-	rmdir "$PORTAGE_BUILDDIR" 2>/dev/null
-
-	true
-}
-
 into() {
 	if [ "$1" == "/" ]; then
 		export DESTTREE=""
@@ -905,359 +803,6 @@ docompress() {
 	fi
 }
 
-abort_handler() {
-	local msg
-	if [ "$2" != "fail" ]; then
-		msg="${EBUILD}: ${1} aborted; exiting."
-	else
-		msg="${EBUILD}: ${1} failed; exiting."
-	fi
-	echo
-	echo "$msg"
-	echo
-	eval ${3}
-	#unset signal handler
-	trap - SIGINT SIGQUIT
-}
-
-abort_prepare() {
-	abort_handler src_prepare $1
-	rm -f "$PORTAGE_BUILDDIR/.prepared"
-	exit 1
-}
-
-abort_configure() {
-	abort_handler src_configure $1
-	rm -f "$PORTAGE_BUILDDIR/.configured"
-	exit 1
-}
-
-abort_compile() {
-	abort_handler "src_compile" $1
-	rm -f "${PORTAGE_BUILDDIR}/.compiled"
-	exit 1
-}
-
-abort_test() {
-	abort_handler "dyn_test" $1
-	rm -f "${PORTAGE_BUILDDIR}/.tested"
-	exit 1
-}
-
-abort_install() {
-	abort_handler "src_install" $1
-	rm -rf "${PORTAGE_BUILDDIR}/image"
-	exit 1
-}
-
-has_phase_defined_up_to() {
-	local phase
-	for phase in unpack prepare configure compile install; do
-		has ${phase} ${DEFINED_PHASES} && return 0
-		[[ ${phase} == $1 ]] && return 1
-	done
-	# We shouldn't actually get here
-	return 1
-}
-
-dyn_prepare() {
-
-	if [[ -e $PORTAGE_BUILDDIR/.prepared ]] ; then
-		vecho ">>> It appears that '$PF' is already prepared; skipping."
-		vecho ">>> Remove '$PORTAGE_BUILDDIR/.prepared' to force prepare."
-		return 0
-	fi
-
-	if [[ -d $S ]] ; then
-		cd "${S}"
-	elif has $EAPI 0 1 2 3 3_pre2 ; then
-		cd "${WORKDIR}"
-	elif [[ -z ${A} ]] && ! has_phase_defined_up_to prepare; then
-		cd "${WORKDIR}"
-	else
-		die "The source directory '${S}' doesn't exist"
-	fi
-
-	trap abort_prepare SIGINT SIGQUIT
-
-	ebuild_phase pre_src_prepare
-	vecho ">>> Preparing source in $PWD ..."
-	ebuild_phase src_prepare
-	>> "$PORTAGE_BUILDDIR/.prepared" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.prepared"
-	vecho ">>> Source prepared."
-	ebuild_phase post_src_prepare
-
-	trap - SIGINT SIGQUIT
-}
-
-dyn_configure() {
-
-	if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
-		vecho ">>> It appears that '$PF' is already configured; skipping."
-		vecho ">>> Remove '$PORTAGE_BUILDDIR/.configured' to force configuration."
-		return 0
-	fi
-
-	if [[ -d $S ]] ; then
-		cd "${S}"
-	elif has $EAPI 0 1 2 3 3_pre2 ; then
-		cd "${WORKDIR}"
-	elif [[ -z ${A} ]] && ! has_phase_defined_up_to configure; then
-		cd "${WORKDIR}"
-	else
-		die "The source directory '${S}' doesn't exist"
-	fi
-
-	trap abort_configure SIGINT SIGQUIT
-
-	ebuild_phase pre_src_configure
-
-	vecho ">>> Configuring source in $PWD ..."
-	ebuild_phase src_configure
-	>> "$PORTAGE_BUILDDIR/.configured" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.configured"
-	vecho ">>> Source configured."
-
-	ebuild_phase post_src_configure
-
-	trap - SIGINT SIGQUIT
-}
-
-dyn_compile() {
-
-	if [[ -e $PORTAGE_BUILDDIR/.compiled ]] ; then
-		vecho ">>> It appears that '${PF}' is already compiled; skipping."
-		vecho ">>> Remove '$PORTAGE_BUILDDIR/.compiled' to force compilation."
-		return 0
-	fi
-
-	if [[ -d $S ]] ; then
-		cd "${S}"
-	elif has $EAPI 0 1 2 3 3_pre2 ; then
-		cd "${WORKDIR}"
-	elif [[ -z ${A} ]] && ! has_phase_defined_up_to compile; then
-		cd "${WORKDIR}"
-	else
-		die "The source directory '${S}' doesn't exist"
-	fi
-
-	trap abort_compile SIGINT SIGQUIT
-
-	if has distcc $FEATURES && has distcc-pump $FEATURES ; then
-		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
-			eval $(pump --startup)
-			trap "pump --shutdown" EXIT
-		fi
-	fi
-
-	ebuild_phase pre_src_compile
-
-	vecho ">>> Compiling source in $PWD ..."
-	ebuild_phase src_compile
-	>> "$PORTAGE_BUILDDIR/.compiled" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.compiled"
-	vecho ">>> Source compiled."
-
-	ebuild_phase post_src_compile
-
-	trap - SIGINT SIGQUIT
-}
-
-dyn_test() {
-
-	if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
-		vecho ">>> It appears that ${PN} has already been tested; skipping."
-		vecho ">>> Remove '${PORTAGE_BUILDDIR}/.tested' to force test."
-		return
-	fi
-
-	if [ "${EBUILD_FORCE_TEST}" == "1" ] ; then
-		# If USE came from ${T}/environment then it might not have USE=test
-		# like it's supposed to here.
-		! has test ${USE} && export USE="${USE} test"
-	fi
-
-	trap "abort_test" SIGINT SIGQUIT
-	if [ -d "${S}" ]; then
-		cd "${S}"
-	else
-		cd "${WORKDIR}"
-	fi
-
-	if ! has test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
-		vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
-	elif has test $RESTRICT; then
-		einfo "Skipping make test/check due to ebuild restriction."
-		vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
-	else
-		local save_sp=${SANDBOX_PREDICT}
-		addpredict /
-		ebuild_phase pre_src_test
-		ebuild_phase src_test
-		>> "$PORTAGE_BUILDDIR/.tested" || \
-			die "Failed to create $PORTAGE_BUILDDIR/.tested"
-		ebuild_phase post_src_test
-		SANDBOX_PREDICT=${save_sp}
-	fi
-
-	trap - SIGINT SIGQUIT
-}
-
-dyn_install() {
-	[ -z "$PORTAGE_BUILDDIR" ] && die "${FUNCNAME}: PORTAGE_BUILDDIR is unset"
-	if has noauto $FEATURES ; then
-		rm -f "${PORTAGE_BUILDDIR}/.installed"
-	elif [[ -e $PORTAGE_BUILDDIR/.installed ]] ; then
-		vecho ">>> It appears that '${PF}' is already installed; skipping."
-		vecho ">>> Remove '${PORTAGE_BUILDDIR}/.installed' to force install."
-		return 0
-	fi
-	trap "abort_install" SIGINT SIGQUIT
-	ebuild_phase pre_src_install
-	rm -rf "${PORTAGE_BUILDDIR}/image"
-	mkdir "${PORTAGE_BUILDDIR}/image"
-	if [[ -d $S ]] ; then
-		cd "${S}"
-	elif has $EAPI 0 1 2 3 3_pre2 ; then
-		cd "${WORKDIR}"
-	elif [[ -z ${A} ]] && ! has_phase_defined_up_to install; then
-		cd "${WORKDIR}"
-	else
-		die "The source directory '${S}' doesn't exist"
-	fi
-
-	vecho
-	vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
-	#our custom version of libtool uses $S and $D to fix
-	#invalid paths in .la files
-	export S D
-
-	# Reset exeinto(), docinto(), insinto(), and into() state variables
-	# in case the user is running the install phase multiple times
-	# consecutively via the ebuild command.
-	export DESTTREE=/usr
-	export INSDESTTREE=""
-	export _E_EXEDESTTREE_=""
-	export _E_DOCDESTTREE_=""
-
-	ebuild_phase src_install
-	>> "$PORTAGE_BUILDDIR/.installed" || \
-		die "Failed to create $PORTAGE_BUILDDIR/.installed"
-	vecho ">>> Completed installing ${PF} into ${D}"
-	vecho
-	ebuild_phase post_src_install
-
-	cd "${PORTAGE_BUILDDIR}"/build-info
-	set -f
-	local f x
-	IFS=$' \t\n\r'
-	for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE REQUIRED_USE \
-		PF PKGUSE SLOT KEYWORDS HOMEPAGE DESCRIPTION ; do
-		x=$(echo -n ${!f})
-		[[ -n $x ]] && echo "$x" > $f
-	done
-	if [[ $CATEGORY != virtual ]] ; then
-		for f in ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX \
-			CXXFLAGS EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \
-			LDFLAGS LIBCFLAGS LIBCXXFLAGS ; do
-			x=$(echo -n ${!f})
-			[[ -n $x ]] && echo "$x" > $f
-		done
-	fi
-	echo "${USE}"       > USE
-	echo "${EAPI:-0}"   > EAPI
-	set +f
-
-	# local variables can leak into the saved environment.
-	unset f
-
-	save_ebuild_env --exclude-init-phases | filter_readonly_variables \
-		--filter-path --filter-sandbox --allow-extra-vars > environment
-	assert "save_ebuild_env failed"
-
-	${PORTAGE_BZIP2_COMMAND} -f9 environment
-
-	cp "${EBUILD}" "${PF}.ebuild"
-	[ -n "${PORTAGE_REPO_NAME}" ]  && echo "${PORTAGE_REPO_NAME}" > repository
-	if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT}
-	then
-		>> DEBUGBUILD
-	fi
-	trap - SIGINT SIGQUIT
-}
-
-dyn_preinst() {
-	if [ -z "${D}" ]; then
-		eerror "${FUNCNAME}: D is unset"
-		return 1
-	fi
-	ebuild_phase_with_hooks pkg_preinst
-}
-
-dyn_help() {
-	echo
-	echo "Portage"
-	echo "Copyright 1999-2010 Gentoo Foundation"
-	echo
-	echo "How to use the ebuild command:"
-	echo
-	echo "The first argument to ebuild should be an existing .ebuild file."
-	echo
-	echo "One or more of the following options can then be specified.  If more"
-	echo "than one option is specified, each will be executed in order."
-	echo
-	echo "  help        : show this help screen"
-	echo "  pretend     : execute package specific pretend actions"
-	echo "  setup       : execute package specific setup actions"
-	echo "  fetch       : download source archive(s) and patches"
-	echo "  digest      : create a manifest file for the package"
-	echo "  manifest    : create a manifest file for the package"
-	echo "  unpack      : unpack sources (auto-dependencies if needed)"
-	echo "  prepare     : prepare sources (auto-dependencies if needed)"
-	echo "  configure   : configure sources (auto-fetch/unpack if needed)"
-	echo "  compile     : compile sources (auto-fetch/unpack/configure if needed)"
-	echo "  test        : test package (auto-fetch/unpack/configure/compile if needed)"
-	echo "  preinst     : execute pre-install instructions"
-	echo "  postinst    : execute post-install instructions"
-	echo "  install     : install the package to the temporary install directory"
-	echo "  qmerge      : merge image into live filesystem, recording files in db"
-	echo "  merge       : do fetch, unpack, compile, install and qmerge"
-	echo "  prerm       : execute pre-removal instructions"
-	echo "  postrm      : execute post-removal instructions"
-	echo "  unmerge     : remove package from live filesystem"
-	echo "  config      : execute package specific configuration actions"
-	echo "  package     : create a tarball package in ${PKGDIR}/All"
-	echo "  rpm         : build a RedHat RPM package"
-	echo "  clean       : clean up all source and temporary files"
-	echo
-	echo "The following settings will be used for the ebuild process:"
-	echo
-	echo "  package     : ${PF}"
-	echo "  slot        : ${SLOT}"
-	echo "  category    : ${CATEGORY}"
-	echo "  description : ${DESCRIPTION}"
-	echo "  system      : ${CHOST}"
-	echo "  c flags     : ${CFLAGS}"
-	echo "  c++ flags   : ${CXXFLAGS}"
-	echo "  make flags  : ${MAKEOPTS}"
-	echo -n "  build mode  : "
-	if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT} ;
-	then
-		echo "debug (large)"
-	else
-		echo "production (stripped)"
-	fi
-	echo "  merge to    : ${ROOT}"
-	echo
-	if [ -n "$USE" ]; then
-		echo "Additionally, support for the following optional features will be enabled:"
-		echo
-		echo "  ${USE}"
-	fi
-	echo
-}
-
 # debug-print() gets called from many places with verbose status information useful
 # for tracking down problems. The output is in $T/eclass-debug.log.
 # You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.
@@ -1466,159 +1011,6 @@ remove_path_entry() {
 	PATH="${stripped_path}"
 }
 
-# @FUNCTION: _ebuild_arg_to_phase
-# @DESCRIPTION:
-# Translate a known ebuild(1) argument into the precise
-# name of it's corresponding ebuild phase.
-_ebuild_arg_to_phase() {
-	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
-	local eapi=$1
-	local arg=$2
-	local phase_func=""
-
-	case "$arg" in
-		pretend)
-			! has $eapi 0 1 2 3 3_pre2 && \
-				phase_func=pkg_pretend
-			;;
-		setup)
-			phase_func=pkg_setup
-			;;
-		nofetch)
-			phase_func=pkg_nofetch
-			;;
-		unpack)
-			phase_func=src_unpack
-			;;
-		prepare)
-			! has $eapi 0 1 && \
-				phase_func=src_prepare
-			;;
-		configure)
-			! has $eapi 0 1 && \
-				phase_func=src_configure
-			;;
-		compile)
-			phase_func=src_compile
-			;;
-		test)
-			phase_func=src_test
-			;;
-		install)
-			phase_func=src_install
-			;;
-		preinst)
-			phase_func=pkg_preinst
-			;;
-		postinst)
-			phase_func=pkg_postinst
-			;;
-		prerm)
-			phase_func=pkg_prerm
-			;;
-		postrm)
-			phase_func=pkg_postrm
-			;;
-	esac
-
-	[[ -z $phase_func ]] && return 1
-	echo "$phase_func"
-	return 0
-}
-
-_ebuild_phase_funcs() {
-	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
-	local eapi=$1
-	local phase_func=$2
-	local default_phases="pkg_nofetch src_unpack src_prepare src_configure
-		src_compile src_install src_test"
-	local x y default_func=""
-
-	for x in pkg_nofetch src_unpack src_test ; do
-		declare -F $x >/dev/null || \
-			eval "$x() { _eapi0_$x \"\$@\" ; }"
-	done
-
-	case $eapi in
-
-		0|1)
-
-			if ! declare -F src_compile >/dev/null ; then
-				case $eapi in
-					0)
-						src_compile() { _eapi0_src_compile "$@" ; }
-						;;
-					*)
-						src_compile() { _eapi1_src_compile "$@" ; }
-						;;
-				esac
-			fi
-
-			for x in $default_phases ; do
-				eval "default_$x() {
-					die \"default_$x() is not supported with EAPI='$eapi' during phase $phase_func\"
-				}"
-			done
-
-			eval "default() {
-				die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
-			}"
-
-			;;
-
-		*)
-
-			declare -F src_configure >/dev/null || \
-				src_configure() { _eapi2_src_configure "$@" ; }
-
-			declare -F src_compile >/dev/null || \
-				src_compile() { _eapi2_src_compile "$@" ; }
-
-			has $eapi 2 3 3_pre2 || declare -F src_install >/dev/null || \
-				src_install() { _eapi4_src_install "$@" ; }
-
-			if has $phase_func $default_phases ; then
-
-				_eapi2_pkg_nofetch   () { _eapi0_pkg_nofetch          "$@" ; }
-				_eapi2_src_unpack    () { _eapi0_src_unpack           "$@" ; }
-				_eapi2_src_prepare   () { true                             ; }
-				_eapi2_src_test      () { _eapi0_src_test             "$@" ; }
-				_eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
-
-				for x in $default_phases ; do
-					eval "default_$x() { _eapi2_$x \"\$@\" ; }"
-				done
-
-				eval "default() { _eapi2_$phase_func \"\$@\" ; }"
-
-				case $eapi in
-					2|3)
-						;;
-					*)
-						eval "default_src_install() { _eapi4_src_install \"\$@\" ; }"
-						[[ $phase_func = src_install ]] && \
-							eval "default() { _eapi4_$phase_func \"\$@\" ; }"
-						;;
-				esac
-
-			else
-
-				for x in $default_phases ; do
-					eval "default_$x() {
-						die \"default_$x() is not supported in phase $default_func\"
-					}"
-				done
-
-				eval "default() {
-					die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
-				}"
-
-			fi
-
-			;;
-	esac
-}
-
 # Set given variables unless these variable have been already set (e.g. during emerge
 # invocation) to values different than values set in make.conf.
 set_unless_changed() {
@@ -1957,6 +1349,8 @@ fi
 export EBUILD_MASTER_PID=$BASHPID
 trap 'exit 1' SIGTERM
 
+[[ $EBUILD_PHASE == depend ]] || source "${PORTAGE_BIN_PATH}/phase-functions.sh"
+
 if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	[ -f "${T}"/environment ] ; then
 	# The environment may have been extracted from environment.bz2 or

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
new file mode 100644
index 0000000..5216877
--- /dev/null
+++ b/bin/phase-functions.sh
@@ -0,0 +1,611 @@
+#!/bin/bash
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+ebuild_phase() {
+	declare -F "$1" >/dev/null && qa_call $1
+}
+
+ebuild_phase_with_hooks() {
+	local x phase_name=${1}
+	for x in {pre_,,post_}${phase_name} ; do
+		ebuild_phase ${x}
+	done
+}
+
+dyn_pretend() {
+	if [[ -e $PORTAGE_BUILDDIR/.pretended ]] ; then
+		vecho ">>> It appears that '$PF' is already pretended; skipping."
+		vecho ">>> Remove '$PORTAGE_BUILDDIR/.pretended' to force pretend."
+		return 0
+	fi
+	ebuild_phase pre_pkg_pretend
+	ebuild_phase pkg_pretend
+	>> "$PORTAGE_BUILDDIR/.pretended" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.pretended"
+	ebuild_phase post_pkg_pretend
+}
+
+dyn_setup() {
+	if [[ -e $PORTAGE_BUILDDIR/.setuped ]] ; then
+		vecho ">>> It appears that '$PF' is already setup; skipping."
+		vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped' to force setup."
+		return 0
+	fi
+	ebuild_phase pre_pkg_setup
+	ebuild_phase pkg_setup
+	>> "$PORTAGE_BUILDDIR/.setuped" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.setuped"
+	ebuild_phase post_pkg_setup
+}
+
+dyn_unpack() {
+	if [[ -f ${PORTAGE_BUILDDIR}/.unpacked ]] ; then
+		vecho ">>> WORKDIR is up-to-date, keeping..."
+		return 0
+	fi
+	if [ ! -d "${WORKDIR}" ]; then
+		install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
+	fi
+	cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
+	ebuild_phase pre_src_unpack
+	vecho ">>> Unpacking source..."
+	ebuild_phase src_unpack
+	>> "$PORTAGE_BUILDDIR/.unpacked" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.unpacked"
+	vecho ">>> Source unpacked in ${WORKDIR}"
+	ebuild_phase post_src_unpack
+}
+
+dyn_clean() {
+	if [ -z "${PORTAGE_BUILDDIR}" ]; then
+		echo "Aborting clean phase because PORTAGE_BUILDDIR is unset!"
+		return 1
+	elif [ ! -d "${PORTAGE_BUILDDIR}" ] ; then
+		return 0
+	fi
+	if has chflags $FEATURES ; then
+		chflags -R noschg,nouchg,nosappnd,nouappnd "${PORTAGE_BUILDDIR}"
+		chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
+	fi
+
+	rm -rf "${PORTAGE_BUILDDIR}/image" "${PORTAGE_BUILDDIR}/homedir"
+	rm -f "${PORTAGE_BUILDDIR}/.installed"
+
+	if [[ $EMERGE_FROM = binary ]] || \
+		! has keeptemp $FEATURES && ! has keepwork $FEATURES ; then
+		rm -rf "${T}"
+	fi
+
+	if [[ $EMERGE_FROM = binary ]] || ! has keepwork $FEATURES; then
+		rm -f "$PORTAGE_BUILDDIR"/.{ebuild_changed,logid,pretended,setuped,unpacked,prepared} \
+			"$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \
+			"$PORTAGE_BUILDDIR"/.die_hooks \
+			"$PORTAGE_BUILDDIR"/.ipc_{in,out,lock} \
+			"$PORTAGE_BUILDDIR"/.exit_status
+
+		rm -rf "${PORTAGE_BUILDDIR}/build-info"
+		rm -rf "${WORKDIR}"
+	fi
+
+	if [ -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then
+		find "${PORTAGE_BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null
+	fi
+
+	# do not bind this to doebuild defined DISTDIR; don't trust doebuild, and if mistakes are made it'll
+	# result in it wiping the users distfiles directory (bad).
+	rm -rf "${PORTAGE_BUILDDIR}/distdir"
+
+	# Some kernels, such as Solaris, return EINVAL when an attempt
+	# is made to remove the current working directory.
+	cd "$PORTAGE_BUILDDIR"/../..
+	rmdir "$PORTAGE_BUILDDIR" 2>/dev/null
+
+	true
+}
+
+abort_handler() {
+	local msg
+	if [ "$2" != "fail" ]; then
+		msg="${EBUILD}: ${1} aborted; exiting."
+	else
+		msg="${EBUILD}: ${1} failed; exiting."
+	fi
+	echo
+	echo "$msg"
+	echo
+	eval ${3}
+	#unset signal handler
+	trap - SIGINT SIGQUIT
+}
+
+abort_prepare() {
+	abort_handler src_prepare $1
+	rm -f "$PORTAGE_BUILDDIR/.prepared"
+	exit 1
+}
+
+abort_configure() {
+	abort_handler src_configure $1
+	rm -f "$PORTAGE_BUILDDIR/.configured"
+	exit 1
+}
+
+abort_compile() {
+	abort_handler "src_compile" $1
+	rm -f "${PORTAGE_BUILDDIR}/.compiled"
+	exit 1
+}
+
+abort_test() {
+	abort_handler "dyn_test" $1
+	rm -f "${PORTAGE_BUILDDIR}/.tested"
+	exit 1
+}
+
+abort_install() {
+	abort_handler "src_install" $1
+	rm -rf "${PORTAGE_BUILDDIR}/image"
+	exit 1
+}
+
+has_phase_defined_up_to() {
+	local phase
+	for phase in unpack prepare configure compile install; do
+		has ${phase} ${DEFINED_PHASES} && return 0
+		[[ ${phase} == $1 ]] && return 1
+	done
+	# We shouldn't actually get here
+	return 1
+}
+
+dyn_prepare() {
+
+	if [[ -e $PORTAGE_BUILDDIR/.prepared ]] ; then
+		vecho ">>> It appears that '$PF' is already prepared; skipping."
+		vecho ">>> Remove '$PORTAGE_BUILDDIR/.prepared' to force prepare."
+		return 0
+	fi
+
+	if [[ -d $S ]] ; then
+		cd "${S}"
+	elif has $EAPI 0 1 2 3 3_pre2 ; then
+		cd "${WORKDIR}"
+	elif [[ -z ${A} ]] && ! has_phase_defined_up_to prepare; then
+		cd "${WORKDIR}"
+	else
+		die "The source directory '${S}' doesn't exist"
+	fi
+
+	trap abort_prepare SIGINT SIGQUIT
+
+	ebuild_phase pre_src_prepare
+	vecho ">>> Preparing source in $PWD ..."
+	ebuild_phase src_prepare
+	>> "$PORTAGE_BUILDDIR/.prepared" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.prepared"
+	vecho ">>> Source prepared."
+	ebuild_phase post_src_prepare
+
+	trap - SIGINT SIGQUIT
+}
+
+dyn_configure() {
+
+	if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
+		vecho ">>> It appears that '$PF' is already configured; skipping."
+		vecho ">>> Remove '$PORTAGE_BUILDDIR/.configured' to force configuration."
+		return 0
+	fi
+
+	if [[ -d $S ]] ; then
+		cd "${S}"
+	elif has $EAPI 0 1 2 3 3_pre2 ; then
+		cd "${WORKDIR}"
+	elif [[ -z ${A} ]] && ! has_phase_defined_up_to configure; then
+		cd "${WORKDIR}"
+	else
+		die "The source directory '${S}' doesn't exist"
+	fi
+
+	trap abort_configure SIGINT SIGQUIT
+
+	ebuild_phase pre_src_configure
+
+	vecho ">>> Configuring source in $PWD ..."
+	ebuild_phase src_configure
+	>> "$PORTAGE_BUILDDIR/.configured" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.configured"
+	vecho ">>> Source configured."
+
+	ebuild_phase post_src_configure
+
+	trap - SIGINT SIGQUIT
+}
+
+dyn_compile() {
+
+	if [[ -e $PORTAGE_BUILDDIR/.compiled ]] ; then
+		vecho ">>> It appears that '${PF}' is already compiled; skipping."
+		vecho ">>> Remove '$PORTAGE_BUILDDIR/.compiled' to force compilation."
+		return 0
+	fi
+
+	if [[ -d $S ]] ; then
+		cd "${S}"
+	elif has $EAPI 0 1 2 3 3_pre2 ; then
+		cd "${WORKDIR}"
+	elif [[ -z ${A} ]] && ! has_phase_defined_up_to compile; then
+		cd "${WORKDIR}"
+	else
+		die "The source directory '${S}' doesn't exist"
+	fi
+
+	trap abort_compile SIGINT SIGQUIT
+
+	if has distcc $FEATURES && has distcc-pump $FEATURES ; then
+		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
+			eval $(pump --startup)
+			trap "pump --shutdown" EXIT
+		fi
+	fi
+
+	ebuild_phase pre_src_compile
+
+	vecho ">>> Compiling source in $PWD ..."
+	ebuild_phase src_compile
+	>> "$PORTAGE_BUILDDIR/.compiled" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.compiled"
+	vecho ">>> Source compiled."
+
+	ebuild_phase post_src_compile
+
+	trap - SIGINT SIGQUIT
+}
+
+dyn_test() {
+
+	if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
+		vecho ">>> It appears that ${PN} has already been tested; skipping."
+		vecho ">>> Remove '${PORTAGE_BUILDDIR}/.tested' to force test."
+		return
+	fi
+
+	if [ "${EBUILD_FORCE_TEST}" == "1" ] ; then
+		# If USE came from ${T}/environment then it might not have USE=test
+		# like it's supposed to here.
+		! has test ${USE} && export USE="${USE} test"
+	fi
+
+	trap "abort_test" SIGINT SIGQUIT
+	if [ -d "${S}" ]; then
+		cd "${S}"
+	else
+		cd "${WORKDIR}"
+	fi
+
+	if ! has test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
+		vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
+	elif has test $RESTRICT; then
+		einfo "Skipping make test/check due to ebuild restriction."
+		vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
+	else
+		local save_sp=${SANDBOX_PREDICT}
+		addpredict /
+		ebuild_phase pre_src_test
+		ebuild_phase src_test
+		>> "$PORTAGE_BUILDDIR/.tested" || \
+			die "Failed to create $PORTAGE_BUILDDIR/.tested"
+		ebuild_phase post_src_test
+		SANDBOX_PREDICT=${save_sp}
+	fi
+
+	trap - SIGINT SIGQUIT
+}
+
+dyn_install() {
+	[ -z "$PORTAGE_BUILDDIR" ] && die "${FUNCNAME}: PORTAGE_BUILDDIR is unset"
+	if has noauto $FEATURES ; then
+		rm -f "${PORTAGE_BUILDDIR}/.installed"
+	elif [[ -e $PORTAGE_BUILDDIR/.installed ]] ; then
+		vecho ">>> It appears that '${PF}' is already installed; skipping."
+		vecho ">>> Remove '${PORTAGE_BUILDDIR}/.installed' to force install."
+		return 0
+	fi
+	trap "abort_install" SIGINT SIGQUIT
+	ebuild_phase pre_src_install
+	rm -rf "${PORTAGE_BUILDDIR}/image"
+	mkdir "${PORTAGE_BUILDDIR}/image"
+	if [[ -d $S ]] ; then
+		cd "${S}"
+	elif has $EAPI 0 1 2 3 3_pre2 ; then
+		cd "${WORKDIR}"
+	elif [[ -z ${A} ]] && ! has_phase_defined_up_to install; then
+		cd "${WORKDIR}"
+	else
+		die "The source directory '${S}' doesn't exist"
+	fi
+
+	vecho
+	vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
+	#our custom version of libtool uses $S and $D to fix
+	#invalid paths in .la files
+	export S D
+
+	# Reset exeinto(), docinto(), insinto(), and into() state variables
+	# in case the user is running the install phase multiple times
+	# consecutively via the ebuild command.
+	export DESTTREE=/usr
+	export INSDESTTREE=""
+	export _E_EXEDESTTREE_=""
+	export _E_DOCDESTTREE_=""
+
+	ebuild_phase src_install
+	>> "$PORTAGE_BUILDDIR/.installed" || \
+		die "Failed to create $PORTAGE_BUILDDIR/.installed"
+	vecho ">>> Completed installing ${PF} into ${D}"
+	vecho
+	ebuild_phase post_src_install
+
+	cd "${PORTAGE_BUILDDIR}"/build-info
+	set -f
+	local f x
+	IFS=$' \t\n\r'
+	for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE REQUIRED_USE \
+		PF PKGUSE SLOT KEYWORDS HOMEPAGE DESCRIPTION ; do
+		x=$(echo -n ${!f})
+		[[ -n $x ]] && echo "$x" > $f
+	done
+	if [[ $CATEGORY != virtual ]] ; then
+		for f in ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX \
+			CXXFLAGS EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \
+			LDFLAGS LIBCFLAGS LIBCXXFLAGS ; do
+			x=$(echo -n ${!f})
+			[[ -n $x ]] && echo "$x" > $f
+		done
+	fi
+	echo "${USE}"       > USE
+	echo "${EAPI:-0}"   > EAPI
+	set +f
+
+	# local variables can leak into the saved environment.
+	unset f
+
+	save_ebuild_env --exclude-init-phases | filter_readonly_variables \
+		--filter-path --filter-sandbox --allow-extra-vars > environment
+	assert "save_ebuild_env failed"
+
+	${PORTAGE_BZIP2_COMMAND} -f9 environment
+
+	cp "${EBUILD}" "${PF}.ebuild"
+	[ -n "${PORTAGE_REPO_NAME}" ]  && echo "${PORTAGE_REPO_NAME}" > repository
+	if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT}
+	then
+		>> DEBUGBUILD
+	fi
+	trap - SIGINT SIGQUIT
+}
+
+dyn_preinst() {
+	if [ -z "${D}" ]; then
+		eerror "${FUNCNAME}: D is unset"
+		return 1
+	fi
+	ebuild_phase_with_hooks pkg_preinst
+}
+
+dyn_help() {
+	echo
+	echo "Portage"
+	echo "Copyright 1999-2010 Gentoo Foundation"
+	echo
+	echo "How to use the ebuild command:"
+	echo
+	echo "The first argument to ebuild should be an existing .ebuild file."
+	echo
+	echo "One or more of the following options can then be specified.  If more"
+	echo "than one option is specified, each will be executed in order."
+	echo
+	echo "  help        : show this help screen"
+	echo "  pretend     : execute package specific pretend actions"
+	echo "  setup       : execute package specific setup actions"
+	echo "  fetch       : download source archive(s) and patches"
+	echo "  digest      : create a manifest file for the package"
+	echo "  manifest    : create a manifest file for the package"
+	echo "  unpack      : unpack sources (auto-dependencies if needed)"
+	echo "  prepare     : prepare sources (auto-dependencies if needed)"
+	echo "  configure   : configure sources (auto-fetch/unpack if needed)"
+	echo "  compile     : compile sources (auto-fetch/unpack/configure if needed)"
+	echo "  test        : test package (auto-fetch/unpack/configure/compile if needed)"
+	echo "  preinst     : execute pre-install instructions"
+	echo "  postinst    : execute post-install instructions"
+	echo "  install     : install the package to the temporary install directory"
+	echo "  qmerge      : merge image into live filesystem, recording files in db"
+	echo "  merge       : do fetch, unpack, compile, install and qmerge"
+	echo "  prerm       : execute pre-removal instructions"
+	echo "  postrm      : execute post-removal instructions"
+	echo "  unmerge     : remove package from live filesystem"
+	echo "  config      : execute package specific configuration actions"
+	echo "  package     : create a tarball package in ${PKGDIR}/All"
+	echo "  rpm         : build a RedHat RPM package"
+	echo "  clean       : clean up all source and temporary files"
+	echo
+	echo "The following settings will be used for the ebuild process:"
+	echo
+	echo "  package     : ${PF}"
+	echo "  slot        : ${SLOT}"
+	echo "  category    : ${CATEGORY}"
+	echo "  description : ${DESCRIPTION}"
+	echo "  system      : ${CHOST}"
+	echo "  c flags     : ${CFLAGS}"
+	echo "  c++ flags   : ${CXXFLAGS}"
+	echo "  make flags  : ${MAKEOPTS}"
+	echo -n "  build mode  : "
+	if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT} ;
+	then
+		echo "debug (large)"
+	else
+		echo "production (stripped)"
+	fi
+	echo "  merge to    : ${ROOT}"
+	echo
+	if [ -n "$USE" ]; then
+		echo "Additionally, support for the following optional features will be enabled:"
+		echo
+		echo "  ${USE}"
+	fi
+	echo
+}
+
+# @FUNCTION: _ebuild_arg_to_phase
+# @DESCRIPTION:
+# Translate a known ebuild(1) argument into the precise
+# name of it's corresponding ebuild phase.
+_ebuild_arg_to_phase() {
+	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
+	local eapi=$1
+	local arg=$2
+	local phase_func=""
+
+	case "$arg" in
+		pretend)
+			! has $eapi 0 1 2 3 3_pre2 && \
+				phase_func=pkg_pretend
+			;;
+		setup)
+			phase_func=pkg_setup
+			;;
+		nofetch)
+			phase_func=pkg_nofetch
+			;;
+		unpack)
+			phase_func=src_unpack
+			;;
+		prepare)
+			! has $eapi 0 1 && \
+				phase_func=src_prepare
+			;;
+		configure)
+			! has $eapi 0 1 && \
+				phase_func=src_configure
+			;;
+		compile)
+			phase_func=src_compile
+			;;
+		test)
+			phase_func=src_test
+			;;
+		install)
+			phase_func=src_install
+			;;
+		preinst)
+			phase_func=pkg_preinst
+			;;
+		postinst)
+			phase_func=pkg_postinst
+			;;
+		prerm)
+			phase_func=pkg_prerm
+			;;
+		postrm)
+			phase_func=pkg_postrm
+			;;
+	esac
+
+	[[ -z $phase_func ]] && return 1
+	echo "$phase_func"
+	return 0
+}
+
+_ebuild_phase_funcs() {
+	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
+	local eapi=$1
+	local phase_func=$2
+	local default_phases="pkg_nofetch src_unpack src_prepare src_configure
+		src_compile src_install src_test"
+	local x y default_func=""
+
+	for x in pkg_nofetch src_unpack src_test ; do
+		declare -F $x >/dev/null || \
+			eval "$x() { _eapi0_$x \"\$@\" ; }"
+	done
+
+	case $eapi in
+
+		0|1)
+
+			if ! declare -F src_compile >/dev/null ; then
+				case $eapi in
+					0)
+						src_compile() { _eapi0_src_compile "$@" ; }
+						;;
+					*)
+						src_compile() { _eapi1_src_compile "$@" ; }
+						;;
+				esac
+			fi
+
+			for x in $default_phases ; do
+				eval "default_$x() {
+					die \"default_$x() is not supported with EAPI='$eapi' during phase $phase_func\"
+				}"
+			done
+
+			eval "default() {
+				die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
+			}"
+
+			;;
+
+		*)
+
+			declare -F src_configure >/dev/null || \
+				src_configure() { _eapi2_src_configure "$@" ; }
+
+			declare -F src_compile >/dev/null || \
+				src_compile() { _eapi2_src_compile "$@" ; }
+
+			has $eapi 2 3 3_pre2 || declare -F src_install >/dev/null || \
+				src_install() { _eapi4_src_install "$@" ; }
+
+			if has $phase_func $default_phases ; then
+
+				_eapi2_pkg_nofetch   () { _eapi0_pkg_nofetch          "$@" ; }
+				_eapi2_src_unpack    () { _eapi0_src_unpack           "$@" ; }
+				_eapi2_src_prepare   () { true                             ; }
+				_eapi2_src_test      () { _eapi0_src_test             "$@" ; }
+				_eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
+
+				for x in $default_phases ; do
+					eval "default_$x() { _eapi2_$x \"\$@\" ; }"
+				done
+
+				eval "default() { _eapi2_$phase_func \"\$@\" ; }"
+
+				case $eapi in
+					2|3)
+						;;
+					*)
+						eval "default_src_install() { _eapi4_src_install \"\$@\" ; }"
+						[[ $phase_func = src_install ]] && \
+							eval "default() { _eapi4_$phase_func \"\$@\" ; }"
+						;;
+				esac
+
+			else
+
+				for x in $default_phases ; do
+					eval "default_$x() {
+						die \"default_$x() is not supported in phase $default_func\"
+					}"
+				done
+
+				eval "default() {
+					die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
+				}"
+
+			fi
+
+			;;
+	esac
+}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11  0:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11  0:47 UTC (permalink / raw
  To: gentoo-commits

commit:     88438656a7b3b5824369043792ce27e63eb76f46
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 00:47:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 00:47:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88438656

ebuild.sh: split out phase-helpers.sh

This relocates phase helper functions that are needed for execution of
regular phases, but not for the "depend" phase. It reduces the size of
ebuild.sh by 25%, so there's less code to be sourced during the
"depend" phase.

---
 bin/ebuild.sh        |  524 +-------------------------------------------------
 bin/phase-helpers.sh |  524 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 528 insertions(+), 520 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 8df5eef..a5cc5ef 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -238,50 +238,6 @@ best_version() {
 	esac
 }
 
-use_with() {
-	if [ -z "$1" ]; then
-		echo "!!! use_with() called without a parameter." >&2
-		echo "!!! use_with <USEFLAG> [<flagname> [value]]" >&2
-		return 1
-	fi
-
-	if ! has "${EAPI:-0}" 0 1 2 3 ; then
-		local UW_SUFFIX=${3+=$3}
-	else
-		local UW_SUFFIX=${3:+=$3}
-	fi
-	local UWORD=${2:-$1}
-
-	if use $1; then
-		echo "--with-${UWORD}${UW_SUFFIX}"
-	else
-		echo "--without-${UWORD}"
-	fi
-	return 0
-}
-
-use_enable() {
-	if [ -z "$1" ]; then
-		echo "!!! use_enable() called without a parameter." >&2
-		echo "!!! use_enable <USEFLAG> [<flagname> [value]]" >&2
-		return 1
-	fi
-
-	if ! has "${EAPI:-0}" 0 1 2 3 ; then
-		local UE_SUFFIX=${3+=$3}
-	else
-		local UE_SUFFIX=${3:+=$3}
-	fi
-	local UWORD=${2:-$1}
-
-	if use $1; then
-		echo "--enable-${UWORD}${UE_SUFFIX}"
-	else
-		echo "--disable-${UWORD}"
-	fi
-	return 0
-}
-
 register_die_hook() {
 	local x
 	for x in $* ; do
@@ -309,161 +265,6 @@ fi
 #if no perms are specified, dirs/files will have decent defaults
 #(not secretive, but not stupid)
 umask 022
-export DESTTREE=/usr
-export INSDESTTREE=""
-export _E_EXEDESTTREE_=""
-export _E_DOCDESTTREE_=""
-export INSOPTIONS="-m0644"
-export EXEOPTIONS="-m0755"
-export LIBOPTIONS="-m0644"
-export DIROPTIONS="-m0755"
-export MOPREFIX=${PN}
-declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
-declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
-
-# adds ".keep" files so that dirs aren't auto-cleaned
-keepdir() {
-	dodir "$@"
-	local x
-	if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
-		shift
-		find "$@" -type d -printf "${D}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
-			| tr "\n" "\0" | \
-			while read -r -d $'\0' ; do
-				>> "$REPLY" || \
-					die "Failed to recursively create .keep files"
-			done
-	else
-		for x in "$@"; do
-			>> "${D}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
-				die "Failed to create .keep in ${D}${x}"
-		done
-	fi
-}
-
-unpack() {
-	local srcdir
-	local x
-	local y
-	local myfail
-	local eapi=${EAPI:-0}
-	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
-
-	for x in "$@"; do
-		vecho ">>> Unpacking ${x} to ${PWD}"
-		y=${x%.*}
-		y=${y##*.}
-
-		if [[ ${x} == "./"* ]] ; then
-			srcdir=""
-		elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
-			die "Arguments to unpack() cannot begin with \${DISTDIR}."
-		elif [[ ${x} == "/"* ]] ; then
-			die "Arguments to unpack() cannot be absolute"
-		else
-			srcdir="${DISTDIR}/"
-		fi
-		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
-
-		_unpack_tar() {
-			if [ "${y}" == "tar" ]; then
-				$1 -c -- "$srcdir$x" | tar xof -
-				assert_sigpipe_ok "$myfail"
-			else
-				local cwd_dest=${x##*/}
-				cwd_dest=${cwd_dest%.*}
-				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
-			fi
-		}
-
-		myfail="failure unpacking ${x}"
-		case "${x##*.}" in
-			tar)
-				tar xof "$srcdir$x" || die "$myfail"
-				;;
-			tgz)
-				tar xozf "$srcdir$x" || die "$myfail"
-				;;
-			tbz|tbz2)
-				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
-				assert_sigpipe_ok "$myfail"
-				;;
-			ZIP|zip|jar)
-				# unzip will interactively prompt under some error conditions,
-				# as reported in bug #336285
-				( while true ; do echo n || break ; done ) | \
-				unzip -qo "${srcdir}${x}" || die "$myfail"
-				;;
-			gz|Z|z)
-				_unpack_tar "gzip -d"
-				;;
-			bz2|bz)
-				_unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
-				;;
-			7Z|7z)
-				local my_output
-				my_output="$(7z x -y "${srcdir}${x}")"
-				if [ $? -ne 0 ]; then
-					echo "${my_output}" >&2
-					die "$myfail"
-				fi
-				;;
-			RAR|rar)
-				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
-				;;
-			LHa|LHA|lha|lzh)
-				lha xfq "${srcdir}${x}" || die "$myfail"
-				;;
-			a)
-				ar x "${srcdir}${x}" || die "$myfail"
-				;;
-			deb)
-				# Unpacking .deb archives can not always be done with
-				# `ar`.  For instance on AIX this doesn't work out.  If
-				# we have `deb2targz` installed, prefer it over `ar` for
-				# that reason.  We just make sure on AIX `deb2targz` is
-				# installed.
-				if type -P deb2targz > /dev/null; then
-					y=${x##*/}
-					local created_symlink=0
-					if [ ! "$srcdir$x" -ef "$y" ] ; then
-						# deb2targz always extracts into the same directory as
-						# the source file, so create a symlink in the current
-						# working directory if necessary.
-						ln -sf "$srcdir$x" "$y" || die "$myfail"
-						created_symlink=1
-					fi
-					deb2targz "$y" || die "$myfail"
-					if [ $created_symlink = 1 ] ; then
-						# Clean up the symlink so the ebuild
-						# doesn't inadvertently install it.
-						rm -f "$y"
-					fi
-					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
-				else
-					ar x "$srcdir$x" || die "$myfail"
-				fi
-				;;
-			lzma)
-				_unpack_tar "lzma -d"
-				;;
-			xz)
-				if has $eapi 0 1 2 ; then
-					vecho "unpack ${x}: file format not recognized. Ignoring."
-				else
-					_unpack_tar "xz -d"
-				fi
-				;;
-			*)
-				vecho "unpack ${x}: file format not recognized. Ignoring."
-				;;
-		esac
-	done
-	# Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
-	# should be preserved.
-	find . -mindepth 1 -maxdepth 1 ! -type l -print0 | \
-		${XARGS} -0 chmod -fR a+rX,u+w,g-w,o-w
-}
 
 strip_duplicate_slashes() {
 	if [[ -n $1 ]] ; then
@@ -482,326 +283,6 @@ hasg() {
     return 1
 }
 hasgq() { hasg "$@" >/dev/null ; }
-econf() {
-	local x
-
-	local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
-	if [[ -n $phase_func ]] ; then
-		if has "$EAPI" 0 1 ; then
-			[[ $phase_func != src_compile ]] && \
-				eqawarn "QA Notice: econf called in" \
-					"$phase_func instead of src_compile"
-		else
-			[[ $phase_func != src_configure ]] && \
-				eqawarn "QA Notice: econf called in" \
-					"$phase_func instead of src_configure"
-		fi
-	fi
-
-	: ${ECONF_SOURCE:=.}
-	if [ -x "${ECONF_SOURCE}/configure" ]; then
-		if [[ -n $CONFIG_SHELL && \
-			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
-			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
-				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
-		fi
-		if [ -e /usr/share/gnuconfig/ ]; then
-			find "${WORKDIR}" -type f '(' \
-			-name config.guess -o -name config.sub ')' -print0 | \
-			while read -r -d $'\0' x ; do
-				vecho " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}"
-				cp -f /usr/share/gnuconfig/"${x##*/}" "${x}"
-			done
-		fi
-
-		# EAPI=4 adds --disable-dependency-tracking to econf
-		if ! has "$EAPI" 0 1 2 3 3_pre2 && \
-			"${ECONF_SOURCE}/configure" --help 2>/dev/null | \
-			grep -q disable-dependency-tracking ; then
-			set -- --disable-dependency-tracking "$@"
-		fi
-
-		# if the profile defines a location to install libs to aside from default, pass it on.
-		# if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
-		local CONF_LIBDIR LIBDIR_VAR="LIBDIR_${ABI}"
-		if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
-			CONF_LIBDIR=${!LIBDIR_VAR}
-		fi
-		if [[ -n ${CONF_LIBDIR} ]] && ! hasgq --libdir=\* "$@" ; then
-			export CONF_PREFIX=$(hasg --exec-prefix=\* "$@")
-			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(hasg --prefix=\* "$@")
-			: ${CONF_PREFIX:=/usr}
-			CONF_PREFIX=${CONF_PREFIX#*=}
-			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
-			[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
-			set -- --libdir="$(strip_duplicate_slashes ${CONF_PREFIX}${CONF_LIBDIR})" "$@"
-		fi
-
-		set -- \
-			--prefix=/usr \
-			${CBUILD:+--build=${CBUILD}} \
-			--host=${CHOST} \
-			${CTARGET:+--target=${CTARGET}} \
-			--mandir=/usr/share/man \
-			--infodir=/usr/share/info \
-			--datadir=/usr/share \
-			--sysconfdir=/etc \
-			--localstatedir=/var/lib \
-			"$@" \
-			${EXTRA_ECONF}
-		vecho "${ECONF_SOURCE}/configure" "$@"
-
-		if ! "${ECONF_SOURCE}/configure" "$@" ; then
-
-			if [ -s config.log ]; then
-				echo
-				echo "!!! Please attach the following file when seeking support:"
-				echo "!!! ${PWD}/config.log"
-			fi
-			die "econf failed"
-		fi
-	elif [ -f "${ECONF_SOURCE}/configure" ]; then
-		die "configure is not executable"
-	else
-		die "no configure script found"
-	fi
-}
-
-einstall() {
-	# CONF_PREFIX is only set if they didn't pass in libdir above.
-	local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
-	LIBDIR_VAR="LIBDIR_${ABI}"
-	if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
-		CONF_LIBDIR="${!LIBDIR_VAR}"
-	fi
-	unset LIBDIR_VAR
-	if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
-		EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
-		EI_DESTLIBDIR="$(strip_duplicate_slashes ${EI_DESTLIBDIR})"
-		LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
-		unset EI_DESTLIBDIR
-	fi
-
-	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
-		if [ "${PORTAGE_DEBUG}" == "1" ]; then
-			${MAKE:-make} -n prefix="${D}usr" \
-				datadir="${D}usr/share" \
-				infodir="${D}usr/share/info" \
-				localstatedir="${D}var/lib" \
-				mandir="${D}usr/share/man" \
-				sysconfdir="${D}etc" \
-				${LOCAL_EXTRA_EINSTALL} \
-				${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
-				"$@" install
-		fi
-		${MAKE:-make} prefix="${D}usr" \
-			datadir="${D}usr/share" \
-			infodir="${D}usr/share/info" \
-			localstatedir="${D}var/lib" \
-			mandir="${D}usr/share/man" \
-			sysconfdir="${D}etc" \
-			${LOCAL_EXTRA_EINSTALL} \
-			${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
-			"$@" install || die "einstall failed"
-	else
-		die "no Makefile found"
-	fi
-}
-
-_eapi0_pkg_nofetch() {
-	[ -z "${SRC_URI}" ] && return
-
-	elog "The following are listed in SRC_URI for ${PN}:"
-	local x
-	for x in $(echo ${SRC_URI}); do
-		elog "   ${x}"
-	done
-}
-
-_eapi0_src_unpack() {
-	[[ -n ${A} ]] && unpack ${A}
-}
-
-_eapi0_src_compile() {
-	if [ -x ./configure ] ; then
-		econf
-	fi
-	_eapi2_src_compile
-}
-
-_eapi0_src_test() {
-	# Since we don't want emake's automatic die
-	# support (EAPI 4 and later), and we also don't
-	# want the warning messages that it produces if
-	# we call it in 'nonfatal' mode, we use emake_cmd
-	# to emulate the desired parts of emake behavior.
-	local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
-	if $emake_cmd -j1 check -n &> /dev/null; then
-		vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
-		if ! $emake_cmd -j1 check; then
-			has test $FEATURES && die "Make check failed. See above for details."
-			has test $FEATURES || eerror "Make check failed. See above for details."
-		fi
-	elif $emake_cmd -j1 test -n &> /dev/null; then
-		vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
-		if ! $emake_cmd -j1 test; then
-			has test $FEATURES && die "Make test failed. See above for details."
-			has test $FEATURES || eerror "Make test failed. See above for details."
-		fi
-	else
-		vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
-	fi
-}
-
-_eapi1_src_compile() {
-	_eapi2_src_configure
-	_eapi2_src_compile
-}
-
-_eapi2_src_configure() {
-	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
-		econf
-	fi
-}
-
-_eapi2_src_compile() {
-	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
-		emake || die "emake failed"
-	fi
-}
-
-_eapi4_src_install() {
-	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
-		emake DESTDIR="${D}" install
-	fi
-
-	if ! declare -p DOCS &>/dev/null ; then
-		local d
-		for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
-				THANKS BUGS FAQ CREDITS CHANGELOG ; do
-			[[ -s "${d}" ]] && dodoc "${d}"
-		done
-	elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
-		dodoc "${DOCS[@]}"
-	else
-		dodoc ${DOCS}
-	fi
-}
-
-into() {
-	if [ "$1" == "/" ]; then
-		export DESTTREE=""
-	else
-		export DESTTREE=$1
-		if [ ! -d "${D}${DESTTREE}" ]; then
-			install -d "${D}${DESTTREE}"
-			local ret=$?
-			if [[ $ret -ne 0 ]] ; then
-				helpers_die "${FUNCNAME[0]} failed"
-				return $ret
-			fi
-		fi
-	fi
-}
-
-insinto() {
-	if [ "$1" == "/" ]; then
-		export INSDESTTREE=""
-	else
-		export INSDESTTREE=$1
-		if [ ! -d "${D}${INSDESTTREE}" ]; then
-			install -d "${D}${INSDESTTREE}"
-			local ret=$?
-			if [[ $ret -ne 0 ]] ; then
-				helpers_die "${FUNCNAME[0]} failed"
-				return $ret
-			fi
-		fi
-	fi
-}
-
-exeinto() {
-	if [ "$1" == "/" ]; then
-		export _E_EXEDESTTREE_=""
-	else
-		export _E_EXEDESTTREE_="$1"
-		if [ ! -d "${D}${_E_EXEDESTTREE_}" ]; then
-			install -d "${D}${_E_EXEDESTTREE_}"
-			local ret=$?
-			if [[ $ret -ne 0 ]] ; then
-				helpers_die "${FUNCNAME[0]} failed"
-				return $ret
-			fi
-		fi
-	fi
-}
-
-docinto() {
-	if [ "$1" == "/" ]; then
-		export _E_DOCDESTTREE_=""
-	else
-		export _E_DOCDESTTREE_="$1"
-		if [ ! -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
-			install -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
-			local ret=$?
-			if [[ $ret -ne 0 ]] ; then
-				helpers_die "${FUNCNAME[0]} failed"
-				return $ret
-			fi
-		fi
-	fi
-}
-
-insopts() {
-	export INSOPTIONS="$@"
-
-	# `install` should never be called with '-s' ...
-	has -s ${INSOPTIONS} && die "Never call insopts() with -s"
-}
-
-diropts() {
-	export DIROPTIONS="$@"
-}
-
-exeopts() {
-	export EXEOPTIONS="$@"
-
-	# `install` should never be called with '-s' ...
-	has -s ${EXEOPTIONS} && die "Never call exeopts() with -s"
-}
-
-libopts() {
-	export LIBOPTIONS="$@"
-
-	# `install` should never be called with '-s' ...
-	has -s ${LIBOPTIONS} && die "Never call libopts() with -s"
-}
-
-docompress() {
-	has "${EAPI}" 0 1 2 3 && die "'docompress' not supported in this EAPI"
-
-	local f g
-	if [[ $1 = "-x" ]]; then
-		shift
-		for f; do
-			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
-			[[ ${f:0:1} = / ]] || f="/${f}"
-			for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
-				[[ ${f} = "${g}" ]] && continue 2
-			done
-			PORTAGE_DOCOMPRESS_SKIP[${#PORTAGE_DOCOMPRESS_SKIP[@]}]=${f}
-		done
-	else
-		for f; do
-			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
-			[[ ${f:0:1} = / ]] || f="/${f}"
-			for g in "${PORTAGE_DOCOMPRESS[@]}"; do
-				[[ ${f} = "${g}" ]] && continue 2
-			done
-			PORTAGE_DOCOMPRESS[${#PORTAGE_DOCOMPRESS[@]}]=${f}
-		done
-	fi
-}
 
 # debug-print() gets called from many places with verbose status information useful
 # for tracking down problems. The output is in $T/eclass-debug.log.
@@ -1349,7 +830,10 @@ fi
 export EBUILD_MASTER_PID=$BASHPID
 trap 'exit 1' SIGTERM
 
-[[ $EBUILD_PHASE == depend ]] || source "${PORTAGE_BIN_PATH}/phase-functions.sh"
+if [[ $EBUILD_PHASE != depend ]] ; then
+	source "${PORTAGE_BIN_PATH}/phase-functions.sh"
+	source "${PORTAGE_BIN_PATH}/phase-helpers.sh"
+fi
 
 if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	[ -f "${T}"/environment ] ; then

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
new file mode 100644
index 0000000..337639f
--- /dev/null
+++ b/bin/phase-helpers.sh
@@ -0,0 +1,524 @@
+#!/bin/bash
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+export DESTTREE=/usr
+export INSDESTTREE=""
+export _E_EXEDESTTREE_=""
+export _E_DOCDESTTREE_=""
+export INSOPTIONS="-m0644"
+export EXEOPTIONS="-m0755"
+export LIBOPTIONS="-m0644"
+export DIROPTIONS="-m0755"
+export MOPREFIX=${PN}
+declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
+declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
+
+into() {
+	if [ "$1" == "/" ]; then
+		export DESTTREE=""
+	else
+		export DESTTREE=$1
+		if [ ! -d "${D}${DESTTREE}" ]; then
+			install -d "${D}${DESTTREE}"
+			local ret=$?
+			if [[ $ret -ne 0 ]] ; then
+				helpers_die "${FUNCNAME[0]} failed"
+				return $ret
+			fi
+		fi
+	fi
+}
+
+insinto() {
+	if [ "$1" == "/" ]; then
+		export INSDESTTREE=""
+	else
+		export INSDESTTREE=$1
+		if [ ! -d "${D}${INSDESTTREE}" ]; then
+			install -d "${D}${INSDESTTREE}"
+			local ret=$?
+			if [[ $ret -ne 0 ]] ; then
+				helpers_die "${FUNCNAME[0]} failed"
+				return $ret
+			fi
+		fi
+	fi
+}
+
+exeinto() {
+	if [ "$1" == "/" ]; then
+		export _E_EXEDESTTREE_=""
+	else
+		export _E_EXEDESTTREE_="$1"
+		if [ ! -d "${D}${_E_EXEDESTTREE_}" ]; then
+			install -d "${D}${_E_EXEDESTTREE_}"
+			local ret=$?
+			if [[ $ret -ne 0 ]] ; then
+				helpers_die "${FUNCNAME[0]} failed"
+				return $ret
+			fi
+		fi
+	fi
+}
+
+docinto() {
+	if [ "$1" == "/" ]; then
+		export _E_DOCDESTTREE_=""
+	else
+		export _E_DOCDESTTREE_="$1"
+		if [ ! -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
+			install -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+			local ret=$?
+			if [[ $ret -ne 0 ]] ; then
+				helpers_die "${FUNCNAME[0]} failed"
+				return $ret
+			fi
+		fi
+	fi
+}
+
+insopts() {
+	export INSOPTIONS="$@"
+
+	# `install` should never be called with '-s' ...
+	has -s ${INSOPTIONS} && die "Never call insopts() with -s"
+}
+
+diropts() {
+	export DIROPTIONS="$@"
+}
+
+exeopts() {
+	export EXEOPTIONS="$@"
+
+	# `install` should never be called with '-s' ...
+	has -s ${EXEOPTIONS} && die "Never call exeopts() with -s"
+}
+
+libopts() {
+	export LIBOPTIONS="$@"
+
+	# `install` should never be called with '-s' ...
+	has -s ${LIBOPTIONS} && die "Never call libopts() with -s"
+}
+
+docompress() {
+	has "${EAPI}" 0 1 2 3 && die "'docompress' not supported in this EAPI"
+
+	local f g
+	if [[ $1 = "-x" ]]; then
+		shift
+		for f; do
+			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
+			[[ ${f:0:1} = / ]] || f="/${f}"
+			for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
+				[[ ${f} = "${g}" ]] && continue 2
+			done
+			PORTAGE_DOCOMPRESS_SKIP[${#PORTAGE_DOCOMPRESS_SKIP[@]}]=${f}
+		done
+	else
+		for f; do
+			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
+			[[ ${f:0:1} = / ]] || f="/${f}"
+			for g in "${PORTAGE_DOCOMPRESS[@]}"; do
+				[[ ${f} = "${g}" ]] && continue 2
+			done
+			PORTAGE_DOCOMPRESS[${#PORTAGE_DOCOMPRESS[@]}]=${f}
+		done
+	fi
+}
+
+# adds ".keep" files so that dirs aren't auto-cleaned
+keepdir() {
+	dodir "$@"
+	local x
+	if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
+		shift
+		find "$@" -type d -printf "${D}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
+			| tr "\n" "\0" | \
+			while read -r -d $'\0' ; do
+				>> "$REPLY" || \
+					die "Failed to recursively create .keep files"
+			done
+	else
+		for x in "$@"; do
+			>> "${D}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
+				die "Failed to create .keep in ${D}${x}"
+		done
+	fi
+}
+
+use_with() {
+	if [ -z "$1" ]; then
+		echo "!!! use_with() called without a parameter." >&2
+		echo "!!! use_with <USEFLAG> [<flagname> [value]]" >&2
+		return 1
+	fi
+
+	if ! has "${EAPI:-0}" 0 1 2 3 ; then
+		local UW_SUFFIX=${3+=$3}
+	else
+		local UW_SUFFIX=${3:+=$3}
+	fi
+	local UWORD=${2:-$1}
+
+	if use $1; then
+		echo "--with-${UWORD}${UW_SUFFIX}"
+	else
+		echo "--without-${UWORD}"
+	fi
+	return 0
+}
+
+use_enable() {
+	if [ -z "$1" ]; then
+		echo "!!! use_enable() called without a parameter." >&2
+		echo "!!! use_enable <USEFLAG> [<flagname> [value]]" >&2
+		return 1
+	fi
+
+	if ! has "${EAPI:-0}" 0 1 2 3 ; then
+		local UE_SUFFIX=${3+=$3}
+	else
+		local UE_SUFFIX=${3:+=$3}
+	fi
+	local UWORD=${2:-$1}
+
+	if use $1; then
+		echo "--enable-${UWORD}${UE_SUFFIX}"
+	else
+		echo "--disable-${UWORD}"
+	fi
+	return 0
+}
+
+unpack() {
+	local srcdir
+	local x
+	local y
+	local myfail
+	local eapi=${EAPI:-0}
+	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
+
+	for x in "$@"; do
+		vecho ">>> Unpacking ${x} to ${PWD}"
+		y=${x%.*}
+		y=${y##*.}
+
+		if [[ ${x} == "./"* ]] ; then
+			srcdir=""
+		elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
+			die "Arguments to unpack() cannot begin with \${DISTDIR}."
+		elif [[ ${x} == "/"* ]] ; then
+			die "Arguments to unpack() cannot be absolute"
+		else
+			srcdir="${DISTDIR}/"
+		fi
+		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
+
+		_unpack_tar() {
+			if [ "${y}" == "tar" ]; then
+				$1 -c -- "$srcdir$x" | tar xof -
+				assert_sigpipe_ok "$myfail"
+			else
+				local cwd_dest=${x##*/}
+				cwd_dest=${cwd_dest%.*}
+				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
+			fi
+		}
+
+		myfail="failure unpacking ${x}"
+		case "${x##*.}" in
+			tar)
+				tar xof "$srcdir$x" || die "$myfail"
+				;;
+			tgz)
+				tar xozf "$srcdir$x" || die "$myfail"
+				;;
+			tbz|tbz2)
+				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
+				assert_sigpipe_ok "$myfail"
+				;;
+			ZIP|zip|jar)
+				# unzip will interactively prompt under some error conditions,
+				# as reported in bug #336285
+				( while true ; do echo n || break ; done ) | \
+				unzip -qo "${srcdir}${x}" || die "$myfail"
+				;;
+			gz|Z|z)
+				_unpack_tar "gzip -d"
+				;;
+			bz2|bz)
+				_unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
+				;;
+			7Z|7z)
+				local my_output
+				my_output="$(7z x -y "${srcdir}${x}")"
+				if [ $? -ne 0 ]; then
+					echo "${my_output}" >&2
+					die "$myfail"
+				fi
+				;;
+			RAR|rar)
+				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
+				;;
+			LHa|LHA|lha|lzh)
+				lha xfq "${srcdir}${x}" || die "$myfail"
+				;;
+			a)
+				ar x "${srcdir}${x}" || die "$myfail"
+				;;
+			deb)
+				# Unpacking .deb archives can not always be done with
+				# `ar`.  For instance on AIX this doesn't work out.  If
+				# we have `deb2targz` installed, prefer it over `ar` for
+				# that reason.  We just make sure on AIX `deb2targz` is
+				# installed.
+				if type -P deb2targz > /dev/null; then
+					y=${x##*/}
+					local created_symlink=0
+					if [ ! "$srcdir$x" -ef "$y" ] ; then
+						# deb2targz always extracts into the same directory as
+						# the source file, so create a symlink in the current
+						# working directory if necessary.
+						ln -sf "$srcdir$x" "$y" || die "$myfail"
+						created_symlink=1
+					fi
+					deb2targz "$y" || die "$myfail"
+					if [ $created_symlink = 1 ] ; then
+						# Clean up the symlink so the ebuild
+						# doesn't inadvertently install it.
+						rm -f "$y"
+					fi
+					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
+				else
+					ar x "$srcdir$x" || die "$myfail"
+				fi
+				;;
+			lzma)
+				_unpack_tar "lzma -d"
+				;;
+			xz)
+				if has $eapi 0 1 2 ; then
+					vecho "unpack ${x}: file format not recognized. Ignoring."
+				else
+					_unpack_tar "xz -d"
+				fi
+				;;
+			*)
+				vecho "unpack ${x}: file format not recognized. Ignoring."
+				;;
+		esac
+	done
+	# Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
+	# should be preserved.
+	find . -mindepth 1 -maxdepth 1 ! -type l -print0 | \
+		${XARGS} -0 chmod -fR a+rX,u+w,g-w,o-w
+}
+
+econf() {
+	local x
+
+	local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
+	if [[ -n $phase_func ]] ; then
+		if has "$EAPI" 0 1 ; then
+			[[ $phase_func != src_compile ]] && \
+				eqawarn "QA Notice: econf called in" \
+					"$phase_func instead of src_compile"
+		else
+			[[ $phase_func != src_configure ]] && \
+				eqawarn "QA Notice: econf called in" \
+					"$phase_func instead of src_configure"
+		fi
+	fi
+
+	: ${ECONF_SOURCE:=.}
+	if [ -x "${ECONF_SOURCE}/configure" ]; then
+		if [[ -n $CONFIG_SHELL && \
+			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
+			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
+				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
+		fi
+		if [ -e /usr/share/gnuconfig/ ]; then
+			find "${WORKDIR}" -type f '(' \
+			-name config.guess -o -name config.sub ')' -print0 | \
+			while read -r -d $'\0' x ; do
+				vecho " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}"
+				cp -f /usr/share/gnuconfig/"${x##*/}" "${x}"
+			done
+		fi
+
+		# EAPI=4 adds --disable-dependency-tracking to econf
+		if ! has "$EAPI" 0 1 2 3 3_pre2 && \
+			"${ECONF_SOURCE}/configure" --help 2>/dev/null | \
+			grep -q disable-dependency-tracking ; then
+			set -- --disable-dependency-tracking "$@"
+		fi
+
+		# if the profile defines a location to install libs to aside from default, pass it on.
+		# if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
+		local CONF_LIBDIR LIBDIR_VAR="LIBDIR_${ABI}"
+		if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
+			CONF_LIBDIR=${!LIBDIR_VAR}
+		fi
+		if [[ -n ${CONF_LIBDIR} ]] && ! hasgq --libdir=\* "$@" ; then
+			export CONF_PREFIX=$(hasg --exec-prefix=\* "$@")
+			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(hasg --prefix=\* "$@")
+			: ${CONF_PREFIX:=/usr}
+			CONF_PREFIX=${CONF_PREFIX#*=}
+			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
+			[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
+			set -- --libdir="$(strip_duplicate_slashes ${CONF_PREFIX}${CONF_LIBDIR})" "$@"
+		fi
+
+		set -- \
+			--prefix=/usr \
+			${CBUILD:+--build=${CBUILD}} \
+			--host=${CHOST} \
+			${CTARGET:+--target=${CTARGET}} \
+			--mandir=/usr/share/man \
+			--infodir=/usr/share/info \
+			--datadir=/usr/share \
+			--sysconfdir=/etc \
+			--localstatedir=/var/lib \
+			"$@" \
+			${EXTRA_ECONF}
+		vecho "${ECONF_SOURCE}/configure" "$@"
+
+		if ! "${ECONF_SOURCE}/configure" "$@" ; then
+
+			if [ -s config.log ]; then
+				echo
+				echo "!!! Please attach the following file when seeking support:"
+				echo "!!! ${PWD}/config.log"
+			fi
+			die "econf failed"
+		fi
+	elif [ -f "${ECONF_SOURCE}/configure" ]; then
+		die "configure is not executable"
+	else
+		die "no configure script found"
+	fi
+}
+
+einstall() {
+	# CONF_PREFIX is only set if they didn't pass in libdir above.
+	local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
+	LIBDIR_VAR="LIBDIR_${ABI}"
+	if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
+		CONF_LIBDIR="${!LIBDIR_VAR}"
+	fi
+	unset LIBDIR_VAR
+	if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
+		EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
+		EI_DESTLIBDIR="$(strip_duplicate_slashes ${EI_DESTLIBDIR})"
+		LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
+		unset EI_DESTLIBDIR
+	fi
+
+	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
+		if [ "${PORTAGE_DEBUG}" == "1" ]; then
+			${MAKE:-make} -n prefix="${D}usr" \
+				datadir="${D}usr/share" \
+				infodir="${D}usr/share/info" \
+				localstatedir="${D}var/lib" \
+				mandir="${D}usr/share/man" \
+				sysconfdir="${D}etc" \
+				${LOCAL_EXTRA_EINSTALL} \
+				${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
+				"$@" install
+		fi
+		${MAKE:-make} prefix="${D}usr" \
+			datadir="${D}usr/share" \
+			infodir="${D}usr/share/info" \
+			localstatedir="${D}var/lib" \
+			mandir="${D}usr/share/man" \
+			sysconfdir="${D}etc" \
+			${LOCAL_EXTRA_EINSTALL} \
+			${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
+			"$@" install || die "einstall failed"
+	else
+		die "no Makefile found"
+	fi
+}
+
+_eapi0_pkg_nofetch() {
+	[ -z "${SRC_URI}" ] && return
+
+	elog "The following are listed in SRC_URI for ${PN}:"
+	local x
+	for x in $(echo ${SRC_URI}); do
+		elog "   ${x}"
+	done
+}
+
+_eapi0_src_unpack() {
+	[[ -n ${A} ]] && unpack ${A}
+}
+
+_eapi0_src_compile() {
+	if [ -x ./configure ] ; then
+		econf
+	fi
+	_eapi2_src_compile
+}
+
+_eapi0_src_test() {
+	# Since we don't want emake's automatic die
+	# support (EAPI 4 and later), and we also don't
+	# want the warning messages that it produces if
+	# we call it in 'nonfatal' mode, we use emake_cmd
+	# to emulate the desired parts of emake behavior.
+	local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
+	if $emake_cmd -j1 check -n &> /dev/null; then
+		vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
+		if ! $emake_cmd -j1 check; then
+			has test $FEATURES && die "Make check failed. See above for details."
+			has test $FEATURES || eerror "Make check failed. See above for details."
+		fi
+	elif $emake_cmd -j1 test -n &> /dev/null; then
+		vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
+		if ! $emake_cmd -j1 test; then
+			has test $FEATURES && die "Make test failed. See above for details."
+			has test $FEATURES || eerror "Make test failed. See above for details."
+		fi
+	else
+		vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
+	fi
+}
+
+_eapi1_src_compile() {
+	_eapi2_src_configure
+	_eapi2_src_compile
+}
+
+_eapi2_src_configure() {
+	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
+		econf
+	fi
+}
+
+_eapi2_src_compile() {
+	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
+		emake || die "emake failed"
+	fi
+}
+
+_eapi4_src_install() {
+	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+		emake DESTDIR="${D}" install
+	fi
+
+	if ! declare -p DOCS &>/dev/null ; then
+		local d
+		for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+				THANKS BUGS FAQ CREDITS CHANGELOG ; do
+			[[ -s "${d}" ]] && dodoc "${d}"
+		done
+	elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
+		dodoc "${DOCS[@]}"
+	else
+		dodoc ${DOCS}
+	fi
+}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 21:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 21:17 UTC (permalink / raw
  To: gentoo-commits

commit:     6a1a8397003edc599c3916d284676a81a02af0e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 21:16:23 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 21:16:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6a1a8397

ebuild.sh: add dummy funcs for "depend" phase

---
 bin/ebuild.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a5cc5ef..936405d 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -833,6 +833,15 @@ trap 'exit 1' SIGTERM
 if [[ $EBUILD_PHASE != depend ]] ; then
 	source "${PORTAGE_BIN_PATH}/phase-functions.sh"
 	source "${PORTAGE_BIN_PATH}/phase-helpers.sh"
+else
+	# These dummy functions are for things that are likely to be called
+	# in global scope, even though they are completely useless during
+	# the "depend" phase.
+	for x in diropts docompress exeopts insopts \
+		keepdir libopts use_with use_enable ; do
+		eval "${x}() { : ; }"
+	done
+	unset x
 fi
 
 if ! has "$EBUILD_PHASE" clean cleanrm depend && \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 21:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     fc4e3c9cae17a0dc0867c7e5ccefbb47eb5e36f7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 21:29:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 21:29:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc4e3c9c

ebuild.sh: move use* funcs to phase-helpers.sh

---
 bin/ebuild.sh        |   50 +-------------------------------------------------
 bin/phase-helpers.sh |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 936405d..ccf84a4 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -127,54 +127,6 @@ esyslog() {
 	return 0
 }
 
-useq() {
-	has $EBUILD_PHASE prerm postrm || eqawarn \
-		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"
-	use ${1}
-}
-
-usev() {
-	if use ${1}; then
-		echo "${1#!}"
-		return 0
-	fi
-	return 1
-}
-
-use() {
-	local u=$1
-	local found=0
-
-	# if we got something like '!flag', then invert the return value
-	if [[ ${u:0:1} == "!" ]] ; then
-		u=${u:1}
-		found=1
-	fi
-
-	if [[ $EBUILD_PHASE = depend ]] ; then
-		# TODO: Add a registration interface for eclasses to register
-		# any number of phase hooks, so that global scope eclass
-		# initialization can by migrated to phase hooks in new EAPIs.
-		# Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
-		#if [[ -n $EAPI ]] && ! has "$EAPI" 0 1 2 3 ; then
-		#	die "use() called during invalid phase: $EBUILD_PHASE"
-		#fi
-		true
-
-	# Make sure we have this USE flag in IUSE
-	elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
-		[[ $u =~ $PORTAGE_IUSE ]] || \
-			eqawarn "QA Notice: USE Flag '${u}' not" \
-				"in IUSE for ${CATEGORY}/${PF}"
-	fi
-
-	if has ${u} ${USE} ; then
-		return ${found}
-	else
-		return $((!found))
-	fi
-}
-
 # Return true if given package is installed. Otherwise return false.
 # Takes single depend-type atoms.
 has_version() {
@@ -838,7 +790,7 @@ else
 	# in global scope, even though they are completely useless during
 	# the "depend" phase.
 	for x in diropts docompress exeopts insopts \
-		keepdir libopts use_with use_enable ; do
+		keepdir libopts use useq usev use_with use_enable ; do
 		eval "${x}() { : ; }"
 	done
 	unset x

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 337639f..6064346 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -149,6 +149,55 @@ keepdir() {
 	fi
 }
 
+
+useq() {
+	has $EBUILD_PHASE prerm postrm || eqawarn \
+		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"
+	use ${1}
+}
+
+usev() {
+	if use ${1}; then
+		echo "${1#!}"
+		return 0
+	fi
+	return 1
+}
+
+use() {
+	local u=$1
+	local found=0
+
+	# if we got something like '!flag', then invert the return value
+	if [[ ${u:0:1} == "!" ]] ; then
+		u=${u:1}
+		found=1
+	fi
+
+	if [[ $EBUILD_PHASE = depend ]] ; then
+		# TODO: Add a registration interface for eclasses to register
+		# any number of phase hooks, so that global scope eclass
+		# initialization can by migrated to phase hooks in new EAPIs.
+		# Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
+		#if [[ -n $EAPI ]] && ! has "$EAPI" 0 1 2 3 ; then
+		#	die "use() called during invalid phase: $EBUILD_PHASE"
+		#fi
+		true
+
+	# Make sure we have this USE flag in IUSE
+	elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
+		[[ $u =~ $PORTAGE_IUSE ]] || \
+			eqawarn "QA Notice: USE Flag '${u}' not" \
+				"in IUSE for ${CATEGORY}/${PF}"
+	fi
+
+	if has ${u} ${USE} ; then
+		return ${found}
+	else
+		return $((!found))
+	fi
+}
+
 use_with() {
 	if [ -z "$1" ]; then
 		echo "!!! use_with() called without a parameter." >&2



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 22:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     fdd2bc1c1fdf8f20732749d44c39c3cab3cc2d52
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 22:17:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 22:17:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fdd2bc1c

ebuild.sh: move ebuild_main to phase-functions.sh

---
 bin/ebuild.sh          |  265 ++++++++----------------------------------------
 bin/phase-functions.sh |  175 +++++++++++++++++++++++++++++++
 2 files changed, 217 insertions(+), 223 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index ccf84a4..6bcc6b3 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -991,12 +991,41 @@ then
 	export DEBUGBUILD=1
 fi
 
-#a reasonable default for $S
-[[ -z ${S} ]] && export S=${WORKDIR}/${P}
+if [[ $EBUILD_PHASE = depend ]] ; then
+	export SANDBOX_ON="0"
+	set -f
+
+	if [ -n "${dbkey}" ] ; then
+		if [ ! -d "${dbkey%/*}" ]; then
+			install -d -g ${PORTAGE_GID} -m2775 "${dbkey%/*}"
+		fi
+		# Make it group writable. 666&~002==664
+		umask 002
+	fi
+
+	auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
+		DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND PROVIDE EAPI
+		PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04
+		UNUSED_03 UNUSED_02 UNUSED_01"
 
-# Note: readonly variables interfere with preprocess_ebuild_env(), so
-# declare them only after it has already run.
-if [ "${EBUILD_PHASE}" != "depend" ] ; then
+	#the extra $(echo) commands remove newlines
+	[ -n "${EAPI}" ] || EAPI=0
+
+	if [ -n "${dbkey}" ] ; then
+		> "${dbkey}"
+		for f in ${auxdbkeys} ; do
+			echo $(echo ${!f}) >> "${dbkey}" || exit $?
+		done
+	else
+		for f in ${auxdbkeys} ; do
+			echo $(echo ${!f}) 1>&9 || exit $?
+		done
+		exec 9>&-
+	fi
+	set +f
+else
+	# Note: readonly variables interfere with preprocess_ebuild_env(), so
+	# declare them only after it has already run.
 	declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS
 	case "$EAPI" in
 		0|1|2)
@@ -1005,227 +1034,17 @@ if [ "${EBUILD_PHASE}" != "depend" ] ; then
 			declare -r ED EPREFIX EROOT
 			;;
 	esac
-fi
-
-ebuild_main() {
-
-	# Subshell/helper die support (must export for the die helper).
-	# Since this function is typically executed in a subshell,
-	# setup EBUILD_MASTER_PID to refer to the current $BASHPID,
-	# which seems to give the best results when further
-	# nested subshells call die.
-	export EBUILD_MASTER_PID=$BASHPID
-	trap 'exit 1' SIGTERM
-
-	if [[ $EBUILD_PHASE != depend ]] ; then
-		# Force configure scripts that automatically detect ccache to
-		# respect FEATURES="-ccache".
-		has ccache $FEATURES || export CCACHE_DISABLE=1
-
-		local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
-		[[ -n $phase_func ]] && _ebuild_phase_funcs "$EAPI" "$phase_func"
-		unset phase_func
-	fi
-
-	source_all_bashrcs
-
-	case ${EBUILD_SH_ARGS} in
-	nofetch)
-		ebuild_phase_with_hooks pkg_nofetch
-		;;
-	prerm|postrm|postinst|config|info)
-		if has "$EBUILD_SH_ARGS" config info && \
-			! declare -F "pkg_$EBUILD_SH_ARGS" >/dev/null ; then
-			ewarn  "pkg_${EBUILD_SH_ARGS}() is not defined: '${EBUILD##*/}'"
-		fi
-		export SANDBOX_ON="0"
-		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
-			ebuild_phase_with_hooks pkg_${EBUILD_SH_ARGS}
-		else
-			set -x
-			ebuild_phase_with_hooks pkg_${EBUILD_SH_ARGS}
-			set +x
-		fi
-		if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then
-			# Update environment.bz2 in case installation phases
-			# need to pass some variables to uninstallation phases.
-			save_ebuild_env --exclude-init-phases | \
-				filter_readonly_variables --filter-path \
-				--filter-sandbox --allow-extra-vars \
-				| ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV"
-			assert "save_ebuild_env failed"
-		fi
-		;;
-	unpack|prepare|configure|compile|test|clean|install)
-		if [[ ${SANDBOX_DISABLED:-0} = 0 ]] ; then
-			export SANDBOX_ON="1"
-		else
-			export SANDBOX_ON="0"
-		fi
-
-		case "$EBUILD_SH_ARGS" in
-		configure|compile)
-
-			local x
-			for x in ASFLAGS CCACHE_DIR CCACHE_SIZE \
-				CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS ; do
-				[[ ${!x+set} = set ]] && export $x
-			done
-			unset x
-
-			has distcc $FEATURES && [[ -n $DISTCC_DIR ]] && \
-				[[ ${SANDBOX_WRITE/$DISTCC_DIR} = $SANDBOX_WRITE ]] && \
-				addwrite "$DISTCC_DIR"
-
-			x=LIBDIR_$ABI
-			[ -z "$PKG_CONFIG_PATH" -a -n "$ABI" -a -n "${!x}" ] && \
-				export PKG_CONFIG_PATH=/usr/${!x}/pkgconfig
-
-			if has noauto $FEATURES && \
-				[[ ! -f $PORTAGE_BUILDDIR/.unpacked ]] ; then
-				echo
-				echo "!!! We apparently haven't unpacked..." \
-					"This is probably not what you"
-				echo "!!! want to be doing... You are using" \
-					"FEATURES=noauto so I'll assume"
-				echo "!!! that you know what you are doing..." \
-					"You have 5 seconds to abort..."
-				echo
-
-				local x
-				for x in 1 2 3 4 5 6 7 8; do
-					LC_ALL=C sleep 0.25
-				done
-
-				sleep 3
-			fi
-
-			cd "$PORTAGE_BUILDDIR"
-			if [ ! -d build-info ] ; then
-				mkdir build-info
-				cp "$EBUILD" "build-info/$PF.ebuild"
-			fi
-
-			#our custom version of libtool uses $S and $D to fix
-			#invalid paths in .la files
-			export S D
 
-			;;
-		esac
-
-		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
-			dyn_${EBUILD_SH_ARGS}
-		else
-			set -x
-			dyn_${EBUILD_SH_ARGS}
-			set +x
-		fi
-		export SANDBOX_ON="0"
-		;;
-	help|pretend|setup|preinst)
-		#pkg_setup needs to be out of the sandbox for tmp file creation;
-		#for example, awking and piping a file in /tmp requires a temp file to be created
-		#in /etc.  If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
-		export SANDBOX_ON="0"
-		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
-			dyn_${EBUILD_SH_ARGS}
-		else
-			set -x
-			dyn_${EBUILD_SH_ARGS}
-			set +x
-		fi
-		;;
-	depend)
-		export SANDBOX_ON="0"
-		set -f
-
-		if [ -n "${dbkey}" ] ; then
-			if [ ! -d "${dbkey%/*}" ]; then
-				install -d -g ${PORTAGE_GID} -m2775 "${dbkey%/*}"
-			fi
-			# Make it group writable. 666&~002==664
-			umask 002
-		fi
-
-		auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
-			DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND PROVIDE EAPI
-			PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04
-			UNUSED_03 UNUSED_02 UNUSED_01"
-
-		#the extra $(echo) commands remove newlines
-		[ -n "${EAPI}" ] || EAPI=0
-
-		if [ -n "${dbkey}" ] ; then
-			> "${dbkey}"
-			for f in ${auxdbkeys} ; do
-				echo $(echo ${!f}) >> "${dbkey}" || exit $?
-			done
-		else
-			for f in ${auxdbkeys} ; do
-				echo $(echo ${!f}) 1>&9 || exit $?
-			done
+	if [[ -n $EBUILD_SH_ARGS ]] ; then
+		(
+			# Don't allow subprocesses to inherit the pipe which
+			# emerge uses to monitor ebuild.sh.
 			exec 9>&-
-		fi
-		set +f
-		;;
-	_internal_test)
-		;;
-	*)
-		export SANDBOX_ON="1"
-		echo "Unrecognized EBUILD_SH_ARGS: '${EBUILD_SH_ARGS}'"
-		echo
-		dyn_help
-		exit 1
-		;;
-	esac
-}
-
-if [[ -s $SANDBOX_LOG ]] ; then
-	# We use SANDBOX_LOG to check for sandbox violations,
-	# so we ensure that there can't be a stale log to
-	# interfere with our logic.
-	x=
-	if [[ -n SANDBOX_ON ]] ; then
-		x=$SANDBOX_ON
-		export SANDBOX_ON=0
-	fi
-
-	rm -f "$SANDBOX_LOG" || \
-		die "failed to remove stale sandbox log: '$SANDBOX_LOG'"
-
-	if [[ -n $x ]] ; then
-		export SANDBOX_ON=$x
+			ebuild_main ${EBUILD_SH_ARGS}
+			exit 0
+		)
+		exit $?
 	fi
-	unset x
-fi
-
-if [[ $EBUILD_PHASE = depend ]] ; then
-	ebuild_main
-elif [[ -n $EBUILD_SH_ARGS ]] ; then
-	(
-		# Don't allow subprocesses to inherit the pipe which
-		# emerge uses to monitor ebuild.sh.
-		exec 9>&-
-
-		ebuild_main
-
-		# Save the env only for relevant phases.
-		if ! has "$EBUILD_SH_ARGS" clean help info nofetch ; then
-			umask 002
-			save_ebuild_env | filter_readonly_variables \
-				--filter-features > "$T/environment"
-			assert "save_ebuild_env failed"
-			chown portage:portage "$T/environment" &>/dev/null
-			chmod g+w "$T/environment" &>/dev/null
-		fi
-		[[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"
-		if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-			[[ ! -s $SANDBOX_LOG ]]
-			"$PORTAGE_BIN_PATH"/ebuild-ipc exit $?
-		fi
-		exit 0
-	)
-	exit $?
 fi
 
 # Do not exit when ebuild.sh is sourced by other scripts.

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 5216877..383253d 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -609,3 +609,178 @@ _ebuild_phase_funcs() {
 			;;
 	esac
 }
+
+ebuild_main() {
+
+	# Subshell/helper die support (must export for the die helper).
+	# Since this function is typically executed in a subshell,
+	# setup EBUILD_MASTER_PID to refer to the current $BASHPID,
+	# which seems to give the best results when further
+	# nested subshells call die.
+	export EBUILD_MASTER_PID=$BASHPID
+	trap 'exit 1' SIGTERM
+
+	#a reasonable default for $S
+	[[ -z ${S} ]] && export S=${WORKDIR}/${P}
+
+	if [[ -s $SANDBOX_LOG ]] ; then
+		# We use SANDBOX_LOG to check for sandbox violations,
+		# so we ensure that there can't be a stale log to
+		# interfere with our logic.
+		local x=
+		if [[ -n SANDBOX_ON ]] ; then
+			x=$SANDBOX_ON
+			export SANDBOX_ON=0
+		fi
+
+		rm -f "$SANDBOX_LOG" || \
+			die "failed to remove stale sandbox log: '$SANDBOX_LOG'"
+
+		if [[ -n $x ]] ; then
+			export SANDBOX_ON=$x
+		fi
+		unset x
+	fi
+
+	# Force configure scripts that automatically detect ccache to
+	# respect FEATURES="-ccache".
+	has ccache $FEATURES || export CCACHE_DISABLE=1
+
+	local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
+	[[ -n $phase_func ]] && _ebuild_phase_funcs "$EAPI" "$phase_func"
+	unset phase_func
+
+	source_all_bashrcs
+
+	case ${1} in
+	nofetch)
+		ebuild_phase_with_hooks pkg_nofetch
+		;;
+	prerm|postrm|postinst|config|info)
+		if has "${1}" config info && \
+			! declare -F "pkg_${1}" >/dev/null ; then
+			ewarn  "pkg_${1}() is not defined: '${EBUILD##*/}'"
+		fi
+		export SANDBOX_ON="0"
+		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
+			ebuild_phase_with_hooks pkg_${1}
+		else
+			set -x
+			ebuild_phase_with_hooks pkg_${1}
+			set +x
+		fi
+		if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then
+			# Update environment.bz2 in case installation phases
+			# need to pass some variables to uninstallation phases.
+			save_ebuild_env --exclude-init-phases | \
+				filter_readonly_variables --filter-path \
+				--filter-sandbox --allow-extra-vars \
+				| ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV"
+			assert "save_ebuild_env failed"
+		fi
+		;;
+	unpack|prepare|configure|compile|test|clean|install)
+		if [[ ${SANDBOX_DISABLED:-0} = 0 ]] ; then
+			export SANDBOX_ON="1"
+		else
+			export SANDBOX_ON="0"
+		fi
+
+		case "${1}" in
+		configure|compile)
+
+			local x
+			for x in ASFLAGS CCACHE_DIR CCACHE_SIZE \
+				CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS ; do
+				[[ ${!x+set} = set ]] && export $x
+			done
+			unset x
+
+			has distcc $FEATURES && [[ -n $DISTCC_DIR ]] && \
+				[[ ${SANDBOX_WRITE/$DISTCC_DIR} = $SANDBOX_WRITE ]] && \
+				addwrite "$DISTCC_DIR"
+
+			x=LIBDIR_$ABI
+			[ -z "$PKG_CONFIG_PATH" -a -n "$ABI" -a -n "${!x}" ] && \
+				export PKG_CONFIG_PATH=/usr/${!x}/pkgconfig
+
+			if has noauto $FEATURES && \
+				[[ ! -f $PORTAGE_BUILDDIR/.unpacked ]] ; then
+				echo
+				echo "!!! We apparently haven't unpacked..." \
+					"This is probably not what you"
+				echo "!!! want to be doing... You are using" \
+					"FEATURES=noauto so I'll assume"
+				echo "!!! that you know what you are doing..." \
+					"You have 5 seconds to abort..."
+				echo
+
+				local x
+				for x in 1 2 3 4 5 6 7 8; do
+					LC_ALL=C sleep 0.25
+				done
+
+				sleep 3
+			fi
+
+			cd "$PORTAGE_BUILDDIR"
+			if [ ! -d build-info ] ; then
+				mkdir build-info
+				cp "$EBUILD" "build-info/$PF.ebuild"
+			fi
+
+			#our custom version of libtool uses $S and $D to fix
+			#invalid paths in .la files
+			export S D
+
+			;;
+		esac
+
+		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
+			dyn_${1}
+		else
+			set -x
+			dyn_${1}
+			set +x
+		fi
+		export SANDBOX_ON="0"
+		;;
+	help|pretend|setup|preinst)
+		#pkg_setup needs to be out of the sandbox for tmp file creation;
+		#for example, awking and piping a file in /tmp requires a temp file to be created
+		#in /etc.  If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
+		export SANDBOX_ON="0"
+		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
+			dyn_${1}
+		else
+			set -x
+			dyn_${1}
+			set +x
+		fi
+		;;
+	_internal_test)
+		;;
+	*)
+		export SANDBOX_ON="1"
+		echo "Unrecognized arg '${1}'"
+		echo
+		dyn_help
+		exit 1
+		;;
+	esac
+
+	# Save the env only for relevant phases.
+	if ! has "${1}" clean help info nofetch ; then
+		umask 002
+		save_ebuild_env | filter_readonly_variables \
+			--filter-features > "$T/environment"
+		assert "save_ebuild_env failed"
+		chown portage:portage "$T/environment" &>/dev/null
+		chmod g+w "$T/environment" &>/dev/null
+	fi
+	[[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"
+	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
+		[[ ! -s $SANDBOX_LOG ]]
+		"$PORTAGE_BIN_PATH"/ebuild-ipc exit $?
+	fi
+}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 22:50 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 22:50 UTC (permalink / raw
  To: gentoo-commits

commit:     e40e2bce40464dace057d91f0a24ba682928814a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 22:50:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 22:50:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e40e2bce

build.sh: has/best_version to phase-helpers.sh

---
 bin/ebuild.sh        |   59 ++++---------------------------------------------
 bin/phase-helpers.sh |   42 +++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 6bcc6b3..4dd2921 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -127,30 +127,6 @@ esyslog() {
 	return 0
 }
 
-# Return true if given package is installed. Otherwise return false.
-# Takes single depend-type atoms.
-has_version() {
-	if [ "${EBUILD_PHASE}" == "depend" ]; then
-		die "portageq calls (has_version calls portageq) are not allowed in the global scope"
-	fi
-
-	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1"
-	else
-		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
-	fi
-	local retval=$?
-	case "${retval}" in
-		0|1)
-			return ${retval}
-			;;
-		*)
-			die "unexpected portageq exit code: ${retval}"
-			;;
-	esac
-}
-
 portageq() {
 	if [ "${EBUILD_PHASE}" == "depend" ]; then
 		die "portageq calls are not allowed in the global scope"
@@ -160,36 +136,6 @@ portageq() {
 	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
 }
 
-
-# ----------------------------------------------------------------------------
-# ----------------------------------------------------------------------------
-# ----------------------------------------------------------------------------
-
-
-# Returns the best/most-current match.
-# Takes single depend-type atoms.
-best_version() {
-	if [ "${EBUILD_PHASE}" == "depend" ]; then
-		die "portageq calls (best_version calls portageq) are not allowed in the global scope"
-	fi
-
-	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1"
-	else
-		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
-	fi
-	local retval=$?
-	case "${retval}" in
-		0|1)
-			return ${retval}
-			;;
-		*)
-			die "unexpected portageq exit code: ${retval}"
-			;;
-	esac
-}
-
 register_die_hook() {
 	local x
 	for x in $* ; do
@@ -793,6 +739,11 @@ else
 		keepdir libopts use useq usev use_with use_enable ; do
 		eval "${x}() { : ; }"
 	done
+	# These functions die because calls to them during the "depend" phase
+	# are considered to be severe QA violations.
+	for x in best_version has_version ; do
+		eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
+	done
 	unset x
 fi
 

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6064346..1f39c75 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -571,3 +571,45 @@ _eapi4_src_install() {
 		dodoc ${DOCS}
 	fi
 }
+
+# Return true if given package is installed. Otherwise return false.
+# Takes single depend-type atoms.
+has_version() {
+
+	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
+		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1"
+	else
+		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
+	fi
+	local retval=$?
+	case "${retval}" in
+		0|1)
+			return ${retval}
+			;;
+		*)
+			die "unexpected portageq exit code: ${retval}"
+			;;
+	esac
+}
+
+# Returns the best/most-current match.
+# Takes single depend-type atoms.
+best_version() {
+
+	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
+		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1"
+	else
+		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${ROOT}" "$1"
+	fi
+	local retval=$?
+	case "${retval}" in
+		0|1)
+			return ${retval}
+			;;
+		*)
+			die "unexpected portageq exit code: ${retval}"
+			;;
+	esac
+}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 22:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 22:58 UTC (permalink / raw
  To: gentoo-commits

commit:     8fb7653c2923bd1a1de5eb842356020c6fbf065e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 22:58:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 22:58:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8fb7653c

ebuild.sh: remove unused lchown and lchgrp

---
 bin/ebuild.sh             |    8 --------
 bin/isolated-functions.sh |    2 +-
 2 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 4dd2921..355a1c0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -113,14 +113,6 @@ fi
 # the sandbox is disabled by default except when overridden in the relevant stages
 export SANDBOX_ON=0
 
-lchown() {
-	chown -h "$@"
-}
-
-lchgrp() {
-	chgrp -h "$@"
-}
-
 esyslog() {
 	# Custom version of esyslog() to take care of the "Red Star" bug.
 	# MUST follow functions.sh to override the "" parameter problem.

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 1de1f7f..8e367ff 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -588,7 +588,7 @@ save_ebuild_env() {
 			has_phase_defined_up_to \
 			hasg hasgq hasv hasq qa_source qa_call \
 			addread addwrite adddeny addpredict _sb_append_var \
-			lchown lchgrp esyslog use usev useq has_version portageq \
+			use usev useq has_version portageq \
 			best_version use_with use_enable register_die_hook \
 			keepdir unpack strip_duplicate_slashes econf einstall \
 			dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 23:15 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 23:15 UTC (permalink / raw
  To: gentoo-commits

commit:     11d543aacf2ee7f7f214a256aabf668ad27ca013
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 23:15:28 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 23:15:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11d543aa

ebuild.sh: move hasg* funcs into econf

---
 bin/ebuild.sh             |    8 --------
 bin/isolated-functions.sh |    4 ++--
 bin/phase-helpers.sh      |   15 ++++++++++++---
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 355a1c0..832b39d 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -166,14 +166,6 @@ strip_duplicate_slashes() {
 	fi
 }
 
-hasg() {
-    local x s=$1
-    shift
-    for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
-    return 1
-}
-hasgq() { hasg "$@" >/dev/null ; }
-
 # debug-print() gets called from many places with verbose status information useful
 # for tracking down problems. The output is in $T/eclass-debug.log.
 # You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 8e367ff..c5adc0c 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -586,7 +586,7 @@ save_ebuild_env() {
 			esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
 			KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
 			has_phase_defined_up_to \
-			hasg hasgq hasv hasq qa_source qa_call \
+			hasv hasq qa_source qa_call \
 			addread addwrite adddeny addpredict _sb_append_var \
 			use usev useq has_version portageq \
 			best_version use_with use_enable register_die_hook \
@@ -602,7 +602,7 @@ save_ebuild_env() {
 			set_unless_changed unset_unless_changed source_all_bashrcs \
 			ebuild_main ebuild_phase ebuild_phase_with_hooks \
 			_ebuild_arg_to_phase _ebuild_phase_funcs default \
-			_pipestatus \
+			_hasg _hasgq _unpack_tar \
 			${QA_INTERCEPTORS}
 
 		# portage config variables and variables set directly by portage

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 1f39c75..a033fa8 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -369,6 +369,15 @@ unpack() {
 econf() {
 	local x
 
+	_hasg() {
+		local x s=$1
+		shift
+		for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
+		return 1
+	}
+
+	_hasgq() { _hasg "$@" >/dev/null ; }
+
 	local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
 	if [[ -n $phase_func ]] ; then
 		if has "$EAPI" 0 1 ; then
@@ -411,9 +420,9 @@ econf() {
 		if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
 			CONF_LIBDIR=${!LIBDIR_VAR}
 		fi
-		if [[ -n ${CONF_LIBDIR} ]] && ! hasgq --libdir=\* "$@" ; then
-			export CONF_PREFIX=$(hasg --exec-prefix=\* "$@")
-			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(hasg --prefix=\* "$@")
+		if [[ -n ${CONF_LIBDIR} ]] && ! _hasgq --libdir=\* "$@" ; then
+			export CONF_PREFIX=$(_hasg --exec-prefix=\* "$@")
+			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(_hasg --prefix=\* "$@")
 			: ${CONF_PREFIX:=/usr}
 			CONF_PREFIX=${CONF_PREFIX#*=}
 			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-11 23:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-11 23:40 UTC (permalink / raw
  To: gentoo-commits

commit:     443a516e1a8e2703bdd25a4a89f385969128d3b3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 23:39:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 23:39:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=443a516e

ebuild.sh: split out bashrc-functions.sh

---
 bin/bashrc-functions.sh |   89 +++++++++++++++++++++++++++++++++++++++++++
 bin/ebuild.sh           |   97 ++--------------------------------------------
 2 files changed, 94 insertions(+), 92 deletions(-)

diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
new file mode 100644
index 0000000..91ff6d7
--- /dev/null
+++ b/bin/bashrc-functions.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+portageq() {
+	PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
+}
+
+register_die_hook() {
+	local x
+	for x in $* ; do
+		has $x $EBUILD_DEATH_HOOKS || \
+			export EBUILD_DEATH_HOOKS="$EBUILD_DEATH_HOOKS $x"
+	done
+}
+
+register_success_hook() {
+	local x
+	for x in $* ; do
+		has $x $EBUILD_SUCCESS_HOOKS || \
+			export EBUILD_SUCCESS_HOOKS="$EBUILD_SUCCESS_HOOKS $x"
+	done
+}
+
+strip_duplicate_slashes() {
+	if [[ -n $1 ]] ; then
+		local removed=$1
+		while [[ ${removed} == *//* ]] ; do
+			removed=${removed//\/\///}
+		done
+		echo ${removed}
+	fi
+}
+
+# this is a function for removing any directory matching a passed in pattern from
+# PATH
+remove_path_entry() {
+	save_IFS
+	IFS=":"
+	stripped_path="${PATH}"
+	while [ -n "$1" ]; do
+		cur_path=""
+		for p in ${stripped_path}; do
+			if [ "${p/${1}}" == "${p}" ]; then
+				cur_path="${cur_path}:${p}"
+			fi
+		done
+		stripped_path="${cur_path#:*}"
+		shift
+	done
+	restore_IFS
+	PATH="${stripped_path}"
+}
+
+# Set given variables unless these variable have been already set (e.g. during emerge
+# invocation) to values different than values set in make.conf.
+set_unless_changed() {
+	if [[ $# -lt 1 ]]; then
+		die "${FUNCNAME}() requires at least 1 argument: VARIABLE=VALUE"
+	fi
+
+	local argument value variable
+	for argument in "$@"; do
+		if [[ ${argument} != *=* ]]; then
+			die "${FUNCNAME}(): Argument '${argument}' has incorrect syntax"
+		fi
+		variable="${argument%%=*}"
+		value="${argument#*=}"
+		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
+			eval "${variable}=\"\${value}\""
+		fi
+	done
+}
+
+# Unset given variables unless these variable have been set (e.g. during emerge
+# invocation) to values different than values set in make.conf.
+unset_unless_changed() {
+	if [[ $# -lt 1 ]]; then
+		die "${FUNCNAME}() requires at least 1 argument: VARIABLE"
+	fi
+
+	local variable
+	for variable in "$@"; do
+		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
+			unset ${variable}
+		fi
+	done
+}

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 832b39d..a781c2e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -119,31 +119,6 @@ esyslog() {
 	return 0
 }
 
-portageq() {
-	if [ "${EBUILD_PHASE}" == "depend" ]; then
-		die "portageq calls are not allowed in the global scope"
-	fi
-
-	PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
-}
-
-register_die_hook() {
-	local x
-	for x in $* ; do
-		has $x $EBUILD_DEATH_HOOKS || \
-			export EBUILD_DEATH_HOOKS="$EBUILD_DEATH_HOOKS $x"
-	done
-}
-
-register_success_hook() {
-	local x
-	for x in $* ; do
-		has $x $EBUILD_SUCCESS_HOOKS || \
-			export EBUILD_SUCCESS_HOOKS="$EBUILD_SUCCESS_HOOKS $x"
-	done
-}
-
 # Ensure that $PWD is sane whenever possible, to protect against
 # exploitation of insecure search path for python -c in ebuilds.
 # See bug #239560.
@@ -156,16 +131,6 @@ fi
 #(not secretive, but not stupid)
 umask 022
 
-strip_duplicate_slashes() {
-	if [[ -n $1 ]] ; then
-		local removed=$1
-		while [[ ${removed} == *//* ]] ; do
-			removed=${removed//\/\///}
-		done
-		echo ${removed}
-	fi
-}
-
 # debug-print() gets called from many places with verbose status information useful
 # for tracking down problems. The output is in $T/eclass-debug.log.
 # You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.
@@ -354,61 +319,6 @@ EXPORT_FUNCTIONS() {
 	eval $__export_funcs_var+=\" $*\"
 }
 
-# this is a function for removing any directory matching a passed in pattern from
-# PATH
-remove_path_entry() {
-	save_IFS
-	IFS=":"
-	stripped_path="${PATH}"
-	while [ -n "$1" ]; do
-		cur_path=""
-		for p in ${stripped_path}; do
-			if [ "${p/${1}}" == "${p}" ]; then
-				cur_path="${cur_path}:${p}"
-			fi
-		done
-		stripped_path="${cur_path#:*}"
-		shift
-	done
-	restore_IFS
-	PATH="${stripped_path}"
-}
-
-# Set given variables unless these variable have been already set (e.g. during emerge
-# invocation) to values different than values set in make.conf.
-set_unless_changed() {
-	if [[ $# -lt 1 ]]; then
-		die "${FUNCNAME}() requires at least 1 argument: VARIABLE=VALUE"
-	fi
-
-	local argument value variable
-	for argument in "$@"; do
-		if [[ ${argument} != *=* ]]; then
-			die "${FUNCNAME}(): Argument '${argument}' has incorrect syntax"
-		fi
-		variable="${argument%%=*}"
-		value="${argument#*=}"
-		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-			eval "${variable}=\"\${value}\""
-		fi
-	done
-}
-
-# Unset given variables unless these variable have been set (e.g. during emerge
-# invocation) to values different than values set in make.conf.
-unset_unless_changed() {
-	if [[ $# -lt 1 ]]; then
-		die "${FUNCNAME}() requires at least 1 argument: VARIABLE"
-	fi
-
-	local variable
-	for variable in "$@"; do
-		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-			unset ${variable}
-		fi
-	done
-}
-
 PORTAGE_BASHRCS_SOURCED=0
 
 # @FUNCTION: source_all_bashrcs
@@ -715,17 +625,20 @@ trap 'exit 1' SIGTERM
 if [[ $EBUILD_PHASE != depend ]] ; then
 	source "${PORTAGE_BIN_PATH}/phase-functions.sh"
 	source "${PORTAGE_BIN_PATH}/phase-helpers.sh"
+	source "${PORTAGE_BIN_PATH}/bashrc-functions.sh"
 else
 	# These dummy functions are for things that are likely to be called
 	# in global scope, even though they are completely useless during
 	# the "depend" phase.
 	for x in diropts docompress exeopts insopts \
-		keepdir libopts use useq usev use_with use_enable ; do
+		keepdir libopts register_die_hook register_success_hook \
+		remove_path_entry set_unless_changed strip_duplicate_slashes \
+		unset_unless_changed use useq usev use_with use_enable ; do
 		eval "${x}() { : ; }"
 	done
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
-	for x in best_version has_version ; do
+	for x in best_version has_version portageq ; do
 		eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
 	done
 	unset x



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  0:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  0:02 UTC (permalink / raw
  To: gentoo-commits

commit:     8d2db38d565f852537211c80153f56a251b84f3a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 00:01:50 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 00:01:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8d2db38d

Move preprocess_ebuild_env to phase-functions.sh.

---
 bin/ebuild.sh          |  188 ------------------------------------------------
 bin/phase-functions.sh |  184 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+), 188 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a781c2e..d722ccc 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -371,201 +371,13 @@ source_all_bashrcs() {
 	[ ! -z "${OCXX}" ] && export CXX="${OCXX}"
 }
 
-# Hardcoded bash lists are needed for backward compatibility with
-# <portage-2.1.4 since they assume that a newly installed version
-# of ebuild.sh will work for pkg_postinst, pkg_prerm, and pkg_postrm
-# when portage is upgrading itself.
-
-PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
-	EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
-	PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI"
-
-PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
-	EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \
-	PM_EBUILD_HOOK_DIR \
-	PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC  \
-	PORTAGE_BINPKG_FILE PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE \
-	PORTAGE_BIN_PATH PORTAGE_BUILDDIR PORTAGE_BUNZIP2_COMMAND \
-	PORTAGE_BZIP2_COMMAND PORTAGE_COLORMAP PORTAGE_CONFIGROOT \
-	PORTAGE_DEBUG PORTAGE_DEPCACHEDIR PORTAGE_EBUILD_EXIT_FILE \
-	PORTAGE_GID PORTAGE_GRPNAME PORTAGE_INST_GID PORTAGE_INST_UID \
-	PORTAGE_IPC_DAEMON PORTAGE_IUSE PORTAGE_LOG_FILE \
-	PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_PYM_PATH PORTAGE_PYTHON \
-	PORTAGE_READONLY_METADATA PORTAGE_READONLY_VARS \
-	PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_SANDBOX_COMPAT_LEVEL \
-	PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \
-	PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \
-	PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \
-	PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR"
-
-PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR"
-
-# Variables that portage sets but doesn't mark readonly.
-# In order to prevent changed values from causing unexpected
-# interference, they are filtered out of the environment when
-# it is saved or loaded (any mutations do not persist).
-PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
-
-# @FUNCTION: filter_readonly_variables
-# @DESCRIPTION: [--filter-sandbox] [--allow-extra-vars]
-# Read an environment from stdin and echo to stdout while filtering variables
-# with names that are known to cause interference:
-#
-#   * some specific variables for which bash does not allow assignment
-#   * some specific variables that affect portage or sandbox behavior
-#   * variable names that begin with a digit or that contain any
-#     non-alphanumeric characters that are not be supported by bash
-#
-# --filter-sandbox causes all SANDBOX_* variables to be filtered, which
-# is only desired in certain cases, such as during preprocessing or when
-# saving environment.bz2 for a binary or installed package.
-#
-# --filter-features causes the special FEATURES variable to be filtered.
-# Generally, we want it to persist between phases since the user might
-# want to modify it via bashrc to enable things like splitdebug and
-# installsources for specific packages. They should be able to modify it
-# in pre_pkg_setup() and have it persist all the way through the install
-# phase. However, if FEATURES exist inside environment.bz2 then they
-# should be overridden by current settings.
-#
-# --filter-locale causes locale related variables such as LANG and LC_*
-# variables to be filtered. These variables should persist between phases,
-# in case they are modified by the ebuild. However, the current user
-# settings should be used when loading the environment from a binary or
-# installed package.
-#
-# --filter-path causes the PATH variable to be filtered. This variable
-# should persist between phases, in case it is modified by the ebuild.
-# However, old settings should be overridden when loading the
-# environment from a binary or installed package.
-#
-# ---allow-extra-vars causes some extra vars to be allowd through, such
-# as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
-#
-# In bash-3.2_p20+ an attempt to assign BASH_*, FUNCNAME, GROUPS or any
-# readonly variable cause the shell to exit while executing the "source"
-# builtin command. To avoid this problem, this function filters those
-# variables out and discards them. See bug #190128.
-filter_readonly_variables() {
-	local x filtered_vars
-	local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
-		FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-	local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
-		HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-		OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-		SECONDS SHELL SHLVL"
-	local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC
-		SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
-		SANDBOX_LOG SANDBOX_ON"
-	local misc_garbage_vars="_portage_filter_opts"
-	filtered_vars="$readonly_bash_vars $bash_misc_vars
-		$PORTAGE_READONLY_VARS $misc_garbage_vars"
-
-	# Don't filter/interfere with prefix variables unless they are
-	# supported by the current EAPI.
-	case "${EAPI:-0}" in
-		0|1|2)
-			;;
-		*)
-			filtered_vars+=" ED EPREFIX EROOT"
-			;;
-	esac
-
-	if has --filter-sandbox $* ; then
-		filtered_vars="${filtered_vars} SANDBOX_.*"
-	else
-		filtered_vars="${filtered_vars} ${filtered_sandbox_vars}"
-	fi
-	if has --filter-features $* ; then
-		filtered_vars="${filtered_vars} FEATURES PORTAGE_FEATURES"
-	fi
-	if has --filter-path $* ; then
-		filtered_vars+=" PATH"
-	fi
-	if has --filter-locale $* ; then
-		filtered_vars+=" LANG LC_ALL LC_COLLATE
-			LC_CTYPE LC_MESSAGES LC_MONETARY
-			LC_NUMERIC LC_PAPER LC_TIME"
-	fi
-	if ! has --allow-extra-vars $* ; then
-		filtered_vars="
-			${filtered_vars}
-			${PORTAGE_SAVED_READONLY_VARS}
-			${PORTAGE_MUTABLE_FILTERED_VARS}
-		"
-	fi
-
-	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
-}
-
-# @FUNCTION: preprocess_ebuild_env
-# @DESCRIPTION:
-# Filter any readonly variables from ${T}/environment, source it, and then
-# save it via save_ebuild_env(). This process should be sufficient to prevent
-# any stale variables or functions from an arbitrary environment from
-# interfering with the current environment. This is useful when an existing
-# environment needs to be loaded from a binary or installed package.
-preprocess_ebuild_env() {
-	local _portage_filter_opts="--filter-features --filter-locale --filter-path --filter-sandbox"
-
-	# If environment.raw is present, this is a signal from the python side,
-	# indicating that the environment may contain stale FEATURES and
-	# SANDBOX_{DENY,PREDICT,READ,WRITE} variables that should be filtered out.
-	# Otherwise, we don't need to filter the environment.
-	[ -f "${T}/environment.raw" ] || return 0
-
-	filter_readonly_variables $_portage_filter_opts < "${T}"/environment \
-		>> "$T/environment.filtered" || return $?
-	unset _portage_filter_opts
-	mv "${T}"/environment.filtered "${T}"/environment || return $?
-	rm -f "${T}/environment.success" || return $?
-	# WARNING: Code inside this subshell should avoid making assumptions
-	# about variables or functions after source "${T}"/environment has been
-	# called. Any variables that need to be relied upon should already be
-	# filtered out above.
-	(
-		export SANDBOX_ON=1
-		source "${T}/environment" || exit $?
-		# We have to temporarily disable sandbox since the
-		# SANDBOX_{DENY,READ,PREDICT,WRITE} values we've just loaded
-		# may be unusable (triggering in spurious sandbox violations)
-		# until we've merged them with our current values.
-		export SANDBOX_ON=0
-
-		# It's remotely possible that save_ebuild_env() has been overridden
-		# by the above source command. To protect ourselves, we override it
-		# here with our own version. ${PORTAGE_BIN_PATH} is safe to use here
-		# because it's already filtered above.
-		source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit $?
-
-		# Rely on save_ebuild_env() to filter out any remaining variables
-		# and functions that could interfere with the current environment.
-		save_ebuild_env || exit $?
-		>> "$T/environment.success" || exit $?
-	) > "${T}/environment.filtered"
-	local retval
-	if [ -e "${T}/environment.success" ] ; then
-		filter_readonly_variables --filter-features < \
-			"${T}/environment.filtered" > "${T}/environment"
-		retval=$?
-	else
-		retval=1
-	fi
-	rm -f "${T}"/environment.{filtered,raw,success}
-	return ${retval}
-}
-
 # === === === === === === === === === === === === === === === === === ===
 # === === === === === functions end, main part begins === === === === ===
-# === === === === === functions end, main part begins === === === === ===
-# === === === === === functions end, main part begins === === === === ===
 # === === === === === === === === === === === === === === === === === ===
 
 export SANDBOX_ON="1"
 export S=${WORKDIR}/${P}
 
-unset E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
-
 # Turn of extended glob matching so that g++ doesn't get incorrectly matched.
 shopt -u extglob
 

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 383253d..f1db257 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -2,6 +2,190 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+# Hardcoded bash lists are needed for backward compatibility with
+# <portage-2.1.4 since they assume that a newly installed version
+# of ebuild.sh will work for pkg_postinst, pkg_prerm, and pkg_postrm
+# when portage is upgrading itself.
+
+PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
+	EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
+	PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI"
+
+PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
+	EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \
+	PM_EBUILD_HOOK_DIR \
+	PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC  \
+	PORTAGE_BINPKG_FILE PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE \
+	PORTAGE_BIN_PATH PORTAGE_BUILDDIR PORTAGE_BUNZIP2_COMMAND \
+	PORTAGE_BZIP2_COMMAND PORTAGE_COLORMAP PORTAGE_CONFIGROOT \
+	PORTAGE_DEBUG PORTAGE_DEPCACHEDIR PORTAGE_EBUILD_EXIT_FILE \
+	PORTAGE_GID PORTAGE_GRPNAME PORTAGE_INST_GID PORTAGE_INST_UID \
+	PORTAGE_IPC_DAEMON PORTAGE_IUSE PORTAGE_LOG_FILE \
+	PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_PYM_PATH PORTAGE_PYTHON \
+	PORTAGE_READONLY_METADATA PORTAGE_READONLY_VARS \
+	PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_SANDBOX_COMPAT_LEVEL \
+	PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \
+	PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \
+	PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \
+	PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR"
+
+PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR"
+
+# Variables that portage sets but doesn't mark readonly.
+# In order to prevent changed values from causing unexpected
+# interference, they are filtered out of the environment when
+# it is saved or loaded (any mutations do not persist).
+PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
+
+# @FUNCTION: filter_readonly_variables
+# @DESCRIPTION: [--filter-sandbox] [--allow-extra-vars]
+# Read an environment from stdin and echo to stdout while filtering variables
+# with names that are known to cause interference:
+#
+#   * some specific variables for which bash does not allow assignment
+#   * some specific variables that affect portage or sandbox behavior
+#   * variable names that begin with a digit or that contain any
+#     non-alphanumeric characters that are not be supported by bash
+#
+# --filter-sandbox causes all SANDBOX_* variables to be filtered, which
+# is only desired in certain cases, such as during preprocessing or when
+# saving environment.bz2 for a binary or installed package.
+#
+# --filter-features causes the special FEATURES variable to be filtered.
+# Generally, we want it to persist between phases since the user might
+# want to modify it via bashrc to enable things like splitdebug and
+# installsources for specific packages. They should be able to modify it
+# in pre_pkg_setup() and have it persist all the way through the install
+# phase. However, if FEATURES exist inside environment.bz2 then they
+# should be overridden by current settings.
+#
+# --filter-locale causes locale related variables such as LANG and LC_*
+# variables to be filtered. These variables should persist between phases,
+# in case they are modified by the ebuild. However, the current user
+# settings should be used when loading the environment from a binary or
+# installed package.
+#
+# --filter-path causes the PATH variable to be filtered. This variable
+# should persist between phases, in case it is modified by the ebuild.
+# However, old settings should be overridden when loading the
+# environment from a binary or installed package.
+#
+# ---allow-extra-vars causes some extra vars to be allowd through, such
+# as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
+#
+# In bash-3.2_p20+ an attempt to assign BASH_*, FUNCNAME, GROUPS or any
+# readonly variable cause the shell to exit while executing the "source"
+# builtin command. To avoid this problem, this function filters those
+# variables out and discards them. See bug #190128.
+filter_readonly_variables() {
+	local x filtered_vars
+	local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
+		FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
+	local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
+		HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
+		OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
+		SECONDS SHELL SHLVL"
+	local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC
+		SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
+		SANDBOX_LOG SANDBOX_ON"
+	local misc_garbage_vars="_portage_filter_opts"
+	filtered_vars="$readonly_bash_vars $bash_misc_vars
+		$PORTAGE_READONLY_VARS $misc_garbage_vars"
+
+	# Don't filter/interfere with prefix variables unless they are
+	# supported by the current EAPI.
+	case "${EAPI:-0}" in
+		0|1|2)
+			;;
+		*)
+			filtered_vars+=" ED EPREFIX EROOT"
+			;;
+	esac
+
+	if has --filter-sandbox $* ; then
+		filtered_vars="${filtered_vars} SANDBOX_.*"
+	else
+		filtered_vars="${filtered_vars} ${filtered_sandbox_vars}"
+	fi
+	if has --filter-features $* ; then
+		filtered_vars="${filtered_vars} FEATURES PORTAGE_FEATURES"
+	fi
+	if has --filter-path $* ; then
+		filtered_vars+=" PATH"
+	fi
+	if has --filter-locale $* ; then
+		filtered_vars+=" LANG LC_ALL LC_COLLATE
+			LC_CTYPE LC_MESSAGES LC_MONETARY
+			LC_NUMERIC LC_PAPER LC_TIME"
+	fi
+	if ! has --allow-extra-vars $* ; then
+		filtered_vars="
+			${filtered_vars}
+			${PORTAGE_SAVED_READONLY_VARS}
+			${PORTAGE_MUTABLE_FILTERED_VARS}
+		"
+	fi
+
+	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
+}
+
+# @FUNCTION: preprocess_ebuild_env
+# @DESCRIPTION:
+# Filter any readonly variables from ${T}/environment, source it, and then
+# save it via save_ebuild_env(). This process should be sufficient to prevent
+# any stale variables or functions from an arbitrary environment from
+# interfering with the current environment. This is useful when an existing
+# environment needs to be loaded from a binary or installed package.
+preprocess_ebuild_env() {
+	local _portage_filter_opts="--filter-features --filter-locale --filter-path --filter-sandbox"
+
+	# If environment.raw is present, this is a signal from the python side,
+	# indicating that the environment may contain stale FEATURES and
+	# SANDBOX_{DENY,PREDICT,READ,WRITE} variables that should be filtered out.
+	# Otherwise, we don't need to filter the environment.
+	[ -f "${T}/environment.raw" ] || return 0
+
+	filter_readonly_variables $_portage_filter_opts < "${T}"/environment \
+		>> "$T/environment.filtered" || return $?
+	unset _portage_filter_opts
+	mv "${T}"/environment.filtered "${T}"/environment || return $?
+	rm -f "${T}/environment.success" || return $?
+	# WARNING: Code inside this subshell should avoid making assumptions
+	# about variables or functions after source "${T}"/environment has been
+	# called. Any variables that need to be relied upon should already be
+	# filtered out above.
+	(
+		export SANDBOX_ON=1
+		source "${T}/environment" || exit $?
+		# We have to temporarily disable sandbox since the
+		# SANDBOX_{DENY,READ,PREDICT,WRITE} values we've just loaded
+		# may be unusable (triggering in spurious sandbox violations)
+		# until we've merged them with our current values.
+		export SANDBOX_ON=0
+
+		# It's remotely possible that save_ebuild_env() has been overridden
+		# by the above source command. To protect ourselves, we override it
+		# here with our own version. ${PORTAGE_BIN_PATH} is safe to use here
+		# because it's already filtered above.
+		source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit $?
+
+		# Rely on save_ebuild_env() to filter out any remaining variables
+		# and functions that could interfere with the current environment.
+		save_ebuild_env || exit $?
+		>> "$T/environment.success" || exit $?
+	) > "${T}/environment.filtered"
+	local retval
+	if [ -e "${T}/environment.success" ] ; then
+		filter_readonly_variables --filter-features < \
+			"${T}/environment.filtered" > "${T}/environment"
+		retval=$?
+	else
+		retval=1
+	fi
+	rm -f "${T}"/environment.{filtered,raw,success}
+	return ${retval}
+}
+
 ebuild_phase() {
 	declare -F "$1" >/dev/null && qa_call $1
 }



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  0:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  0:16 UTC (permalink / raw
  To: gentoo-commits

commit:     bddd8215f278a61210a320bb05416020e28ac2c1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 00:16:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 00:16:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bddd8215

ebuild.sh: source *.sh at the top

---
 bin/ebuild.sh |   56 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d722ccc..42616d0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -5,6 +5,34 @@
 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
 PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
 
+# Prevent aliases from causing portage to act inappropriately.
+# Make sure it's before everything so we don't mess aliases that follow.
+unalias -a
+
+source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1
+
+if [[ $EBUILD_PHASE != depend ]] ; then
+	source "${PORTAGE_BIN_PATH}/phase-functions.sh" || die
+	source "${PORTAGE_BIN_PATH}/phase-helpers.sh" || die
+	source "${PORTAGE_BIN_PATH}/bashrc-functions.sh" || die
+else
+	# These dummy functions are for things that are likely to be called
+	# in global scope, even though they are completely useless during
+	# the "depend" phase.
+	for x in diropts docompress exeopts insopts \
+		keepdir libopts register_die_hook register_success_hook \
+		remove_path_entry set_unless_changed strip_duplicate_slashes \
+		unset_unless_changed use useq usev use_with use_enable ; do
+		eval "${x}() { : ; }"
+	done
+	# These functions die because calls to them during the "depend" phase
+	# are considered to be severe QA violations.
+	for x in best_version has_version portageq ; do
+		eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
+	done
+	unset x
+fi
+
 if [[ $PORTAGE_SANDBOX_COMPAT_LEVEL -lt 22 ]] ; then
 	# Ensure that /dev/std* streams have appropriate sandbox permission for
 	# bug #288863. This can be removed after sandbox is fixed and portage
@@ -67,15 +95,9 @@ EBUILD_SH_ARGS="$*"
 
 shift $#
 
-# Prevent aliases from causing portage to act inappropriately.
-# Make sure it's before everything so we don't mess aliases that follow.
-unalias -a
-
 # Unset some variables that break things.
 unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
 
-source "${PORTAGE_BIN_PATH}/isolated-functions.sh"  &>/dev/null
-
 [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
 
 # sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex)
@@ -434,28 +456,6 @@ fi
 export EBUILD_MASTER_PID=$BASHPID
 trap 'exit 1' SIGTERM
 
-if [[ $EBUILD_PHASE != depend ]] ; then
-	source "${PORTAGE_BIN_PATH}/phase-functions.sh"
-	source "${PORTAGE_BIN_PATH}/phase-helpers.sh"
-	source "${PORTAGE_BIN_PATH}/bashrc-functions.sh"
-else
-	# These dummy functions are for things that are likely to be called
-	# in global scope, even though they are completely useless during
-	# the "depend" phase.
-	for x in diropts docompress exeopts insopts \
-		keepdir libopts register_die_hook register_success_hook \
-		remove_path_entry set_unless_changed strip_duplicate_slashes \
-		unset_unless_changed use useq usev use_with use_enable ; do
-		eval "${x}() { : ; }"
-	done
-	# These functions die because calls to them during the "depend" phase
-	# are considered to be severe QA violations.
-	for x in best_version has_version portageq ; do
-		eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
-	done
-	unset x
-fi
-
 if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	[ -f "${T}"/environment ] ; then
 	# The environment may have been extracted from environment.bz2 or



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  0:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     29cc214d53c7babfa825c7a07cc8d58b4fe5da95
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 00:33:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 00:33:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=29cc214d

ebuild.sh: setup PATH earlier

This avoids "uname: command not found" messages from
isolated-functions.sh.

---
 bin/ebuild.sh |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 42616d0..1cb9269 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -5,6 +5,13 @@
 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
 PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
 
+ROOTPATH=${ROOTPATH##:}
+ROOTPATH=${ROOTPATH%%:}
+PREROOTPATH=${PREROOTPATH##:}
+PREROOTPATH=${PREROOTPATH%%:}
+PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
+export PATH
+
 # Prevent aliases from causing portage to act inappropriately.
 # Make sure it's before everything so we don't mess aliases that follow.
 unalias -a
@@ -47,13 +54,6 @@ fi
 # environment by modifying our PATH.
 unset BASH_ENV
 
-ROOTPATH=${ROOTPATH##:}
-ROOTPATH=${ROOTPATH%%:}
-PREROOTPATH=${PREROOTPATH##:}
-PREROOTPATH=${PREROOTPATH%%:}
-PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
-export PATH
-
 # This is just a temporary workaround for portage-9999 users since
 # earlier portage versions do not detect a version change in this case
 # (9999 to 9999) and therefore they try execute an incompatible version of



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  0:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  0:57 UTC (permalink / raw
  To: gentoo-commits

commit:     80737f32ff8bcebe327821243594d17bd4f79fdd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 00:56:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 00:56:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80737f32

isolated-functions.sh: split save-ebuild-env.sh

---
 bin/ebuild.sh             |    1 +
 bin/isolated-functions.sh |   91 --------------------------------------------
 bin/phase-functions.sh    |    2 +-
 bin/save-ebuild-env.sh    |   93 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 95 insertions(+), 92 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1cb9269..1d01416 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -20,6 +20,7 @@ source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1
 
 if [[ $EBUILD_PHASE != depend ]] ; then
 	source "${PORTAGE_BIN_PATH}/phase-functions.sh" || die
+	source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || die
 	source "${PORTAGE_BIN_PATH}/phase-helpers.sh" || die
 	source "${PORTAGE_BIN_PATH}/bashrc-functions.sh" || die
 else

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index c5adc0c..5247e7e 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -541,95 +541,4 @@ has() {
 	return 1
 }
 
-# @FUNCTION: save_ebuild_env
-# @DESCRIPTION:
-# echo the current environment to stdout, filtering out redundant info.
-#
-# --exclude-init-phases causes pkg_nofetch and src_* phase functions to
-# be excluded from the output. These function are not needed for installation
-# or removal of the packages, and can therefore be safely excluded.
-#
-save_ebuild_env() {
-	(
-
-		if has --exclude-init-phases $* ; then
-			unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
-			if [[ -n $PYTHONPATH ]] ; then
-				export PYTHONPATH=${PYTHONPATH/${PORTAGE_PYM_PATH}:}
-				[[ -z $PYTHONPATH ]] && unset PYTHONPATH
-			fi
-		fi
-
-		# misc variables inherited from the calling environment
-		unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \
-			TERM TERMCAP USER ftp_proxy http_proxy no_proxy
-
-		# other variables inherited from the calling environment
-		unset CVS_RSH ECHANGELOG_USER GPG_AGENT_INFO \
-		SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY
-
-		# CCACHE and DISTCC config
-		unset ${!CCACHE_*} ${!DISTCC_*}
-
-		# There's no need to bloat environment.bz2 with internally defined
-		# functions and variables, so filter them out if possible.
-
-		for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
-			src_compile src_test src_install pkg_preinst pkg_postinst \
-			pkg_prerm pkg_postrm ; do
-			unset -f default_$x _eapi{0,1,2,3,4}_$x
-		done
-		unset x
-
-		unset -f assert assert_sigpipe_ok dump_trace die diefunc \
-			quiet_mode vecho elog_base eqawarn elog \
-			esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
-			KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
-			has_phase_defined_up_to \
-			hasv hasq qa_source qa_call \
-			addread addwrite adddeny addpredict _sb_append_var \
-			use usev useq has_version portageq \
-			best_version use_with use_enable register_die_hook \
-			keepdir unpack strip_duplicate_slashes econf einstall \
-			dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
-			insopts diropts exeopts libopts docompress \
-			abort_handler abort_prepare abort_configure abort_compile \
-			abort_test abort_install dyn_prepare dyn_configure \
-			dyn_compile dyn_test dyn_install \
-			dyn_preinst dyn_help debug-print debug-print-function \
-			debug-print-section inherit EXPORT_FUNCTIONS remove_path_entry \
-			save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
-			set_unless_changed unset_unless_changed source_all_bashrcs \
-			ebuild_main ebuild_phase ebuild_phase_with_hooks \
-			_ebuild_arg_to_phase _ebuild_phase_funcs default \
-			_hasg _hasgq _unpack_tar \
-			${QA_INTERCEPTORS}
-
-		# portage config variables and variables set directly by portage
-		unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
-			DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
-			EBUILD_FORCE_TEST EBUILD_MASTER_PID \
-			ECLASS_DEPTH ENDCOL FAKEROOTKEY \
-			GOOD HILITE HOME \
-			LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \
-			NOCOLOR NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \
-			PORTAGE_BASHRCS_SOURCED PORTAGE_NONFATAL PORTAGE_QUIET \
-			PORTAGE_SANDBOX_DENY PORTAGE_SANDBOX_PREDICT \
-			PORTAGE_SANDBOX_READ PORTAGE_SANDBOX_WRITE PREROOTPATH \
-			QA_INTERCEPTORS \
-			RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL RC_INDENTATION  \
-			ROOT ROOTPATH RPMDIR TEMP TMP TMPDIR USE_EXPAND \
-			WARN XARGS _RC_GET_KV_CACHE
-
-		# user config variables
-		unset DOC_SYMLINKS_DIR INSTALL_MASK PKG_INSTALL_MASK
-
-		declare -p
-		declare -fp
-		if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-			export
-		fi
-	)
-}
-
 true

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index f1db257..164b309 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -167,7 +167,7 @@ preprocess_ebuild_env() {
 		# by the above source command. To protect ourselves, we override it
 		# here with our own version. ${PORTAGE_BIN_PATH} is safe to use here
 		# because it's already filtered above.
-		source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit $?
+		source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || exit $?
 
 		# Rely on save_ebuild_env() to filter out any remaining variables
 		# and functions that could interfere with the current environment.

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
new file mode 100644
index 0000000..3bb8255
--- /dev/null
+++ b/bin/save-ebuild-env.sh
@@ -0,0 +1,93 @@
+#!/bin/bash
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @FUNCTION: save_ebuild_env
+# @DESCRIPTION:
+# echo the current environment to stdout, filtering out redundant info.
+#
+# --exclude-init-phases causes pkg_nofetch and src_* phase functions to
+# be excluded from the output. These function are not needed for installation
+# or removal of the packages, and can therefore be safely excluded.
+#
+save_ebuild_env() {
+	(
+	if has --exclude-init-phases $* ; then
+		unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
+		if [[ -n $PYTHONPATH ]] ; then
+			export PYTHONPATH=${PYTHONPATH/${PORTAGE_PYM_PATH}:}
+			[[ -z $PYTHONPATH ]] && unset PYTHONPATH
+		fi
+	fi
+
+	# misc variables inherited from the calling environment
+	unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \
+		TERM TERMCAP USER ftp_proxy http_proxy no_proxy
+
+	# other variables inherited from the calling environment
+	unset CVS_RSH ECHANGELOG_USER GPG_AGENT_INFO \
+	SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY
+
+	# CCACHE and DISTCC config
+	unset ${!CCACHE_*} ${!DISTCC_*}
+
+	# There's no need to bloat environment.bz2 with internally defined
+	# functions and variables, so filter them out if possible.
+
+	for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
+		src_compile src_test src_install pkg_preinst pkg_postinst \
+		pkg_prerm pkg_postrm ; do
+		unset -f default_$x _eapi{0,1,2,3,4}_$x
+	done
+	unset x
+
+	unset -f assert assert_sigpipe_ok dump_trace die diefunc \
+		quiet_mode vecho elog_base eqawarn elog \
+		esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
+		KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
+		has_phase_defined_up_to \
+		hasv hasq qa_source qa_call \
+		addread addwrite adddeny addpredict _sb_append_var \
+		use usev useq has_version portageq \
+		best_version use_with use_enable register_die_hook \
+		keepdir unpack strip_duplicate_slashes econf einstall \
+		dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
+		insopts diropts exeopts libopts docompress \
+		abort_handler abort_prepare abort_configure abort_compile \
+		abort_test abort_install dyn_prepare dyn_configure \
+		dyn_compile dyn_test dyn_install \
+		dyn_preinst dyn_help debug-print debug-print-function \
+		debug-print-section inherit EXPORT_FUNCTIONS remove_path_entry \
+		save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
+		set_unless_changed unset_unless_changed source_all_bashrcs \
+		ebuild_main ebuild_phase ebuild_phase_with_hooks \
+		_ebuild_arg_to_phase _ebuild_phase_funcs default \
+		_hasg _hasgq _unpack_tar \
+		${QA_INTERCEPTORS}
+
+	# portage config variables and variables set directly by portage
+	unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
+		DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
+		EBUILD_FORCE_TEST EBUILD_MASTER_PID \
+		ECLASS_DEPTH ENDCOL FAKEROOTKEY \
+		GOOD HILITE HOME \
+		LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \
+		NOCOLOR NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \
+		PORTAGE_BASHRCS_SOURCED PORTAGE_NONFATAL PORTAGE_QUIET \
+		PORTAGE_SANDBOX_DENY PORTAGE_SANDBOX_PREDICT \
+		PORTAGE_SANDBOX_READ PORTAGE_SANDBOX_WRITE PREROOTPATH \
+		QA_INTERCEPTORS \
+		RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL RC_INDENTATION  \
+		ROOT ROOTPATH RPMDIR TEMP TMP TMPDIR USE_EXPAND \
+		WARN XARGS _RC_GET_KV_CACHE
+
+	# user config variables
+	unset DOC_SYMLINKS_DIR INSTALL_MASK PKG_INSTALL_MASK
+
+	declare -p
+	declare -fp
+	if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
+		export
+	fi
+	)
+}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  1:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  1:10 UTC (permalink / raw
  To: gentoo-commits

commit:     4463e4a87ec2835e1454bbe4f99e5b054aa12855
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 01:09:44 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 01:09:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4463e4a8

Move KV funcs to bashrc-functions.sh.

---
 bin/bashrc-functions.sh   |   51 +++++++++++++++++++++++++++++++++++++++++++++
 bin/ebuild.sh             |    5 ++-
 bin/isolated-functions.sh |   51 ---------------------------------------------
 3 files changed, 54 insertions(+), 53 deletions(-)

diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
index 91ff6d7..4da5585 100644
--- a/bin/bashrc-functions.sh
+++ b/bin/bashrc-functions.sh
@@ -87,3 +87,54 @@ unset_unless_changed() {
 		fi
 	done
 }
+
+KV_major() {
+	[[ -z $1 ]] && return 1
+
+	local KV=$@
+	echo "${KV%%.*}"
+}
+
+KV_minor() {
+	[[ -z $1 ]] && return 1
+
+	local KV=$@
+	KV=${KV#*.}
+	echo "${KV%%.*}"
+}
+
+KV_micro() {
+	[[ -z $1 ]] && return 1
+
+	local KV=$@
+	KV=${KV#*.*.}
+	echo "${KV%%[^[:digit:]]*}"
+}
+
+KV_to_int() {
+	[[ -z $1 ]] && return 1
+
+	local KV_MAJOR=$(KV_major "$1")
+	local KV_MINOR=$(KV_minor "$1")
+	local KV_MICRO=$(KV_micro "$1")
+	local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
+
+	# We make version 2.2.0 the minimum version we will handle as
+	# a sanity check ... if its less, we fail ...
+	if [[ ${KV_int} -ge 131584 ]] ; then
+		echo "${KV_int}"
+		return 0
+	fi
+
+	return 1
+}
+
+_RC_GET_KV_CACHE=""
+get_KV() {
+	[[ -z ${_RC_GET_KV_CACHE} ]] \
+		&& _RC_GET_KV_CACHE=$(uname -r)
+
+	echo $(KV_to_int "${_RC_GET_KV_CACHE}")
+
+	return $?
+}

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1d01416..641d827 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -27,8 +27,9 @@ else
 	# These dummy functions are for things that are likely to be called
 	# in global scope, even though they are completely useless during
 	# the "depend" phase.
-	for x in diropts docompress exeopts insopts \
-		keepdir libopts register_die_hook register_success_hook \
+	for x in diropts docompress exeopts get_KV insopts \
+		keepdir KV_major KV_micro KV_minor KV_to_int \
+		libopts register_die_hook register_success_hook \
 		remove_path_entry set_unless_changed strip_duplicate_slashes \
 		unset_unless_changed use useq usev use_with use_enable ; do
 		eval "${x}() { : ; }"

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5247e7e..dbd653c 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -397,57 +397,6 @@ eend() {
 	return ${retval}
 }
 
-KV_major() {
-	[[ -z $1 ]] && return 1
-
-	local KV=$@
-	echo "${KV%%.*}"
-}
-
-KV_minor() {
-	[[ -z $1 ]] && return 1
-
-	local KV=$@
-	KV=${KV#*.}
-	echo "${KV%%.*}"
-}
-
-KV_micro() {
-	[[ -z $1 ]] && return 1
-
-	local KV=$@
-	KV=${KV#*.*.}
-	echo "${KV%%[^[:digit:]]*}"
-}
-
-KV_to_int() {
-	[[ -z $1 ]] && return 1
-
-	local KV_MAJOR=$(KV_major "$1")
-	local KV_MINOR=$(KV_minor "$1")
-	local KV_MICRO=$(KV_micro "$1")
-	local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
-
-	# We make version 2.2.0 the minimum version we will handle as
-	# a sanity check ... if its less, we fail ...
-	if [[ ${KV_int} -ge 131584 ]] ; then
-		echo "${KV_int}"
-		return 0
-	fi
-
-	return 1
-}
-
-_RC_GET_KV_CACHE=""
-get_KV() {
-	[[ -z ${_RC_GET_KV_CACHE} ]] \
-		&& _RC_GET_KV_CACHE=$(uname -r)
-
-	echo $(KV_to_int "${_RC_GET_KV_CACHE}")
-
-	return $?
-}
-
 unset_colors() {
 	COLS=80
 	ENDCOL=



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  1:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  1:25 UTC (permalink / raw
  To: gentoo-commits

commit:     20b0fdd6910d094b829a16c54a97f8d2900e00de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 01:24:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 01:24:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=20b0fdd6

isolated-functions.sh: skip set_colors for depend

This avoids an unneeded stty call.

---
 bin/isolated-functions.sh |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index dbd653c..733795a 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -434,14 +434,19 @@ RC_INDENTATION=''
 RC_DEFAULT_INDENT=2
 RC_DOT_PATTERN=''
 
-case "${NOCOLOR:-false}" in
-	yes|true)
-		unset_colors
-		;;
-	no|false)
-		set_colors
-		;;
-esac
+if [[ $EBUILD_PHASE == depend ]] ; then
+	# avoid unneeded stty call in set_colors during "depend" phase
+	unset_colors
+else
+	case "${NOCOLOR:-false}" in
+		yes|true)
+			unset_colors
+			;;
+		no|false)
+			set_colors
+			;;
+	esac
+fi
 
 if [[ -z ${USERLAND} ]] ; then
 	case $(uname -s) in



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12  3:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12  3:06 UTC (permalink / raw
  To: gentoo-commits

commit:     9fd712873f8f974089bbd4ab43f3ff4bd3308aa9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 03:06:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 03:06:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9fd71287

save-ebuild-env.sh: tweak PYTHONPATH cleansing

---
 bin/save-ebuild-env.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 3bb8255..a84a125 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -14,9 +14,13 @@ save_ebuild_env() {
 	(
 	if has --exclude-init-phases $* ; then
 		unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
-		if [[ -n $PYTHONPATH ]] ; then
-			export PYTHONPATH=${PYTHONPATH/${PORTAGE_PYM_PATH}:}
-			[[ -z $PYTHONPATH ]] && unset PYTHONPATH
+		if [[ -n $PYTHONPATH &&
+			${PYTHONPATH%%:*} -ef $PORTAGE_PYM_PATH ]] ; then
+			if [[ $PYTHONPATH == *:* ]] ; then
+				export PYTHONPATH=${PYTHONPATH#*:}
+			else
+				unset PYTHONPATH
+			fi
 		fi
 	fi
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-12 20:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-12 20:43 UTC (permalink / raw
  To: gentoo-commits

commit:     9116d2b8a7b553e4d445f0d9329a28aa54dfd1ef
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 20:37:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 20:37:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9116d2b8

ebuild.sh: make use* return false for "depend"

This ensures that `use multislot` is false for the "depend" phase.

---
 bin/ebuild.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 641d827..7b77c10 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -31,9 +31,14 @@ else
 		keepdir KV_major KV_micro KV_minor KV_to_int \
 		libopts register_die_hook register_success_hook \
 		remove_path_entry set_unless_changed strip_duplicate_slashes \
-		unset_unless_changed use useq usev use_with use_enable ; do
+		unset_unless_changed use_with use_enable ; do
 		eval "${x}() { : ; }"
 	done
+	# These dummy functions return false, in order to ensure that
+	# `use multislot` is false for the "depend" phase.
+	for x in use useq usev ; do
+		eval "${x}() { return 1; }"
+	done
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
 	for x in best_version has_version portageq ; do



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-13  3:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-13  3:20 UTC (permalink / raw
  To: gentoo-commits

commit:     677240f7b3db66bdcd403c214e5d3fa30e31a24a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 13 03:20:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 13 03:20:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=677240f7

repoman: don't sign thin manifests

Thin manifests imply reliance on the VCS for file integrity,
which implies that manifest signatures are not needed.

---
 bin/repoman |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 3462f93..38b3273 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -592,6 +592,12 @@ repo_info = portdb._repo_info[portdir_overlay]
 portdb.porttrees = list(repo_info.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 
+# Thin manifests imply reliance on the VCS for file integrity,
+# which implies that manifest signatures are not needed.
+sign_manifests = "sign" in repoman_settings.features and not \
+	repoman_settings.repositories.get_repo_for_location(
+	portdir_overlay).thin_manifest
+
 # Generate an appropriate PORTDIR_OVERLAY value for passing into the
 # profile-specific config constructor calls.
 env = os.environ.copy()
@@ -2402,7 +2408,7 @@ else:
 
 	if vcs in ('cvs', 'svn') and (myupdates or myremoved):
 		myfiles = myupdates + myremoved
-		if not myheaders and "sign" not in repoman_settings.features:
+		if not myheaders and not sign_manifests:
 			myfiles += mymanifests
 		fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
 		mymsg = os.fdopen(fd, "wb")
@@ -2548,7 +2554,7 @@ else:
 			sys.exit(1)
 
 		# Force an unsigned commit when more than one Manifest needs to be signed.
-		if repolevel < 3 and "sign" in repoman_settings.features:
+		if repolevel < 3 and sign_manifests:
 
 			fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
 			mymsg = os.fdopen(fd, "wb")
@@ -2581,7 +2587,7 @@ else:
 			manifest_commit_required = False
 
 	signed = False
-	if "sign" in repoman_settings.features:
+	if sign_manifests:
 		signed = True
 		myfiles = myupdates + myremoved + mymanifests
 		try:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-13  4:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-13  4:57 UTC (permalink / raw
  To: gentoo-commits

commit:     7bd285079a6b66fbf7548d040af800ce0b51f0ae
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 13 04:56:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 13 04:56:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7bd28507

ebuild(1): avoid "Location not set for repo" msgs

When overriding PORTDIR_OVERLAY, we can avoid "Location not set for
repository" messages if we include the original PORTDIR_OVERLAY paths
in the overridden setting.

---
 bin/ebuild |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 92105bb..1408dd3 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -134,13 +134,19 @@ vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 # Make sure that portdb.findname() returns the correct ebuild.
 if ebuild_portdir != vdb_path and \
 	ebuild_portdir not in portage.portdb.porttrees:
+	portdir_overlay = os.environ.get("PORTDIR_OVERLAY")
+	if portdir_overlay is None:
+		portdir_overlay = portage.settings.get("PORTDIR_OVERLAY")
+	if portdir_overlay is None:
+		portdir_overlay = ""
 	if sys.hexversion >= 0x3000000:
 		os.environ["PORTDIR_OVERLAY"] = \
-			os.environ.get("PORTDIR_OVERLAY","") + \
+			portdir_overlay + \
 			" " + _shell_quote(ebuild_portdir)
 	else:
 		os.environ["PORTDIR_OVERLAY"] = \
-			os.environ.get("PORTDIR_OVERLAY","") + \
+			_unicode_encode(portdir_overlay,
+			encoding=_encodings['content'], errors='strict') + \
 			" " + _unicode_encode(_shell_quote(ebuild_portdir),
 			encoding=_encodings['content'], errors='strict')
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-13  5:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-13  5:22 UTC (permalink / raw
  To: gentoo-commits

commit:     c646a13990bc1267ab5f557d72f3c02c08be82ad
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 13 05:22:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 13 05:22:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c646a139

ebuild(1): remove unneeded porttrees modification

This code should be unnecessary, as long as the repo is correctly
identified for all calls to portdbapi methods like aux_get and
findname. Notably, config.setcpv() must be called with a Package
instance in order to ensure that it gets the metadata from the correct
repository.

---
 bin/ebuild |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 1408dd3..95f4e15 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -153,14 +153,9 @@ if ebuild_portdir != vdb_path and \
 	print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir)
 	imp.reload(portage)
 
-# Constrain eclass resolution to the master(s)
-# that are specified in layout.conf (using an
-# approach similar to repoman's).
 myrepo = None
 if ebuild_portdir != vdb_path:
 	myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
-	repo_info = portage.portdb._repo_info[ebuild_portdir]
-	portage.portdb.porttrees = list(repo_info.eclass_db.porttrees)
 
 if not os.path.exists(ebuild):
 	print("'%s' does not exist." % ebuild)
@@ -282,7 +277,10 @@ pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv,
 
 # Apply package.env and repo-level settings. This allows per-package
 # FEATURES and other variables (possibly PORTAGE_TMPDIR) to be
-# available as soon as possible.
+# available as soon as possible. Also, note that the only way to ensure
+# that setcpv gets metadata from the correct repository is to pass in
+# a Package instance, as we do here (previously we had to modify
+# portdb.porttrees in order to accomplish this).
 tmpsettings.setcpv(pkg)
 
 def stale_env_warning():



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-14 16:11 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-14 16:11 UTC (permalink / raw
  To: gentoo-commits

commit:     c1eb8e75ba4cb192607a896ad7b72bf8b525740a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 16:08:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 16:08:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c1eb8e75

repoman: fix KeyError from digestgen with symlink

---
 bin/repoman |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index e0cdf6e..2180f64 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -648,6 +648,13 @@ for x in range(0, repolevel - 1):
 	repodir = os.path.dirname(repodir)
 repodir = os.path.realpath(repodir)
 
+# Make startdir relative to the cannonical repodir, so that we can pass
+# it to digestgen and it won't have to be cannonicalized again.
+if repolevel == 1:
+	startdir = repodir
+else:
+	startdir = os.path.join(repodir, *startdir.split(os.sep)[-2-repolevel+3:])
+
 def caterror(mycat):
 	err(mycat+" is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-14 18:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-14 18:40 UTC (permalink / raw
  To: gentoo-commits

commit:     280f10d42a8fbfe3b4b34eb18e6ea5f8dd3ff484
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 18:34:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 18:34:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=280f10d4

repoman: use the repodir variable more

---
 bin/repoman |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 2180f64..3189797 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -587,8 +587,8 @@ portdb = trees[root]['porttree'].dbapi
 
 # Constrain dependency resolution to the master(s)
 # that are specified in layout.conf.
-portdir_overlay = os.path.realpath(portdir_overlay)
-repo_info = portdb._repo_info[portdir_overlay]
+repodir = os.path.realpath(portdir_overlay)
+repo_info = portdb._repo_info[repodir]
 portdb.porttrees = list(repo_info.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 
@@ -598,7 +598,7 @@ portdir = portdb.porttrees[0]
 # thin-manifests is designed to prevent.
 sign_manifests = "sign" in repoman_settings.features and \
 	repoman_settings.repositories.get_repo_for_location(
-	portdir_overlay).sign_manifest
+	repodir).sign_manifest
 
 # Generate an appropriate PORTDIR_OVERLAY value for passing into the
 # profile-specific config constructor calls.
@@ -642,17 +642,12 @@ if options.mode == 'commit' and repolevel not in [1,2,3]:
 	print(red("***"))
 	err("Unable to identify level we're commiting from for %s" % '/'.join(reposplit))
 
-startdir = normalize_path(mydir)
-repodir = startdir
-for x in range(0, repolevel - 1):
-	repodir = os.path.dirname(repodir)
-repodir = os.path.realpath(repodir)
-
 # Make startdir relative to the cannonical repodir, so that we can pass
 # it to digestgen and it won't have to be cannonicalized again.
 if repolevel == 1:
 	startdir = repodir
 else:
+	startdir = normalize_path(mydir)
 	startdir = os.path.join(repodir, *startdir.split(os.sep)[-2-repolevel+3:])
 
 def caterror(mycat):



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-14 20:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-14 20:23 UTC (permalink / raw
  To: gentoo-commits

commit:     630996d8ea9dcdb429e56fa55b966c47a2dff433
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 20:23:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 20:23:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=630996d8

repoman: use repodir more

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 3189797..65ac634 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -615,7 +615,7 @@ logging.info('PORTDIR_OVERLAY = "%s"' % env['PORTDIR_OVERLAY'])
 env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
 
 categories = []
-for path in set([portdir, portdir_overlay]):
+for path in set([portdir, repodir]):
 	categories.extend(portage.util.grabfile(
 		os.path.join(path, 'profiles', 'categories')))
 repoman_settings.categories = tuple(sorted(



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-17  4:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-17  4:09 UTC (permalink / raw
  To: gentoo-commits

commit:     4242e2ce17105cd9a55ee8027c2be795b7c6e91e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 17 04:09:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 17 04:09:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4242e2ce

repoman: quote paths in PORTDIR_OVERLAY

This will fix bug #383269.

---
 bin/repoman |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index b95fc03..7532a99 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -572,7 +572,8 @@ if options.mode == 'commit' and not options.pretend and not vcs:
 # Ensure that PORTDIR_OVERLAY contains the repository corresponding to $PWD.
 repoman_settings = portage.config(local_config=False, _eprefix=eprefix)
 repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
-	(repoman_settings.get('PORTDIR_OVERLAY', ''), portdir_overlay)
+	(repoman_settings.get('PORTDIR_OVERLAY', ''),
+	portage._shell_quote(portdir_overlay))
 # We have to call the config constructor again so
 # that config.repositories is initialized correctly.
 repoman_settings = portage.config(local_config=False, _eprefix=eprefix,



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-17 17:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-17 17:34 UTC (permalink / raw
  To: gentoo-commits

commit:     3a4ca2531dfa7cd9dabcbf2ccfec1d977aef7f49
Author:     Alon Bar-Lev <alon.barlev <AT> gmail <DOT> com>
AuthorDate: Sat Sep 17 17:32:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 17 17:32:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3a4ca253

emerge-webrsync: exit if "gpg binary not found"

This prevents an endless loop (bug #383375).

---
 bin/emerge-webrsync |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index d933871..60e6118 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -157,6 +157,7 @@ check_file_signature() {
 			gpg --homedir "${PORTAGE_GPG_DIR}" --verify "$signature" "$file" && r=0
 		else
 			eecho "cannot check signature: gpg binary not found"
+			exit 1
 		fi
 	else
 		r=0



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-18 20:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-18 20:41 UTC (permalink / raw
  To: gentoo-commits

commit:     62da1be30a7b9a9d550e63a18f0c6736f0801b59
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 18 20:41:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 18 20:41:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62da1be3

install_qa_check: adjust "poor programming" msgs

Refer to "severe warnings" rather than "poor programming", in order to
be more politically correct, as discussed in bug #374233.

---
 bin/misc-functions.sh |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 8c191ff..30244a7 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -621,8 +621,8 @@ install_qa_check() {
 				#esac
 				if [[ $always_overflow = yes ]] ; then
 					eerror
-					eerror "QA Notice: Package has poor programming practices which may compile"
-					eerror "           fine but exhibit random runtime failures."
+					eerror "QA Notice: Package triggers severe warnings which indicate that it"
+					eerror "           may exhibit random runtime failures."
 					eerror
 					eerror "${f}"
 					eerror
@@ -631,8 +631,8 @@ install_qa_check() {
 					eerror
 				else
 					vecho -ne '\n'
-					eqawarn "QA Notice: Package has poor programming practices which may compile"
-					eqawarn "           fine but exhibit random runtime failures."
+					eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
+					eqawarn "           may exhibit random runtime failures."
 					eqawarn "${f}"
 					vecho -ne '\n'
 				fi
@@ -658,8 +658,8 @@ install_qa_check() {
 
 			if [[ $gentoo_bug = yes ]] ; then
 				eerror
-				eerror "QA Notice: Package has poor programming practices which may compile"
-				eerror "           but will almost certainly crash on 64bit architectures."
+				eerror "QA Notice: Package triggers severe warnings which indicate that it"
+				eerror "           will almost certainly crash on 64bit architectures."
 				eerror
 				eerror "${f}"
 				eerror
@@ -668,8 +668,8 @@ install_qa_check() {
 				eerror
 			else
 				vecho -ne '\n'
-				eqawarn "QA Notice: Package has poor programming practices which may compile"
-				eqawarn "           but will almost certainly crash on 64bit architectures."
+				eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
+				eqawarn "           will almost certainly crash on 64bit architectures."
 				eqawarn "${f}"
 				vecho -ne '\n'
 			fi
@@ -678,7 +678,7 @@ install_qa_check() {
 		if [[ ${abort} == "yes" ]] ; then
 			if [[ $gentoo_bug = yes || $always_overflow = yes ]] ; then
 				die "install aborted due to" \
-					"poor programming practices shown above"
+					"severe warnings shown above"
 			else
 				echo "Please do not file a Gentoo bug and instead" \
 				"report the above QA issues directly to the upstream" \
@@ -686,7 +686,7 @@ install_qa_check() {
 				while read -r line ; do eqawarn "${line}" ; done
 				eqawarn "Homepage: ${HOMEPAGE}"
 				has stricter ${FEATURES} && die "install aborted due to" \
-					"poor programming practices shown above"
+					"severe warnings shown above"
 			fi
 		fi
 	fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-19  3:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-19  3:18 UTC (permalink / raw
  To: gentoo-commits

commit:     343418c4cbd1c0dbf65583adeab618db09efea6c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 19 03:17:44 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 03:17:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=343418c4

bin/ebuild: simplify PORTDIR_OVERLAY query

There's no need to query os.environ here, because portage.settings
will inherit the value automatically.

---
 bin/ebuild |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index f47975a..1cbdb2d 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -134,11 +134,7 @@ vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 # Make sure that portdb.findname() returns the correct ebuild.
 if ebuild_portdir != vdb_path and \
 	ebuild_portdir not in portage.portdb.porttrees:
-	portdir_overlay = os.environ.get("PORTDIR_OVERLAY")
-	if portdir_overlay is None:
-		portdir_overlay = portage.settings.get("PORTDIR_OVERLAY")
-	if portdir_overlay is None:
-		portdir_overlay = ""
+	portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "")
 	if sys.hexversion >= 0x3000000:
 		os.environ["PORTDIR_OVERLAY"] = \
 			portdir_overlay + \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-22 23:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-22 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     c157d3b4ce32573263676c48659fd8fbe1cf122f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 23:52:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 23:52:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c157d3b4

portageq best_visible: multi-repo support

This will fix bug #384063.

---
 bin/portageq |   46 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 57a7c39..3ae29d1 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -48,6 +48,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 	'_emerge.Package:Package',
 	'_emerge.RootConfig:RootConfig',
 	'portage.dbapi._expand_new_virt:expand_new_virt',
+	'portage._sets.base:InternalPackageSet',
 )
 
 def eval_atom_use(atom):
@@ -462,19 +463,40 @@ def best_visible(argv):
 	root_config = RootConfig(portage.settings,
 		portage.db[portage.settings["ROOT"]], None)
 
-	try:
+	if hasattr(db, "xmatch"):
+		cpv_list = db.xmatch("match-all", atom)
+	else:
+		cpv_list = db.match(atom)
+
+	if cpv_list:
 		# reversed, for descending order
-		for cpv in reversed(db.match(atom)):
-			metadata = dict(zip(Package.metadata_keys,
-				db.aux_get(cpv, Package.metadata_keys, myrepo=atom.repo)))
-			pkg = Package(built=(pkgtype != "ebuild"), cpv=cpv,
-				installed=(pkgtype=="installed"), metadata=metadata,
-				root_config=root_config, type_name=pkgtype)
-			if pkg.visible:
-				writemsg_stdout("%s\n" % (pkg.cpv,), noiselevel=-1)
-				return os.EX_OK
-	except KeyError:
-		pass
+		cpv_list.reverse()
+		# verify match, since the atom may match the package
+		# for a given cpv from one repo but not another
+		atom_set = InternalPackageSet(initial_atoms=(atom,))
+
+		if atom.repo is None and hasattr(db, "getRepositories"):
+			repo_list = db.getRepositories()
+		else:
+			repo_list = [atom.repo]
+
+		for cpv in cpv_list:
+			for repo in repo_list:
+				try:
+					metadata = dict(zip(Package.metadata_keys,
+						db.aux_get(cpv, Package.metadata_keys, myrepo=repo)))
+				except KeyError:
+					continue
+				pkg = Package(built=(pkgtype != "ebuild"), cpv=cpv,
+					installed=(pkgtype=="installed"), metadata=metadata,
+					root_config=root_config, type_name=pkgtype)
+				if not atom_set.findAtomForPackage(pkg):
+					continue
+
+				if pkg.visible:
+					writemsg_stdout("%s\n" % (pkg.cpv,), noiselevel=-1)
+					return os.EX_OK
+
 	return 1
 best_visible.uses_root = True
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-23  3:26 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-09-23  3:26 UTC (permalink / raw
  To: gentoo-commits

commit:     13660734e81a8d35c7204fe05fb26068ad7bd19f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Fri Sep 23 03:23:01 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 03:23:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=13660734

Fix 'shopt: +s: invalid shell option name' error.

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 7d858a2..a54ce2b 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -996,7 +996,7 @@ install_hooks() {
 			ret=$(( $ret | $? ))
 		fi
 	done
-	shopt +s nullglob
+	shopt -u nullglob
 	return $ret
 }
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-23 17:15 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-23 17:15 UTC (permalink / raw
  To: gentoo-commits

commit:     dd7c57ecb90949ce3306394cfe262566b87351ca
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 17:12:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 17:15:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd7c57ec

unpack: handle non-gz files from deb2targz

This will fix bug #384147.

---
 bin/phase-helpers.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a033fa8..ab597ff 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -340,7 +340,11 @@ unpack() {
 						# doesn't inadvertently install it.
 						rm -f "$y"
 					fi
-					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
+					local tarfile
+					for tarfile in "${y%.deb}".tar.* ; do
+						mv -f "${tarfile}" data.tar.${tarfile##*.} || \
+							die "$myfail"
+					done
 				else
 					ar x "$srcdir$x" || die "$myfail"
 				fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-23 17:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-23 17:47 UTC (permalink / raw
  To: gentoo-commits

commit:     6f4a5ef478b76ac24e6cd54a38728415fe852277
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 17:46:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 17:46:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6f4a5ef4

Revert "unpack: handle non-gz files from deb2targz"

This reverts commit dd7c57ecb90949ce3306394cfe262566b87351ca.
We'll do this in a new EAPI, as discussed in bug #384147.

---
 bin/phase-helpers.sh |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ab597ff..a033fa8 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -340,11 +340,7 @@ unpack() {
 						# doesn't inadvertently install it.
 						rm -f "$y"
 					fi
-					local tarfile
-					for tarfile in "${y%.deb}".tar.* ; do
-						mv -f "${tarfile}" data.tar.${tarfile##*.} || \
-							die "$myfail"
-					done
+					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
 				else
 					ar x "$srcdir$x" || die "$myfail"
 				fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-23 18:36 Fabian Groffen
  0 siblings, 0 replies; 881+ messages in thread
From: Fabian Groffen @ 2011-09-23 18:36 UTC (permalink / raw
  To: gentoo-commits

commit:     ed9982d781a81651db0480af128a6509eafe358a
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 18:35:29 2011 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 18:35:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ed9982d7

install_hooks: fix variable name for PORTAGE_CONFIGROOT

in addition, omit the leading slash, since PORTAGE_CONFIGROOT contains a
trailing slash

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index a54ce2b..882d171 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -986,7 +986,7 @@ success_hooks() {
 }
 
 install_hooks() {
-	local hooks_dir="${PORTAGE_CONFIG_ROOT}/etc/portage/hooks/install"
+	local hooks_dir="${PORTAGE_CONFIGROOT}etc/portage/hooks/install"
 	local fp
 	local ret=0
 	shopt -s nullglob



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-23 21:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-23 21:00 UTC (permalink / raw
  To: gentoo-commits

commit:     9e17de9a9cbd412760b761b4362175939fd4b13d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 21:00:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 21:00:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e17de9a

portageq best_visible: use match-all-cpv-only

---
 bin/portageq |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 3ae29d1..b416b66 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -464,7 +464,7 @@ def best_visible(argv):
 		portage.db[portage.settings["ROOT"]], None)
 
 	if hasattr(db, "xmatch"):
-		cpv_list = db.xmatch("match-all", atom)
+		cpv_list = db.xmatch("match-all-cpv-only", atom)
 	else:
 		cpv_list = db.match(atom)
 
@@ -472,7 +472,9 @@ def best_visible(argv):
 		# reversed, for descending order
 		cpv_list.reverse()
 		# verify match, since the atom may match the package
-		# for a given cpv from one repo but not another
+		# for a given cpv from one repo but not another, and
+		# we can use match-all-cpv-only to avoid redundant
+		# metadata access.
 		atom_set = InternalPackageSet(initial_atoms=(atom,))
 
 		if atom.repo is None and hasattr(db, "getRepositories"):



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-28 13:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-28 13:51 UTC (permalink / raw
  To: gentoo-commits

commit:     6ec1972b43512356f988fa23aa33c86b3629d16e
Author:     Ruggero Morsucci <morse <AT> supercomputing <DOT> univpm <DOT> it>
AuthorDate: Wed Sep 28 13:50:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 28 13:50:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6ec1972b

archive-conf: dispatch_conf import bug #384665

---
 bin/archive-conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index 5a03b85..7978668 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -20,7 +20,7 @@ except ImportError:
     import portage
 
 from portage import os
-import dispatch_conf
+from portage import dispatch_conf
 
 FIND_EXTANT_CONTENTS  = "find %s -name CONTENTS"
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-29  0:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-29  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     0b12491de238eb6fb66a42019d8c83c59f0ad684
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 00:36:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 00:36:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b12491d

dispatch-conf: tweak pager basename comparison

---
 bin/dispatch-conf |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 55d7f13..9f245d5 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -104,12 +104,13 @@ class dispatch:
             if pager is None or not cmd_var_is_valid(pager):
                 pager = "cat"
 
-        if os.path.basename(pager) == "less":
+        pager_basename = os.path.basename(portage.util.shlex_split(pager)[0])
+        if pager_basename == "less":
             less_opts = self.options.get("less-opts")
             if less_opts is not None and less_opts.strip():
                 pager += " " + less_opts
 
-        if os.path.basename(portage.util.shlex_split(pager)[0]) == "cat":
+        if pager_basename == "cat":
             pager = ""
         else:
             pager = " | " + pager



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-09-29 16:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-09-29 16:49 UTC (permalink / raw
  To: gentoo-commits

commit:     a24bcfcfad95fcf4b71064e386fb6272f41ff49a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 16:48:55 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 16:48:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a24bcfcf

repoman: never force unsigned manifest commit

This removes a special case where manifests would first be commited
without signatures for category-level or greater commits. This case
behavior wasn't very useful anyway, and would be a problem if the
unsigned manifests got rejected by a commit hook (as may happen in the
near future).

---
 bin/repoman |   33 ---------------------------------
 1 files changed, 0 insertions(+), 33 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 184c5ef..20f4b15 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2557,39 +2557,6 @@ else:
 			print(red("I'm confused... I don't know where I am!"))
 			sys.exit(1)
 
-		# Force an unsigned commit when more than one Manifest needs to be signed.
-		if repolevel < 3 and sign_manifests:
-
-			fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
-			mymsg = os.fdopen(fd, "wb")
-			mymsg.write(_unicode_encode(commitmessage))
-			mymsg.write(b"\n (Unsigned Manifest commit)")
-			mymsg.close()
-
-			commit_cmd = [vcs]
-			commit_cmd.extend(vcs_global_opts)
-			commit_cmd.append("commit")
-			commit_cmd.extend(vcs_local_opts)
-			commit_cmd.extend(["-F", commitmessagefile])
-			commit_cmd.extend(f.lstrip("./") for f in mymanifests)
-
-			try:
-				if options.pretend:
-					print("(%s)" % (" ".join(commit_cmd),))
-				else:
-					retval = spawn(commit_cmd, env=os.environ)
-					if retval:
-						writemsg_level(("!!! Exiting on %s (shell) " + \
-							"error code: %s\n") % (vcs, retval),
-							level=logging.ERROR, noiselevel=-1)
-						sys.exit(retval)
-			finally:
-				try:
-					os.unlink(commitmessagefile)
-				except OSError:
-					pass
-			manifest_commit_required = False
-
 	signed = False
 	if sign_manifests:
 		signed = True



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-02  0:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-02  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     fcba9794d9d377cafc60679fc800e3f5a5b506d7
Author:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  2 00:34:14 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  2 00:34:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fcba9794

dispatch-conf: fix replace-wscomments pattern

This will fix bug #375613.

---
 bin/dispatch-conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 9f245d5..3089329 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -33,7 +33,7 @@ from portage.process import find_binary
 FIND_EXTANT_CONFIGS  = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname '.*.bak' -print"
 DIFF_CONTENTS        = "diff -Nu '%s' '%s'"
 DIFF_CVS_INTERP      = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'"
-DIFF_WSCOMMENTS      = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'"
+DIFF_WSCOMMENTS      = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][[:space:]]*$'"
 
 # We need a secure scratch dir and python does silly verbose errors on the use of tempnam
 oldmask = os.umask(0o077)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-03 10:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-03 10:02 UTC (permalink / raw
  To: gentoo-commits

commit:     7b537c443c83b7ad297d4a027d902d8459a75490
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  3 10:02:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct  3 10:02:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7b537c44

repoman: account for GLEP 59 in RMD160 check

---
 bin/repoman |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 20f4b15..711fce9 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -20,6 +20,7 @@ import signal
 import stat
 import sys
 import tempfile
+import textwrap
 import time
 import platform
 
@@ -547,24 +548,6 @@ if vcs_global_opts is None:
 		vcs_global_opts = ""
 vcs_global_opts = vcs_global_opts.split()
 
-if vcs == "cvs" and \
-	"commit" == options.mode and \
-	"RMD160" not in portage.checksum.hashorigin_map:
-	from portage.util import grablines
-	repo_lines = grablines("./CVS/Repository")
-	if repo_lines and \
-		"gentoo-x86" == repo_lines[0].strip().split(os.path.sep)[0]:
-		msg = "Please install " \
-		"pycrypto or enable python's ssl USE flag in order " \
-		"to enable RMD160 hash support. See bug #198398 for " \
-		"more information."
-		prefix = bad(" * ")
-		from textwrap import wrap
-		for line in wrap(msg, 70):
-			print(prefix + line)
-		sys.exit(1)
-	del repo_lines
-
 if options.mode == 'commit' and not options.pretend and not vcs:
 	logging.info("Not in a version controlled repository; enabling pretend mode.")
 	options.pretend = True
@@ -588,6 +571,7 @@ portdb = trees[root]['porttree'].dbapi
 # Constrain dependency resolution to the master(s)
 # that are specified in layout.conf.
 repodir = os.path.realpath(portdir_overlay)
+repo_config = repoman_settings.repositories.get_repo_for_location(repodir)
 repo_info = portdb._repo_info[repodir]
 portdb.porttrees = list(repo_info.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
@@ -597,8 +581,24 @@ portdir = portdb.porttrees[0]
 # can be used to prevent merge conflicts like those that
 # thin-manifests is designed to prevent.
 sign_manifests = "sign" in repoman_settings.features and \
-	repoman_settings.repositories.get_repo_for_location(
-	repodir).sign_manifest
+	repo_config.sign_manifest
+
+manifest_hashes = repo_config.manifest_hashes
+if manifest_hashes is None:
+	manifest_hashes = portage.const.MANIFEST2_HASH_DEFAULTS
+
+if "commit" == options.mode and \
+	repo_config.name == "gentoo" and \
+	"RMD160" in manifest_hashes and \
+	"RMD160" not in portage.checksum.hashorigin_map:
+	msg = "Please install " \
+	"pycrypto or enable python's ssl USE flag in order " \
+	"to enable RMD160 hash support. See bug #198398 for " \
+	"more information."
+	prefix = bad(" * ")
+	for line in textwrap.wrap(msg, 70):
+		print(prefix + line)
+	sys.exit(1)
 
 # Generate an appropriate PORTDIR_OVERLAY value for passing into the
 # profile-specific config constructor calls.



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-04  5:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-04  5:42 UTC (permalink / raw
  To: gentoo-commits

commit:     12cf3eb1397dc2b33b087f6e37878d94a15a6b9f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  4 05:42:22 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 05:42:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12cf3eb1

repoman: bail out if unsupported manifest-hashes

---
 bin/repoman |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 711fce9..7943f54 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -587,6 +587,31 @@ manifest_hashes = repo_config.manifest_hashes
 if manifest_hashes is None:
 	manifest_hashes = portage.const.MANIFEST2_HASH_DEFAULTS
 
+if options.mode in ("commit", "fix", "manifest"):
+	if portage.const.MANIFEST2_REQUIRED_HASH not in manifest_hashes:
+		msg = ("The 'manifest-hashes' setting in the '%s' repository's "
+		"metadata/layout.conf does not contain the '%s' hash which "
+		"is required by this portage version. You will have to "
+		"upgrade portage if you want to generate valid manifests for "
+		"this repository.") % \
+		(repo_config.name, portage.const.MANIFEST2_REQUIRED_HASH)
+		for line in textwrap.wrap(msg, 70):
+			logging.error(line)
+		sys.exit(1)
+
+	unsupported_hashes = manifest_hashes.difference(
+		portage.const.MANIFEST2_HASH_FUNCTIONS)
+	if unsupported_hashes:
+		msg = ("The 'manifest-hashes' setting in the '%s' repository's "
+		"metadata/layout.conf contains one or more hash types '%s' "
+		"which are not supported by this portage version. You will "
+		"have to upgrade portage if you want to generate valid "
+		"manifests for this repository.") % \
+		(repo_config.name, " ".join(sorted(unsupported_hashes)))
+		for line in textwrap.wrap(msg, 70):
+			logging.error(line)
+		sys.exit(1)
+
 if "commit" == options.mode and \
 	repo_config.name == "gentoo" and \
 	"RMD160" in manifest_hashes and \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-07 14:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-07 14:33 UTC (permalink / raw
  To: gentoo-commits

commit:     1cdf41d1b5c17ac593f0d61a90b8d2a7db6b494d
Author:     Nathan Phillip Brink <binki <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 05:00:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 14:28:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1cdf41d1

Don't do a split signed Manifest commit when no headers will change. Fixes bug #340475.

---
 bin/repoman |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 7943f54..6b6a197 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2435,10 +2435,11 @@ else:
 		print("* aborting commit.")
 		sys.exit(1)
 
-	if vcs in ('cvs', 'svn') and (myupdates or myremoved):
+	# Handle the case where committed files have keywords which
+	# will change and need a priming commit before the Manifest
+	# can be committed.
+	if (myupdates or myremoved) and myheaders:
 		myfiles = myupdates + myremoved
-		if not myheaders and not sign_manifests:
-			myfiles += mymanifests
 		fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
 		mymsg = os.fdopen(fd, "wb")
 		mymsg.write(_unicode_encode(commitmessage))
@@ -2539,7 +2540,6 @@ else:
 			portage.util.write_atomic(x, b''.join(mylines),
 				mode='wb')
 
-	manifest_commit_required = True
 	if vcs in ('cvs', 'svn') and (myupdates or myremoved):
 		myfiles = myupdates + myremoved
 		for x in range(len(myfiles)-1, -1, -1):
@@ -2647,10 +2647,13 @@ else:
 					level=logging.ERROR, noiselevel=-1)
 				sys.exit(retval)
 
-	if vcs in ['git', 'bzr', 'hg'] or manifest_commit_required or signed:
+	if True:
 
 		myfiles = mymanifests[:]
-		if vcs in ['git', 'bzr', 'hg']:
+		# If there are no header (SVN/CVS keywords) changes in
+		# the files, this Manifest commit must include the
+		# other (yet uncommitted) files.
+		if not myheaders:
 			myfiles += myupdates
 			myfiles += myremoved
 		myfiles.sort()



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-07 15:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-07 15:04 UTC (permalink / raw
  To: gentoo-commits

commit:     ae260804da9689c69fad3775d8a4be31b34a087d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 15:04:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 15:04:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ae260804

repoman: tweak commit logic wrt thin-manifest

Don't populate the "myheaders" variable when we have thin-manifests
that contain only DIST entries.

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 6b6a197..ec227ed 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2336,7 +2336,7 @@ else:
 		# there's no need to regenerate manifests and all files will be
 		# committed in one big commit at the end.
 		print()
-	else:
+	elif not repo_config.thin_manifest:
 		if vcs == 'cvs':
 			headerstring = "'\$(Header|Id).*\$'"
 		elif vcs == "svn":



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-07 16:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-07 16:07 UTC (permalink / raw
  To: gentoo-commits

commit:     d2249e5f44ee4ae22304b4d120c4be43c6ab45d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 16:06:49 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 16:06:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2249e5f

repoman: tweak myupdates/myheaders commit logic

If we unconditionally exclude myremoved from myupdates, then removed
files will also be excluded from myheaders. This allows us to avoid
unnecessary separate manifest commits in cases when "myheaders" only
contained files that were being removed. Since our code always uses
myupdates + myremoved, this change in logic doesn't break anything.

---
 bin/repoman |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ec227ed..5d2a84c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2323,8 +2323,7 @@ else:
 			mymanifests.add(f)
 		else:
 			myupdates.add(f)
-	if vcs in ('git', 'hg'):
-		myupdates.difference_update(myremoved)
+	myupdates.difference_update(myremoved)
 	myupdates = list(myupdates)
 	mymanifests = list(mymanifests)
 	myheaders = []



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-08  6:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-08  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     176f43b1ec7e7a82cf67d19b40dcacbebc6dc3f6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  8 06:52:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct  8 06:52:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=176f43b1

repoman: add 'repository' to portdbapi cache

This fixes _getMaskAtom to work correctly with the repo atoms that are
generated by MaskManager, solving the issue reported here:

https://github.com/cschwan/sage-on-gentoo/issues/90#issuecomment-2324953

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 5d2a84c..38f9694 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -652,7 +652,7 @@ root_config = RootConfig(repoman_settings, trees[root], None)
 # We really only need to cache the metadata that's necessary for visibility
 # filtering. Anything else can be discarded to reduce memory consumption.
 portdb._aux_cache_keys.clear()
-portdb._aux_cache_keys.update(["EAPI", "IUSE", "KEYWORDS", "SLOT"])
+portdb._aux_cache_keys.update(["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
 
 reposplit = myreporoot.split(os.path.sep)
 repolevel = len(reposplit)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-11 18:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-11 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     601f819deef7da3af2101ce9e85cb8804355dffa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 11 18:28:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 11 18:28:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=601f819d

bin/ebuild: add --version option

---
 bin/ebuild |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 1cbdb2d..d4b8b71 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -46,6 +46,8 @@ parser.add_option("--color", help="enable or disable color output",
 	type="choice", choices=("y", "n"))
 parser.add_option("--debug", help="show debug output",
 	action="store_true", dest="debug")
+parser.add_option("--version", help="show version and exit",
+	action="store_true", dest="version")
 parser.add_option("--ignore-default-opts",
 	action="store_true",
 	help="do not use the EBUILD_DEFAULT_OPTS environment variable")
@@ -54,9 +56,6 @@ parser.add_option("--skip-manifest", help="skip all manifest checks",
 
 opts, pargs = parser.parse_args(args=sys.argv[1:])
 
-if len(pargs) < 2:
-	parser.error("missing required args")
-
 os.environ["PORTAGE_CALLER"]="ebuild"
 try:
 	import portage
@@ -75,6 +74,13 @@ from portage.const import VDB_PATH
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
+if opts.version:
+	print("Portage", portage.VERSION)
+	sys.exit(os.EX_OK)
+
+if len(pargs) < 2:
+	parser.error("missing required args")
+
 if not opts.ignore_default_opts:
 	default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split()
 	opts, pargs = parser.parse_args(default_opts + sys.argv[1:])



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-13 15:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-13 15:07 UTC (permalink / raw
  To: gentoo-commits

commit:     a580aee32bec544889e08a76b4d0f308447f8d89
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Thu Oct 13 13:03:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 15:07:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a580aee3

quickpkg: Support extended atoms

---
 bin/quickpkg |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 09723f5..c95a584 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -21,7 +21,7 @@ except ImportError:
 from portage import os
 from portage import xpak
 from portage.dbapi.dep_expand import dep_expand
-from portage.dep import use_reduce
+from portage.dep import Atom, extended_cp_match, use_reduce
 from portage.exception import InvalidAtom, InvalidData, InvalidDependString, \
 	PackageSetNotFound, PermissionDenied
 from portage.util import ConfigProtect, ensure_dirs, shlex_split
@@ -187,6 +187,42 @@ def quickpkg_set(options, infos, arg, eout):
 	for atom in atoms:
 		quickpkg_atom(options, infos, atom, eout)
 
+
+def quickpkg_extended_atom(options, infos, arg, eout):
+	root = portage.settings["ROOT"]
+	trees = portage.db[root]
+	vartree = trees["vartree"]
+	vardb = vartree.dbapi
+
+	try:
+		atom = Atom(arg, allow_wildcard=True, allow_repo=True)
+	except (InvalidAtom, InvalidData):
+		eout.eerror("Invalid atom: %s" % (arg,))
+		infos["missing"].append(arg)
+		return
+
+	require_metadata = atom.slot or atom.repo
+	atoms = []
+	for cpv in vardb.cpv_all():
+		cpv_atom = Atom("=%s" % cpv)
+		if not extended_cp_match(atom.cp, cpv_atom.cp):
+			continue
+
+		if require_metadata:
+			slot, repo = vardb.aux_get(cpv, ["SLOT", "repository"])
+
+			if atom.slot and atom.slot != slot:
+				continue
+
+			if atom.repo and atom.repo != repo:
+				continue
+
+		atoms.append(cpv_atom)
+
+	for atom in atoms:
+		quickpkg_atom(options, infos, atom, eout)
+
+
 def quickpkg_main(options, args, eout):
 	root = portage.settings["ROOT"]
 	trees = portage.db[root]
@@ -207,6 +243,8 @@ def quickpkg_main(options, args, eout):
 	for arg in args:
 		if arg[0] == SETPREFIX:
 			quickpkg_set(options, infos, arg, eout)
+		elif '*' in arg:
+			quickpkg_extended_atom(options, infos, arg, eout)
 		else:
 			quickpkg_atom(options, infos, arg, eout)
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-13 15:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-13 15:14 UTC (permalink / raw
  To: gentoo-commits

commit:     2ae07610ad187de2182fe0a36611042104f66511
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 13 15:14:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 15:14:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2ae07610

quickpkg_extended_atom: handle =* operator

---
 bin/quickpkg |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index c95a584..0982c4a 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -201,6 +201,11 @@ def quickpkg_extended_atom(options, infos, arg, eout):
 		infos["missing"].append(arg)
 		return
 
+	if not atom.extended_syntax:
+		# =* operator
+		quickpkg_atom(options, infos, atom, eout)
+		return
+
 	require_metadata = atom.slot or atom.repo
 	atoms = []
 	for cpv in vardb.cpv_all():



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-13 21:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-13 21:53 UTC (permalink / raw
  To: gentoo-commits

commit:     c2523b8833bcf0074f7446a5cbf165cf50f8aa2c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 13 21:53:45 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 21:53:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2523b88

quickpkg: fix '*' in arg extended atom check

This check isn't really accurate due to the =* operator, and we don't
want to reject =* atoms when they omit the category.

---
 bin/quickpkg |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 0982c4a..a326bd4 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -188,24 +188,12 @@ def quickpkg_set(options, infos, arg, eout):
 		quickpkg_atom(options, infos, atom, eout)
 
 
-def quickpkg_extended_atom(options, infos, arg, eout):
+def quickpkg_extended_atom(options, infos, atom, eout):
 	root = portage.settings["ROOT"]
 	trees = portage.db[root]
 	vartree = trees["vartree"]
 	vardb = vartree.dbapi
 
-	try:
-		atom = Atom(arg, allow_wildcard=True, allow_repo=True)
-	except (InvalidAtom, InvalidData):
-		eout.eerror("Invalid atom: %s" % (arg,))
-		infos["missing"].append(arg)
-		return
-
-	if not atom.extended_syntax:
-		# =* operator
-		quickpkg_atom(options, infos, atom, eout)
-		return
-
 	require_metadata = atom.slot or atom.repo
 	atoms = []
 	for cpv in vardb.cpv_all():
@@ -248,10 +236,17 @@ def quickpkg_main(options, args, eout):
 	for arg in args:
 		if arg[0] == SETPREFIX:
 			quickpkg_set(options, infos, arg, eout)
-		elif '*' in arg:
-			quickpkg_extended_atom(options, infos, arg, eout)
-		else:
+			continue
+		try:
+			atom = Atom(arg, allow_wildcard=True, allow_repo=True)
+		except (InvalidAtom, InvalidData):
+			# maybe it's valid but missing category (requires dep_expand)
 			quickpkg_atom(options, infos, arg, eout)
+		else:
+			if atom.extended_syntax:
+				quickpkg_extended_atom(options, infos, atom, eout)
+			else:
+				quickpkg_atom(options, infos, atom, eout)
 
 	if not infos["successes"]:
 		eout.eerror("No packages found")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-13 21:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-13 21:58 UTC (permalink / raw
  To: gentoo-commits

commit:     bf28492ed8ccc7fd3679a8e5433101a0945d417d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 13 21:58:17 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 21:58:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bf28492e

quickpkg: use AmbiguousPackageName

---
 bin/quickpkg |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index a326bd4..6947224 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -22,8 +22,8 @@ from portage import os
 from portage import xpak
 from portage.dbapi.dep_expand import dep_expand
 from portage.dep import Atom, extended_cp_match, use_reduce
-from portage.exception import InvalidAtom, InvalidData, InvalidDependString, \
-	PackageSetNotFound, PermissionDenied
+from portage.exception import (AmbiguousPackageName, InvalidAtom, InvalidData,
+	InvalidDependString, PackageSetNotFound, PermissionDenied)
 from portage.util import ConfigProtect, ensure_dirs, shlex_split
 from portage.dbapi.vartree import dblink, tar_contents
 from portage.checksum import perform_md5
@@ -43,7 +43,7 @@ def quickpkg_atom(options, infos, arg, eout):
 
 	try:
 		atom = dep_expand(arg, mydb=vardb, settings=vartree.settings)
-	except ValueError as e:
+	except AmbiguousPackageName as e:
 		# Multiple matches thrown from cpv_expand
 		eout.eerror("Please use a more specific atom: %s" % \
 			" ".join(e.args[0]))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-14  5:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-14  5:04 UTC (permalink / raw
  To: gentoo-commits

commit:     5a0344bffc31a171afe43092a088084c329320fb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 14 05:04:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 14 05:04:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a0344bf

portageq match: wildcard support

---
 bin/portageq |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index b416b66..eaeca60 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -546,15 +546,42 @@ def match(argv):
 		print("ERROR: expected 2 parameters, got %d!" % len(argv))
 		sys.exit(2)
 	root, atom = argv
-	if atom:
-		if atom_validate_strict and not portage.isvalidatom(atom):
-			portage.writemsg("ERROR: Invalid atom: '%s'\n" % atom,
-				noiselevel=-1)
-			return 2
-		results = portage.db[root]["vartree"].dbapi.match(atom)
-	else:
-		results = portage.db[root]["vartree"].dbapi.cpv_all()
+	if not atom:
+		atom = "*/*"
+
+	vardb = portage.db[root]["vartree"].dbapi
+	try:
+		atom = portage.dep.Atom(atom, allow_wildcard=True, allow_repo=True)
+	except portage.exception.InvalidAtom:
+		# maybe it's valid but missing category
+		atom = portage.dep_expand(atom, mydb=vardb, settings=vardb.settings)
+
+	if atom.extended_syntax:
+		if atom == "*/*":
+			results = vardb.cpv_all()
+		else:
+			results = []
+			require_metadata = atom.slot or atom.repo
+			for cpv in vardb.cpv_all():
+
+				if not portage.dep.extended_cp_match(
+					atom.cp, portage.cpv_getkey(cpv)):
+					continue
+
+				if require_metadata:
+					slot, repo = vardb.aux_get(cpv, ["SLOT", "repository"])
+
+					if atom.slot is not None and atom.slot != slot:
+						continue
+
+					if atom.repo is not None and atom.repo != repo:
+						continue
+
+				results.append(cpv)
+
 		results.sort()
+	else:
+		results = vardb.match(atom)
 	for cpv in results:
 		print(cpv)
 match.uses_root = True



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-14  5:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-14  5:13 UTC (permalink / raw
  To: gentoo-commits

commit:     55dd7bc8587f4ef48a4ff6ddd4e176fbb72d118d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 14 05:13:03 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 14 05:13:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=55dd7bc8

quickpkg: optimize */* matches

---
 bin/quickpkg |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 6947224..ced2468 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -198,6 +198,11 @@ def quickpkg_extended_atom(options, infos, atom, eout):
 	atoms = []
 	for cpv in vardb.cpv_all():
 		cpv_atom = Atom("=%s" % cpv)
+
+		if atom == "*/*":
+			atoms.append(cpv_atom)
+			continue
+
 		if not extended_cp_match(atom.cp, cpv_atom.cp):
 			continue
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-14 19:31 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-14 19:31 UTC (permalink / raw
  To: gentoo-commits

commit:     366e9f0dc05b063427235b567c5e0874db41cf6b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 14 19:31:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 14 19:31:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=366e9f0d

repoman: handle unicode in echangelog args

---
 bin/repoman |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 47ae974..11fb56a 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -73,7 +73,7 @@ from portage.process import find_binary, spawn
 from portage.output import bold, create_color_func, \
 	green, nocolor, red
 from portage.output import ConsoleStyleFile, StyleWriter
-from portage.util import cmp_sort_key, writemsg_level
+from portage.util import cmp_sort_key, writemsg_level, writemsg_stdout
 from portage.package.ebuild.digestgen import digestgen
 from portage.eapi import eapi_has_slot_deps, \
 	eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_iuse_defaults, \
@@ -2444,9 +2444,13 @@ else:
 			logging.info("calling echangelog for package %s" % x)
 			echangelog_args = ["echangelog", "--vcs", vcs, changelog_msg]
 			if options.pretend:
-				print("(%s)" % (" ".join(echangelog_args),))
+				writemsg_stdout("(%s)\n" % (" ".join(echangelog_args),),
+					noiselevel=-1)
 				continue
-			retcode = subprocess.call(echangelog_args, cwd=checkdir)
+			echangelog_args = [_unicode_encode(arg) for arg in echangelog_args]
+			echangelog_cwd = _unicode_encode(checkdir,
+				encoding=_encodings['fs'], errors='strict')
+			retcode = subprocess.call(echangelog_args, cwd=echangelog_cwd)
 			if retcode != os.EX_OK:
 				logging.error("echangelog exited with '%s' status" % retcode)
 				sys.exit(retcode)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15  2:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15  2:34 UTC (permalink / raw
  To: gentoo-commits

commit:     4983b670cdb44d860b9a46325f5ae28cd9685586
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 02:33:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 02:33:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4983b670

repoman --if-modified: handle removed files

---
 bin/repoman |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 11fb56a..ffc622c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -544,6 +544,11 @@ else:
 	else:
 		vcs = None
 
+if options.if_modified == "y" and vcs is None:
+	logging.info("Not in a version controlled repository; "
+		"disabling --if-modified.")
+	options.if_modified = "n"
+
 # Disable copyright/mtime check if vcs does not preserve mtime (bug #324075).
 vcs_preserves_mtime = vcs not in ('git',)
 
@@ -1068,25 +1073,41 @@ if vcs == "cvs":
 	mycvstree = cvstree.getentries("./", recursive=1)
 	mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
 	mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
+	if options.if_modified == "y":
+		myremoved = cvstree.findremoved(mycvstree, recursive=1, basedir="./")
+
 if vcs == "svn":
 	svnstatus = os.popen("svn status").readlines()
 	mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ]
 	mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ]
+	if options.if_modified == "y":
+		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
+
 elif vcs == "git":
 	mychanged = os.popen("git diff-index --name-only --relative --diff-filter=M HEAD").readlines()
 	mychanged = ["./" + elem[:-1] for elem in mychanged]
 
 	mynew = os.popen("git diff-index --name-only --relative --diff-filter=A HEAD").readlines()
 	mynew = ["./" + elem[:-1] for elem in mynew]
+	if options.if_modified == "y":
+		myremoved = os.popen("git diff-index --name-only --relative --diff-filter=D HEAD").readlines()
+		myremoved = ["./" + elem[:-1] for elem in myremoved]
+
 elif vcs == "bzr":
 	bzrstatus = os.popen("bzr status -S .").readlines()
 	mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
 	mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "NK" or elem[0:1] == "R" ) ]
+	if options.if_modified == "y":
+		myremoved = [ "./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "K" or elem[0:1] == "R" ) ]
+
 elif vcs == "hg":
 	mychanged = os.popen("hg status --no-status --modified .").readlines()
 	mychanged = ["./" + elem.rstrip() for elem in mychanged]
 	mynew = os.popen("hg status --no-status --added .").readlines()
 	mynew = ["./" + elem.rstrip() for elem in mynew]
+	if options.if_modified == "y":
+		myremoved = os.popen("hg status --no-status --removed .").readlines()
+		myremoved = ["./" + elem.rstrip() for elem in myremoved]
 
 if vcs:
 	new_ebuilds.update(x for x in mynew if x.endswith(".ebuild"))
@@ -1130,9 +1151,6 @@ except FileNotFound:
 	herd_base = None
 
 modified_pkgs = 0
-if options.if_modified == "y" and not vcs:
-	logging.info("Not in a version controlled repository; disabling --if-modified.")
-	options.if_modified = "n"
 
 for x in scanlist:
 	#ebuilds and digests added to cvs respectively.
@@ -1150,7 +1168,7 @@ for x in scanlist:
 	if options.if_modified == "y":
 		checkdir_modified = False
 		checkdir_pattern = checkdir_relative.rstrip(os.sep) + os.sep
-		for f in chain(mychanged, mynew):
+		for f in chain(mychanged, mynew, myremoved):
 			if f.startswith(checkdir_pattern):
 				checkdir_modified = True
 				modified_pkgs += 1



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15  2:54 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15  2:54 UTC (permalink / raw
  To: gentoo-commits

commit:     cc1c0813859d7860e3f4a497e41ee51bb86111f8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 02:54:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 02:54:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cc1c0813

repoman --echangelog: fix manifest-only commmits

---
 bin/repoman |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ffc622c..2b4cd28 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2451,7 +2451,7 @@ else:
 
 			checkdir_modified = False
 			checkdir_pattern = checkdir_relative.rstrip(os.sep) + os.sep
-			for f in chain(myupdates, myremoved):
+			for f in chain(myupdates, mymanifests, myremoved):
 				if f.startswith(checkdir_pattern):
 					checkdir_modified = True
 					break
@@ -2460,7 +2460,9 @@ else:
 
 			myupdates.append(changelog_path)
 			logging.info("calling echangelog for package %s" % x)
-			echangelog_args = ["echangelog", "--vcs", vcs, changelog_msg]
+			# --no-strict is required if only manifest(s) have changed
+			echangelog_args = ["echangelog", "--no-strict",
+				"--vcs", vcs, changelog_msg]
 			if options.pretend:
 				writemsg_stdout("(%s)\n" % (" ".join(echangelog_args),),
 					noiselevel=-1)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15  3:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     9c9145a9e3c2d8d1bcebf791ce2188add656fee2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 03:03:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 03:03:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c9145a9

repoman: optimize --if-modified and --echangelog

Avoid unnecessary nested loops.

---
 bin/repoman |   64 +++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 2b4cd28..4a157e5 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -906,6 +906,37 @@ scanlist.sort()
 
 logging.debug("Found the following packages to scan:\n%s" % '\n'.join(scanlist))
 
+def vcs_files_to_cps(vcs_file_iter):
+	"""
+	Iterate over the given modified file paths returned from the vcs,
+	and return a frozenset containing category/pn strings for each
+	modified package.
+	"""
+
+	modified_cps = []
+
+	if repolevel == 3:
+		if next(vcs_file_iter, None) is not None:
+			modified_cps.append("/".join(reposplit[-2:]))
+
+	elif repolevel == 2:
+		category = reposplit[-1]
+		for filename in vcs_file_iter:
+			f_split = filename.split(os.sep)
+			# ['.', pn,...]
+			if len(f_split) > 2:
+				modified_cps.append(category + "/" + f_split[1])
+
+	else:
+		# repolevel == 1
+		for filename in vcs_file_iter:
+			f_split = filename.split(os.sep)
+			# ['.', category, pn,...]
+			if len(f_split) > 3:
+				modified_cps.append("/".join(f_split[1:3]))
+
+	return frozenset(modified_cps)
+
 def dev_keywords(profiles):
 	"""
 	Create a set of KEYWORDS values that exist in 'dev'
@@ -1150,9 +1181,12 @@ except FileNotFound:
 	# disable for non-gentoo repoman users who may not have herds.
 	herd_base = None
 
-modified_pkgs = 0
+effective_scanlist = scanlist
+if options.if_modified == "y":
+	effective_scanlist = sorted(vcs_files_to_cps(
+		chain(mychanged, mynew, myremoved)))
 
-for x in scanlist:
+for x in effective_scanlist:
 	#ebuilds and digests added to cvs respectively.
 	logging.info("checking package %s" % x)
 	eadded=[]
@@ -1164,18 +1198,6 @@ for x in scanlist:
 	if repolevel < 2:
 		checkdir_relative = os.path.join(catdir, checkdir_relative)
 	checkdir_relative = os.path.join(".", checkdir_relative)
-
-	if options.if_modified == "y":
-		checkdir_modified = False
-		checkdir_pattern = checkdir_relative.rstrip(os.sep) + os.sep
-		for f in chain(mychanged, mynew, myremoved):
-			if f.startswith(checkdir_pattern):
-				checkdir_modified = True
-				modified_pkgs += 1
-				break
-		if not checkdir_modified:
-			continue
-
 	generated_manifest = False
 
 	if options.mode == "manifest" or \
@@ -2102,7 +2124,7 @@ for x in scanlist:
 				"%s/metadata.xml: unused local USE-description: '%s'" % \
 				(x, myflag))
 
-if options.if_modified == "y" and modified_pkgs < 1:
+if options.if_modified == "y" and len(effective_scanlist) < 1:
 	logging.warn("--if-modified is enabled, but no modified packages were found!")
 
 if options.mode == "manifest":
@@ -2434,7 +2456,8 @@ else:
 
 	if options.echangelog == 'y':
 		logging.info("checking for unmodified ChangeLog files")
-		for x in scanlist:
+		for x in sorted(vcs_files_to_cps(
+			chain(myupdates, mymanifests, myremoved))):
 			catdir, pkgdir = x.split("/")
 			checkdir = repodir + "/" + x
 			checkdir_relative = ""
@@ -2449,15 +2472,6 @@ else:
 			if changelog_modified:
 				continue
 
-			checkdir_modified = False
-			checkdir_pattern = checkdir_relative.rstrip(os.sep) + os.sep
-			for f in chain(myupdates, mymanifests, myremoved):
-				if f.startswith(checkdir_pattern):
-					checkdir_modified = True
-					break
-			if not checkdir_modified:
-				continue
-
 			myupdates.append(changelog_path)
 			logging.info("calling echangelog for package %s" % x)
 			# --no-strict is required if only manifest(s) have changed



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15  3:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15  3:21 UTC (permalink / raw
  To: gentoo-commits

commit:     1d170ec97f6c9db495ba9cbe9256623e1b946d86
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 03:21:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 03:21:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1d170ec9

repoman: simplify digestgen and gpgsign loops

We can re-use the vcs_files_to_cps() function from commit
9c9145a9e3c2d8d1bcebf791ce2188add656fee2.

---
 bin/repoman |   84 +++++++---------------------------------------------------
 1 files changed, 11 insertions(+), 73 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 4a157e5..ebe06f8 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2648,87 +2648,25 @@ else:
 			portage.util.write_atomic(x, b''.join(mylines),
 				mode='wb')
 
+	if repolevel == 1:
+		print(green("RepoMan sez:"), "\"You're rather crazy... "
+			"doing the entire repository.\"\n")
+
 	if vcs in ('cvs', 'svn') and (myupdates or myremoved):
-		myfiles = myupdates + myremoved
-		for x in range(len(myfiles)-1, -1, -1):
-			if myfiles[x].count("/") < 4-repolevel:
-				del myfiles[x]
-		mydone=[]
-		if repolevel==3:   # In a package dir
-			repoman_settings["O"] = startdir
+
+		for x in sorted(vcs_files_to_cps(
+			chain(myupdates, myremoved, mymanifests))):
+			repoman_settings["O"] = os.path.join(repodir, x)
 			digestgen(mysettings=repoman_settings, myportdb=portdb)
-		elif repolevel==2: # In a category dir
-			for x in myfiles:
-				xs=x.split("/")
-				if len(xs) < 4-repolevel:
-					continue
-				if xs[0]==".":
-					xs=xs[1:]
-				if xs[0] in mydone:
-					continue
-				mydone.append(xs[0])
-				repoman_settings["O"] = os.path.join(startdir, xs[0])
-				if not os.path.isdir(repoman_settings["O"]):
-					continue
-				digestgen(mysettings=repoman_settings, myportdb=portdb)
-		elif repolevel==1: # repo-cvsroot
-			print(green("RepoMan sez:"), "\"You're rather crazy... doing the entire repository.\"\n")
-			for x in myfiles:
-				xs=x.split("/")
-				if len(xs) < 4-repolevel:
-					continue
-				if xs[0]==".":
-					xs=xs[1:]
-				if "/".join(xs[:2]) in mydone:
-					continue
-				mydone.append("/".join(xs[:2]))
-				repoman_settings["O"] = os.path.join(startdir, xs[0], xs[1])
-				if not os.path.isdir(repoman_settings["O"]):
-					continue
-				digestgen(mysettings=repoman_settings, myportdb=portdb)
-		else:
-			print(red("I'm confused... I don't know where I am!"))
-			sys.exit(1)
 
 	signed = False
 	if sign_manifests:
 		signed = True
-		myfiles = myupdates + myremoved + mymanifests
 		try:
-			if repolevel==3:   # In a package dir
-				repoman_settings["O"] = "."
+			for x in sorted(vcs_files_to_cps(
+				chain(myupdates, myremoved, mymanifests))):
+				repoman_settings["O"] = os.path.join(repodir, x)
 				gpgsign(os.path.join(repoman_settings["O"], "Manifest"))
-			elif repolevel==2: # In a category dir
-				mydone=[]
-				for x in myfiles:
-					xs=x.split("/")
-					if len(xs) < 4-repolevel:
-						continue
-					if xs[0]==".":
-						xs=xs[1:]
-					if xs[0] in mydone:
-						continue
-					mydone.append(xs[0])
-					repoman_settings["O"] = os.path.join(".", xs[0])
-					if not os.path.isdir(repoman_settings["O"]):
-						continue
-					gpgsign(os.path.join(repoman_settings["O"], "Manifest"))
-			elif repolevel==1: # repo-cvsroot
-				print(green("RepoMan sez:"), "\"You're rather crazy... doing the entire repository.\"\n")
-				mydone=[]
-				for x in myfiles:
-					xs=x.split("/")
-					if len(xs) < 4-repolevel:
-						continue
-					if xs[0]==".":
-						xs=xs[1:]
-					if "/".join(xs[:2]) in mydone:
-						continue
-					mydone.append("/".join(xs[:2]))
-					repoman_settings["O"] = os.path.join(".", xs[0], xs[1])
-					if not os.path.isdir(repoman_settings["O"]):
-						continue
-					gpgsign(os.path.join(repoman_settings["O"], "Manifest"))
 		except portage.exception.PortageException as e:
 			portage.writemsg("!!! %s\n" % str(e))
 			portage.writemsg("!!! Disabled FEATURES='sign'\n")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15 18:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15 18:20 UTC (permalink / raw
  To: gentoo-commits

commit:     c6cd30c6165d39bf3cd040b3dc29bfec4323bbf2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 18:20:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 18:20:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6cd30c6

repoman: validate categories for vcs files

---
 bin/repoman |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ebe06f8..2a6d782 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -682,7 +682,7 @@ for path in set([portdir, repodir]):
 		os.path.join(path, 'profiles', 'categories')))
 repoman_settings.categories = tuple(sorted(
 	portage.util.stack_lists([categories], incremental=1)))
-del categories
+categories = frozenset(repoman_settings.categories)
 
 portdb.settings = repoman_settings
 root_config = RootConfig(repoman_settings, trees[root], None)
@@ -870,7 +870,7 @@ scanlist=[]
 if repolevel==2:
 	#we are inside a category directory
 	catdir=reposplit[-1]
-	if catdir not in repoman_settings.categories:
+	if catdir not in categories:
 		caterror(catdir)
 	mydirlist=os.listdir(startdir)
 	for x in mydirlist:
@@ -880,7 +880,7 @@ if repolevel==2:
 			scanlist.append(catdir+"/"+x)
 	repo_subdir = catdir + os.sep
 elif repolevel==1:
-	for x in repoman_settings.categories:
+	for x in categories:
 		if not os.path.isdir(startdir+"/"+x):
 			continue
 		for y in os.listdir(startdir+"/"+x):
@@ -891,7 +891,7 @@ elif repolevel==1:
 	repo_subdir = ""
 elif repolevel==3:
 	catdir = reposplit[-2]
-	if catdir not in repoman_settings.categories:
+	if catdir not in categories:
 		caterror(catdir)
 	scanlist.append(catdir+"/"+reposplit[-1])
 	repo_subdir = scanlist[-1] + os.sep
@@ -916,23 +916,25 @@ def vcs_files_to_cps(vcs_file_iter):
 	modified_cps = []
 
 	if repolevel == 3:
-		if next(vcs_file_iter, None) is not None:
+		if reposplit[-2] in categories and \
+			next(vcs_file_iter, None) is not None:
 			modified_cps.append("/".join(reposplit[-2:]))
 
 	elif repolevel == 2:
 		category = reposplit[-1]
-		for filename in vcs_file_iter:
-			f_split = filename.split(os.sep)
-			# ['.', pn,...]
-			if len(f_split) > 2:
-				modified_cps.append(category + "/" + f_split[1])
+		if category in categories:
+			for filename in vcs_file_iter:
+				f_split = filename.split(os.sep)
+				# ['.', pn,...]
+				if len(f_split) > 2:
+					modified_cps.append(category + "/" + f_split[1])
 
 	else:
 		# repolevel == 1
 		for filename in vcs_file_iter:
 			f_split = filename.split(os.sep)
 			# ['.', category, pn,...]
-			if len(f_split) > 3:
+			if len(f_split) > 3 and f_split[1] in categories:
 				modified_cps.append("/".join(f_split[1:3]))
 
 	return frozenset(modified_cps)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15 18:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     5e0a1972beb98d31772c8eb10ac70df5f608e2a1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 18:58:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 18:58:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e0a1972

repoman: handle categories for multiple masters

Also, copy repoman_settings.categories to each individual
profile's dep_settings.categories attribute, in order to ensure
that portdbapi.cp_list() uses the correct category set.

---
 bin/repoman |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index b80b783..cdf1001 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -677,7 +677,7 @@ logging.info('PORTDIR_OVERLAY = "%s"' % env['PORTDIR_OVERLAY'])
 env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
 
 categories = []
-for path in set([portdir, repodir]):
+for path in repo_info.eclass_db.porttrees:
 	categories.extend(portage.util.grabfile(
 		os.path.join(path, 'profiles', 'categories')))
 repoman_settings.categories = frozenset(
@@ -2000,6 +2000,7 @@ for x in effective_scanlist:
 						local_config=False,
 						_unmatched_removal=options.unmatched_removal,
 						env=env, _eprefix=eprefix)
+					dep_settings.categories = repoman_settings.categories
 					if options.without_mask:
 						dep_settings._mask_manager = \
 							copy.deepcopy(dep_settings._mask_manager)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15 22:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15 22:33 UTC (permalink / raw
  To: gentoo-commits

commit:     559d5f76cd1925972b50e0faf1e1a0c8c0f60be5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 22:32:55 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 22:32:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=559d5f76

repoman: remove unused imports

---
 bin/repoman |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index cdf1001..b1a2ac3 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -75,9 +75,7 @@ from portage.output import bold, create_color_func, \
 from portage.output import ConsoleStyleFile, StyleWriter
 from portage.util import cmp_sort_key, writemsg_level, writemsg_stdout
 from portage.package.ebuild.digestgen import digestgen
-from portage.eapi import eapi_has_slot_deps, \
-	eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_iuse_defaults, \
-	eapi_has_required_use, eapi_has_use_dep_defaults
+from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
 
 if sys.hexversion >= 0x3000000:
 	basestring = str



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-15 23:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-15 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     5e924b1c0467bdb6f2f9e517780844a07795b9da
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 23:10:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 23:10:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e924b1c

egencache: add _mtime_ to metadata

This fixes a regression in FEATURES=parse-eapi-ebuild-head support
for egencache since commit 2ed1cb53cc4158af08c22d466b15b9a9a7767212.
If the metadata does not contain _mtime_ here, then _setitem from
cache.metadata.database will raise KeyError.

---
 bin/egencache |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 8d16cd6..22fb1d5 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -237,8 +237,7 @@ class GenCache(object):
 				del metadata['EAPI']
 			try:
 				chf = self._trg_cache.validation_chf
-				if chf != 'mtime':
-					metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
+				metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
 				try:
 					self._trg_cache[cpv] = metadata
 				except StatCollision as sc:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-16  0:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-16  0:03 UTC (permalink / raw
  To: gentoo-commits

commit:     afa7af37fdf9f4d370776082c7f437db3f81b1aa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 16 00:02:50 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 16 00:02:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=afa7af37

egencache: remove unused import

---
 bin/egencache |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 22fb1d5..0d07cdb 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -38,7 +38,6 @@ except ImportError:
 from portage import os, _encodings, _unicode_encode, _unicode_decode
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision
-from portage.cache import metadata
 from portage.manifest import guessManifestFileType
 from portage.util import cmp_sort_key, writemsg_level
 from portage import cpv_getkey



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-17  0:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-17  0:39 UTC (permalink / raw
  To: gentoo-commits

commit:     375127ef9e265ec311dce3dd23a4fa2feb729717
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 00:39:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 00:39:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=375127ef

repoman: simplify autoadd code

---
 bin/repoman |   36 +++++++++++-------------------------
 1 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 1d7d71a..efd8a01 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -18,6 +18,7 @@ import optparse
 import re
 import signal
 import stat
+import subprocess
 import sys
 import tempfile
 import textwrap
@@ -2459,33 +2460,18 @@ else:
 
 	if myautoadd:
 		print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
+		add_cmd = [vcs, "add"]
+		add_cmd += myautoadd
 		if options.pretend:
-			if vcs == "cvs":
-				print("(cvs add "+" ".join(myautoadd)+")")
-			elif vcs == "svn":
-				print("(svn add "+" ".join(myautoadd)+")")
-			elif vcs == "git":
-				print("(git add "+" ".join(myautoadd)+")")
-			elif vcs == "bzr":
-				print("(bzr add "+" ".join(myautoadd)+")")
-			elif vcs == "hg":
-				print("(hg add "+" ".join(myautoadd)+")")
-			retval = os.EX_OK
+			portage.writemsg_stdout("(%s)\n" % " ".join(add_cmd),
+				noiselevel=-1)
 		else:
-			if vcs == "cvs":
-				retval = os.system("cvs add "+" ".join(myautoadd))
-			elif vcs == "svn":
-				retval = os.system("svn add "+" ".join(myautoadd))
-			elif vcs == "git":
-				retval = os.system("git add "+" ".join(myautoadd))
-			elif vcs == "bzr":
-				retval = os.system("bzr add "+" ".join(myautoadd))
-			elif vcs == "hg":
-				retval = os.system("hg add "+" ".join(myautoadd))
-		if retval != os.EX_OK:
-			writemsg_level("!!! Exiting on %s (shell) error code: %s\n" % \
-				(vcs, retval), level=logging.ERROR, noiselevel=-1)
-			sys.exit(retval)
+			add_cmd = [_unicode_encode(arg) for arg in add_cmd]
+			retcode = subprocess.call(add_cmd)
+			if retcode != os.EX_OK:
+				logging.error(
+					"Exiting on %s error code: %s\n" % (vcs, retcode))
+				sys.exit(retcode)
 
 		myupdates += myautoadd
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-17  2:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-17  2:51 UTC (permalink / raw
  To: gentoo-commits

commit:     753d35cb6784fc361c9804800355ff8b6b70a247
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 02:51:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 02:51:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=753d35cb

repoman: handle subprocess bug with Python 3.1

---
 bin/repoman |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index efd8a01..ba810c6 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2466,7 +2466,15 @@ else:
 			portage.writemsg_stdout("(%s)\n" % " ".join(add_cmd),
 				noiselevel=-1)
 		else:
-			add_cmd = [_unicode_encode(arg) for arg in add_cmd]
+			if not (sys.hexversion >= 0x3000000 and sys.hexversion < 0x3020000):
+				# Python 3.1 produces the following TypeError if raw bytes are
+				# passed to subprocess.call():
+				#   File "/usr/lib/python3.1/subprocess.py", line 646, in __init__
+				#     errread, errwrite)
+				#   File "/usr/lib/python3.1/subprocess.py", line 1157, in _execute_child
+				#     raise child_exception
+				# TypeError: expected an object with the buffer interface
+				add_cmd = [_unicode_encode(arg) for arg in add_cmd]
 			retcode = subprocess.call(add_cmd)
 			if retcode != os.EX_OK:
 				logging.error(



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-18  6:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-18  6:05 UTC (permalink / raw
  To: gentoo-commits

commit:     cb3f4b3c7a81ea5f15f9e5dbc67ede961511d2f8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 18 06:05:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 18 06:05:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb3f4b3c

python3.2 fixes: "ResourceWarning: unclosed file"

---
 bin/repoman |   68 +++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 48 insertions(+), 20 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ad1e688..4966d22 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1105,36 +1105,46 @@ if vcs == "cvs":
 		myremoved = cvstree.findremoved(mycvstree, recursive=1, basedir="./")
 
 if vcs == "svn":
-	svnstatus = os.popen("svn status").readlines()
+	with os.popen("svn status") as f:
+		svnstatus = f.readlines()
 	mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ]
 	mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ]
 	if options.if_modified == "y":
 		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
 
 elif vcs == "git":
-	mychanged = os.popen("git diff-index --name-only --relative --diff-filter=M HEAD").readlines()
+	with os.popen("git diff-index --name-only "
+		"--relative --diff-filter=M HEAD") as f:
+		mychanged = f.readlines()
 	mychanged = ["./" + elem[:-1] for elem in mychanged]
 
-	mynew = os.popen("git diff-index --name-only --relative --diff-filter=A HEAD").readlines()
+	with os.popen("git diff-index --name-only "
+		"--relative --diff-filter=A HEAD") as f:
+		mynew = f.readlines()
 	mynew = ["./" + elem[:-1] for elem in mynew]
 	if options.if_modified == "y":
-		myremoved = os.popen("git diff-index --name-only --relative --diff-filter=D HEAD").readlines()
+		with os.popen("git diff-index --name-only "
+			"--relative --diff-filter=D HEAD") as f:
+			myremoved = f.readlines()
 		myremoved = ["./" + elem[:-1] for elem in myremoved]
 
 elif vcs == "bzr":
-	bzrstatus = os.popen("bzr status -S .").readlines()
+	with os.popen("bzr status -S .") as f:
+		bzrstatus = f.readlines()
 	mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
 	mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "NK" or elem[0:1] == "R" ) ]
 	if options.if_modified == "y":
 		myremoved = [ "./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "K" or elem[0:1] == "R" ) ]
 
 elif vcs == "hg":
-	mychanged = os.popen("hg status --no-status --modified .").readlines()
+	with os.popen("hg status --no-status --modified .") as f:
+		mychanged = f.readlines()
 	mychanged = ["./" + elem.rstrip() for elem in mychanged]
 	mynew = os.popen("hg status --no-status --added .").readlines()
 	mynew = ["./" + elem.rstrip() for elem in mynew]
 	if options.if_modified == "y":
-		myremoved = os.popen("hg status --no-status --removed .").readlines()
+		with os.popen("hg status --no-status --removed .") as f:
+			myremoved = f.readlines()
 		myremoved = ["./" + elem.rstrip() for elem in myremoved]
 
 if vcs:
@@ -2239,7 +2249,8 @@ else:
 			err("Error retrieving CVS tree; exiting.")
 	if vcs == "svn":
 		try:
-			svnstatus=os.popen("svn status --no-ignore").readlines()
+			with os.popen("svn status --no-ignore") as f:
+				svnstatus = f.readlines()
 			myunadded = [ "./"+elem.rstrip().split()[1] for elem in svnstatus if elem.startswith("?") or elem.startswith("I") ]
 		except SystemExit as e:
 			raise  # TODO propagate this
@@ -2252,20 +2263,23 @@ else:
 		myf.close()
 	if vcs == "bzr":
 		try:
-			bzrstatus=os.popen("bzr status -S .").readlines()
+			with os.popen("bzr status -S .") as f:
+				bzrstatus = f.readlines()
 			myunadded = [ "./"+elem.rstrip().split()[1].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("?") or elem[0:2] == " D" ]
 		except SystemExit as e:
 			raise  # TODO propagate this
 		except:
 			err("Error retrieving bzr info; exiting.")
 	if vcs == "hg":
-		myunadded = os.popen("hg status --no-status --unknown .").readlines()
+		with os.popen("hg status --no-status --unknown .") as f:
+			myunadded = f.readlines()
 		myunadded = ["./" + elem.rstrip() for elem in myunadded]
 		
 		# Mercurial doesn't handle manually deleted files as removed from
 		# the repository, so the user need to remove them before commit,
 		# using "hg remove [FILES]"
-		mydeleted = os.popen("hg status --no-status --deleted .").readlines()
+		with os.popen("hg status --no-status --deleted .") as f:
+			mydeleted = f.readlines()
 		mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
 
 
@@ -2310,28 +2324,37 @@ else:
 
 
 	if vcs == "svn":
-		svnstatus = os.popen("svn status").readlines()
+		with os.popen("svn status") as f:
+			svnstatus = f.readlines()
 		mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if (elem[:1] in "MR" or elem[1:2] in "M")]
 		mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A")]
 		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
 
 		# Subversion expands keywords specified in svn:keywords properties.
-		props = os.popen("svn propget -R svn:keywords").readlines()
+		with os.popen("svn propget -R svn:keywords") as f:
+			props = f.readlines()
 		expansion = dict(("./" + prop.split(" - ")[0], prop.split(" - ")[1].split()) \
 			for prop in props if " - " in prop)
 
 	elif vcs == "git":
-		mychanged = os.popen("git diff-index --name-only --relative --diff-filter=M HEAD").readlines()
+		with os.popen("git diff-index --name-only "
+			"--relative --diff-filter=M HEAD") as f:
+			mychanged = f.readlines()
 		mychanged = ["./" + elem[:-1] for elem in mychanged]
 
-		mynew = os.popen("git diff-index --name-only --relative --diff-filter=A HEAD").readlines()
+		with os.popen("git diff-index --name-only "
+			"--relative --diff-filter=A HEAD") as f:
+			mynew = f.readlines()
 		mynew = ["./" + elem[:-1] for elem in mynew]
 
-		myremoved = os.popen("git diff-index --name-only --relative --diff-filter=D HEAD").readlines()
+		with os.popen("git diff-index --name-only "
+			"--relative --diff-filter=D HEAD") as f:
+			myremoved = f.readlines()
 		myremoved = ["./" + elem[:-1] for elem in myremoved]
 
 	if vcs == "bzr":
-		bzrstatus = os.popen("bzr status -S .").readlines()
+		with os.popen("bzr status -S .") as f:
+			bzrstatus = f.readlines()
 		mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
 		mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] in "NK" or elem[0:1] == "R" ) ]
 		myremoved = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("-") ]
@@ -2339,11 +2362,16 @@ else:
 		# Bazaar expands nothing.
 
 	if vcs == "hg":
-		mychanged = os.popen("hg status --no-status --modified .").readlines()
+		with os.popen("hg status --no-status --modified .") as f:
+			mychanged = f.readlines()
 		mychanged = ["./" + elem.rstrip() for elem in mychanged]
-		mynew = os.popen("hg status --no-status --added .").readlines()
+
+		with os.popen("hg status --no-status --added .") as f:
+			mynew = f.readlines()
 		mynew = ["./" + elem.rstrip() for elem in mynew]
-		myremoved = os.popen("hg status --no-status --removed .").readlines()
+
+		with os.popen("hg status --no-status --removed .") as f:
+			myremoved = f.readlines()
 		myremoved = ["./" + elem.rstrip() for elem in myremoved]
 
 	if vcs:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-20 14:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-20 14:17 UTC (permalink / raw
  To: gentoo-commits

commit:     a5968f7d9b1c17568fba27f7b7fd284b9431802d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 14:16:50 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 14:16:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a5968f7d

misc-functions.sh: move sleep out of loop

Having sleep in the world-writable loop causes riduculous delays for
prefix users with exotic filesystem constraints (like a FAT filesystem
mounted with umask=000).

---
 bin/misc-functions.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b3e62c5..0d2d206 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -166,14 +166,14 @@ install_qa_check() {
 	fi
 
 	# Now we look for all world writable files.
-	local i
+	local i=
 	for i in $(find "${D}/" -type f -perm -2); do
 		vecho "QA Security Notice:"
 		vecho "- ${i:${#D}:${#i}} will be a world writable file."
 		vecho "- This may or may not be a security problem, most of the time it is one."
 		vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly."
-		sleep 1
 	done
+	[[ -n ${i} ]] && sleep 1
 
 	if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT}; then
 		local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-21  2:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-21  2:23 UTC (permalink / raw
  To: gentoo-commits

commit:     44a03c9f2218ae7cfdc03aae495d255e0ca2e5b1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 02:19:28 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 02:19:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=44a03c9f

misc-functions.sh: condense world-writable output

---
 bin/misc-functions.sh |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 0d2d206..55d9663 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -144,7 +144,7 @@ prepcompress() {
 }
 
 install_qa_check() {
-	local f x
+	local f i x
 
 	cd "${D}" || die "cd failed"
 
@@ -166,14 +166,14 @@ install_qa_check() {
 	fi
 
 	# Now we look for all world writable files.
-	local i=
-	for i in $(find "${D}/" -type f -perm -2); do
-		vecho "QA Security Notice:"
-		vecho "- ${i:${#D}:${#i}} will be a world writable file."
+	local unsafe_files=$(find "${D}" -type f -perm -2 | sed -e "s:^${D}:- :")
+	if [[ -n ${unsafe_files} ]] ; then
+		vecho "QA Security Notice: world writable file(s):"
+		vecho "${unsafe_files}"
 		vecho "- This may or may not be a security problem, most of the time it is one."
 		vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly."
-	done
-	[[ -n ${i} ]] && sleep 1
+		sleep 1
+	fi
 
 	if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT}; then
 		local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-29  3:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-29  3:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c7a9678751251c027a3b2072962be49865c2c6f2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 03:26:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 03:26:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c7a96787

portageq: refer to <eroot> instead of <root>

Since commit a715b65f7bd36409c1283e6911265d1f4405ab7a, portageq takes
EROOT as the first argument of commands that require a root argument.
So, update the docs to refer to <eroot> instead of <root>.

---
 bin/portageq |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 66f6509..cee343f 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -79,7 +79,7 @@ def eval_atom_use(atom):
 #
 
 def has_version(argv):
-	"""<root> <category/package>
+	"""<eroot> <category/package>
 	Return code 0 if it's available, 1 otherwise.
 	"""
 	if (len(argv) < 2):
@@ -126,7 +126,7 @@ has_version.uses_root = True
 
 
 def best_version(argv):
-	"""<root> <category/package>
+	"""<eroot> <category/package>
 	Returns category/package-version (without .ebuild).
 	"""
 	if (len(argv) < 2):
@@ -166,7 +166,7 @@ best_version.uses_root = True
 
 
 def mass_best_version(argv):
-	"""<root> [<category/package>]+
+	"""<eroot> [<category/package>]+
 	Returns category/package-version (without .ebuild).
 	"""
 	if (len(argv) < 2):
@@ -204,7 +204,7 @@ def metadata(argv):
 		sys.exit(1)
 
 metadata.__doc__ = """
-<root> <pkgtype> <category/package> [<key>]+
+<eroot> <pkgtype> <category/package> [<key>]+
 Returns metadata values for the specified package.
 Available keys: %s
 """  % ','.join(sorted(x for x in portage.auxdbkeys \
@@ -213,10 +213,10 @@ if not x.startswith('UNUSED_')))
 metadata.uses_root = True
 
 def contents(argv):
-	"""<root> <category/package>
+	"""<eroot> <category/package>
 	List the files that are installed for a given package, with
 	one file listed on each line. All file names will begin with
-	<root>.
+	<eroot>.
 	"""
 	if len(argv) != 2:
 		print("ERROR: expected 2 parameters, got %d!" % len(argv))
@@ -235,11 +235,11 @@ def contents(argv):
 contents.uses_root = True
 
 def owners(argv):
-	"""<root> [<filename>]+
+	"""<eroot> [<filename>]+
 	Given a list of files, print the packages that own the files and which
 	files belong to each package. Files owned by a package are listed on
 	the lines below it, indented by a single tab character (\\t). All file
-	paths must either start with <root> or be a basename alone.
+	paths must either start with <eroot> or be a basename alone.
 	Returns 1 if no owners could be found, and 0 otherwise.
 	"""
 	if len(argv) < 2:
@@ -272,7 +272,7 @@ def owners(argv):
 			f = os.path.join(cwd, f)
 			f = portage.normalize_path(f)
 		if not is_basename and not f.startswith(eroot):
-			sys.stderr.write("ERROR: file paths must begin with <root>!\n")
+			sys.stderr.write("ERROR: file paths must begin with <eroot>!\n")
 			sys.stderr.flush()
 			return 2
 		if is_basename:
@@ -316,9 +316,9 @@ def owners(argv):
 owners.uses_root = True
 
 def is_protected(argv):
-	"""<root> <filename>
+	"""<eroot> <filename>
 	Given a single filename, return code 0 if it's protected, 1 otherwise.
-	The filename must begin with <root>.
+	The filename must begin with <eroot>.
 	"""
 	if len(argv) != 2:
 		sys.stderr.write("ERROR: expected 2 parameters, got %d!\n" % len(argv))
@@ -344,7 +344,7 @@ def is_protected(argv):
 		f = portage.normalize_path(f)
 
 	if not f.startswith(root):
-		err.write("ERROR: file paths must begin with <root>!\n")
+		err.write("ERROR: file paths must begin with <eroot>!\n")
 		err.flush()
 		return 2
 
@@ -363,9 +363,9 @@ def is_protected(argv):
 is_protected.uses_root = True
 
 def filter_protected(argv):
-	"""<root>
+	"""<eroot>
 	Read filenames from stdin and write them to stdout if they are protected.
-	All filenames are delimited by \\n and must begin with <root>.
+	All filenames are delimited by \\n and must begin with <eroot>.
 	"""
 	if len(argv) != 1:
 		sys.stderr.write("ERROR: expected 1 parameter, got %d!\n" % len(argv))
@@ -405,7 +405,7 @@ def filter_protected(argv):
 			f = portage.normalize_path(f)
 
 		if not f.startswith(root):
-			err.write("ERROR: file paths must begin with <root>!\n")
+			err.write("ERROR: file paths must begin with <eroot>!\n")
 			err.flush()
 			errors += 1
 			continue
@@ -423,7 +423,7 @@ def filter_protected(argv):
 filter_protected.uses_root = True
 
 def best_visible(argv):
-	"""<root> [pkgtype] <atom>
+	"""<eroot> [pkgtype] <atom>
 	Returns category/package-version (without .ebuild).
 	The pkgtype argument defaults to "ebuild" if unspecified,
 	otherwise it must be one of ebuild, binary, or installed.
@@ -503,7 +503,7 @@ best_visible.uses_root = True
 
 
 def mass_best_visible(argv):
-	"""<root> [<category/package>]+
+	"""<eroot> [<category/package>]+
 	Returns category/package-version (without .ebuild).
 	"""
 	if (len(argv) < 2):
@@ -519,7 +519,7 @@ mass_best_visible.uses_root = True
 
 
 def all_best_visible(argv):
-	"""<root>
+	"""<eroot>
 	Returns all best_visible packages (without .ebuild).
 	"""
 	if len(argv) < 1:
@@ -536,7 +536,7 @@ all_best_visible.uses_root = True
 
 
 def match(argv):
-	"""<root> <atom>
+	"""<eroot> <atom>
 	Returns a \\n separated list of category/package-version.
 	When given an empty string, all installed packages will
 	be listed.
@@ -586,7 +586,7 @@ def match(argv):
 match.uses_root = True
 
 def expand_virtual(argv):
-	"""<root> <atom>
+	"""<eroot> <atom>
 	Returns a \\n separated list of atoms expanded from a
 	given virtual atom (GLEP 37 virtuals only),
 	excluding blocker atoms. Satisfied
@@ -700,8 +700,8 @@ def envvar(argv):
 			print(portage.settings[arg])
 
 def get_repos(argv):
-	"""<root>
-	Returns all repos with names (repo_name file) argv[0] = $ROOT
+	"""<eroot>
+	Returns all repos with names (repo_name file) argv[0] = $EROOT
 	"""
 	if len(argv) < 1:
 		print("ERROR: insufficient parameters!")
@@ -709,8 +709,8 @@ def get_repos(argv):
 	print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories()))
 
 def get_repo_path(argv):
-	"""<root> <repo_id>+
-	Returns the path to the repo named argv[1], argv[0] = $ROOT
+	"""<eroot> <repo_id>+
+	Returns the path to the repo named argv[1], argv[0] = $EROOT
 	"""
 	if len(argv) < 2:
 		print("ERROR: insufficient parameters!")
@@ -722,7 +722,7 @@ def get_repo_path(argv):
 		print(path)
 
 def list_preserved_libs(argv):
-	"""<root>
+	"""<eroot>
 	Print a list of libraries preserved during a package update in the form
 	package: path. Returns 1 if no preserved libraries could be found,
 	0 otherwise.



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-29  7:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-29  7:59 UTC (permalink / raw
  To: gentoo-commits

commit:     a058baf9ed238a1f260b6739ba7fc10c6472f6ee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 07:59:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 07:59:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a058baf9

egencache: multiple cache-formats support

If layout.conf contains "cache-formats = md5-dict pms", egencache will
now write both formats.

---
 bin/egencache |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index dec10b1..477ba98 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -215,18 +215,22 @@ class GenCache(object):
 			max_jobs=max_jobs, max_load=max_load)
 		self.returncode = os.EX_OK
 		conf = portdb.repositories.get_repo_for_location(portdb.porttrees[0])
-		self._trg_cache = conf.get_pregenerated_cache(portage.auxdbkeys[:],
-			force=True, readonly=False)
-		if self._trg_cache is None:
+		self._trg_caches = tuple(conf.iter_pregenerated_caches(
+			portage.auxdbkeys[:], force=True, readonly=False))
+		if not self._trg_caches:
 			raise Exception("cache formats '%s' aren't supported" %
 				(" ".join(conf.cache_formats),))
 		if rsync:
-			self._trg_cache.raise_stat_collision = True
-		try:
-			self._trg_cache.ec = \
-				portdb._repo_info[portdb.porttrees[0]].eclass_db
-		except AttributeError:
-			pass
+			from portage.cache.metadata import database as pms_database
+			for trg_cache in self._trg_caches:
+				if isinstance(trg_cache, pms_database):
+					trg_cache.raise_stat_collision = True
+					# Make _metadata_callback write this cache first, in case
+					# it raises a StatCollision and triggers mtime
+					# modification.
+					self._trg_caches = tuple([trg_cache] +
+						[x for x in self._trg_caches if x is not trg_cache])
+
 		self._existing_nodes = set()
 
 	def _metadata_callback(self, cpv, repo_path, metadata, ebuild_hash):
@@ -235,11 +239,16 @@ class GenCache(object):
 		if metadata is not None:
 			if metadata.get('EAPI') == '0':
 				del metadata['EAPI']
+			for trg_cache in self._trg_caches:
+				self._write_cache(trg_cache,
+					cpv, repo_path, metadata, ebuild_hash)
+
+	def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
 			try:
-				chf = self._trg_cache.validation_chf
+				chf = trg_cache.validation_chf
 				metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
 				try:
-					self._trg_cache[cpv] = metadata
+					trg_cache[cpv] = metadata
 				except StatCollision as sc:
 					# If the content of a cache entry changes and neither the
 					# file mtime nor size changes, it will prevent rsync from
@@ -264,7 +273,7 @@ class GenCache(object):
 							level=logging.ERROR, noiselevel=-1)
 					else:
 						metadata['_mtime_'] = max_mtime
-						self._trg_cache[cpv] = metadata
+						trg_cache[cpv] = metadata
 						self._portdb.auxdb[repo_path][cpv] = metadata
 
 			except CacheError as ce:
@@ -303,9 +312,12 @@ class GenCache(object):
 			sys.exit(received_signal[0])
 
 		self.returncode |= self._regen.returncode
-		cp_missing = self._cp_missing
 
-		trg_cache = self._trg_cache
+		for trg_cache in self._trg_caches:
+			self._cleanse_cache(trg_cache)
+
+	def _cleanse_cache(self, trg_cache):
+		cp_missing = self._cp_missing
 		dead_nodes = set()
 		if self._global_cleanse:
 			try:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-29 18:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-29 18:33 UTC (permalink / raw
  To: gentoo-commits

commit:     34391999ff880d96812878ce0dafcc372ada71c9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 18:33:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 18:33:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=34391999

egencache: update ebuild_hash.mtime after utime

---
 bin/egencache |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 477ba98..38e9833 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -272,6 +272,7 @@ class GenCache(object):
 							"%s writing target: %s\n" % (cpv, e),
 							level=logging.ERROR, noiselevel=-1)
 					else:
+						ebuild_hash.mtime = max_mtime
 						metadata['_mtime_'] = max_mtime
 						trg_cache[cpv] = metadata
 						self._portdb.auxdb[repo_path][cpv] = metadata



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-29 18:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-29 18:56 UTC (permalink / raw
  To: gentoo-commits

commit:     b07808edb1bc7b7adb36fd8d21ea430d1769d2a7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 18:56:14 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 18:56:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b07808ed

egencache: fix StatCollision handling breakage

This has been broken since the _eclasses_ structure changed in commit
2ed1cb53cc4158af08c22d466b15b9a9a7767212.

---
 bin/egencache |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 38e9833..01eadf0 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -258,9 +258,9 @@ class GenCache(object):
 					# mtime on the ebuild (and the corresponding cache entry).
 					# See bug #139134.
 					max_mtime = sc.mtime
-					for ec, (loc, ec_mtime) in metadata['_eclasses_'].items():
-						if max_mtime < ec_mtime:
-							max_mtime = ec_mtime
+					for ec, ec_hash in metadata['_eclasses_'].items():
+						if max_mtime < ec_hash.mtime:
+							max_mtime = ec_hash.mtime
 					if max_mtime == sc.mtime:
 						max_mtime += 1
 					max_mtime = long(max_mtime)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-29 19:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-29 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     0e3c7e33f3fe0ce593d6c40984db15f42fabd7f3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 19:38:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 19:38:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0e3c7e33

egencache: ensure correct porttrees

The GenCache class assumes that portdb.porttrees[0] is the desired
tree, so assert that it is true. The behavior should have already been
correct, since PORTDIR_OVERLAY was already set to an empty string when
necessary.

---
 bin/egencache |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 01eadf0..22ce8ec 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -864,6 +864,8 @@ def egencache_main(args):
 
 		# Limit ebuilds to the specified repo.
 		portdb.porttrees = [repo_path]
+	else:
+		portdb.porttrees = [portdb.porttree_root]
 
 	ret = [os.EX_OK]
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-29 20:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-29 20:38 UTC (permalink / raw
  To: gentoo-commits

commit:     0e120da008c9d0d41c9372c81145c6e153028a6d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 20:36:23 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 20:36:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0e120da0

egencache: avoid redundant md5-dict writes

The pms cache already does this automatically, since __setitem__ calls
are used to detect stat collisions in order to solve bug #139134.

---
 bin/egencache |   58 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 22ce8ec..33839aa 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -199,7 +199,12 @@ def parse_args(args):
 class GenCache(object):
 	def __init__(self, portdb, cp_iter=None, max_jobs=None, max_load=None,
 		rsync=False):
+		# The caller must set portdb.porttrees in order to constrain
+		# findname, cp_list, and cpv_list to the desired tree.
+		tree = portdb.porttrees[0]
 		self._portdb = portdb
+		self._eclass_db = portdb._repo_info[tree].eclass_db
+		self._auxdbkeys = portage.auxdbkeys
 		# We can globally cleanse stale cache only if we
 		# iterate over every single cp.
 		self._global_cleanse = cp_iter is None
@@ -214,22 +219,25 @@ class GenCache(object):
 			consumer=self._metadata_callback,
 			max_jobs=max_jobs, max_load=max_load)
 		self.returncode = os.EX_OK
-		conf = portdb.repositories.get_repo_for_location(portdb.porttrees[0])
+		conf = portdb.repositories.get_repo_for_location(tree)
 		self._trg_caches = tuple(conf.iter_pregenerated_caches(
-			portage.auxdbkeys[:], force=True, readonly=False))
+			self._auxdbkeys, force=True, readonly=False))
 		if not self._trg_caches:
 			raise Exception("cache formats '%s' aren't supported" %
 				(" ".join(conf.cache_formats),))
-		if rsync:
-			from portage.cache.metadata import database as pms_database
-			for trg_cache in self._trg_caches:
-				if isinstance(trg_cache, pms_database):
-					trg_cache.raise_stat_collision = True
-					# Make _metadata_callback write this cache first, in case
-					# it raises a StatCollision and triggers mtime
-					# modification.
-					self._trg_caches = tuple([trg_cache] +
-						[x for x in self._trg_caches if x is not trg_cache])
+
+		self._avoid_redundant_write = set()
+		from portage.cache.metadata import database as pms_database
+		for trg_cache in self._trg_caches:
+			if not isinstance(trg_cache, pms_database):
+				self._avoid_redundant_write.add(id(trg_cache))
+			elif rsync:
+				trg_cache.raise_stat_collision = True
+				# Make _metadata_callback write this cache first, in case
+				# it raises a StatCollision and triggers mtime
+				# modification.
+				self._trg_caches = tuple([trg_cache] +
+					[x for x in self._trg_caches if x is not trg_cache])
 
 		self._existing_nodes = set()
 
@@ -244,6 +252,27 @@ class GenCache(object):
 					cpv, repo_path, metadata, ebuild_hash)
 
 	def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
+
+			if id(trg_cache) in self._avoid_redundant_write:
+				# This cache does not avoid redundant writes automatically,
+				# so check for an identical existing entry before writing.
+				# This prevents unecessary disk writes and can also prevent
+				# unecessary rsync transfers.
+				try:
+					dest = trg_cache[cpv]
+				except (KeyError, CacheError):
+					pass
+				else:
+					if trg_cache.validate_entry(dest,
+						ebuild_hash, self._eclass_db):
+						identical = True
+						for k in self._auxdbkeys:
+							if dest.get(k, '') != metadata.get(k, ''):
+								identical = False
+								break
+						if identical:
+							return
+
 			try:
 				chf = trg_cache.validation_chf
 				metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
@@ -256,7 +285,10 @@ class GenCache(object):
 					# exception from _setitem() if they detect this type of stat
 					# collision. These exceptions are handled by bumping the
 					# mtime on the ebuild (and the corresponding cache entry).
-					# See bug #139134.
+					# This type of cache must not be included in the above
+					# _avoid_redundant_write set, since __setitem__ must be
+					# called in order to detect the StatCollision (redundant
+					# writes will be avoided internally). See bug #139134.
 					max_mtime = sc.mtime
 					for ec, ec_hash in metadata['_eclasses_'].items():
 						if max_mtime < ec_hash.mtime:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-30  5:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-10-30  5:25 UTC (permalink / raw
  To: gentoo-commits

commit:     9347995ce3f657263e9216eed34a876a5c02c3d2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 30 05:24:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 05:24:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9347995c

egencache: tweak redundant write check condition

We can use the raise_stat_collision attribute to determine when it is
necessary to check for redundant writes.

---
 bin/egencache |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index afd2baa..02ef4bd 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -226,18 +226,15 @@ class GenCache(object):
 			raise Exception("cache formats '%s' aren't supported" %
 				(" ".join(conf.cache_formats),))
 
-		self._avoid_redundant_write = set()
-		from portage.cache.metadata import database as pms_database
-		for trg_cache in self._trg_caches:
-			if not isinstance(trg_cache, pms_database):
-				self._avoid_redundant_write.add(id(trg_cache))
-			elif rsync:
-				trg_cache.raise_stat_collision = True
-				# Make _metadata_callback write this cache first, in case
-				# it raises a StatCollision and triggers mtime
-				# modification.
-				self._trg_caches = tuple([trg_cache] +
-					[x for x in self._trg_caches if x is not trg_cache])
+		if rsync:
+			for trg_cache in self._trg_caches:
+				if hasattr(trg_cache, 'raise_stat_collision'):
+					trg_cache.raise_stat_collision = True
+					# Make _metadata_callback write this cache first, in case
+					# it raises a StatCollision and triggers mtime
+					# modification.
+					self._trg_caches = tuple([trg_cache] +
+						[x for x in self._trg_caches if x is not trg_cache])
 
 		self._existing_nodes = set()
 
@@ -253,7 +250,7 @@ class GenCache(object):
 
 	def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
 
-			if id(trg_cache) in self._avoid_redundant_write:
+			if not hasattr(trg_cache, 'raise_stat_collision'):
 				# This cache does not avoid redundant writes automatically,
 				# so check for an identical existing entry before writing.
 				# This prevents unecessary disk writes and can also prevent
@@ -285,10 +282,12 @@ class GenCache(object):
 					# exception from _setitem() if they detect this type of stat
 					# collision. These exceptions are handled by bumping the
 					# mtime on the ebuild (and the corresponding cache entry).
-					# This type of cache must not be included in the above
-					# _avoid_redundant_write set, since __setitem__ must be
-					# called in order to detect the StatCollision (redundant
-					# writes will be avoided internally). See bug #139134.
+					# See bug #139134. It is convenient to include checks for
+					# redundant writes along with the interal StatCollision
+					# detection code, so for caches with the
+					# raise_stat_collision attribute, we do not need to
+					# explicitly check for redundant writes like we do for the
+					# other cache types above.
 					max_mtime = sc.mtime
 					for ec, ec_hash in metadata['_eclasses_'].items():
 						if max_mtime < ec_hash.mtime:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-10-30  6:42 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-10-30  6:42 UTC (permalink / raw
  To: gentoo-commits

commit:     4841c50ec9913c9ea300649e227961c2f12e0708
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Oct 30 06:40:52 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 06:40:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4841c50e

Fix typos in comments.

---
 bin/egencache |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 02ef4bd..3329a07 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -253,8 +253,8 @@ class GenCache(object):
 			if not hasattr(trg_cache, 'raise_stat_collision'):
 				# This cache does not avoid redundant writes automatically,
 				# so check for an identical existing entry before writing.
-				# This prevents unecessary disk writes and can also prevent
-				# unecessary rsync transfers.
+				# This prevents unnecessary disk writes and can also prevent
+				# unnecessary rsync transfers.
 				try:
 					dest = trg_cache[cpv]
 				except (KeyError, CacheError):
@@ -283,7 +283,7 @@ class GenCache(object):
 					# collision. These exceptions are handled by bumping the
 					# mtime on the ebuild (and the corresponding cache entry).
 					# See bug #139134. It is convenient to include checks for
-					# redundant writes along with the interal StatCollision
+					# redundant writes along with the internal StatCollision
 					# detection code, so for caches with the
 					# raise_stat_collision attribute, we do not need to
 					# explicitly check for redundant writes like we do for the



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-02  1:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-02  1:48 UTC (permalink / raw
  To: gentoo-commits

commit:     889853171246ab1063bb5015caf41a41761f5424
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  2 01:47:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  2 01:47:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88985317

Merge install_qa_check_prefix from prefix branch.

---
 bin/misc-functions.sh |  124 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 55d9663..80cd0f8 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -154,6 +154,12 @@ install_qa_check() {
 	ecompressdir --dequeue
 	ecompress --dequeue
 
+	local ed=${ED}
+	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+
+	# Prefix specific checks
+	[[ ${ed} != ${D} ]] && install_qa_check_prefix
+
 	f=
 	for x in etc/app-defaults usr/man usr/info usr/X11R6 usr/doc usr/locale ; do
 		[[ -d $D/$x ]] && f+="  $x\n"
@@ -731,6 +737,124 @@ install_qa_check() {
 	fi
 }
 
+install_qa_check_prefix() {
+	if [[ -d ${ED}/${D} ]] ; then
+		find "${ED}/${D}" | \
+		while read i ; do
+			eqawarn "QA Notice: /${i##${ED}/${D}} installed in \${ED}/\${D}"
+		done
+		die "Aborting due to QA concerns: files installed in ${ED}/${D}"
+	fi
+
+	if [[ -d ${ED}/${EPREFIX} ]] ; then
+		find "${ED}/${EPREFIX}/" | \
+		while read i ; do
+			eqawarn "QA Notice: ${i#${D}} double prefix"
+		done
+		die "Aborting due to QA concerns: double prefix files installed"
+	fi
+
+	if [[ -d ${D} ]] ; then
+		INSTALLTOD=$(find ${D%/} | egrep -v "^${ED}" | sed -e "s|^${D%/}||" | awk '{if (length($0) <= length("'"${EPREFIX}"'")) { if (substr("'"${EPREFIX}"'", 1, length($0)) != $0) {print $0;} } else if (substr($0, 1, length("'"${EPREFIX}"'")) != "'"${EPREFIX}"'") {print $0;} }')
+		if [[ -n ${INSTALLTOD} ]] ; then
+			eqawarn "QA Notice: the following files are outside of the prefix:"
+			eqawarn "${INSTALLTOD}"
+			die "Aborting due to QA concerns: there are files installed outside the prefix"
+		fi
+	fi
+
+	# all further checks rely on ${ED} existing
+	[[ -d ${ED} ]] || return
+
+	# this does not really belong here, but it's closely tied to
+	# the code below; many runscripts generate positives here, and we
+	# know they don't work (bug #196294) so as long as that one
+	# remains an issue, simply remove them as they won't work
+	# anyway, avoid etc/init.d/functions.sh from being thrown away
+	if [[ ( -d "${ED}"/etc/conf.d || -d "${ED}"/etc/init.d ) && ! -f "${ED}"/etc/init.d/functions.sh ]] ; then
+		ewarn "removed /etc/init.d and /etc/conf.d directories until bug #196294 has been resolved"
+		rm -Rf "${ED}"/etc/{conf,init}.d
+	fi
+
+	# check shebangs, bug #282539
+	rm -f "${T}"/non-prefix-shebangs-errs
+	local WHITELIST=" /usr/bin/env "
+	# this is hell expensive, but how else?
+	find "${ED}" -executable \! -type d -print0 \
+			| xargs -0 grep -H -n -m1 "^#!" \
+			| while read f ;
+	do
+		local fn=${f%%:*}
+		local pos=${f#*:} ; pos=${pos%:*}
+		local line=${f##*:}
+		# shebang always appears on the first line ;)
+		[[ ${pos} != 1 ]] && continue
+		local oldIFS=${IFS}
+		IFS=$'\r'$'\n'$'\t'" "
+		line=( ${line#"#!"} )
+		IFS=${oldIFS}
+		[[ ${WHITELIST} == *" ${line[0]} "* ]] && continue
+		local fp=${fn#${D}} ; fp=/${fp%/*}
+		# line[0] can be an absolutised path, bug #342929
+		local eprefix=$(canonicalize ${EPREFIX})
+		local rf=${fn}
+		# in case we deal with a symlink, make sure we don't replace it
+		# with a real file (sed -i does that)
+		if [[ -L ${fn} ]] ; then
+			rf=$(readlink ${fn})
+			[[ ${rf} != /* ]] && rf=${fn%/*}/${rf}
+			# ignore symlinks pointing to outside prefix
+			# as seen in sys-devel/native-cctools
+			[[ $(canonicalize "/${rf#${D}}") != ${eprefix}/* ]] && continue
+		fi
+		# does the shebang start with ${EPREFIX}, and does it exist?
+		if [[ ${line[0]} == ${EPREFIX}/* || ${line[0]} == ${eprefix}/* ]] ; then
+			if [[ ! -e ${ROOT%/}${line[0]} && ! -e ${D%/}${line[0]} ]] ; then
+				# hmm, refers explicitly to $EPREFIX, but doesn't exist,
+				# if it's in PATH that's wrong in any case
+				if [[ ":${PATH}:" == *":${fp}:"* ]] ; then
+					echo "${fn#${D}}:${line[0]} (explicit EPREFIX but target not found)" \
+						>> "${T}"/non-prefix-shebangs-errs
+				else
+					eqawarn "${fn#${D}} has explicit EPREFIX in shebang but target not found (${line[0]})"
+				fi
+			fi
+			continue
+		fi
+		# unprefixed shebang, is the script directly in $PATH?
+		if [[ ":${PATH}:" == *":${fp}:"* ]] ; then
+			if [[ -e ${EROOT}${line[0]} || -e ${ED}${line[0]} ]] ; then
+				# is it unprefixed, but we can just fix it because a
+				# prefixed variant exists
+				eqawarn "prefixing shebang of ${fn#${D}}"
+				# statement is made idempotent on purpose, because
+				# symlinks may point to the same target, and hence the
+				# same real file may be sedded multiple times since we
+				# read the shebangs in one go upfront for performance
+				# reasons
+				sed -i -e '1s:^#! \?'"${line[0]}"':#!'"${EPREFIX}"${line[0]}':' "${rf}"
+				continue
+			else
+				# this is definitely wrong: script in $PATH and invalid shebang
+				echo "${fn#${D}}:${line[0]} (script ${fn##*/} installed in PATH but interpreter ${line[0]} not found)" \
+					>> "${T}"/non-prefix-shebangs-errs
+			fi
+		else
+			# unprefixed/invalid shebang, but outside $PATH, this may be
+			# intended (e.g. config.guess) so remain silent by default
+			has stricter ${FEATURES} && \
+				eqawarn "invalid shebang in ${fn#${D}}: ${line[0]}"
+		fi
+	done
+	if [[ -e "${T}"/non-prefix-shebangs-errs ]] ; then
+		eqawarn "QA Notice: the following files use invalid (possible non-prefixed) shebangs:"
+		while read line ; do
+			eqawarn "  ${line}"
+		done < "${T}"/non-prefix-shebangs-errs
+		rm -f "${T}"/non-prefix-shebangs-errs
+		die "Aborting due to QA concerns: invalid shebangs found"
+	fi
+}
 
 install_mask() {
 	local root="$1"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-02  4:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-02  4:57 UTC (permalink / raw
  To: gentoo-commits

commit:     ab484dc9a2612aa6709fad3ff926c8589a706637
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  2 04:57:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  2 04:57:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab484dc9

phase-helpers.sh: fix best/has_version for prefix

---
 bin/phase-helpers.sh |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 8a2f381..a47064e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -600,11 +600,13 @@ _eapi4_src_install() {
 # Takes single depend-type atoms.
 has_version() {
 
+	local eroot=${EROOT}
+	case "$EAPI" in 0|1|2) eroot=${ROOT} ;; esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1"
+		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1"
 	else
 		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
+		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "$1"
 	fi
 	local retval=$?
 	case "${retval}" in
@@ -621,11 +623,13 @@ has_version() {
 # Takes single depend-type atoms.
 best_version() {
 
+	local eroot=${EROOT}
+	case "$EAPI" in 0|1|2) eroot=${ROOT} ;; esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1"
+		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1"
 	else
 		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${ROOT}" "$1"
+		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "$1"
 	fi
 	local retval=$?
 	case "${retval}" in



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-07  8:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-07  8:32 UTC (permalink / raw
  To: gentoo-commits

commit:     37efaf908013455cb48102df3c3d2b8ae6260e6d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 08:32:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 08:32:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=37efaf90

save_ebuild_env: filter more functions

dyn_pretend
helpers_die
nonfatal
register_success_hook

---
 bin/save-ebuild-env.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index a84a125..f99d204 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -60,8 +60,9 @@ save_ebuild_env() {
 		abort_handler abort_prepare abort_configure abort_compile \
 		abort_test abort_install dyn_prepare dyn_configure \
 		dyn_compile dyn_test dyn_install \
-		dyn_preinst dyn_help debug-print debug-print-function \
-		debug-print-section inherit EXPORT_FUNCTIONS remove_path_entry \
+		dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
+		debug-print-section helpers_die inherit EXPORT_FUNCTIONS \
+		nonfatal register_success_hook remove_path_entry \
 		save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
 		set_unless_changed unset_unless_changed source_all_bashrcs \
 		ebuild_main ebuild_phase ebuild_phase_with_hooks \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-07 18:30 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-11-07 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     1a2b3bdd4791533a424279b806373b1797b090ad
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Nov  7 18:28:05 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 18:28:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a2b3bdd

Avoid initial spaces in some variables.

---
 bin/ebuild.sh |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5648a97..8ca7a41 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -289,11 +289,11 @@ inherit() {
 
 		# If each var has a value, append it to the global variable E_* to
 		# be applied after everything is finished. New incremental behavior.
-		[ "${IUSE+set}"       = set ] && export E_IUSE="${E_IUSE} ${IUSE}"
-		[ "${REQUIRED_USE+set}"       = set ] && export E_REQUIRED_USE="${E_REQUIRED_USE} ${REQUIRED_USE}"
-		[ "${DEPEND+set}"     = set ] && export E_DEPEND="${E_DEPEND} ${DEPEND}"
-		[ "${RDEPEND+set}"    = set ] && export E_RDEPEND="${E_RDEPEND} ${RDEPEND}"
-		[ "${PDEPEND+set}"    = set ] && export E_PDEPEND="${E_PDEPEND} ${PDEPEND}"
+		[ "${IUSE+set}"       = set ] && export E_IUSE+="${E_IUSE:+ }${IUSE}"
+		[ "${REQUIRED_USE+set}"       = set ] && export E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
+		[ "${DEPEND+set}"     = set ] && export E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
+		[ "${RDEPEND+set}"    = set ] && export E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
+		[ "${PDEPEND+set}"    = set ] && export E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
 
 		[ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
 		[ "${B_IUSE+set}"     = set ] || unset IUSE
@@ -544,11 +544,11 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		fi
 
 		# add in dependency info from eclasses
-		IUSE="${IUSE} ${E_IUSE}"
-		DEPEND="${DEPEND} ${E_DEPEND}"
-		RDEPEND="${RDEPEND} ${E_RDEPEND}"
-		PDEPEND="${PDEPEND} ${E_PDEPEND}"
-		REQUIRED_USE="${REQUIRED_USE} ${E_REQUIRED_USE}"
+		IUSE+="${IUSE:+ }${E_IUSE}"
+		DEPEND+="${DEPEND:+ }${E_DEPEND}"
+		RDEPEND+="${RDEPEND:+ }${E_RDEPEND}"
+		PDEPEND+="${PDEPEND:+ }${E_PDEPEND}"
+		REQUIRED_USE+="${REQUIRED_USE:+ }${E_REQUIRED_USE}"
 		
 		unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND \
 			__INHERITED_QA_CACHE



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-07 19:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-07 19:16 UTC (permalink / raw
  To: gentoo-commits

commit:     b58e5fd407c8726fd2ffe674444255aab9ae0010
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 19:16:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 19:16:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b58e5fd4

Fix best/has_version ROOT override for EAPI 3-4.

This has been broken since commit
ab484dc9a2612aa6709fad3ff926c8589a706637. In order to support prefix,
callers will have to override EROOT instead.

---
 bin/phase-helpers.sh |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a47064e..5d2d5dd 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -596,12 +596,29 @@ _eapi4_src_install() {
 	fi
 }
 
-# Return true if given package is installed. Otherwise return false.
-# Takes single depend-type atoms.
+# @FUNCTION: has_version
+# @USAGE: <DEPEND ATOM>
+# @DESCRIPTION:
+# Returns the best/most-current match. Callers may override the ROOT
+# variable in order match packages from an alternative ROOT. In
+# EAPI 3 and later, override EROOT instead (ROOT override is supported
+# in this case only if EPREFIX is empty).
 has_version() {
 
 	local eroot=${EROOT}
-	case "$EAPI" in 0|1|2) eroot=${ROOT} ;; esac
+	case "$EAPI" in
+		0|1|2)
+			eroot=${ROOT}
+			;;
+		*)
+			if [[ -z ${EPREFIX} && ${EROOT} != ${ROOT} ]] ; then
+				# Handle ROOT environment override, which ebuilds
+				# sometimes use for stage1/cross-compiling.
+				# In order to support prefix, they'll have to
+				# override EROOT instead.
+				eroot=${ROOT}
+			fi
+	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
 		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1"
 	else
@@ -619,12 +636,29 @@ has_version() {
 	esac
 }
 
-# Returns the best/most-current match.
-# Takes single depend-type atoms.
+# @FUNCTION: best_version
+# @USAGE: <DEPEND ATOM>
+# @DESCRIPTION:
+# Returns the best/most-current match. Callers may override the ROOT
+# variable in order match packages from an alternative ROOT. In
+# EAPI 3 and later, override EROOT instead (ROOT override is supported
+# in this case only if EPREFIX is empty).
 best_version() {
 
 	local eroot=${EROOT}
-	case "$EAPI" in 0|1|2) eroot=${ROOT} ;; esac
+	case "$EAPI" in
+		0|1|2)
+			eroot=${ROOT}
+			;;
+		*)
+			if [[ -z ${EPREFIX} && ${EROOT} != ${ROOT} ]] ; then
+				# Handle ROOT environment override, which ebuilds
+				# sometimes use for stage1/cross-compiling.
+				# In order to support prefix, they'll have to
+				# override EROOT instead.
+				eroot=${ROOT}
+			fi
+	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
 		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1"
 	else



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-07 20:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-07 20:20 UTC (permalink / raw
  To: gentoo-commits

commit:     d00e6b124b8709269de1c66d889c79bd8f91fa88
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 20:19:53 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 20:20:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d00e6b12

Only support ROOT override for best/has_version.

In the context of ebuilds, ROOT=/ override is the only common case, so
it makes sense to only support ROOT overrides.

---
 bin/phase-helpers.sh |   36 ++++++++++++------------------------
 1 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5d2d5dd..6609dc7 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -599,25 +599,19 @@ _eapi4_src_install() {
 # @FUNCTION: has_version
 # @USAGE: <DEPEND ATOM>
 # @DESCRIPTION:
-# Returns the best/most-current match. Callers may override the ROOT
-# variable in order match packages from an alternative ROOT. In
-# EAPI 3 and later, override EROOT instead (ROOT override is supported
-# in this case only if EPREFIX is empty).
+# Return true if given package is installed. Otherwise return false.
+# Callers may override the ROOT variable in order match packages from an
+# alternative ROOT.
 has_version() {
 
-	local eroot=${EROOT}
+	local eroot
 	case "$EAPI" in
 		0|1|2)
 			eroot=${ROOT}
 			;;
 		*)
-			if [[ -z ${EPREFIX} && ${EROOT} != ${ROOT} ]] ; then
-				# Handle ROOT environment override, which ebuilds
-				# sometimes use for stage1/cross-compiling.
-				# In order to support prefix, they'll have to
-				# override EROOT instead.
-				eroot=${ROOT}
-			fi
+			eroot=${ROOT%/}${EPREFIX#/}/
+			;;
 	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
 		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1"
@@ -639,25 +633,19 @@ has_version() {
 # @FUNCTION: best_version
 # @USAGE: <DEPEND ATOM>
 # @DESCRIPTION:
-# Returns the best/most-current match. Callers may override the ROOT
-# variable in order match packages from an alternative ROOT. In
-# EAPI 3 and later, override EROOT instead (ROOT override is supported
-# in this case only if EPREFIX is empty).
+# Returns the best/most-current match.
+# Callers may override the ROOT variable in order match packages from an
+# alternative ROOT.
 best_version() {
 
-	local eroot=${EROOT}
+	local eroot
 	case "$EAPI" in
 		0|1|2)
 			eroot=${ROOT}
 			;;
 		*)
-			if [[ -z ${EPREFIX} && ${EROOT} != ${ROOT} ]] ; then
-				# Handle ROOT environment override, which ebuilds
-				# sometimes use for stage1/cross-compiling.
-				# In order to support prefix, they'll have to
-				# override EROOT instead.
-				eroot=${ROOT}
-			fi
+			eroot=${ROOT%/}${EPREFIX#/}/
+			;;
 	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
 		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-07 20:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-07 20:42 UTC (permalink / raw
  To: gentoo-commits

commit:     19a890a63ab15603fccba89c69ab939ec16aefb5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 20:42:28 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 20:42:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19a890a6

best/has_version: fix eroot assignment

---
 bin/phase-helpers.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6609dc7..361aa3f 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -610,7 +610,7 @@ has_version() {
 			eroot=${ROOT}
 			;;
 		*)
-			eroot=${ROOT%/}${EPREFIX#/}/
+			eroot=${ROOT%/}${EPREFIX}/
 			;;
 	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
@@ -644,7 +644,7 @@ best_version() {
 			eroot=${ROOT}
 			;;
 		*)
-			eroot=${ROOT%/}${EPREFIX#/}/
+			eroot=${ROOT%/}${EPREFIX}/
 			;;
 	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-08 19:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-08 19:28 UTC (permalink / raw
  To: gentoo-commits

commit:     62a402337c6d43c448ff0b5657ada26ff004d421
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  8 19:28:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov  8 19:28:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62a40233

has/best_version: fix grammar in docs

---
 bin/phase-helpers.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 361aa3f..27b486f 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -600,7 +600,7 @@ _eapi4_src_install() {
 # @USAGE: <DEPEND ATOM>
 # @DESCRIPTION:
 # Return true if given package is installed. Otherwise return false.
-# Callers may override the ROOT variable in order match packages from an
+# Callers may override the ROOT variable in order to match packages from an
 # alternative ROOT.
 has_version() {
 
@@ -634,7 +634,7 @@ has_version() {
 # @USAGE: <DEPEND ATOM>
 # @DESCRIPTION:
 # Returns the best/most-current match.
-# Callers may override the ROOT variable in order match packages from an
+# Callers may override the ROOT variable in order to match packages from an
 # alternative ROOT.
 best_version() {
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-09  2:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-09  2:36 UTC (permalink / raw
  To: gentoo-commits

commit:     d6b008760c6e04bd3640e71ae1f3e599947cfbec
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 02:36:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 02:36:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d6b00876

phase-functions.sh: remove stray echo

---
 bin/phase-functions.sh |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index a686dcd..f46368d 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -229,7 +229,6 @@ dyn_unpack() {
 		return 0
 	fi
 	if [ ! -d "${WORKDIR}" ]; then
-		echo PATH=$PATH
 		install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
 	fi
 	cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-09 18:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-09 18:42 UTC (permalink / raw
  To: gentoo-commits

commit:     27a9aec2a725066bd4585baab252eae5110f6b58
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 18:42:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 18:42:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=27a9aec2

Use local ED for uniformity.

The ED variable is not readonly in EAPI 0, 1, and 2, so we can declare
ED as a local variable. We must be careful not to let this variable
leak into the environment of ebuild/eclass functions that we call,
since bash propagates local variables to nested function calls.

---
 bin/misc-functions.sh |  115 +++++++++++++++++++++++--------------------------
 bin/phase-helpers.sh  |   64 ++++++++++++---------------
 2 files changed, 83 insertions(+), 96 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 81bae76..b1f4736 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -17,9 +17,8 @@ shift $#
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
 
 install_symlink_html_docs() {
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
-	cd "${ed}" || die "cd failed"
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+	cd "${ED}" || die "cd failed"
 	#symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
 	if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
 		local mydocdir docdir
@@ -66,13 +65,12 @@ canonicalize() {
 prepcompress() {
 	local -a include exclude incl_d incl_f
 	local f g i real_f real_d
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
 	# Canonicalize path names and check for their existence.
-	real_d=$(canonicalize "${ed}")
+	real_d=$(canonicalize "${ED}")
 	for (( i = 0; i < ${#PORTAGE_DOCOMPRESS[@]}; i++ )); do
-		real_f=$(canonicalize "${ed}${PORTAGE_DOCOMPRESS[i]}")
+		real_f=$(canonicalize "${ED}${PORTAGE_DOCOMPRESS[i]}")
 		f=${real_f#"${real_d}"}
 		if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
 		then
@@ -83,7 +81,7 @@ prepcompress() {
 		fi
 	done
 	for (( i = 0; i < ${#PORTAGE_DOCOMPRESS_SKIP[@]}; i++ )); do
-		real_f=$(canonicalize "${ed}${PORTAGE_DOCOMPRESS_SKIP[i]}")
+		real_f=$(canonicalize "${ED}${PORTAGE_DOCOMPRESS_SKIP[i]}")
 		f=${real_f#"${real_d}"}
 		if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
 		then
@@ -132,7 +130,7 @@ prepcompress() {
 
 	# Split the include list into directories and files
 	for f in "${include[@]}"; do
-		if [[ -d ${ed}${f} ]]; then
+		if [[ -d ${ED}${f} ]]; then
 			incl_d[${#incl_d[@]}]=${f}
 		else
 			incl_f[${#incl_f[@]}]=${f}
@@ -142,17 +140,16 @@ prepcompress() {
 	# Queue up for compression.
 	# ecompress{,dir} doesn't like to be called with empty argument lists.
 	[[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --queue "${incl_d[@]}"
-	[[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ed}}"
+	[[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ED}}"
 	[[ ${#exclude[@]} -gt 0 ]] && ecompressdir --ignore "${exclude[@]}"
 	return 0
 }
 
 install_qa_check() {
 	local f i x
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
-	cd "${ed}" || die "cd failed"
+	cd "${ED}" || die "cd failed"
 
 	export STRIP_MASK
 	prepall
@@ -161,11 +158,11 @@ install_qa_check() {
 	ecompress --dequeue
 
 	# Prefix specific checks
-	[[ ${ed} != ${D} ]] && install_qa_check_prefix
+	[[ ${ED} != ${D} ]] && install_qa_check_prefix
 
 	f=
 	for x in etc/app-defaults usr/man usr/info usr/X11R6 usr/doc usr/locale ; do
-		[[ -d $ed/$x ]] && f+="  $x\n"
+		[[ -d ${ED}/$x ]] && f+="  $x\n"
 	done
 
 	if [[ -n $f ]] ; then
@@ -175,7 +172,7 @@ install_qa_check() {
 	fi
 
 	# Now we look for all world writable files.
-	local unsafe_files=$(find "${ed}" -type f -perm -2 | sed -e "s:^${ed}:- :")
+	local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :")
 	if [[ -n ${unsafe_files} ]] ; then
 		vecho "QA Security Notice: world writable file(s):"
 		vecho "${unsafe_files}"
@@ -205,7 +202,7 @@ install_qa_check() {
 		if [[ -n "${ROOT}" && "${ROOT}" != "/" ]]; then
 			forbidden_dirs+=" ${ROOT}"
 		fi
-		local dir l rpath_files=$(scanelf -F '%F:%r' -qBR "${ed}")
+		local dir l rpath_files=$(scanelf -F '%F:%r' -qBR "${ED}")
 		f=""
 		for dir in ${forbidden_dirs}; do
 			for l in $(echo "${rpath_files}" | grep -E ":${dir}|::|: "); do
@@ -219,7 +216,7 @@ install_qa_check() {
 
 		# Reject set*id binaries with $ORIGIN in RPATH #260331
 		x=$(
-			find "${ed}" -type f \( -perm -u+s -o -perm -g+s \) -print0 | \
+			find "${ED}" -type f \( -perm -u+s -o -perm -g+s \) -print0 | \
 			xargs -0 scanelf -qyRF '%r %p' | grep '$ORIGIN'
 		)
 
@@ -245,7 +242,7 @@ install_qa_check() {
 		[[ -n ${!qa_var} ]] && QA_TEXTRELS=${!qa_var}
 		[[ -n ${QA_STRICT_TEXTRELS} ]] && QA_TEXTRELS=""
 		export QA_TEXTRELS="${QA_TEXTRELS} lib*/modules/*.ko"
-		f=$(scanelf -qyRF '%t %p' "${ed}" | grep -v 'usr/lib/debug/')
+		f=$(scanelf -qyRF '%t %p' "${ED}" | grep -v 'usr/lib/debug/')
 		if [[ -n ${f} ]] ; then
 			scanelf -qyRAF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log
 			vecho -ne '\n'
@@ -285,7 +282,7 @@ install_qa_check() {
 					[[ -n ${QA_STRICT_WX_LOAD} ]] && QA_WX_LOAD=""
 					export QA_EXECSTACK="${QA_EXECSTACK} lib*/modules/*.ko"
 					export QA_WX_LOAD="${QA_WX_LOAD} lib*/modules/*.ko"
-					f=$(scanelf -qyRAF '%e %p' "${ed}" | grep -v 'usr/lib/debug/')
+					f=$(scanelf -qyRAF '%e %p' "${ED}" | grep -v 'usr/lib/debug/')
 					;;
 			esac
 			;;
@@ -312,7 +309,7 @@ install_qa_check() {
 		if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && [[ "${PN}" != *-bin ]] ; then
 			qa_var="QA_DT_HASH_${ARCH/-/_}"
 			eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
-			f=$(scanelf -qyRF '%k %p' -k .hash "${ed}" | sed -e "s:\.hash ::")
+			f=$(scanelf -qyRF '%k %p' -k .hash "${ED}" | sed -e "s:\.hash ::")
 			if [[ -n ${f} ]] ; then
 				echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log
 				if [ "${QA_STRICT_DT_HASH-unset}" == unset ] ; then
@@ -394,7 +391,7 @@ install_qa_check() {
 		# Check for shared libraries lacking SONAMEs
 		qa_var="QA_SONAME_${ARCH/-/_}"
 		eval "[[ -n \${!qa_var} ]] && QA_SONAME=(\"\${${qa_var}[@]}\")"
-		f=$(scanelf -ByF '%S %p' "${ed}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ed}:/:")
+		f=$(scanelf -ByF '%S %p' "${ED}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED}:/:")
 		if [[ -n ${f} ]] ; then
 			echo "${f}" > "${T}"/scanelf-missing-SONAME.log
 			if [[ "${QA_STRICT_SONAME-unset}" == unset ]] ; then
@@ -428,7 +425,7 @@ install_qa_check() {
 		# Check for shared libraries lacking NEEDED entries
 		qa_var="QA_DT_NEEDED_${ARCH/-/_}"
 		eval "[[ -n \${!qa_var} ]] && QA_DT_NEEDED=(\"\${${qa_var}[@]}\")"
-		f=$(scanelf -ByF '%n %p' "${ed}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ed}:/:")
+		f=$(scanelf -ByF '%n %p' "${ED}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED}:/:")
 		if [[ -n ${f} ]] ; then
 			echo "${f}" > "${T}"/scanelf-missing-NEEDED.log
 			if [[ "${QA_STRICT_DT_NEEDED-unset}" == unset ]] ; then
@@ -462,7 +459,7 @@ install_qa_check() {
 		PORTAGE_QUIET=${tmp_quiet}
 	fi
 
-	local unsafe_files=$(find "${ed}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ed}:/:")
+	local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:")
 	if [[ -n ${unsafe_files} ]] ; then
 		eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"
 		eqawarn "${unsafe_files}"
@@ -482,8 +479,8 @@ install_qa_check() {
 	# Sanity check syntax errors in init.d scripts
 	local d
 	for d in /etc/conf.d /etc/init.d ; do
-		[[ -d ${ed}/${d} ]] || continue
-		for i in "${ed}"/${d}/* ; do
+		[[ -d ${ED}/${d} ]] || continue
+		for i in "${ED}"/${d}/* ; do
 			[[ -L ${i} ]] && continue
 			# if empty conf.d/init.d dir exists (baselayout), then i will be "/etc/conf.d/*" and not exist
 			[[ ! -e ${i} ]] && continue
@@ -494,17 +491,17 @@ install_qa_check() {
 	# this should help to ensure that all (most?) shared libraries are executable
 	# and that all libtool scripts / static libraries are not executable
 	local j
-	for i in "${ed}"opt/*/lib{,32,64} \
-	         "${ed}"lib{,32,64}       \
-	         "${ed}"usr/lib{,32,64}   \
-	         "${ed}"usr/X11R6/lib{,32,64} ; do
+	for i in "${ED}"opt/*/lib{,32,64} \
+	         "${ED}"lib{,32,64}       \
+	         "${ED}"usr/lib{,32,64}   \
+	         "${ED}"usr/X11R6/lib{,32,64} ; do
 		[[ ! -d ${i} ]] && continue
 
 		for j in "${i}"/*.so.* "${i}"/*.so ; do
 			[[ ! -e ${j} ]] && continue
 			[[ -L ${j} ]] && continue
 			[[ -x ${j} ]] && continue
-			vecho "making executable: ${j#${ed}}"
+			vecho "making executable: ${j#${ED}}"
 			chmod +x "${j}"
 		done
 
@@ -512,7 +509,7 @@ install_qa_check() {
 			[[ ! -e ${j} ]] && continue
 			[[ -L ${j} ]] && continue
 			[[ ! -x ${j} ]] && continue
-			vecho "removing executable bit: ${j#${ed}}"
+			vecho "removing executable bit: ${j#${ED}}"
 			chmod -x "${j}"
 		done
 
@@ -536,7 +533,7 @@ install_qa_check() {
 	# http://bugs.gentoo.org/4411
 	abort="no"
 	local a s
-	for a in "${ed}"usr/lib*/*.a ; do
+	for a in "${ED}"usr/lib*/*.a ; do
 		s=${a%.a}.so
 		if [[ ! -e ${s} ]] ; then
 			s=${s%usr/*}${s##*/usr/}
@@ -550,7 +547,7 @@ install_qa_check() {
 	[[ ${abort} == "yes" ]] && die "add those ldscripts"
 
 	# Make sure people don't store libtool files or static libs in /lib
-	f=$(ls "${ed}"lib*/*.{a,la} 2>/dev/null)
+	f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
 	if [[ -n ${f} ]] ; then
 		vecho -ne '\n'
 		eqawarn "QA Notice: Excessive files found in the / partition"
@@ -561,9 +558,9 @@ install_qa_check() {
 
 	# Verify that the libtool files don't contain bogus $D entries.
 	local abort=no gentoo_bug=no always_overflow=no
-	for a in "${ed}"usr/lib*/*.la ; do
+	for a in "${ED}"usr/lib*/*.la ; do
 		s=${a##*/}
-		if grep -qs "${ed}" "${a}" ; then
+		if grep -qs "${ED}" "${a}" ; then
 			vecho -ne '\n'
 			eqawarn "QA Notice: ${s} appears to contain PORTAGE_TMPDIR paths"
 			abort="yes"
@@ -705,7 +702,7 @@ install_qa_check() {
 	fi
 
 	# Portage regenerates this on the installed system.
-	rm -f "${ed}"/usr/share/info/dir{,.gz,.bz2}
+	rm -f "${ED}"/usr/share/info/dir{,.gz,.bz2}
 
 	if has multilib-strict ${FEATURES} && \
 	   [[ -x /usr/bin/file && -x /usr/bin/find ]] && \
@@ -714,15 +711,15 @@ install_qa_check() {
 		local abort=no dir file firstrun=yes
 		MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT} | sed -e 's:\([(|)]\):\\\1:g')
 		for dir in ${MULTILIB_STRICT_DIRS} ; do
-			[[ -d ${ed}/${dir} ]] || continue
-			for file in $(find ${ed}/${dir} -type f | grep -v "^${ed}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
+			[[ -d ${ED}/${dir} ]] || continue
+			for file in $(find ${ED}/${dir} -type f | grep -v "^${ED}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
 				if file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" ; then
 					if [[ ${firstrun} == yes ]] ; then
 						echo "Files matching a file type that is not allowed:"
 						firstrun=no
 					fi
 					abort=yes
-					echo "   ${file#${ed}//}"
+					echo "   ${file#${ED}//}"
 				fi
 			done
 		done
@@ -731,7 +728,7 @@ install_qa_check() {
 
 	# ensure packages don't install systemd units automagically
 	if ! has systemd ${INHERITED} && \
-		[[ -d "${ed}"/lib/systemd/system ]]
+		[[ -d "${ED}"/lib/systemd/system ]]
 	then
 		eqawarn "QA Notice: package installs systemd unit files (/lib/systemd/system)"
 		eqawarn "           but does not inherit systemd.eclass."
@@ -889,8 +886,7 @@ preinst_mask() {
 		 return 1
 	fi
 
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
 	# Make sure $PWD is not ${D} so that we don't leave gmon.out files
 	# in there in case any tools were built with -pg in CFLAGS.
@@ -904,11 +900,11 @@ preinst_mask() {
 		fi
 	done
 
-	install_mask "${ed}" "${INSTALL_MASK}"
+	install_mask "${ED}" "${INSTALL_MASK}"
 
 	# remove share dir if unnessesary
 	if has nodoc $FEATURES || has noman $FEATURES || has noinfo $FEATURES; then
-		rmdir "${ed}usr/share" &> /dev/null
+		rmdir "${ED}usr/share" &> /dev/null
 	fi
 }
 
@@ -918,32 +914,31 @@ preinst_sfperms() {
 		 return 1
 	fi
 
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
 	# Smart FileSystem Permissions
 	if has sfperms $FEATURES; then
 		local i
-		find "${ed}" -type f -perm -4000 -print0 | \
+		find "${ED}" -type f -perm -4000 -print0 | \
 		while read -r -d $'\0' i ; do
 			if [ -n "$(find "$i" -perm -2000)" ] ; then
-				ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${ed}}"
+				ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${ED}}"
 				chmod o-r "$i"
 				eend $?
 			else
-				ebegin ">>> SetUID: [chmod go-r] /${i#${ed}}"
+				ebegin ">>> SetUID: [chmod go-r] /${i#${ED}}"
 				chmod go-r "$i"
 				eend $?
 			fi
 		done
-		find "${ed}" -type f -perm -2000 -print0 | \
+		find "${ED}" -type f -perm -2000 -print0 | \
 		while read -r -d $'\0' i ; do
 			if [ -n "$(find "$i" -perm -4000)" ] ; then
 				# This case is already handled
 				# by the SetUID check above.
 				true
 			else
-				ebegin ">>> SetGID: [chmod o-r] /${i#${ed}}"
+				ebegin ">>> SetGID: [chmod o-r] /${i#${ED}}"
 				chmod o-r "$i"
 				eend $?
 			fi
@@ -957,8 +952,7 @@ preinst_suid_scan() {
 		 return 1
 	fi
 
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
 	# total suid control.
 	if has suidctl $FEATURES; then
@@ -968,10 +962,10 @@ preinst_suid_scan() {
 		# to files outside of the sandbox, but this
 		# can easly be bypassed using the addwrite() function
 		addwrite "${sfconf}"
-		vecho ">>> Performing suid scan in ${ed}"
-		for i in $(find "${ed}" -type f \( -perm -4000 -o -perm -2000 \) ); do
+		vecho ">>> Performing suid scan in ${ED}"
+		for i in $(find "${ED}" -type f \( -perm -4000 -o -perm -2000 \) ); do
 			if [ -s "${sfconf}" ]; then
-				install_path=/${i#${ed}}
+				install_path=/${i#${ED}}
 				if grep -q "^${install_path}\$" "${sfconf}" ; then
 					vecho "- ${install_path} is an approved suid file"
 				else
@@ -981,7 +975,7 @@ preinst_suid_scan() {
 					chmod ugo-s "${i}"
 					grep "^#${install_path}$" "${sfconf}" > /dev/null || {
 						vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
-						echo "## ${ls_ret%${ed}*}${install_path}" >> "${sfconf}"
+						echo "## ${ls_ret%${ED}*}${install_path}" >> "${sfconf}"
 						echo "#${install_path}" >> "${sfconf}"
 						# no delwrite() eh?
 						# delwrite ${sconf}
@@ -1023,13 +1017,12 @@ preinst_selinux_labels() {
 
 dyn_package() {
 
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
 	# Make sure $PWD is not ${D} so that we don't leave gmon.out files
 	# in there in case any tools were built with -pg in CFLAGS.
 	cd "${T}"
-	install_mask "${ed}" "${PKG_INSTALL_MASK}"
+	install_mask "${ED}" "${PKG_INSTALL_MASK}"
 	local tar_options=""
 	[[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v"
 	# Sandbox is disabled in case the user wants to use a symlink

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 27b486f..be8919c 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -19,10 +19,9 @@ into() {
 		export DESTTREE=""
 	else
 		export DESTTREE=$1
-		local ed=${ED}
-		case "$EAPI" in 0|1|2) ed=${D} ;; esac
-		if [ ! -d "${ed}${DESTTREE}" ]; then
-			install -d "${ed}${DESTTREE}"
+		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+		if [ ! -d "${ED}${DESTTREE}" ]; then
+			install -d "${ED}${DESTTREE}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
 				helpers_die "${FUNCNAME[0]} failed"
@@ -37,10 +36,9 @@ insinto() {
 		export INSDESTTREE=""
 	else
 		export INSDESTTREE=$1
-		local ed=${ED}
-		case "$EAPI" in 0|1|2) ed=${D} ;; esac
-		if [ ! -d "${ed}${INSDESTTREE}" ]; then
-			install -d "${ed}${INSDESTTREE}"
+		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+		if [ ! -d "${ED}${INSDESTTREE}" ]; then
+			install -d "${ED}${INSDESTTREE}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
 				helpers_die "${FUNCNAME[0]} failed"
@@ -55,10 +53,9 @@ exeinto() {
 		export _E_EXEDESTTREE_=""
 	else
 		export _E_EXEDESTTREE_="$1"
-		local ed=${ED}
-		case "$EAPI" in 0|1|2) ed=${D} ;; esac
-		if [ ! -d "${ed}${_E_EXEDESTTREE_}" ]; then
-			install -d "${ed}${_E_EXEDESTTREE_}"
+		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+		if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then
+			install -d "${ED}${_E_EXEDESTTREE_}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
 				helpers_die "${FUNCNAME[0]} failed"
@@ -73,10 +70,9 @@ docinto() {
 		export _E_DOCDESTTREE_=""
 	else
 		export _E_DOCDESTTREE_="$1"
-		local ed=${ED}
-		case "$EAPI" in 0|1|2) ed=${D} ;; esac
-		if [ ! -d "${ed}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
-			install -d "${ed}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+		if [ ! -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
+			install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
 				helpers_die "${FUNCNAME[0]} failed"
@@ -141,11 +137,10 @@ docompress() {
 keepdir() {
 	dodir "$@"
 	local x
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 	if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
 		shift
-		find "$@" -type d -printf "${ed}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
+		find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
 			| tr "\n" "\0" | \
 			while read -r -d $'\0' ; do
 				>> "$REPLY" || \
@@ -153,8 +148,8 @@ keepdir() {
 			done
 	else
 		for x in "$@"; do
-			>> "${ed}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
-				die "Failed to create .keep in ${ed}${x}"
+			>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
+				die "Failed to create .keep in ${ED}${x}"
 		done
 	fi
 }
@@ -476,8 +471,7 @@ econf() {
 einstall() {
 	# CONF_PREFIX is only set if they didn't pass in libdir above.
 	local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
-	local ed=${ED}
-	case "$EAPI" in 0|1|2) ed=${D} ;; esac
+	case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 	LIBDIR_VAR="LIBDIR_${ABI}"
 	if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
 		CONF_LIBDIR="${!LIBDIR_VAR}"
@@ -492,22 +486,22 @@ einstall() {
 
 	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
 		if [ "${PORTAGE_DEBUG}" == "1" ]; then
-			${MAKE:-make} -n prefix="${ed}usr" \
-				datadir="${ed}usr/share" \
-				infodir="${ed}usr/share/info" \
-				localstatedir="${ed}var/lib" \
-				mandir="${ed}usr/share/man" \
-				sysconfdir="${ed}etc" \
+			${MAKE:-make} -n prefix="${ED}usr" \
+				datadir="${ED}usr/share" \
+				infodir="${ED}usr/share/info" \
+				localstatedir="${ED}var/lib" \
+				mandir="${ED}usr/share/man" \
+				sysconfdir="${ED}etc" \
 				${LOCAL_EXTRA_EINSTALL} \
 				${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
 				"$@" install
 		fi
-		${MAKE:-make} prefix="${ed}usr" \
-			datadir="${ed}usr/share" \
-			infodir="${ed}usr/share/info" \
-			localstatedir="${ed}var/lib" \
-			mandir="${ed}usr/share/man" \
-			sysconfdir="${ed}etc" \
+		${MAKE:-make} prefix="${ED}usr" \
+			datadir="${ED}usr/share" \
+			infodir="${ED}usr/share/info" \
+			localstatedir="${ED}var/lib" \
+			mandir="${ED}usr/share/man" \
+			sysconfdir="${ED}etc" \
 			${LOCAL_EXTRA_EINSTALL} \
 			${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
 			"$@" install || die "einstall failed"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-09 18:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-09 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     f75d02eb630c5595127faded4a048268ff59ac17
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 18:48:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 18:48:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f75d02eb

Use local EPREFIX for uniformity.

The EPREFIX variable is not readonly in EAPI 0, 1, and 2, so we can
declare EPREFIX as a local variable. We must be careful not to let this
variable leak into the environment of ebuild/eclass functions that we
call, since bash propagates local variables to nested function calls.

---
 bin/misc-functions.sh |    7 +++----
 bin/phase-helpers.sh  |   23 +++++++++++------------
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b1f4736..1c11dc5 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1097,13 +1097,12 @@ __END1__
 
 dyn_rpm() {
 
-	local eprefix=${EPREFIX}
-	case "$EAPI" in 0|1|2) eprefix= ;; esac
+	case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
 
 	cd "${T}" || die "cd failed"
 	local machine_name=$(uname -m)
-	local dest_dir=${eprefix}/usr/src/rpm/RPMS/${machine_name}
-	addwrite ${eprefix}/usr/src/rpm
+	local dest_dir=${EPREFIX}/usr/src/rpm/RPMS/${machine_name}
+	addwrite ${EPREFIX}/usr/src/rpm
 	addwrite "${RPMDIR}"
 	dyn_spec
 	rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file"

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index be8919c..04cf35a 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -374,8 +374,7 @@ unpack() {
 econf() {
 	local x
 
-	local eprefix=${EPREFIX}
-	case "$EAPI" in 0|1|2) eprefix= ;; esac
+	case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
 
 	_hasg() {
 		local x s=$1
@@ -406,12 +405,12 @@ econf() {
 			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
 				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
 		fi
-		if [ -e "${eprefix}"/usr/share/gnuconfig/ ]; then
+		if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
 			find "${WORKDIR}" -type f '(' \
 			-name config.guess -o -name config.sub ')' -print0 | \
 			while read -r -d $'\0' x ; do
-				vecho " * econf: updating ${x/${WORKDIR}\/} with ${eprefix}/usr/share/gnuconfig/${x##*/}"
-				cp -f "${eprefix}"/usr/share/gnuconfig/"${x##*/}" "${x}"
+				vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
+				cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}"
 			done
 		fi
 
@@ -431,7 +430,7 @@ econf() {
 		if [[ -n ${CONF_LIBDIR} ]] && ! _hasgq --libdir=\* "$@" ; then
 			export CONF_PREFIX=$(_hasg --exec-prefix=\* "$@")
 			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(_hasg --prefix=\* "$@")
-			: ${CONF_PREFIX:=${eprefix}/usr}
+			: ${CONF_PREFIX:=${EPREFIX}/usr}
 			CONF_PREFIX=${CONF_PREFIX#*=}
 			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
 			[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
@@ -439,15 +438,15 @@ econf() {
 		fi
 
 		set -- \
-			--prefix="${eprefix}"/usr \
+			--prefix="${EPREFIX}"/usr \
 			${CBUILD:+--build=${CBUILD}} \
 			--host=${CHOST} \
 			${CTARGET:+--target=${CTARGET}} \
-			--mandir="${eprefix}"/usr/share/man \
-			--infodir="${eprefix}"/usr/share/info \
-			--datadir="${eprefix}"/usr/share \
-			--sysconfdir="${eprefix}"/etc \
-			--localstatedir="${eprefix}"/var/lib \
+			--mandir="${EPREFIX}"/usr/share/man \
+			--infodir="${EPREFIX}"/usr/share/info \
+			--datadir="${EPREFIX}"/usr/share \
+			--sysconfdir="${EPREFIX}"/etc \
+			--localstatedir="${EPREFIX}"/var/lib \
 			"$@" \
 			${EXTRA_ECONF}
 		vecho "${ECONF_SOURCE}/configure" "$@"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-11-25  5:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-11-25  5:29 UTC (permalink / raw
  To: gentoo-commits

commit:     abfc6238532ea237bfc36a73de73969d37542de7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 25 05:28:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 25 05:28:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=abfc6238

emerge-webrsync: new gpg key, bug #331537

---
 bin/emerge-webrsync |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 60e6118..e5c5300 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -12,7 +12,7 @@
 
 #
 # gpg key import
-# KEY_ID=0x239C75C4
+# KEY_ID=0x96D8BF6D
 # gpg --homedir /etc/portage/gnupg --keyserver subkeys.pgp.net --recv-keys $KEY_ID
 # gpg --homedir /etc/portage/gnupg --edit-key $KEY_ID trust
 #



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-05  1:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-05  1:52 UTC (permalink / raw
  To: gentoo-commits

commit:     d15c3ac976b7d95d5b1cd29c3ae0e51ab9971022
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  5 01:52:37 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 01:52:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d15c3ac9

ebuild.sh: quote sandbox export args

---
 bin/ebuild.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index f39e536..1bef43f 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -465,7 +465,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 		die "error processing environment"
 	# Colon separated SANDBOX_* variables need to be cumulative.
 	for x in SANDBOX_DENY SANDBOX_READ SANDBOX_PREDICT SANDBOX_WRITE ; do
-		export PORTAGE_${x}=${!x}
+		export PORTAGE_${x}="${!x}"
 	done
 	PORTAGE_SANDBOX_ON=${SANDBOX_ON}
 	export SANDBOX_ON=1
@@ -479,13 +479,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	for x in SANDBOX_DENY SANDBOX_PREDICT SANDBOX_READ SANDBOX_WRITE ; do
 		y="PORTAGE_${x}"
 		if [ -z "${!x}" ] ; then
-			export ${x}=${!y}
+			export ${x}="${!y}"
 		elif [ -n "${!y}" ] && [ "${!y}" != "${!x}" ] ; then
 			# filter out dupes
-			export ${x}=$(printf "${!y}:${!x}" | tr ":" "\0" | \
-				sort -z -u | tr "\0" ":")
+			export ${x}="$(printf "${!y}:${!x}" | tr ":" "\0" | \
+				sort -z -u | tr "\0" ":")"
 		fi
-		export ${x}=${!x%:}
+		export ${x}="${!x%:}"
 		unset PORTAGE_${x}
 	done
 	unset x y



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-05  2:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-05  2:28 UTC (permalink / raw
  To: gentoo-commits

commit:     6bdc8c114a60727a4a5c77344b5c89379463b693
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  5 02:28:03 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 02:28:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6bdc8c11

ebuild.sh: add note about quoting export ${FOO}=

---
 bin/ebuild.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1bef43f..ec35e18 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -461,6 +461,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	# The environment may have been extracted from environment.bz2 or
 	# may have come from another version of ebuild.sh or something.
 	# In any case, preprocess it to prevent any potential interference.
+	# NOTE: export ${FOO}=... requires quoting, unlike normal exports
 	preprocess_ebuild_env || \
 		die "error processing environment"
 	# Colon separated SANDBOX_* variables need to be cumulative.



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-06 19:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-06 19:01 UTC (permalink / raw
  To: gentoo-commits

commit:     a26868215843b35038110bfedf57c1107f65aa70
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  6 19:01:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 19:01:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2686821

emerge-webrsync: call emerge --check-news

---
 bin/emerge-webrsync |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index e5c5300..f7888d3 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -212,6 +212,7 @@ sync_local() {
 		emerge --metadata
 	fi
 	[ -x /etc/portage/bin/post_sync ] && /etc/portage/bin/post_sync
+	has news ${FEATURES} && emerge --check-news
 	return 0
 }
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-06 19:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-06 19:06 UTC (permalink / raw
  To: gentoo-commits

commit:     eec5c751f20295b2573e509988aa0eede91fc616
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  6 19:06:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 19:06:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eec5c751

emerge-webrsync: use --quiet with --check-news

This suppresses output if there are no relevant items.

---
 bin/emerge-webrsync |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index f7888d3..e6749f2 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -212,7 +212,8 @@ sync_local() {
 		emerge --metadata
 	fi
 	[ -x /etc/portage/bin/post_sync ] && /etc/portage/bin/post_sync
-	has news ${FEATURES} && emerge --check-news
+	# --quiet suppresses output if there are no relevant news items
+	has news ${FEATURES} && emerge --check-news --quiet
 	return 0
 }
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-06 21:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-06 21:57 UTC (permalink / raw
  To: gentoo-commits

commit:     a2a7a4c55c314d132bfd956c27d1c9f31926c357
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  6 21:57:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 21:57:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2a7a4c5

ebuild.sh: don't export inherit E_* vars

---
 bin/ebuild.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index ec35e18..a3ac1e0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -282,11 +282,11 @@ inherit() {
 
 		# If each var has a value, append it to the global variable E_* to
 		# be applied after everything is finished. New incremental behavior.
-		[ "${IUSE+set}"       = set ] && export E_IUSE+="${E_IUSE:+ }${IUSE}"
-		[ "${REQUIRED_USE+set}"       = set ] && export E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
-		[ "${DEPEND+set}"     = set ] && export E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
-		[ "${RDEPEND+set}"    = set ] && export E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
-		[ "${PDEPEND+set}"    = set ] && export E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
+		[ "${IUSE+set}"         = set ] && E_IUSE+="${E_IUSE:+ }${IUSE}"
+		[ "${REQUIRED_USE+set}" = set ] && E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
+		[ "${DEPEND+set}"       = set ] && E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
+		[ "${RDEPEND+set}"      = set ] && E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
+		[ "${PDEPEND+set}"      = set ] && E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
 
 		[ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
 		[ "${B_IUSE+set}"     = set ] || unset IUSE



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-08  6:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-08  6:43 UTC (permalink / raw
  To: gentoo-commits

commit:     5cd61be51c5d6c9e4714e65db77ad9c27b2fb9a7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  8 06:43:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec  8 06:43:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5cd61be5

Save EPREFIX in vdb when appropriate.

The prefix branch already does this since it makes it easy to use
chpathtool to adjust the content of a binary package so that it will
work in a different EPREFIX from the one is was built for.

---
 bin/phase-functions.sh |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 351ae9e..2302910 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -558,6 +558,20 @@ dyn_install() {
 	fi
 	echo "${USE}"       > USE
 	echo "${EAPI:-0}"   > EAPI
+
+	# Save EPREFIX, since it makes it easy to use chpathtool to
+	# adjust the content of a binary package so that it will
+	# work in a different EPREFIX from the one is was built for.
+	case "${EAPI:-0}" in
+		0|1|2)
+			[[ " ${USE} " == *" prefix "* ]] && \
+				[ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
+			;;
+		*)
+			[ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
+			;;
+	esac
+
 	set +f
 
 	# local variables can leak into the saved environment.



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-08 18:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-08 18:03 UTC (permalink / raw
  To: gentoo-commits

commit:     f38e5fced3cf96c086093314f5227bc024c20d9b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  8 18:03:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec  8 18:03:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f38e5fce

etc-update: experimental prefix support

---
 bin/etc-update |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 2af04cc..5a7ba2a 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -54,7 +54,7 @@ scan() {
 	local my_basename
 
 	for path in ${CONFIG_PROTECT} ; do
-		path="${ROOT}${path}"
+		path="${EROOT}${path}"
 		# Do not traverse hidden directories such as .svn or .git.
 		find_opts="-name .* -type d -prune -o -name ._cfg????_*"
 		if [ ! -d "${path}" ]; then
@@ -74,7 +74,7 @@ scan() {
 			rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
 			rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
 			for mpath in ${CONFIG_PROTECT_MASK}; do
-				mpath="${ROOT}${mpath}"
+				mpath="${EROOT}${mpath}"
 				mpath=$(echo "${mpath/\/\///}")
 				if [[ "${rpath}" == "${mpath}"* ]]; then
 					mv ${rpath}/${rfile} ${rpath}/${rfile:10}
@@ -537,7 +537,7 @@ ${SET_X} && set -x
 
 type portageq > /dev/null || exit $?
 eval $(portageq envvar -v CONFIG_PROTECT \
-	CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT USERLAND)
+	CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR EROOT USERLAND)
 export PORTAGE_TMPDIR
 
 TMP="${PORTAGE_TMPDIR}/etc-update-$$"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-08 19:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-08 19:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b79dd09c523764f95be882fe1a5afde71cbab81c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  8 19:51:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec  8 19:51:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b79dd09c

etc-update: use PORTAGE_INST_UID/GID

---
 bin/etc-update |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 5a7ba2a..731b648 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -537,7 +537,8 @@ ${SET_X} && set -x
 
 type portageq > /dev/null || exit $?
 eval $(portageq envvar -v CONFIG_PROTECT \
-	CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR EROOT USERLAND)
+	CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_INST_GID PORTAGE_INST_UID \
+	PORTAGE_TMPDIR EROOT USERLAND)
 export PORTAGE_TMPDIR
 
 TMP="${PORTAGE_TMPDIR}/etc-update-$$"
@@ -554,7 +555,8 @@ rm -rf "${TMP}" 2> /dev/null
 mkdir "${TMP}" || die "failed to create temp dir" 1
 # make sure we have a secure directory to work in
 chmod 0700 "${TMP}" || die "failed to set perms on temp dir" 1
-chown ${UID:-0}:${GID:-0} "${TMP}" || die "failed to set ownership on temp dir" 1
+chown ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${TMP}" || \
+	die "failed to set ownership on temp dir" 1
 
 # I need the CONFIG_PROTECT value
 #CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-09 18:54 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-09 18:54 UTC (permalink / raw
  To: gentoo-commits

commit:     174ffd8336ec9914f85f871b7ce78506574d3d9b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  9 18:54:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  9 18:54:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=174ffd83

portageq: get_repo* uses_root

---
 bin/portageq |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index cee343f..e1cf1a0 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -708,6 +708,8 @@ def get_repos(argv):
 		sys.exit(2)
 	print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories()))
 
+get_repos.uses_root = True
+
 def get_repo_path(argv):
 	"""<eroot> <repo_id>+
 	Returns the path to the repo named argv[1], argv[0] = $EROOT
@@ -721,6 +723,8 @@ def get_repo_path(argv):
 			path = ""
 		print(path)
 
+get_repo_path.uses_root = True
+
 def list_preserved_libs(argv):
 	"""<eroot>
 	Print a list of libraries preserved during a package update in the form



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-10 18:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-10 18:45 UTC (permalink / raw
  To: gentoo-commits

commit:     c37d0c55ac3f70586afcad86636973de35eabe4e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 18:45:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 18:45:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c37d0c55

Remove redundant eprefix in config constructors.

Since commit 11a7448f1d5a0bfb38f8de9d66a8fa8d7118c877, the config
constructor uses portage.const.EPREFIX by default.

---
 bin/egencache |    6 ++----
 bin/repoman   |    9 ++++-----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 6d18f66..7a87bb6 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -841,10 +841,8 @@ def egencache_main(args):
 	if options.portdir is not None:
 		env['PORTDIR'] = options.portdir
 
-	eprefix = portage.const.EPREFIX
-
 	settings = portage.config(config_root=config_root,
-		local_config=False, env=env, eprefix=eprefix)
+		local_config=False, env=env)
 
 	default_opts = None
 	if not options.ignore_default_opts:
@@ -857,7 +855,7 @@ def egencache_main(args):
 			env['PORTAGE_DEPCACHEDIR'] = options.cache_dir
 
 		settings = portage.config(config_root=config_root,
-			local_config=False, env=env, eprefix=eprefix)
+			local_config=False, env=env)
 
 	if not options.update and not options.update_use_local_desc \
 			and not options.update_changelogs:

diff --git a/bin/repoman b/bin/repoman
index 24e8f77..43270f9 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -95,8 +95,7 @@ os.umask(0o22)
 # behave incrementally.
 repoman_incrementals = tuple(x for x in \
 	portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
-eprefix = portage.const.EPREFIX
-repoman_settings = portage.config(local_config=False, eprefix=eprefix)
+repoman_settings = portage.config(local_config=False)
 repoman_settings.lock()
 
 if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
@@ -565,13 +564,13 @@ if options.mode == 'commit' and not options.pretend and not vcs:
 	options.pretend = True
 
 # Ensure that PORTDIR_OVERLAY contains the repository corresponding to $PWD.
-repoman_settings = portage.config(local_config=False, eprefix=eprefix)
+repoman_settings = portage.config(local_config=False)
 repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
 	(repoman_settings.get('PORTDIR_OVERLAY', ''),
 	portage._shell_quote(portdir_overlay))
 # We have to call the config constructor again so
 # that config.repositories is initialized correctly.
-repoman_settings = portage.config(local_config=False, eprefix=eprefix,
+repoman_settings = portage.config(local_config=False,
 	env=dict(os.environ, PORTDIR_OVERLAY=repoman_settings['PORTDIR_OVERLAY']))
 
 root = repoman_settings['EROOT']
@@ -2005,7 +2004,7 @@ for x in effective_scanlist:
 						config_incrementals=repoman_incrementals,
 						local_config=False,
 						_unmatched_removal=options.unmatched_removal,
-						env=env, eprefix=eprefix)
+						env=env)
 					dep_settings.categories = repoman_settings.categories
 					if options.without_mask:
 						dep_settings._mask_manager = \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-10 20:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-10 20:52 UTC (permalink / raw
  To: gentoo-commits

commit:     6163432c090c5e4959d8b09d7e6cf8a3bfc415eb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 20:52:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 20:52:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6163432c

repoman: eliminate eclass_db variable

---
 bin/repoman |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 43270f9..5924ba9 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -583,8 +583,7 @@ portdb = trees[root]['porttree'].dbapi
 # that are specified in layout.conf.
 repodir = os.path.realpath(portdir_overlay)
 repo_config = repoman_settings.repositories.get_repo_for_location(repodir)
-eclass_db = portdb.repositories.get_repo_for_location(repodir).eclass_db
-portdb.porttrees = list(eclass_db.porttrees)
+portdb.porttrees = list(repo_config.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 
 # In order to disable manifest signatures, repos may set
@@ -672,7 +671,7 @@ logging.info('PORTDIR_OVERLAY = "%s"' % env['PORTDIR_OVERLAY'])
 env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
 
 categories = []
-for path in eclass_db.porttrees:
+for path in repo_config.eclass_db.porttrees:
 	categories.extend(portage.util.grabfile(
 		os.path.join(path, 'profiles', 'categories')))
 repoman_settings.categories = frozenset(



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-10 23:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-10 23:39 UTC (permalink / raw
  To: gentoo-commits

commit:     56d11b736c2702b77466d3b7bbb59516b9f90835
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 23:39:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 23:39:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=56d11b73

lock-helper.py: disable_legacy_globals

This prevents the portage.data module from accessing portage.settings.

---
 bin/lock-helper.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/lock-helper.py b/bin/lock-helper.py
index 065ddcb..dfb8876 100755
--- a/bin/lock-helper.py
+++ b/bin/lock-helper.py
@@ -6,6 +6,7 @@ import os
 import sys
 sys.path.insert(0, os.environ['PORTAGE_PYM_PATH'])
 import portage
+portage._disable_legacy_globals()
 
 def main(args):
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-14  4:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-14  4:06 UTC (permalink / raw
  To: gentoo-commits

commit:     9fa915eef028c96b8cde3876fb8bb299c03f9a62
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 04:06:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 04:06:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9fa915ee

ebuils-ipc.py: _exit in finally block after fork

---
 bin/ebuild-ipc.py |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 68ad985..372585f 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -13,6 +13,7 @@ import select
 import signal
 import sys
 import time
+import traceback
 
 def debug_signal(signum, frame):
 	import pdb
@@ -228,14 +229,22 @@ class EbuildIpc(object):
 		pid = os.fork()
 
 		if pid == 0:
-			os.close(pr)
-
-			# File streams are in unbuffered mode since we do atomic
-			# read and write of whole pickles.
-			output_file = open(self.ipc_in_fifo, 'wb', 0)
-			output_file.write(pickle.dumps(args))
-			output_file.close()
-			os._exit(os.EX_OK)
+			retval = 1
+			try:
+				os.close(pr)
+
+				# File streams are in unbuffered mode since we do atomic
+				# read and write of whole pickles.
+				output_file = open(self.ipc_in_fifo, 'wb', 0)
+				output_file.write(pickle.dumps(args))
+				output_file.close()
+				retval = os.EX_OK
+			except SystemExit:
+				raise
+			except:
+				traceback.print_exc()
+			finally:
+				os._exit(retval)
 
 		os.close(pw)
 
@@ -258,9 +267,16 @@ class EbuildIpc(object):
 		pid = os.fork()
 
 		if pid == 0:
-			os.close(pr)
-			retval = self._receive_reply(input_fd)
-			os._exit(retval)
+			retval = 1
+			try:
+				os.close(pr)
+				retval = self._receive_reply(input_fd)
+			except SystemExit:
+				raise
+			except:
+				traceback.print_exc()
+			finally:
+				os._exit(retval)
 
 		os.close(pw)
 		retval = self._wait(pid, pr, portage.localization._('during read'))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-14  5:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-14  5:32 UTC (permalink / raw
  To: gentoo-commits

commit:     7bcb8e14d52c51904d42ccb1df49f481df2be9dd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 05:32:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 05:32:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7bcb8e14

ebuild-ipc.py: return 2 when forked child crashes

---
 bin/ebuild-ipc.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 372585f..29d4c23 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -229,7 +229,7 @@ class EbuildIpc(object):
 		pid = os.fork()
 
 		if pid == 0:
-			retval = 1
+			retval = 2
 			try:
 				os.close(pr)
 
@@ -267,7 +267,7 @@ class EbuildIpc(object):
 		pid = os.fork()
 
 		if pid == 0:
-			retval = 1
+			retval = 2
 			try:
 				os.close(pr)
 				retval = self._receive_reply(input_fd)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-14  9:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-14  9:43 UTC (permalink / raw
  To: gentoo-commits

commit:     32a5e5531d6fa0520478ff831953702365ca6cd9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 09:42:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 09:42:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=32a5e553

Filter __PORTAGE_TEST_HARDLINK_LOCKS from env.

---
 bin/phase-functions.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 6dcf2b6..664202a 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -28,7 +28,8 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
 	PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \
 	PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \
 	PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \
-	PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR"
+	PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \
+	__PORTAGE_TEST_HARDLINK_LOCKS"
 
 PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR"
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-18 20:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-18 20:18 UTC (permalink / raw
  To: gentoo-commits

commit:     aae7d871ba564c188a16eff96dac302ba74aade1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 18 20:18:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 20:18:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aae7d871

environment: don't save COLUMNS

---
 bin/phase-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 664202a..26ffde6 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -83,7 +83,7 @@ filter_readonly_variables() {
 	local x filtered_vars
 	local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
 		FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-	local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
+	local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
 		HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
 		OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
 		SECONDS SHELL SHLVL _"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-18 20:48 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-18 20:48 UTC (permalink / raw
  To: gentoo-commits

commit:     35a87e80937d06eab3b605dc038b48da590fe88e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Dec 18 20:43:51 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 20:43:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=35a87e80

set_colors(): Redirect input to `stty size` to make it work after
commit a3797a63a30579be3ba5418aad7e76fd520f9aee.

---
 bin/isolated-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index d2ea319..1bcc5c9 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -415,7 +415,7 @@ set_colors() {
 	# If stdout is a pipe, the parent process can export COLUMNS
 	# if it's relevant.
 	[[ $COLS == 0 && $EBUILD_PHASE != depend ]] && \
-		COLS=$(set -- $(stty size 2>/dev/null) ; echo $2)
+		COLS=$(set -- $(stty size </dev/tty 2>/dev/null) ; echo $2)
 	(( COLS > 0 )) || (( COLS = 80 ))
 
 	# Now, ${ENDCOL} will move us to the end of the



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-18 22:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-18 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     af7d4ecf7e939818df2f2a210a376d91dd41291d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 18 22:13:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 22:13:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af7d4ecf

set_colors(): suppress "/dev/tty: No such device"

---
 bin/isolated-functions.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 1bcc5c9..9321ad5 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -413,9 +413,11 @@ set_colors() {
 	COLS=${COLUMNS:-0}      # bash's internal COLUMNS variable
 	# Avoid wasteful stty calls during the "depend" phases.
 	# If stdout is a pipe, the parent process can export COLUMNS
-	# if it's relevant.
+	# if it's relevant. Use an extra subshell for stty calls, in
+	# order to redirect "/dev/tty: No such device or address"
+	# error from bash to /dev/null.
 	[[ $COLS == 0 && $EBUILD_PHASE != depend ]] && \
-		COLS=$(set -- $(stty size </dev/tty 2>/dev/null) ; echo $2)
+		COLS=$(set -- $( ( stty size </dev/tty ) 2>/dev/null || echo 24 80 ) ; echo $2)
 	(( COLS > 0 )) || (( COLS = 80 ))
 
 	# Now, ${ENDCOL} will move us to the end of the



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-19  1:38 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-19  1:38 UTC (permalink / raw
  To: gentoo-commits

commit:     2ea565e1af3416ab5743c4b7181476d9a6734123
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Dec 19 01:33:27 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 01:33:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2ea565e1

Disallow some functions in global scope in EAPI="4-python".

---
 bin/ebuild.sh |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index af7b3a9..63c246a 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -25,17 +25,27 @@ else
 		libopts register_die_hook register_success_hook \
 		remove_path_entry set_unless_changed strip_duplicate_slashes \
 		unset_unless_changed use_with use_enable ; do
-		eval "${x}() { : ; }"
+		eval "${x}() {
+			if has \"\${EAPI:-0}\" 4-python; then
+				die \"\${FUNCNAME}() calls are not allowed in global scope\"
+			fi
+		}"
 	done
-	# These dummy functions return false, in order to ensure that
+	# These dummy functions return false in older EAPIs, in order to ensure that
 	# `use multislot` is false for the "depend" phase.
 	for x in use useq usev ; do
-		eval "${x}() { return 1; }"
+		eval "${x}() {
+			if has \"\${EAPI:-0}\" 4-python; then
+				die \"\${FUNCNAME}() calls are not allowed in global scope\"
+			else
+				return 1
+			fi
+		}"
 	done
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
 	for x in best_version has_version portageq ; do
-		eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
+		eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }"
 	done
 	unset x
 fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-21 19:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-21 19:36 UTC (permalink / raw
  To: gentoo-commits

commit:     a192ba876959823534ebfbe2fcb7989a02f68810
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 21 19:36:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 21 19:36:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a192ba87

install_qa_check: more RESTRICT=binchecks

---
 bin/misc-functions.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b536a63..b6bd8ed 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -309,7 +309,8 @@ install_qa_check() {
 		fi
 
 		# Check for files built without respecting CFLAGS
-		if [[ "${CFLAGS}" == *-frecord-gcc-switches* ]] && [[ "${PN}" != *-bin ]] ; then
+		if [[ "${CFLAGS}" == *-frecord-gcc-switches* ]] && \
+			! has binchecks ${RESTRICT} ; then
 			qa_var="QA_DT_SWITCHES_${ARCH/-/_}"
 			eval "[[ -n \${!qa_var} ]] && QA_DT_SWITCHES=(\"\${${qa_var}[@]}\")"
 			f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
@@ -349,7 +350,8 @@ install_qa_check() {
 		fi
 
 		# Check for files built without respecting LDFLAGS
-		if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && [[ "${PN}" != *-bin ]] ; then
+		if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && \
+			! has binchecks ${RESTRICT} ; then
 			qa_var="QA_DT_HASH_${ARCH/-/_}"
 			eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
 			f=$(scanelf -qyRF '%k %p' -k .hash "${ED}" | sed -e "s:\.hash ::")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-22  4:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-22  4:06 UTC (permalink / raw
  To: gentoo-commits

commit:     7ae2254d1e8db0e3976b82c65a8640cfc99cedb1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 22 04:06:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 04:06:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7ae2254d

filter_readonly_variables: preserve binpkg vars

---
 bin/phase-functions.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 26ffde6..482fd6a 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -74,6 +74,8 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
 #
 # ---allow-extra-vars causes some extra vars to be allowd through, such
 # as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
+# This is enabled automatically if EMERGE_FROM=binary, since it preserves
+# variables from when the package was originally built.
 #
 # In bash-3.2_p20+ an attempt to assign BASH_*, FUNCNAME, GROUPS or any
 # readonly variable cause the shell to exit while executing the "source"
@@ -122,7 +124,7 @@ filter_readonly_variables() {
 			LC_CTYPE LC_MESSAGES LC_MONETARY
 			LC_NUMERIC LC_PAPER LC_TIME"
 	fi
-	if ! has --allow-extra-vars $* ; then
+	if [[ ${EMERGE_FROM} != binary ]] && ! has --allow-extra-vars $* ; then
 		filtered_vars="
 			${filtered_vars}
 			${PORTAGE_SAVED_READONLY_VARS}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-22  5:44 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-22  5:44 UTC (permalink / raw
  To: gentoo-commits

commit:     c3a50a9a2c8116c95c8b2f89d570a89c299ddea3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 22 05:43:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 05:43:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c3a50a9a

filter_readonly_variables: don't trust binpkg var

---
 bin/phase-functions.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 482fd6a..7407aba 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -92,6 +92,8 @@ filter_readonly_variables() {
 	local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC
 		SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
 		SANDBOX_LOG SANDBOX_ON"
+	# Untrusted due to possible application of package renames to binpkgs
+	local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
 	local misc_garbage_vars="_portage_filter_opts"
 	filtered_vars="$readonly_bash_vars $bash_misc_vars
 		$PORTAGE_READONLY_VARS $misc_garbage_vars"
@@ -130,6 +132,8 @@ filter_readonly_variables() {
 			${PORTAGE_SAVED_READONLY_VARS}
 			${PORTAGE_MUTABLE_FILTERED_VARS}
 		"
+	elif ! has --allow-extra-vars $* ; then
+		filtered_vars+=" ${binpkg_untrusted_vars}"
 	fi
 
 	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-22 19:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-22 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     8d524638e4e664a684d781181a09eee3de12319c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 22 19:39:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 19:39:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8d524638

filter_readonly_variables: refactor binpkg logic

---
 bin/phase-functions.sh |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 7407aba..2167853 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -126,14 +126,15 @@ filter_readonly_variables() {
 			LC_CTYPE LC_MESSAGES LC_MONETARY
 			LC_NUMERIC LC_PAPER LC_TIME"
 	fi
-	if [[ ${EMERGE_FROM} != binary ]] && ! has --allow-extra-vars $* ; then
-		filtered_vars="
-			${filtered_vars}
-			${PORTAGE_SAVED_READONLY_VARS}
-			${PORTAGE_MUTABLE_FILTERED_VARS}
-		"
-	elif ! has --allow-extra-vars $* ; then
-		filtered_vars+=" ${binpkg_untrusted_vars}"
+	if ! has --allow-extra-vars $* ; then
+		if [ "${EMERGE_FROM}" = binary ] ; then
+			# preserve additional variables from build time,
+			# while excluding untrusted variables
+			filtered_vars+=" ${binpkg_untrusted_vars}"
+		else
+			filtered_vars+=" ${PORTAGE_SAVED_READONLY_VARS}"
+			filtered_vars+=" ${PORTAGE_MUTABLE_FILTERED_VARS}"
+		fi
 	fi
 
 	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-23  0:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-23  0:27 UTC (permalink / raw
  To: gentoo-commits

commit:     3bbbe6b190079e943bbfda598f9dd0d45661c0e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 00:26:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 00:26:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3bbbe6b1

QA_FLAGS_IGNORED: include QA_PREBUILT

Also, QA_DT_HASH doesn't need to include QA_PREBUILT anymore, since
it's merged with QA_FLAGS_IGNORED.

---
 bin/ebuild.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 63c246a..a4ac81b 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -603,7 +603,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 
 				# these ones support regular expressions, so translate
 				# fnmatch patterns to regular expressions
-				for x in QA_DT_HASH QA_DT_NEEDED QA_PRESTRIPPED QA_SONAME ; do
+				for x in QA_DT_NEEDED QA_FLAGS_IGNORED QA_PRESTRIPPED QA_SONAME ; do
 					if [[ $(declare -p $x 2>/dev/null) = declare\ -a* ]] ; then
 						eval "$x=(\"\${$x[@]}\" ${QA_PREBUILT//\*/.*})"
 					else



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-24  9:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-24  9:10 UTC (permalink / raw
  To: gentoo-commits

commit:     b91754cb94e3f3d2db50768ec7cad47314d806ce
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 24 09:07:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 24 09:07:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b91754cb

Do CFLAGS check before strip for bug #395877.

---
 bin/misc-functions.sh |  144 +++++++++++++++++++++++++------------------------
 1 files changed, 73 insertions(+), 71 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index dcfdceb..9d8244d 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -148,12 +148,83 @@ prepcompress() {
 }
 
 install_qa_check() {
-	local f i x
+	local f i qa_var x
 	[[ " ${FEATURES} " == *" force-prefix "* ]] || \
 		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
 
 	cd "${ED}" || die "cd failed"
 
+	# Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since
+	# QA_DT_HASH is deprecated.
+	qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}"
+	eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")"
+	if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then
+		local shopts=$-
+		set -o noglob
+		QA_FLAGS_IGNORED=(${QA_FLAGS_IGNORED})
+		set +o noglob
+		set -${shopts}
+	fi
+
+	qa_var="QA_DT_HASH_${ARCH/-/_}"
+	eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
+	if [[ ${#QA_DT_HASH[@]} -eq 1 ]] ; then
+		local shopts=$-
+		set -o noglob
+		QA_DT_HASH=(${QA_DT_HASH})
+		set +o noglob
+		set -${shopts}
+	fi
+
+	if [[ -n ${QA_DT_HASH} ]] ; then
+		QA_FLAGS_IGNORED=("${QA_FLAGS_IGNORED[@]}" "${QA_DT_HASH[@]}")
+		unset QA_DT_HASH
+	fi
+
+	# Merge QA_STRICT_FLAGS_IGNORED and QA_STRICT_DT_HASH, since
+	# QA_STRICT_DT_HASH is deprecated
+	if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] && \
+		[ "${QA_STRICT_DT_HASH-unset}" != unset ] ; then
+		QA_STRICT_FLAGS_IGNORED=1
+		unset QA_STRICT_DT_HASH
+	fi
+
+	# Check for files built without respecting *FLAGS. Note that
+	# -frecord-gcc-switches must be in all *FLAGS variables, in
+	# order to avoid false positive results here.
+	# NOTE: This check must execute before prepall/prepstrip, since
+	# prepstrip strips the .GCC.command.line sections.
+	if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT} && \
+		[[ "${CFLAGS}" == *-frecord-gcc-switches* ]] && \
+		[[ "${CXXFLAGS}" == *-frecord-gcc-switches* ]] && \
+		[[ "${FFLAGS}" == *-frecord-gcc-switches* ]] && \
+		[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] ; then
+		f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
+		if [[ -n ${f} ]] ; then
+			echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log
+			if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then
+				for x in "${QA_FLAGS_IGNORED[@]}" ; do
+					sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
+				done
+			fi
+			# Filter anything under /usr/lib/debug/ in order to avoid
+			# duplicate warnings for splitdebug files.
+			sed -e "s#^usr/lib/debug/.*##" -e "/^\$/d" -e "s#^#/#" \
+				-i "${T}"/scanelf-ignored-CFLAGS.log
+			f=$(<"${T}"/scanelf-ignored-CFLAGS.log)
+			if [[ -n ${f} ]] ; then
+				vecho -ne '\n'
+				eqawarn "${BAD}QA Notice: Files built without respecting CFLAGS have been detected${NORMAL}"
+				eqawarn " Please include the following list of files in your report:"
+				eqawarn "${f}"
+				vecho -ne '\n'
+				sleep 1
+			else
+				rm -f "${T}"/scanelf-ignored-CFLAGS.log
+			fi
+		fi
+	fi
+
 	export STRIP_MASK
 	prepall
 	has "${EAPI}" 0 1 2 3 || prepcompress
@@ -185,7 +256,7 @@ install_qa_check() {
 	fi
 
 	if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT}; then
-		local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}
+		local insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}
 		local x
 
 		# display warnings when using stricter because we die afterwards
@@ -308,75 +379,6 @@ install_qa_check() {
 			sleep 1
 		fi
 
-		# Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since
-		# QA_DT_HASH is deprecated.
-		qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}"
-		eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")"
-		if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then
-			local shopts=$-
-			set -o noglob
-			QA_FLAGS_IGNORED=(${QA_FLAGS_IGNORED})
-			set +o noglob
-			set -${shopts}
-		fi
-
-		qa_var="QA_DT_HASH_${ARCH/-/_}"
-		eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
-		if [[ ${#QA_DT_HASH[@]} -eq 1 ]] ; then
-			local shopts=$-
-			set -o noglob
-			QA_DT_HASH=(${QA_DT_HASH})
-			set +o noglob
-			set -${shopts}
-		fi
-
-		if [[ -n ${QA_DT_HASH} ]] ; then
-			QA_FLAGS_IGNORED=("${QA_FLAGS_IGNORED[@]}" "${QA_DT_HASH[@]}")
-			unset QA_DT_HASH
-		fi
-
-		# Merge QA_STRICT_FLAGS_IGNORED and QA_STRICT_DT_HASH, since
-		# QA_STRICT_DT_HASH is deprecated
-		if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] && \
-			[ "${QA_STRICT_DT_HASH-unset}" != unset ] ; then
-			QA_STRICT_FLAGS_IGNORED=1
-			unset QA_STRICT_DT_HASH
-		fi
-
-		# Check for files built without respecting *FLAGS. Note that
-		# -frecord-gcc-switches must be in all *FLAGS variables, in
-		# order to avoid false positive results here.
-		if [[ "${CFLAGS}" == *-frecord-gcc-switches* ]] && \
-			[[ "${CXXFLAGS}" == *-frecord-gcc-switches* ]] && \
-			[[ "${FFLAGS}" == *-frecord-gcc-switches* ]] && \
-			[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] && \
-			! has binchecks ${RESTRICT} ; then
-			f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
-			if [[ -n ${f} ]] ; then
-				echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log
-				if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then
-					for x in "${QA_FLAGS_IGNORED[@]}" ; do
-						sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
-					done
-				fi
-				# Filter anything under /usr/lib/debug/ in order to avoid
-				# duplicate warnings for splitdebug files.
-				sed -e "s#^usr/lib/debug/.*##" -e "/^\$/d" -e "s#^#/#" \
-					-i "${T}"/scanelf-ignored-CFLAGS.log
-				f=$(<"${T}"/scanelf-ignored-CFLAGS.log)
-				if [[ -n ${f} ]] ; then
-					vecho -ne '\n'
-					eqawarn "${BAD}QA Notice: Files built without respecting CFLAGS have been detected${NORMAL}"
-					eqawarn " Please include the following list of files in your report:"
-					eqawarn "${f}"
-					vecho -ne '\n'
-					sleep 1
-				else
-					rm -f "${T}"/scanelf-ignored-CFLAGS.log
-				fi
-			fi
-		fi
-
 		# Check for files built without respecting LDFLAGS
 		if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && \
 			! has binchecks ${RESTRICT} ; then 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-24 10:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-24 10:13 UTC (permalink / raw
  To: gentoo-commits

commit:     dfe2afc9549e596a438a322feb35240d52ca26b5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 24 10:13:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 24 10:13:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dfe2afc9

Don't check .GCC.command.line for kernel modules.

Linux kernel modules trigger the following warning when compiled with
-frecord-gcc-switches:

WARNING: mod.o (.GCC.command.line): unexpected non-allocatable section.

---
 bin/misc-functions.sh |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9d8244d..bb67432 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -201,7 +201,18 @@ install_qa_check() {
 		[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] ; then
 		f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
 		if [[ -n ${f} ]] ; then
-			echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log
+			# Separate out file types that are known to support
+			# .GCC.command.line sections, using the `file` command
+			# similar to how prepstrip uses it.
+			> "${T}"/scanelf-ignored-CFLAGS.log
+			for x in $f ; do
+				f=$(file "${x}") || continue
+				[[ -z ${f} ]] && continue
+				if [[ ${f} == *"SB executable"* ||
+					${f} == *"SB shared object"* ]] ; then
+					echo "${x}" >> "${T}"/scanelf-ignored-CFLAGS.log
+				fi
+			done
 			if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then
 				for x in "${QA_FLAGS_IGNORED[@]}" ; do
 					sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-24 11:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-24 11:53 UTC (permalink / raw
  To: gentoo-commits

commit:     84260c2aadbe3fe416d0e2fb428cc1ea07404930
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 24 11:52:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 24 11:52:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84260c2a

Tweak CFLAGS scanelf loop.

---
 bin/misc-functions.sh |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index bb67432..5a726b3 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -199,20 +199,22 @@ install_qa_check() {
 		[[ "${CXXFLAGS}" == *-frecord-gcc-switches* ]] && \
 		[[ "${FFLAGS}" == *-frecord-gcc-switches* ]] && \
 		[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] ; then
-		f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
-		if [[ -n ${f} ]] ; then
+		rm -f "${T}"/scanelf-ignored-CFLAGS.log
+		for x in $(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | \
+			sed -e "s:\!.GCC.command.line ::") ; do
 			# Separate out file types that are known to support
 			# .GCC.command.line sections, using the `file` command
 			# similar to how prepstrip uses it.
-			> "${T}"/scanelf-ignored-CFLAGS.log
-			for x in $f ; do
-				f=$(file "${x}") || continue
-				[[ -z ${f} ]] && continue
-				if [[ ${f} == *"SB executable"* ||
-					${f} == *"SB shared object"* ]] ; then
-					echo "${x}" >> "${T}"/scanelf-ignored-CFLAGS.log
-				fi
-			done
+			f=$(file "${x}") || continue
+			[[ -z ${f} ]] && continue
+			if [[ ${f} == *"SB executable"* ||
+				${f} == *"SB shared object"* ]] ; then
+				echo "${x}" >> "${T}"/scanelf-ignored-CFLAGS.log
+			fi
+		done
+
+		if [[ -f "${T}"/scanelf-ignored-CFLAGS.log ]] ; then
+
 			if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then
 				for x in "${QA_FLAGS_IGNORED[@]}" ; do
 					sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2011-12-25 20:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2011-12-25 20:05 UTC (permalink / raw
  To: gentoo-commits

commit:     656562dd40ea1487dd93a565f8f2f87040555b42
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 25 20:05:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 20:05:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=656562dd

repoman: later --ask prompt for bug #395995

---
 bin/repoman |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 5924ba9..5fc2de0 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2443,10 +2443,6 @@ else:
 		commitmessage += ", RepoMan options: --force"
 	commitmessage += ")"
 
-	if options.ask and userquery('Commit changes?', True) != 'Yes':
-		print("* aborting commit.")
-		sys.exit(1)
-
 	if options.echangelog in ('y', 'force'):
 		logging.info("checking for unmodified ChangeLog files")
 		committer_name = utilities.get_committer_name(env=repoman_settings)
@@ -2570,6 +2566,10 @@ else:
 	logging.info("myupdates: %s", myupdates)
 	logging.info("myheaders: %s", myheaders)
 
+	if options.ask and userquery('Commit changes?', True) != 'Yes':
+		print("* aborting commit.")
+		sys.exit(1)
+
 	# Handle the case where committed files have keywords which
 	# will change and need a priming commit before the Manifest
 	# can be committed.



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-02  7:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-02  7:37 UTC (permalink / raw
  To: gentoo-commits

commit:     bbd0a415c33d46c168f38a59bf1bc031a586c5e2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  2 07:34:30 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan  2 07:34:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbd0a415

repoman: discard xmatch caches from previous pkgs

This should help prevent repoman from consuming too much memory when
checking multiple packages or the whole tree.

---
 bin/repoman |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 5fc2de0..1933489 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1195,6 +1195,8 @@ if options.if_modified == "y":
 for x in effective_scanlist:
 	#ebuilds and digests added to cvs respectively.
 	logging.info("checking package %s" % x)
+	# save memory by discarding xmatch caches from previous package(s)
+	arch_xmatch_caches.clear()
 	eadded=[]
 	catdir,pkgdir=x.split("/")
 	checkdir=repodir+"/"+x



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-08  6:07 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-08  6:07 UTC (permalink / raw
  To: gentoo-commits

commit:     d933ef603595ef43128065cf1791be97c5515578
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan  8 06:06:33 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 06:06:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d933ef60

Fix location of a comment.

---
 bin/ebuild.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a4ac81b..f8e71f5 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
@@ -650,9 +650,9 @@ if [[ $EBUILD_PHASE = depend ]] ; then
 		PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04
 		UNUSED_03 UNUSED_02 UNUSED_01"
 
-	#the extra $(echo) commands remove newlines
 	[ -n "${EAPI}" ] || EAPI=0
 
+	# The extra $(echo) commands remove newlines.
 	if [ -n "${dbkey}" ] ; then
 		> "${dbkey}"
 		for f in ${auxdbkeys} ; do



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-13 12:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-13 12:20 UTC (permalink / raw
  To: gentoo-commits

commit:     5d5364e982820fda56db5a40884e1c5f8e784b96
Author:     Brian Harring <ferringb <AT> chromium <DOT> org>
AuthorDate: Fri Jan 13 12:18:48 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 12:18:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5d5364e9

Modify PKG_INSTALL_MASK to apply only to binpkg creation.

Primarily useful for certain cases where cros needs to suppress debug
symbols being included for specific pkgs, and/or suppressing binpkgs
from carrying sensitive configuration data, but we still wish for it
to be installed.

BUG=chromium-os:25060
TEST=set PKG_INSTALL_MASK, check ${D} vs what's in the binpkg

Change-Id: I0f81a9e394b7b0b64dbbcbe8d189876cb8421dfa

---
 bin/misc-functions.sh |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 5a726b3..df0493b 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1101,8 +1101,16 @@ dyn_package() {
 
 	# Make sure $PWD is not ${D} so that we don't leave gmon.out files
 	# in there in case any tools were built with -pg in CFLAGS.
+
 	cd "${T}"
-	install_mask "${ED}" "${PKG_INSTALL_MASK}"
+
+	local PROOT="${T}/packaging"
+	# make a temporary copy of ${D} so that any modifications we do that
+	# are binpkg specific, do not influence the actual installed image.
+	cp -la "${PORTAGE_BUILDDIR}/image" "${PROOT}" || die "failed creating packaging tree"
+
+	install_mask "${PROOT}" "${PKG_INSTALL_MASK}"
+
 	local tar_options=""
 	[[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v"
 	# Sandbox is disabled in case the user wants to use a symlink
@@ -1111,7 +1119,7 @@ dyn_package() {
 	[ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \
 		die "PORTAGE_BINPKG_TMPFILE is unset"
 	mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed"
-	tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \
+	tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${PROOT}" . | \
 		$PORTAGE_BZIP2_COMMAND -c > "$PORTAGE_BINPKG_TMPFILE"
 	assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'"
 	PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
@@ -1132,6 +1140,9 @@ dyn_package() {
 	[ -n "${md5_hash}" ] && \
 		echo ${md5_hash} > "${PORTAGE_BUILDDIR}"/build-info/BINPKGMD5
 	vecho ">>> Done."
+
+	# cleanup our temp tree
+	rm -rf "${PROOT}"
 	cd "${PORTAGE_BUILDDIR}"
 	>> "$PORTAGE_BUILDDIR/.packaged" || \
 		die "Failed to create $PORTAGE_BUILDDIR/.packaged"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-13 14:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-13 14:14 UTC (permalink / raw
  To: gentoo-commits

commit:     850931b76f62509df1b55ff3f4151393da0b3807
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 14:14:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 14:14:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=850931b7

dyn_package: remove stale PROOT if necessary

---
 bin/misc-functions.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index df0493b..6094fb7 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1107,6 +1107,7 @@ dyn_package() {
 	local PROOT="${T}/packaging"
 	# make a temporary copy of ${D} so that any modifications we do that
 	# are binpkg specific, do not influence the actual installed image.
+	rm -rf "${PROOT}" || die "failed removing stale package tree"
 	cp -la "${PORTAGE_BUILDDIR}/image" "${PROOT}" || die "failed creating packaging tree"
 
 	install_mask "${PROOT}" "${PKG_INSTALL_MASK}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-13 16:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-13 16:06 UTC (permalink / raw
  To: gentoo-commits

commit:     9ea603a611ddf4a8575ba73edc63b85213d7e701
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:06:20 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:06:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ea603a6

dyn_package: portable cp args by Mike Frysinger

---
 bin/misc-functions.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 6094fb7..431e89f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1108,7 +1108,9 @@ dyn_package() {
 	# make a temporary copy of ${D} so that any modifications we do that
 	# are binpkg specific, do not influence the actual installed image.
 	rm -rf "${PROOT}" || die "failed removing stale package tree"
-	cp -la "${PORTAGE_BUILDDIR}/image" "${PROOT}" || die "failed creating packaging tree"
+	cp -pPR $(cp --help | grep -qs -e-l && echo -l) \
+		"${PORTAGE_BUILDDIR}/image" "${PROOT}" \
+		|| die "failed creating packaging tree"
 
 	install_mask "${PROOT}" "${PKG_INSTALL_MASK}"
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-13 16:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-13 16:22 UTC (permalink / raw
  To: gentoo-commits

commit:     c978b14d9a400c30616f27b63d8aa2d6d0522c0f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:21:31 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:21:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c978b14d

dyn_install: skip copy if possible

Also, fix EPREFIX breakage since commit
5d5364e982820fda56db5a40884e1c5f8e784b96.

---
 bin/misc-functions.sh |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 431e89f..2c002cc 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1095,24 +1095,29 @@ preinst_selinux_labels() {
 }
 
 dyn_package() {
+	local PROOT
 
 	[[ " ${FEATURES} " == *" force-prefix "* ]] || \
-		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+		case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac
 
 	# Make sure $PWD is not ${D} so that we don't leave gmon.out files
 	# in there in case any tools were built with -pg in CFLAGS.
 
 	cd "${T}"
 
-	local PROOT="${T}/packaging"
-	# make a temporary copy of ${D} so that any modifications we do that
-	# are binpkg specific, do not influence the actual installed image.
-	rm -rf "${PROOT}" || die "failed removing stale package tree"
-	cp -pPR $(cp --help | grep -qs -e-l && echo -l) \
-		"${PORTAGE_BUILDDIR}/image" "${PROOT}" \
-		|| die "failed creating packaging tree"
-
-	install_mask "${PROOT}" "${PKG_INSTALL_MASK}"
+	if [[ -n ${PKG_INSTALL_MASK} ]] ; then
+		PROOT=${T}/packaging/
+		# make a temporary copy of ${D} so that any modifications we do that
+		# are binpkg specific, do not influence the actual installed image.
+		rm -rf "${PROOT}" || die "failed removing stale package tree"
+		cp -pPR $(cp --help | grep -qs -e-l && echo -l) \
+			"${D}" "${PROOT}" \
+			|| die "failed creating packaging tree"
+
+		install_mask "${PROOT%/}${EPREFIX}/" "${PKG_INSTALL_MASK}"
+	else
+		PROOT=${D}
+	fi
 
 	local tar_options=""
 	[[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v"
@@ -1145,7 +1150,7 @@ dyn_package() {
 	vecho ">>> Done."
 
 	# cleanup our temp tree
-	rm -rf "${PROOT}"
+	[[ -n ${PKG_INSTALL_MASK} ]] && rm -rf "${PROOT}"
 	cd "${PORTAGE_BUILDDIR}"
 	>> "$PORTAGE_BUILDDIR/.packaged" || \
 		die "Failed to create $PORTAGE_BUILDDIR/.packaged"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-14 17:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-14 17:01 UTC (permalink / raw
  To: gentoo-commits

commit:     ee42bbb989cb31b0af76b6ae53ab238954a6f14e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 14 17:01:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 14 17:01:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ee42bbb9

egencache: use textwrap.dedent

---
 bin/egencache |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 7a87bb6..2f81966 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -503,12 +503,12 @@ class GenUseLocalDesc(object):
 				errors='backslashreplace')
 			output.write(_unicode_decode('\n'))
 		else:
-			output.write(_unicode_decode('''
-# This file is deprecated as per GLEP 56 in favor of metadata.xml. Please add
-# your descriptions to your package's metadata.xml ONLY.
-# * generated automatically using egencache *
+			output.write(textwrap.dedent(_unicode_decode('''
+				# This file is deprecated as per GLEP 56 in favor of metadata.xml. Please add
+				# your descriptions to your package's metadata.xml ONLY.
+				# * generated automatically using egencache *
 
-'''.lstrip()))
+				'''.lstrip())))
 
 		# The cmp function no longer exists in python3, so we'll
 		# implement our own here under a slightly different name
@@ -690,12 +690,12 @@ class GenChangeLogs(object):
 			self.returncode |= 2
 			return
 
-		output.write(_unicode_decode('''
-# ChangeLog for %s
-# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
-# $Header: $
+		output.write(textwrap.dedent(_unicode_decode('''
+			# ChangeLog for %s
+			# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
+			# $Header: $
 
-''' % (cp, time.strftime('%Y'))).lstrip())
+			''' % (cp, time.strftime('%Y'))).lstrip()))
 
 		# now grab all the commits
 		commits = self.grab(['git', 'rev-list', 'HEAD', '--', '.']).split()



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-14 17:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-14 17:10 UTC (permalink / raw
  To: gentoo-commits

commit:     5690ca2b8114ae352c97aefeb2a7b240204e078f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 14 17:10:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 14 17:10:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5690ca2b

egencache: escape newline instead of lstrip

---
 bin/egencache |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 2f81966..b301115 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -503,12 +503,12 @@ class GenUseLocalDesc(object):
 				errors='backslashreplace')
 			output.write(_unicode_decode('\n'))
 		else:
-			output.write(textwrap.dedent(_unicode_decode('''
+			output.write(textwrap.dedent(_unicode_decode('''\
 				# This file is deprecated as per GLEP 56 in favor of metadata.xml. Please add
 				# your descriptions to your package's metadata.xml ONLY.
 				# * generated automatically using egencache *
 
-				'''.lstrip())))
+				''')))
 
 		# The cmp function no longer exists in python3, so we'll
 		# implement our own here under a slightly different name
@@ -690,12 +690,12 @@ class GenChangeLogs(object):
 			self.returncode |= 2
 			return
 
-		output.write(textwrap.dedent(_unicode_decode('''
+		output.write(textwrap.dedent(_unicode_decode('''\
 			# ChangeLog for %s
 			# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
 			# $Header: $
 
-			''' % (cp, time.strftime('%Y'))).lstrip()))
+			''' % (cp, time.strftime('%Y')))))
 
 		# now grab all the commits
 		commits = self.grab(['git', 'rev-list', 'HEAD', '--', '.']).split()



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-15 21:46 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-15 21:46 UTC (permalink / raw
  To: gentoo-commits

commit:     99e5562e09a481a9d484302ad84c380bcf291efc
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan 15 21:44:17 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 21:44:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=99e5562e

portageq metadata: Support repository dependencies.

---
 bin/portageq |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 5e488d3..e532f1c 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -195,9 +195,11 @@ def metadata(argv):
 		print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
 		sys.exit(1)
 	trees = portage.db
+	repo = portage.dep.dep_getrepo(pkgspec)
+	pkgspec = portage.dep.remove_slot(pkgspec)
 	try:
 			values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
-				pkgspec, metakeys)
+				pkgspec, metakeys, myrepo=repo)
 			writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
 	except KeyError:
 		print("Package not found: '%s'" % pkgspec, file=sys.stderr)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-17 15:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-17 15:30 UTC (permalink / raw
  To: gentoo-commits

commit:     e738400f07fbe369af0d6179fb8761ff22c95f39
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 17 15:30:11 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 15:30:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e738400f

_eapi0_src_test: remove redundant FEATURES checks

---
 bin/phase-helpers.sh |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 969cecf..d65845e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -546,15 +546,12 @@ _eapi0_src_test() {
 	local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
 	if $emake_cmd -j1 check -n &> /dev/null; then
 		vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
-		if ! $emake_cmd -j1 check; then
-			has test $FEATURES && die "Make check failed. See above for details."
-			has test $FEATURES || eerror "Make check failed. See above for details."
-		fi
+		$emake_cmd -j1 check || \
+			die "Make check failed. See above for details."
 	elif $emake_cmd -j1 test -n &> /dev/null; then
 		vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
-		if ! $emake_cmd -j1 test; then
-			has test $FEATURES && die "Make test failed. See above for details."
-			has test $FEATURES || eerror "Make test failed. See above for details."
+		$emake_cmd -j1 test || \
+			die "Make test failed. See above for details."
 		fi
 	else
 		vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-17 20:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-17 20:39 UTC (permalink / raw
  To: gentoo-commits

commit:     fcb2aafbbd9d4f62c07942560005b6053eff8a9f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 17 20:39:00 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 20:39:00 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fcb2aafb

remove stray 'fi' from last commit

---
 bin/phase-helpers.sh |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index d65845e..517a910 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -552,7 +552,6 @@ _eapi0_src_test() {
 		vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
 		$emake_cmd -j1 test || \
 			die "Make test failed. See above for details."
-		fi
 	else
 		vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
 	fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-01-25  5:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-01-25  5:34 UTC (permalink / raw
  To: gentoo-commits

commit:     be009d82d552740843d703fcde33112dcd698a9e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 25 05:34:27 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 25 05:34:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=be009d82

phase-helpers.sh: set -x when emulating yes

This avoids displaying a bunch of garbage in debug mode.

---
 bin/phase-helpers.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 517a910..946520b 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -302,7 +302,7 @@ unpack() {
 			ZIP|zip|jar)
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
-				( while true ; do echo n || break ; done ) | \
+				( set +x ; while true ; do echo n || break ; done ) | \
 				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
 			gz|Z|z)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-02-01 18:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-02-01 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     9e4b06838cef9a10468a6e3d220cc4f2154939e1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  1 18:52:11 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  1 18:52:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e4b0683

install_qa_check: handle info dir rm failure

This will fix bug #400679.

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 2c002cc..2614151 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -778,7 +778,7 @@ install_qa_check() {
 	fi
 
 	# Portage regenerates this on the installed system.
-	rm -f "${ED}"/usr/share/info/dir{,.gz,.bz2}
+	rm -f "${ED}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!"
 
 	if has multilib-strict ${FEATURES} && \
 	   [[ -x /usr/bin/file && -x /usr/bin/find ]] && \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-02-08 17:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-02-08 17:33 UTC (permalink / raw
  To: gentoo-commits

commit:     4d4b444be9e89ac25f6919e95b3d7c775e1af212
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 16:35:50 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 16:35:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d4b444b

repoman: normalize thirdpartymirrors trailing /

---
 bin/repoman |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index bee6661..e54967d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1171,7 +1171,10 @@ check_ebuild_notadded = not \
 # Build a regex from thirdpartymirrors for the SRC_URI.mirror check.
 thirdpartymirrors = []
 for v in repoman_settings.thirdpartymirrors().values():
-	thirdpartymirrors.extend(v)
+	for v in v:
+		if not v.endswith("/"):
+			v += "/"
+		thirdpartymirrors.append(v)
 
 class _MetadataTreeBuilder(xml.etree.ElementTree.TreeBuilder):
 	"""



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-02-08 17:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-02-08 17:33 UTC (permalink / raw
  To: gentoo-commits

commit:     3e8e27667bce754914935fe858a9dd3441d44653
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 16:38:27 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 16:38:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3e8e2766

repoman: make SRC_URI.mirror fatal

Thanks to Christian Ruppert <idl0r <AT> gentoo.org> for the suggestion.

---
 bin/repoman |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index e54967d..c78b42f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -415,7 +415,6 @@ qawarnings = set((
 "RDEPEND.implicit",
 "RDEPEND.suspect",
 "RESTRICT.invalid",
-"SRC_URI.mirror",
 "ebuild.minorsyn",
 "ebuild.badheader",
 "ebuild.patches",



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-02-10 23:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-02-10 23:14 UTC (permalink / raw
  To: gentoo-commits

commit:     b92ed5bbd7c90b532019e197a17ba2e698740759
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 10 23:13:49 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 10 23:13:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b92ed5bb

repoman: remove redundant config constructor

---
 bin/repoman |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c78b42f..7edeb65 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -96,7 +96,6 @@ os.umask(0o22)
 repoman_incrementals = tuple(x for x in \
 	portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
 repoman_settings = portage.config(local_config=False)
-repoman_settings.lock()
 
 if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
 	repoman_settings.get('TERM') == 'dumb' or \
@@ -559,7 +558,6 @@ if options.mode == 'commit' and not options.pretend and not vcs:
 	options.pretend = True
 
 # Ensure that PORTDIR_OVERLAY contains the repository corresponding to $PWD.
-repoman_settings = portage.config(local_config=False)
 repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
 	(repoman_settings.get('PORTDIR_OVERLAY', ''),
 	portage._shell_quote(portdir_overlay))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-02-10 23:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-02-10 23:19 UTC (permalink / raw
  To: gentoo-commits

commit:     4abd7ee534a78b78bcec8ebfdcbc023e5ba30bd3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 10 23:19:06 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 10 23:19:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4abd7ee5

repoman: support PORTAGE_CONFIGROOT, bug 402577

---
 bin/repoman |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 7edeb65..32111bd 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -95,7 +95,8 @@ os.umask(0o22)
 # behave incrementally.
 repoman_incrementals = tuple(x for x in \
 	portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
-repoman_settings = portage.config(local_config=False)
+config_root = os.environ.get("PORTAGE_CONFIGROOT")
+repoman_settings = portage.config(config_root=config_root, local_config=False)
 
 if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
 	repoman_settings.get('TERM') == 'dumb' or \
@@ -563,7 +564,7 @@ repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
 	portage._shell_quote(portdir_overlay))
 # We have to call the config constructor again so
 # that config.repositories is initialized correctly.
-repoman_settings = portage.config(local_config=False,
+repoman_settings = portage.config(config_root=config_root, local_config=False,
 	env=dict(os.environ, PORTDIR_OVERLAY=repoman_settings['PORTDIR_OVERLAY']))
 
 root = repoman_settings['EROOT']
@@ -2004,6 +2005,7 @@ for x in effective_scanlist:
 					dep_settings = portage.config(
 						config_profile_path=prof.abs_path,
 						config_incrementals=repoman_incrementals,
+						config_root=config_root,
 						local_config=False,
 						_unmatched_removal=options.unmatched_removal,
 						env=env)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-02-11  5:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-02-11  5:43 UTC (permalink / raw
  To: gentoo-commits

commit:     e96a703a6d1e27681b0982c05d8d1389a035254d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 05:42:57 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 05:42:57 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e96a703a

repoman: no ChangeLog for Manifest-only commit

Use --echangelog=force to force ChangeLog generation in this case.
See bug #398009.

---
 bin/repoman |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 32111bd..f3946ea 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2463,6 +2463,15 @@ else:
 			clnew = [elem[cdrlen:] for elem in mynew if elem.startswith(checkdir_relative)]
 			clremoved = [elem[cdrlen:] for elem in myremoved if elem.startswith(checkdir_relative)]
 			clchanged = [elem[cdrlen:] for elem in mychanged if elem.startswith(checkdir_relative)]
+
+			# Skip ChangeLog generation if only the Manifest was modified,
+			# as discussed in bug #398009.
+			nontrivial_cl_files = set()
+			nontrivial_cl_files.update(clnew, clremoved, clchanged)
+			nontrivial_cl_files.difference_update(['Manifest'])
+			if not nontrivial_cl_files and options.echangelog != 'force':
+				continue
+
 			new_changelog = utilities.UpdateChangeLog(checkdir_relative,
 				committer_name, changelog_msg,
 				os.path.join(repodir, 'skel.ChangeLog'),



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-05  0:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-05  0:49 UTC (permalink / raw
  To: gentoo-commits

commit:     350c094fd54644cbb49bcf8d483a75eb22cb4b6e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  5 00:48:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  5 00:48:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=350c094f

repoman: say Git >=1.7.9 needed for signed commit

---
 bin/repoman |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index bcb48e4..d430a6d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Next to do: dep syntax checking in mask files
@@ -936,6 +936,20 @@ def vcs_files_to_cps(vcs_file_iter):
 
 	return frozenset(modified_cps)
 
+def git_supports_gpg_sign():
+	status, cmd_output = \
+		subprocess_getstatusoutput("git --version")
+	cmd_output = cmd_output.split()
+	if cmd_output:
+		version = re.match(r'^(\d*)\.(\d*)\.(\d*)', cmd_output[-1])
+		if version is not None:
+			version = [int(x) for x in version.groups()[1:]]
+			if version[0] > 1 or \
+				(version[0] == 1 and version[1] > 7) or \
+				(version[0] == 1 and version[1] == 7 and version[2] >= 9):
+				return True
+	return False
+
 def dev_keywords(profiles):
 	"""
 	Create a set of KEYWORDS values that exist in 'dev'
@@ -2772,6 +2786,13 @@ else:
 			else:
 				retval = spawn(commit_cmd, env=os.environ)
 				if retval != os.EX_OK:
+
+					if repo_config.sign_commit and vcs == 'git' and \
+						not git_supports_gpg_sign():
+						# Inform user that newer git is needed (bug #403323).
+						logging.error(
+							"Git >=1.7.9 is required for signed commits!")
+
 					writemsg_level(("!!! Exiting on %s (shell) " + \
 						"error code: %s\n") % (vcs, retval),
 						level=logging.ERROR, noiselevel=-1)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-05  0:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-05  0:55 UTC (permalink / raw
  To: gentoo-commits

commit:     43593de8225589fcd5c0d07ce70f45dfbe11bba9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  5 00:48:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  5 00:54:39 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=43593de8

repoman: say Git >=1.7.9 needed for signed commit

---
 bin/repoman |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index bcb48e4..3f16603 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Next to do: dep syntax checking in mask files
@@ -936,6 +936,20 @@ def vcs_files_to_cps(vcs_file_iter):
 
 	return frozenset(modified_cps)
 
+def git_supports_gpg_sign():
+	status, cmd_output = \
+		subprocess_getstatusoutput("git --version")
+	cmd_output = cmd_output.split()
+	if cmd_output:
+		version = re.match(r'^(\d+)\.(\d+)\.(\d+)', cmd_output[-1])
+		if version is not None:
+			version = [int(x) for x in version.groups()[1:]]
+			if version[0] > 1 or \
+				(version[0] == 1 and version[1] > 7) or \
+				(version[0] == 1 and version[1] == 7 and version[2] >= 9):
+				return True
+	return False
+
 def dev_keywords(profiles):
 	"""
 	Create a set of KEYWORDS values that exist in 'dev'
@@ -2772,6 +2786,13 @@ else:
 			else:
 				retval = spawn(commit_cmd, env=os.environ)
 				if retval != os.EX_OK:
+
+					if repo_config.sign_commit and vcs == 'git' and \
+						not git_supports_gpg_sign():
+						# Inform user that newer git is needed (bug #403323).
+						logging.error(
+							"Git >=1.7.9 is required for signed commits!")
+
 					writemsg_level(("!!! Exiting on %s (shell) " + \
 						"error code: %s\n") % (vcs, retval),
 						level=logging.ERROR, noiselevel=-1)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-08  5:18 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-08  5:18 UTC (permalink / raw
  To: gentoo-commits

commit:     2bf62e023956a4ed1adf67d18152aa82b7aa7356
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  8 05:11:56 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Mar  8 05:18:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2bf62e02

etc-update: rewrite significantly

This tool is very inefficient, especially in the case of auto-merging
with -3/-5 and such.  Rewrite the code to kill off dead paths, compress
multiple greps into a single sed, cache more calculated results, and
use bash code where possible rather than execing external tools.  There
are also style updates here, many of which fix quoting issues and other
such things.

The next rewrite should probably be in python, but this version is
fast enough for me now even on my slow machines.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/etc-update |  643 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 338 insertions(+), 305 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 731b648..4058229 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -1,8 +1,9 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Author Brandon Low <lostlogic@gentoo.org>
+# Mike Frysinger <vapier@gentoo.org>
 #
 # Previous version (from which I've borrowed a few bits) by:
 # Jochem Kossen <j.kossen@home.nl>
@@ -11,9 +12,7 @@
 
 cd /
 
-if type -P gsed >/dev/null ; then
-	sed() { gsed "$@"; }
-fi
+type -P gsed >/dev/null && sed() { gsed "$@"; }
 
 get_config() {
 	# the sed here does:
@@ -25,10 +24,10 @@ get_config() {
 	# If there's more than one of the same configuration item, then
 	# the store to the hold space clobbers previous value so the last
 	# setting takes precedence.
-	local item=$1
-	eval echo $(sed -n \
+	local match=$1
+	eval $(sed -n -r \
 		-e 's:[[:space:]]*#.*$::' \
-		-e "/^[[:space:]]*$item[[:space:]]*=/{s:[^=]*=[[:space:]]*\([\"']\{0,1\}\)\(.*\)\1:\2:;h}" \
+		-e "/^[[:space:]]*${match}[[:space:]]*=/{s:^([^=]*)=[[:space:]]*([\"']{0,1})(.*)\2:\1=\2\3\2:;H}" \
 		-e '${g;p}' \
 		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
 }
@@ -46,39 +45,49 @@ diff_command() {
 
 scan() {
 	echo "Scanning Configuration files..."
-	rm -rf ${TMP}/files > /dev/null 2>&1
-	mkdir ${TMP}/files || die "Failed mkdir command!" 1
+	rm -rf "${TMP}"/files > /dev/null 2>&1
+	mkdir "${TMP}"/files || die "Failed mkdir command!"
 	count=0
 	input=0
 	local find_opts
-	local my_basename
+	local path
 
 	for path in ${CONFIG_PROTECT} ; do
-		path="${EROOT}${path}"
+		path="${EROOT%/}${path}"
+
+		[[ -w ${path} ]] || die "Need write access to ${path}"
+
 		# Do not traverse hidden directories such as .svn or .git.
-		find_opts="-name .* -type d -prune -o -name ._cfg????_*"
-		if [ ! -d "${path}" ]; then
-			[ ! -f "${path}" ] && continue
-			my_basename="${path##*/}"
+		find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
+		if [[ ! -d ${path} ]] ; then
+			[[ ! -f ${path} ]] && continue
+			local my_basename="${path##*/}"
 			path="${path%/*}"
-			find_opts="-maxdepth 1 -name ._cfg????_${my_basename}"
+			find_opts+=( -maxdepth 1 -name "._cfg????_${my_basename}" )
 		fi
-
-		ofile=""
-		# The below set -f turns off file name globbing in the ${find_opts} expansion.
-		for file in $(set -f ; find ${path}/ ${find_opts} \
-		       ! -name '.*~' ! -iname '.*.bak' -print |
-			   sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\1%\2\%\3:" |
-			   sort -t'%' -k2,2 -k4,4 -k3,3 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
-
-			rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
-			rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
+		find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
+
+		local file ofile b=$'\001'
+		for file in $(find "${path}"/ "${find_opts[@]}" |
+		              sed \
+						-e 's://*:/:g' \
+						-e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3$b\1$b\2$b\3:" |
+		              sort -t"$b" -k2,2 -k4,4 -k3,3 |
+		              LC_ALL=C cut -f1 -d"$b")
+		do
+			local rpath rfile cfg_file live_file
+			rpath=${file%/*}
+			rfile=${file##*/}
+			cfg_file="${rpath}/${rfile}"
+			live_file="${rpath}/${rfile:10}"
+
+			local mpath
 			for mpath in ${CONFIG_PROTECT_MASK}; do
-				mpath="${EROOT}${mpath}"
-				mpath=$(echo "${mpath/\/\///}")
-				if [[ "${rpath}" == "${mpath}"* ]]; then
-					mv ${rpath}/${rfile} ${rpath}/${rfile:10}
-					break
+				mpath="${EROOT%/}${mpath}"
+				if [[ "${rpath}" == "${mpath}"* ]] ; then
+					echo "Updating masked file: ${live_file}"
+					mv "${cfg_file}" "${live_file}"
+					continue 2
 				fi
 			done
 			if [[ ! -f ${file} ]] ; then
@@ -87,39 +96,53 @@ scan() {
 			fi
 
 			if [[ "${ofile:10}" != "${rfile:10}" ]] ||
-			   [[ ${opath} != ${rpath} ]]; then
+			   [[ ${opath} != ${rpath} ]]
+			then
 				MATCHES=0
-				if [[ "${EU_AUTOMERGE}" == "yes" ]]; then
-					if [ ! -e "${rpath}/${rfile}" ] || [ ! -e "${rpath}/${rfile:10}" ]; then
+				if [[ ${eu_automerge} == "yes" ]] ; then
+					if [[ ! -e ${cfg_file} || ! -e ${live_file} ]] ; then
 						MATCHES=0
 					else
-						diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | egrep '^[+-]' | egrep -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | egrep -qv '^[-+][\t ]*$'
+						diff -Bbua "${cfg_file}" "${live_file}" | \
+							sed -n -r \
+								-e '/^[+-]/{/^([+-][\t ]*(#|$)|-{3} |\+{3} )/d;q0}' \
+								-e '$q1'
 						MATCHES=$?
 					fi
-				elif [[ -z $(diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
-							  grep "^[+-][^+-]"|grep -v '# .Header:.*') ]]; then
+
+				elif diff -Nua "${cfg_file}" "${live_file}" |
+					sed -n \
+						-e '/# .Header:/d' \
+						-e '/^[+-][^+-]/q1' \
+						-e '$q0'
+				then
 					MATCHES=1
 				fi
-				if [[ "${MATCHES}" == "1" ]]; then
-					echo "Automerging trivial changes in: ${rpath}/${rfile:10}"
-					mv ${rpath}/${rfile} ${rpath}/${rfile:10}
+
+				if [[ ${MATCHES} == 1 ]] ; then
+					echo "Automerging trivial changes in: ${live_file}"
+					mv "${cfg_file}" "${live_file}"
 					continue
 				else
-					count=${count}+1
-					echo "${rpath}/${rfile:10}" > ${TMP}/files/${count}
-					echo "${rpath}/${rfile}" >> ${TMP}/files/${count}
+					: $(( ++count ))
+					echo "${live_file}" > "${TMP}"/files/${count}
+					echo "${cfg_file}" >> "${TMP}"/files/${count}
 					ofile="${rfile}"
 					opath="${rpath}"
 					continue
 				fi
 			fi
 
-			if [[ -z $(diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
-					  grep "^[+-][^+-]"|grep -v '# .Header:.*') ]]; then
-				mv ${rpath}/${rfile} ${rpath}/${ofile}
+			if diff -Nua "${cfg_file}" "${rpath}/${ofile}" |
+				sed -n \
+					-e '/# .Header:/d' \
+					-e '/^[+-][^+-]/q1' \
+					-e '$q0'
+			then
+				mv "${cfg_file}" "${rpath}/${ofile}"
 				continue
 			else
-				echo "${rpath}/${rfile}" >> ${TMP}/files/${count}
+				echo "${cfg_file}" >> "${TMP}"/files/${count}
 				ofile="${rfile}"
 				opath="${rpath}"
 			fi
@@ -134,60 +157,63 @@ sel_file() {
 	      [[ ${input} == -1 ]] || \
 	      [[ ${input} == -3 ]]
 	do
-		local numfiles=$(ls ${TMP}/files|wc -l)
-		local numwidth=${#numfiles}
-		for file in $(ls ${TMP}/files|sort -n); do
-			if [[ ${isfirst} == 0 ]] ; then
-				isfirst=${file}
-			fi
-			numshow=$(printf "%${numwidth}i${PAR} " ${file})
-			numupdates=$(( $(wc -l <${TMP}/files/${file}) - 1 ))
-			echo -n "${numshow}"
-			if [[ ${mode} == 0 ]] ; then
-				echo "$(head -n1 ${TMP}/files/${file}) (${numupdates})"
-			else
-				head -n1 ${TMP}/files/${file}
-			fi
-		done > ${TMP}/menuitems
+		local allfiles=( $(cd "${TMP}"/files/ && printf '%s\n' * | sort -n) )
+		local isfirst=${allfiles[0]}
 
-		if [ "${OVERWRITE_ALL}" == "yes" ]; then
-			input=0
-		elif [ "${DELETE_ALL}" == "yes" ]; then
+		# Optimize: no point in building the whole file list if
+		# we're not actually going to talk to the user.
+		if [[ ${OVERWRITE_ALL} == "yes" || ${DELETE_ALL} == "yes" ]] ; then
 			input=0
 		else
-			[[ $CLEAR_TERM == yes ]] && clear
-			if [[ ${mode} == 0 ]] ; then
-				echo "The following is the list of files which need updating, each
-configuration file is followed by a list of possible replacement files."
-			else
-				local my_title="Please select a file to update"
-			fi
+			local numfiles=${#allfiles[@]}
+			local numwidth=${#numfiles}
+			local file fullfile line
+			for file in "${allfiles[@]}" ; do
+				fullfile="${TMP}/files/${file}"
+				line=$(head -n1 "${fullfile}")
+				printf '%*i%s %s' ${numwidth} ${file} "${PAR}" "${line}"
+				if [[ ${mode} == 0 ]] ; then
+					local numupdates=$(( $(wc -l <"${fullfile}") - 1 ))
+					echo " (${numupdates})"
+				else
+					echo
+				fi
+			done > "${TMP}"/menuitems
+
+			clear
 
 			if [[ ${mode} == 0 ]] ; then
-				cat ${TMP}/menuitems
-				echo    "Please select a file to edit by entering the corresponding number."
-				echo    "              (don't use -3, -5, -7 or -9 if you're unsure what to do)"
-				echo    "              (-1 to exit) (-3 to auto merge all remaining files)"
-				echo    "                           (-5 to auto-merge AND not use 'mv -i')"
-				echo    "                           (-7 to discard all updates)"
-				echo -n "                           (-9 to discard all updates AND not use 'rm -i'): "
+				cat <<-EOF
+					The following is the list of files which need updating, each
+					configuration file is followed by a list of possible replacement files.
+					$(<"${TMP}"/menuitems)
+					Please select a file to edit by entering the corresponding number.
+					              (don't use -3, -5, -7 or -9 if you're unsure what to do)
+					              (-1 to exit) (-3 to auto merge all remaining files)
+					                           (-5 to auto-merge AND not use 'mv -i')
+					                           (-7 to discard all updates)
+				EOF
+				printf "                           (-9 to discard all updates AND not use 'rm -i'): "
 				input=$(read_int)
 			else
-				dialog --title "${title}" --menu "${my_title}" \
-					0 0 0 $(echo -e "-1 Exit\n$(<${TMP}/menuitems)") \
-					2> ${TMP}/input || die "User termination!" 0
-				input=$(<${TMP}/input)
+				dialog \
+					--title "${title}" \
+					--menu "Please select a file to update"	\
+					0 0 0 $(<"${TMP}"/menuitems) \
+					2> "${TMP}"/input \
+					|| die "$(<"${TMP}"/input)\n\nUser termination!" 0
+				input=$(<"${TMP}"/input)
 			fi
-			if [[ ${input} == -9 ]]; then
-				read -p "Are you sure that you want to delete all updates (type YES):" reply
-				if [[ ${reply} != "YES" ]]; then
+			if [[ ${input} == -9 ]] ; then
+				read -p "Are you sure that you want to delete all updates (type YES): " reply
+				if [[ ${reply} != "YES" ]] ; then
 					continue
 				else
 					input=-7
 					export rm_opts=""
 				fi
 			fi
-			if [[ ${input} == -7 ]]; then
+			if [[ ${input} == -7 ]] ; then
 				input=0
 				export DELETE_ALL="yes"
 			fi
@@ -201,21 +227,24 @@ configuration file is followed by a list of possible replacement files."
 				export OVERWRITE_ALL="yes"
 			fi
 		fi # -3 automerge
-		if [[ -z ${input} ]] || [[ ${input} == 0 ]] ; then
+		if [[ ${input:-0} == 0 ]] ; then
 			input=${isfirst}
 		fi
 	done
 }
 
 user_special() {
-	if [ -r ${PORTAGE_CONFIGROOT}etc/etc-update.special ]; then
-		if [ -z "$1" ]; then
-			echo "ERROR: user_special() called without arguments"
+	local special="${PORTAGE_CONFIGROOT}etc/etc-update.special"
+
+	if [[ -r ${special} ]] ; then
+		if [[ -z $1 ]] ; then
+			error "user_special() called without arguments"
 			return 1
 		fi
-		while read -r pat; do
-			echo ${1} | grep "${pat}" > /dev/null && return 0
-		done < ${PORTAGE_CONFIGROOT}etc/etc-update.special
+		local pat
+		while read -r pat ; do
+			echo "$1" | grep -q "${pat}" && return 0
+		done < "${special}"
 	fi
 	return 1
 }
@@ -225,12 +254,12 @@ read_int() {
 	# read.  This is a workaround for odd behavior of bash when an attempt is
 	# made to store a value such as "1y" into an integer-only variable.
 	local my_input
-	while true; do
+	while : ; do
 		read my_input
 		# failed integer conversions will break a loop unless they're enclosed
 		# in a subshell.
-		echo "${my_input}" | ( declare -i x; read x) 2>/dev/null && break
-		echo -n "Value '$my_input' is not valid. Please enter an integer value:" >&2
+		echo "${my_input}" | (declare -i x; read x) 2>/dev/null && break
+		printf 'Value "%s" is not valid. Please enter an integer value: ' "${my_input}" >&2
 	done
 	echo ${my_input}
 }
@@ -239,141 +268,147 @@ do_file() {
 	interactive_echo() { [ "${OVERWRITE_ALL}" != "yes" ] && [ "${DELETE_ALL}" != "yes" ] && echo; }
 	interactive_echo
 	local -i my_input
-	local -i fcount=0
-	until (( $(wc -l < ${TMP}/files/${input}) < 2 )); do
-		my_input=0
-		if (( $(wc -l < ${TMP}/files/${input}) == 2 )); then
+	local -i linecnt
+	local fullfile="${TMP}/files/${input}"
+	local ofile=$(head -n1 "${fullfile}")
+
+	# Walk through all the pending updates for this one file.
+	linecnt=$(wc -l <"${fullfile}")
+	while (( linecnt > 1 )) ; do
+		if (( linecnt == 2 )) ; then
+			# Only one update ... keeps things simple.
 			my_input=1
+		else
+			my_input=0
 		fi
-		until (( ${my_input} > 0 )) && (( ${my_input} < $(wc -l < ${TMP}/files/${input}) )); do
-			fcount=0
 
-			if [ "${OVERWRITE_ALL}" == "yes" ]; then
-				my_input=0
-			elif [ "${DELETE_ALL}" == "yes" ]; then
-				my_input=0
-			else
-				for line in $(<${TMP}/files/${input}); do
-					if (( ${fcount} > 0 )); then
-						echo -n "${fcount}${PAR} "
-						echo "${line}"
-					else
-						if [[ ${mode} == 0 ]] ; then
-							echo "Below are the new config files for ${line}:"
-						else
-							local my_title="Please select a file to process for ${line}"
-						fi
-					fi
-					fcount=${fcount}+1
-				done > ${TMP}/menuitems
+		# Optimize: no point in scanning the file list when we know
+		# we're just going to consume all the ones available.
+		if [[ ${OVERWRITE_ALL} == "yes" || ${DELETE_ALL} == "yes" ]] ; then
+			my_input=1
+		fi
 
-				if [[ ${mode} == 0 ]] ; then
-					cat ${TMP}/menuitems
-					echo -n "Please select a file to process (-1 to exit this file): "
-					my_input=$(read_int)
-				else
-					dialog --title "${title}" --menu "${my_title}" \
-						0 0 0 $(echo -e "$(<${TMP}/menuitems)\n${fcount} Exit") \
-						2> ${TMP}/input || die "User termination!" 0
-					my_input=$(<${TMP}/input)
+		# Figure out which file they wish to operate on.
+		while (( my_input <= 0 || my_input >= linecnt )) ; do
+			local fcount=0
+			for line in $(<"${fullfile}"); do
+				if (( fcount > 0 )); then
+					printf '%i%s %s\n' ${fcount} "${PAR}" "${line}"
 				fi
-			fi # OVERWRITE_ALL
+				: $(( ++fcount ))
+			done > "${TMP}"/menuitems
+
+			if [[ ${mode} == 0 ]] ; then
+				echo "Below are the new config files for ${ofile}:"
+				cat "${TMP}"/menuitems
+				echo -n "Please select a file to process (-1 to exit this file): "
+				my_input=$(read_int)
+			else
+				dialog \
+					--title "${title}" \
+					--menu "Please select a file to process for ${ofile}" \
+					0 0 0 $(<"${TMP}"/menuitems) \
+					2> "${TMP}"/input \
+					|| die "$(<"${TMP}"/input)\n\nUser termination!" 0
+				my_input=$(<"${TMP}"/input)
+			fi
 
 			if [[ ${my_input} == 0 ]] ; then
+				# Auto select the first file.
 				my_input=1
 			elif [[ ${my_input} == -1 ]] ; then
 				input=0
 				return
-			elif [[ ${my_input} == ${fcount} ]] ; then
-				break
 			fi
 		done
-		if [[ ${my_input} == ${fcount} ]] ; then
-			break
-		fi
-
-		fcount=${my_input}+1
-
-		file=$(sed -e "${fcount}p;d" ${TMP}/files/${input})
-		ofile=$(head -n1 ${TMP}/files/${input})
 
+		# First line is the old file while the rest are the config files.
+		: $(( ++my_input ))
+		local file=$(sed -n -e "${my_input}p" "${fullfile}")
 		do_cfg "${file}" "${ofile}"
 
-		sed -e "${fcount}!p;d" ${TMP}/files/${input} > ${TMP}/files/sed
-		mv ${TMP}/files/sed ${TMP}/files/${input}
+		sed -i -e "${my_input}d" "${fullfile}"
 
-		if [[ ${my_input} == -1 ]] ; then
-			break
-		fi
+		: $(( --linecnt ))
 	done
+
 	interactive_echo
-	rm ${TMP}/files/${input}
-	count=${count}-1
+	rm "${fullfile}"
+	: $(( --count ))
 }
 
-do_cfg() {
+show_diff() {
+	clear
+	local file1=$1 file2=$2
+	if [[ ${using_editor} == 0 ]] ; then
+		(
+			echo "Showing differences between ${file1} and ${file2}"
+			diff_command "${file1}" "${file2}"
+		) | ${pager}
+	else
+		echo "Beginning of differences between ${file1} and ${file2}"
+		diff_command "${file1}" "${file2}"
+		echo "End of differences between ${file1} and ${file2}"
+	fi
+}
 
-	local file="${1}"
-	local ofile="${2}"
+do_cfg() {
+	local file=$1
+	local ofile=$2
 	local -i my_input=0
 
-	until (( ${my_input} == -1 )) || [ ! -f ${file} ]; do
+	until (( my_input == -1 )) || [ ! -f ${file} ] ; do
 		if [[ "${OVERWRITE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
 			my_input=1
 		elif [[ "${DELETE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
 			my_input=2
 		else
-			[[ $CLEAR_TERM == yes ]] && clear
-			if [ "${using_editor}" == 0 ]; then
-				(
-					echo "Showing differences between ${ofile} and ${file}"
-					diff_command "${ofile}" "${file}"
-				) | ${pager}
-			else
-				echo "Beginning of differences between ${ofile} and ${file}"
-				diff_command "${ofile}" "${file}"
-				echo "End of differences between ${ofile} and ${file}"
-			fi
-			if [ -L "${file}" ]; then
-				echo
-				echo "-------------------------------------------------------------"
-				echo "NOTE: File is a symlink to another file. REPLACE recommended."
-				echo "      The original file may simply have moved. Please review."
-				echo "-------------------------------------------------------------"
-				echo
+			show_diff "${ofile}" "${file}"
+			if [[ -L ${file} ]] ; then
+				cat <<-EOF
+
+					-------------------------------------------------------------
+					NOTE: File is a symlink to another file. REPLACE recommended.
+					      The original file may simply have moved. Please review.
+					-------------------------------------------------------------
+
+				EOF
 			fi
-			echo -n "File: ${file}
-1) Replace original with update
-2) Delete update, keeping original as is
-3) Interactively merge original with update
-4) Show differences again
-5) Save update as example config
-Please select from the menu above (-1 to ignore this update): "
+			cat <<-EOF
+
+				File: ${file}
+				1) Replace original with update
+				2) Delete update, keeping original as is
+				3) Interactively merge original with update
+				4) Show differences again
+				5) Save update as example config
+			EOF
+			printf 'Please select from the menu above (-1 to ignore this update): '
 			my_input=$(read_int)
 		fi
 
 		case ${my_input} in
-			1) echo "Replacing ${ofile} with ${file}"
-			   mv ${mv_opts} ${file} ${ofile}
-			   [ -n "${OVERWRITE_ALL}" ] && my_input=-1
-			   continue
-			   ;;
-			2) echo "Deleting ${file}"
-			   rm ${rm_opts} ${file}
-			   [ -n "${DELETE_ALL}" ] && my_input=-1
-			   continue
-			   ;;
-			3) do_merge "${file}" "${ofile}"
-			   my_input=${?}
-#			   [ ${my_input} == 255 ] && my_input=-1
-			   continue
-			   ;;
-			4) continue
-			   ;;
-			5) do_distconf "${file}" "${ofile}"
-			   ;;
-			*) continue
-			   ;;
+			1)	echo "Replacing ${ofile} with ${file}"
+				mv ${mv_opts} ${file} ${ofile}
+				[ -n "${OVERWRITE_ALL}" ] && my_input=-1
+				continue
+				;;
+			2)	echo "Deleting ${file}"
+				rm ${rm_opts} ${file}
+				[ -n "${DELETE_ALL}" ] && my_input=-1
+				continue
+				;;
+			3)	do_merge "${file}" "${ofile}"
+				my_input=${?}
+#				[ ${my_input} == 255 ] && my_input=-1
+				continue
+				;;
+			4)	continue
+				;;
+			5)	do_distconf "${file}" "${ofile}"
+				;;
+			*)	continue
+				;;
 		esac
 	done
 }
@@ -399,57 +434,48 @@ do_merge() {
 	# need to make sure the full /path/to/ exists ahead of time
 	mkdir -p "${mfile%/*}"
 
-	until (( ${my_input} == -1 )); do
+	until (( my_input == -1 )); do
 		echo "Merging ${file} and ${ofile}"
 		$(echo "${merge_command}" |
 		 sed -e "s:%merged:${mfile}:g" \
 		 	 -e "s:%orig:${ofile}:g" \
 			 -e "s:%new:${file}:g")
-		until (( ${my_input} == -1 )); do
-			echo -n "1) Replace ${ofile} with merged file
-2) Show differences between merged file and original
-3) Remerge original with update
-4) Edit merged file
-5) Return to the previous menu
-Please select from the menu above (-1 to exit, losing this merge): "
+		until (( my_input == -1 )); do
+			cat <<-EOF
+				1) Replace ${ofile} with merged file
+				2) Show differences between merged file and original
+				3) Remerge original with update
+				4) Edit merged file
+				5) Return to the previous menu
+			EOF
+			printf 'Please select from the menu above (-1 to exit, losing this merge): '
 			my_input=$(read_int)
 			case ${my_input} in
-				1) echo "Replacing ${ofile} with ${mfile}"
-				   if  [[ ${USERLAND} == BSD ]] ; then
-				       chown "$(stat -f %Su:%Sg "${ofile}")" "${mfile}"
-				       chmod $(stat -f %Mp%Lp "${ofile}") "${mfile}"
-				   else
-				       chown --reference="${ofile}" "${mfile}"
-				       chmod --reference="${ofile}" "${mfile}"
-				   fi
-				   mv ${mv_opts} "${mfile}" "${ofile}"
-				   rm ${rm_opts} "${file}"
-				   return 255
-				   ;;
-				2)
-					[[ $CLEAR_TERM == yes ]] && clear
-					if [ "${using_editor}" == 0 ]; then
-						(
-							echo "Showing differences between ${ofile} and ${mfile}"
-							diff_command "${ofile}" "${mfile}"
-						) | ${pager}
+				1)	echo "Replacing ${ofile} with ${mfile}"
+					if [[ ${USERLAND} == BSD ]] ; then
+						chown "$(stat -f %Su:%Sg "${ofile}")" "${mfile}"
+						chmod $(stat -f %Mp%Lp "${ofile}") "${mfile}"
 					else
-						echo "Beginning of differences between ${ofile} and ${mfile}"
-						diff_command "${ofile}" "${mfile}"
-						echo "End of differences between ${ofile} and ${mfile}"
+						chown --reference="${ofile}" "${mfile}"
+						chmod --reference="${ofile}" "${mfile}"
 					fi
-				   continue
-				   ;;
-				3) break
-				   ;;
-				4) ${EDITOR:-nano -w} "${mfile}"
-				   continue
-					 ;;
-				5) rm ${rm_opts} "${mfile}"
-				   return 0
-				   ;;
-				*) continue
-				   ;;
+					mv ${mv_opts} "${mfile}" "${ofile}"
+					rm ${rm_opts} "${file}"
+					return 255
+					;;
+				2)	show_diff "${ofile}" "${mfile}"
+					continue
+					;;
+				3)	break
+					;;
+				4)	${EDITOR:-nano -w} "${mfile}"
+					continue
+					;;
+				5)	rm ${rm_opts} "${mfile}"
+					return 0
+					;;
+				*)	continue
+					;;
 			esac
 		done
 	done
@@ -461,21 +487,15 @@ do_distconf() {
 	# search for any previously saved distribution config
 	# files and number the current one accordingly
 
-	local file="${1}"
-	local ofile="${2}"
+	local file=$1 ofile=$2
 	local -i count
-	local -i fill
 	local suffix
 	local efile
 
-	for ((count = 0; count <= 9999; count++)); do
-		suffix=".dist_"
-		for ((fill = 4 - ${#count}; fill > 0; fill--)); do
-			suffix+="0"
-		done
-		suffix+="${count}"
+	for (( count = 0; count <= 9999; ++count )) ; do
+		suffix=$(printf ".dist_%04i" ${count})
 		efile="${ofile}${suffix}"
-		if [[ ! -f ${efile} ]]; then
+		if [[ ! -f ${efile} ]] ; then
 			mv ${mv_opts} "${file}" "${efile}"
 			break
 		elif diff_command "${file}" "${efile}" &> /dev/null; then
@@ -486,20 +506,22 @@ do_distconf() {
 	done
 }
 
+error() { echo "etc-update: ERROR: $*" 1>&2 ; return 1 ; }
 die() {
 	trap SIGTERM
 	trap SIGINT
+	local msg=$1 exitcode=${2:-1}
 
-	if [ "$2" -eq 0 ]; then
-		echo "Exiting: ${1}"
+	if [ ${exitcode} -eq 0 ] ; then
+		printf 'Exiting: %b\n' "${msg}"
 		scan > /dev/null
 		[ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
 	else
-		echo "ERROR: ${1}"
+		error "${msg}"
 	fi
 
 	rm -rf "${TMP}"
-	exit ${2}
+	exit ${exitcode}
 }
 
 usage() {
@@ -511,10 +533,11 @@ usage() {
 	Options:
 	  -d, --debug    Enable shell debugging
 	  -h, --help     Show help and run away
+	  -v, --verbose  Show settings and such along the way
 	  -V, --version  Show version and trundle away
 	EOF
 
-	[[ -n ${*:2} ]] && printf "\nError: %s\n" "${*:2}" 1>&2
+	[[ $# -gt 1 ]] && printf "\nError: %s\n" "${*:2}" 1>&2
 
 	exit ${1:-0}
 }
@@ -524,10 +547,12 @@ usage() {
 #
 
 SET_X=false
+VERBOSE=false
 while [[ -n $1 ]] ; do
 	case $1 in
 		-d|--debug)   SET_X=true;;
 		-h|--help)    usage;;
+		-v|--verbose) VERBOSE=true;;
 		-V|--version) emerge --version ; exit 0;;
 		*)            usage 1 "Invalid option '$1'";;
 	esac
@@ -535,77 +560,85 @@ while [[ -n $1 ]] ; do
 done
 ${SET_X} && set -x
 
-type portageq > /dev/null || exit $?
-eval $(portageq envvar -v CONFIG_PROTECT \
-	CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_INST_GID PORTAGE_INST_UID \
-	PORTAGE_TMPDIR EROOT USERLAND)
+type portageq >/dev/null || die "missing portageq"
+portage_vars=(
+	CONFIG_PROTECT{,_MASK}
+	PORTAGE_CONFIGROOT
+	PORTAGE_INST_{G,U}ID
+	PORTAGE_TMPDIR
+	EROOT
+	USERLAND
+	NOCOLOR
+)
+eval $(portageq envvar -v ${portage_vars[@]})
 export PORTAGE_TMPDIR
 
 TMP="${PORTAGE_TMPDIR}/etc-update-$$"
-trap "die terminated 1" SIGTERM
-trap "die interrupted 1" SIGINT
-
-[ -w ${PORTAGE_CONFIGROOT}etc ] || die "Need write access to ${PORTAGE_CONFIGROOT}etc" 1
-#echo $PORTAGE_TMPDIR
-#echo $CONFIG_PROTECT
-#echo $CONFIG_PROTECT_MASK
-#export PORTAGE_TMPDIR=$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)
+trap "die terminated" SIGTERM
+trap "die interrupted" SIGINT
 
-rm -rf "${TMP}" 2> /dev/null
-mkdir "${TMP}" || die "failed to create temp dir" 1
+rm -rf "${TMP}" 2>/dev/null
+mkdir "${TMP}" || die "failed to create temp dir"
 # make sure we have a secure directory to work in
-chmod 0700 "${TMP}" || die "failed to set perms on temp dir" 1
+chmod 0700 "${TMP}" || die "failed to set perms on temp dir"
 chown ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${TMP}" || \
-	die "failed to set ownership on temp dir" 1
-
-# I need the CONFIG_PROTECT value
-#CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT)
-#CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
-
-# load etc-config's configuration
-CLEAR_TERM=$(get_config clear_term)
-EU_AUTOMERGE=$(get_config eu_automerge)
-rm_opts=$(get_config rm_opts)
-mv_opts=$(get_config mv_opts)
-cp_opts=$(get_config cp_opts)
-pager=$(get_config pager)
-diff_command=$(get_config diff_command)
-using_editor=$(get_config using_editor)
-merge_command=$(get_config merge_command)
-declare -i mode=$(get_config mode)
-[[ -z ${mode} ]] && mode=0
+	die "failed to set ownership on temp dir"
+
+# Get all the user settings from etc-update.conf
+cfg_vars=(
+	using_editor
+	clear_term
+	eu_automerge
+	rm_opts
+	mv_opts
+	pager
+	diff_command
+	using_editor
+	merge_command
+	mode
+)
+# default them all to ""
+eval ${cfg_vars[@]/%/=}
+# then extract them all from the conf in one shot
+# (ugly var at end is due to printf appending a '|' to last item)
+get_config "($(printf '%s|' "${cfg_vars[@]}")NOVARFOROLDMEN)"
+
+# finally setup any specific defaults
+: ${mode:="0"}
 if ! cmd_var_is_valid "${pager}" ; then
 	pager=${PAGER}
 	cmd_var_is_valid "${pager}" || pager=cat
 fi
 
-if [ "${using_editor}" == 0 ]; then
+[[ ${clear_term} == "yes" ]] || clear() { :; }
+
+if [[ ${using_editor} == "0" ]] ; then
 	# Sanity check to make sure diff exists and works
 	echo > "${TMP}"/.diff-test-1
 	echo > "${TMP}"/.diff-test-2
-	
+
 	if ! diff_command "${TMP}"/.diff-test-1 "${TMP}"/.diff-test-2 ; then
-		die "'${diff_command}' does not seem to work, aborting" 1
+		die "'${diff_command}' does not seem to work, aborting"
 	fi
 else
-	if ! type ${diff_command%% *} >/dev/null; then
-		die "'${diff_command}' does not seem to work, aborting" 1
+	if ! cmd_var_is_valid "${diff_command}" ; then
+		die "'${diff_command}' does not seem to work, aborting"
 	fi
 fi
 
-if [[ ${mode} == "1" ]] ; then
+if [[ ${mode} == "0" ]] ; then
+	PAR=")"
+else
+	PAR=""
 	if ! type dialog >/dev/null || ! dialog --help >/dev/null ; then
-		die "mode=1 and 'dialog' not found or not executable, aborting" 1
+		die "mode=1 and 'dialog' not found or not executable, aborting"
 	fi
 fi
 
-#echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts"
-#echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command"
-
-if (( ${mode} == 0 )); then
-	PAR=")"
-else
-	PAR=""
+if ${VERBOSE} ; then
+	for v in ${portage_vars[@]} ${cfg_vars[@]} TMP ; do
+		echo "${v}=${!v}"
+	done
 fi
 
 declare -i count=0
@@ -614,12 +647,12 @@ declare title="Gentoo's etc-update tool!"
 
 scan
 
-until (( ${input} == -1 )); do
-	if (( ${count} == 0 )); then
+until (( input == -1 )); do
+	if (( count == 0 )); then
 		die "Nothing left to do; exiting. :)" 0
 	fi
 	sel_file
-	if (( ${input} != -1 )); then
+	if (( input != -1 )); then
 		do_file
 	fi
 done



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-08 18:46 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-08 18:46 UTC (permalink / raw
  To: gentoo-commits

commit:     0788886b0e001fcf57d4c1bddded1d809b5d9d31
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  8 18:45:29 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Mar  8 18:45:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0788886b

etc-update: turn -[3579] flags into command line option

This lets people do `etc-update --automode -3` rather than having
to do something like `echo "-3" | etc-update`.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/etc-update |   85 +++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 54 insertions(+), 31 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 4058229..989d367 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -148,7 +148,39 @@ scan() {
 			fi
 		done
 	done
+}
 
+parse_automode_flag() {
+	case $1 in
+	-9)
+		local reply
+		read -p "Are you sure that you want to delete all updates (type YES): " reply
+		if [[ ${reply} != "YES" ]] ; then
+			echo "Did not get a 'YES', so ignoring request"
+			return 1
+		else
+			parse_automode_flag -7
+			export rm_opts=""
+		fi
+		;;
+	-7)
+		input=0
+		export DELETE_ALL="yes"
+		;;
+	-5)
+		parse_automode_flag -3
+		export mv_opts=" ${mv_opts} "
+		mv_opts="${mv_opts// -i / }"
+		;;
+	-3)
+		input=0
+		export OVERWRITE_ALL="yes"
+		;;
+	*)
+		return 1
+		;;
+	esac
+	return 0
 }
 
 sel_file() {
@@ -189,11 +221,11 @@ sel_file() {
 					$(<"${TMP}"/menuitems)
 					Please select a file to edit by entering the corresponding number.
 					              (don't use -3, -5, -7 or -9 if you're unsure what to do)
-					              (-1 to exit) (-3 to auto merge all remaining files)
-					                           (-5 to auto-merge AND not use 'mv -i')
-					                           (-7 to discard all updates)
+					              (-1 to exit) (${_3_HELP_TEXT})
+					                           (${_5_HELP_TEXT})
+					                           (${_7_HELP_TEXT})
 				EOF
-				printf "                           (-9 to discard all updates AND not use 'rm -i'): "
+				printf "                           (${_9_HELP_TEXT}): "
 				input=$(read_int)
 			else
 				dialog \
@@ -204,28 +236,8 @@ sel_file() {
 					|| die "$(<"${TMP}"/input)\n\nUser termination!" 0
 				input=$(<"${TMP}"/input)
 			fi
-			if [[ ${input} == -9 ]] ; then
-				read -p "Are you sure that you want to delete all updates (type YES): " reply
-				if [[ ${reply} != "YES" ]] ; then
-					continue
-				else
-					input=-7
-					export rm_opts=""
-				fi
-			fi
-			if [[ ${input} == -7 ]] ; then
-				input=0
-				export DELETE_ALL="yes"
-			fi
-			if [[ ${input} == -5 ]] ; then
-				input=-3
-				export mv_opts=" ${mv_opts} "
-				mv_opts="${mv_opts// -i / }"
-			fi
-			if [[ ${input} == -3 ]] ; then
-				input=0
-				export OVERWRITE_ALL="yes"
-			fi
+
+			parse_automode_flag ${input} || continue
 		fi # -3 automerge
 		if [[ ${input:-0} == 0 ]] ; then
 			input=${isfirst}
@@ -524,6 +536,10 @@ die() {
 	exit ${exitcode}
 }
 
+_3_HELP_TEXT="-3 to auto merge all files"
+_5_HELP_TEXT="-5 to auto-merge AND not use 'mv -i'"
+_7_HELP_TEXT="-7 to discard all updates"
+_9_HELP_TEXT="-9 to discard all updates AND not use 'rm -i'"
 usage() {
 	cat <<-EOF
 	etc-update: Handle configuration file updates
@@ -535,6 +551,12 @@ usage() {
 	  -h, --help     Show help and run away
 	  -v, --verbose  Show settings and such along the way
 	  -V, --version  Show version and trundle away
+
+	  --automode <mode>
+	             ${_3_HELP_TEXT}
+	             ${_5_HELP_TEXT}
+	             ${_7_HELP_TEXT}
+	             ${_9_HELP_TEXT}
 	EOF
 
 	[[ $# -gt 1 ]] && printf "\nError: %s\n" "${*:2}" 1>&2
@@ -546,6 +568,10 @@ usage() {
 # Run the script
 #
 
+declare -i count=0
+declare input=0
+declare title="Gentoo's etc-update tool!"
+
 SET_X=false
 VERBOSE=false
 while [[ -n $1 ]] ; do
@@ -553,7 +579,8 @@ while [[ -n $1 ]] ; do
 		-d|--debug)   SET_X=true;;
 		-h|--help)    usage;;
 		-v|--verbose) VERBOSE=true;;
-		-V|--version) emerge --version ; exit 0;;
+		-V|--version) emerge --version; exit 0;;
+		--automode)   parse_automode_flag $2 && shift || usage 1 "Invalid mode '$2'";;
 		*)            usage 1 "Invalid option '$1'";;
 	esac
 	shift
@@ -641,10 +668,6 @@ if ${VERBOSE} ; then
 	done
 fi
 
-declare -i count=0
-declare input=0
-declare title="Gentoo's etc-update tool!"
-
 scan
 
 until (( input == -1 )); do



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-08 23:26 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-08 23:26 UTC (permalink / raw
  To: gentoo-commits

commit:     aec36182da4f1f0e754cc53ab9f8dd08c0ff9a28
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  8 20:19:55 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Mar  8 20:19:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aec36182

dispatch-conf: add --help/--version flags

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/dispatch-conf |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 75e9911..a778118 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -459,6 +459,19 @@ def spawn_shell(cmd):
     else:
         os.system(cmd)
 
+def usage(argv):
+    print('dispatch-conf: sane configuration file update\n')
+    print('Usage: dispatch-conf [config dirs]\n')
+    print('See the dispatch-conf(1) man page for more details')
+    sys.exit(os.EX_OK)
+
+for x in sys.argv:
+    if x in ('-h', '--help'):
+        usage(sys.argv)
+    elif x in ('--version'):
+        print("Portage", portage.VERSION)
+        sys.exit(os.EX_OK)
+
 # run
 d = dispatch ()
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-08 23:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-08 23:55 UTC (permalink / raw
  To: gentoo-commits

commit:     6486c0957cb54adf8ec45fb07d62750b77680632
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  8 23:55:39 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar  8 23:55:39 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6486c095

Disable 'illegally inherited' check for nofetch.

It's disabled for nofetch, since that can be called by repoman and
that triggers bug #407449 due to repoman not exporting non-essential
variables such as INHERITED.

---
 bin/ebuild.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index f8e71f5..74c4f69 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -230,11 +230,15 @@ inherit() {
 		unset $__export_funcs_var
 
 		if [ "${EBUILD_PHASE}" != "depend" ] && \
+			[ "${EBUILD_PHASE}" != "nofetch" ] && \
 			[[ ${EBUILD_PHASE} != *rm ]] && \
 			[[ ${EMERGE_FROM} != "binary" ]] ; then
 			# This is disabled in the *rm phases because they frequently give
 			# false alarms due to INHERITED in /var/db/pkg being outdated
-			# in comparison the the eclasses from the portage tree.
+			# in comparison the the eclasses from the portage tree. It's
+			# disabled for nofetch, since that can be called by repoman and
+			# that triggers bug #407449 due to repoman not exporting
+			# non-essential variables such as INHERITED.
 			if ! has $ECLASS $INHERITED $__INHERITED_QA_CACHE ; then
 				eqawarn "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF $EBUILD_PHASE"
 			fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-10 15:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-10 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     9c6fec67d0097ab577eaaa718cfe6e2f9f1d2f97
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 10 15:22:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 10 15:22:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c6fec67

ebuild.sh: skip EBUILD_HOOK_DIR for depend phase

---
 bin/ebuild.sh |   40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 74c4f69..04ca1a0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -375,24 +375,34 @@ source_all_bashrcs() {
 		for x in "${path_array[@]}" ; do
 			[ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc"
 		done
-	fi
 
-	# We assume if people are changing shopts in their bashrc they do so at their
-	# own peril.  This is the ONLY non-portage bit of code that can change shopts
-	# without a QA violation.
-	for x in "${PORTAGE_BASHRC}" "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
-		if [ -r "${x}" ]; then
-			# If $- contains x, then tracing has already enabled elsewhere for some
-			# reason.  We preserve it's state so as not to interfere.
-			if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
-				source "${x}"
-			else
-				set -x
-				source "${x}"
-				set +x
+		# The user's bashrc is the ONLY non-portage bit of code that can
+		# change shopts without a QA violation.
+		for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
+			if [ -r "${x}" ]; then
+				# If $- contains x, then tracing has already been enabled
+				# elsewhere for some reason. We preserve it's state so as
+				# not to interfere.
+				if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+					source "${x}"
+				else
+					set -x
+					source "${x}"
+					set +x
+				fi
 			fi
+		done
+	fi
+
+	if [ -r "${PORTAGE_BASHRC}" ] ; then
+		if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+			source "${x}"
+		else
+			set -x
+			source "${x}"
+			set +x
 		fi
-	done
+	fi
 
 	[ ! -z "${OCC}" ] && export CC="${OCC}"
 	[ ! -z "${OCXX}" ] && export CXX="${OCXX}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-10 17:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-10 17:45 UTC (permalink / raw
  To: gentoo-commits

commit:     20403c15331c63f5bbdc6dabbd8c9b3ad291aaca
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 10 15:22:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 10 17:44:44 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=20403c15

ebuild.sh: skip EBUILD_HOOK_DIR for depend phase

---
 bin/ebuild.sh |   40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 74c4f69..b1d1df1 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -375,24 +375,34 @@ source_all_bashrcs() {
 		for x in "${path_array[@]}" ; do
 			[ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc"
 		done
-	fi
 
-	# We assume if people are changing shopts in their bashrc they do so at their
-	# own peril.  This is the ONLY non-portage bit of code that can change shopts
-	# without a QA violation.
-	for x in "${PORTAGE_BASHRC}" "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
-		if [ -r "${x}" ]; then
-			# If $- contains x, then tracing has already enabled elsewhere for some
-			# reason.  We preserve it's state so as not to interfere.
-			if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
-				source "${x}"
-			else
-				set -x
-				source "${x}"
-				set +x
+		# The user's bashrc is the ONLY non-portage bit of code that can
+		# change shopts without a QA violation.
+		for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
+			if [ -r "${x}" ]; then
+				# If $- contains x, then tracing has already been enabled
+				# elsewhere for some reason. We preserve it's state so as
+				# not to interfere.
+				if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+					source "${x}"
+				else
+					set -x
+					source "${x}"
+					set +x
+				fi
 			fi
+		done
+	fi
+
+	if [ -r "${PORTAGE_BASHRC}" ] ; then
+		if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+			source "${PORTAGE_BASHRC}"
+		else
+			set -x
+			source "${PORTAGE_BASHRC}"
+			set +x
 		fi
-	done
+	fi
 
 	[ ! -z "${OCC}" ] && export CC="${OCC}"
 	[ ! -z "${OCXX}" ] && export CXX="${OCXX}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-11  3:25 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-11  3:25 UTC (permalink / raw
  To: gentoo-commits

commit:     a78ec9a7e6b4a0dd6e565913db35e436f67553ff
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 11 03:23:25 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 03:23:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a78ec9a7

etc-update: fix default "enter" behavior

Adding support for -[3579] command line flags inadvertently broke the
default behavior of hitting "enter" to automatically select the next
file.  Make this work again.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/etc-update |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index cd63ae1..7b05f11 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -236,10 +236,13 @@ sel_file() {
 					|| die "$(<"${TMP}"/input)\n\nUser termination!" 0
 				input=$(<"${TMP}"/input)
 			fi
+			: ${input:=0}
 
-			parse_automode_flag ${input} || continue
+			if [[ ${input} != 0 ]] ; then
+				parse_automode_flag ${input} || continue
+			fi
 		fi # -3 automerge
-		if [[ ${input:-0} == 0 ]] ; then
+		if [[ ${input} == 0 ]] ; then
 			input=${isfirst}
 		fi
 	done



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-11  3:58 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-11  3:58 UTC (permalink / raw
  To: gentoo-commits

commit:     157c9c0de811b64326ebf09cc95a59b34cbc0547
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 11 03:57:43 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 03:57:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=157c9c0d

etc-update: handle symlinked files

If the config file is symlinked somewhere, then update the target rather
then discarding the symlink and replacing it with a real file.

URL: http://bugs.gentoo.org/330221
Reported-by: Jack Byer <ftn768 <AT> gmail.com>
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/etc-update |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 7b05f11..644512a 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -43,6 +43,24 @@ diff_command() {
 	${cmd//%file2/$2}
 }
 
+# Usage: do_mv_ln [options] <src> <dst>
+# Files have to be the last two args, and has to be
+# files so we can handle symlinked target sanely.
+do_mv_ln() {
+	local opts=( ${@:1:$(( $# - 2 ))} )
+	local src=${@:$(( $# - 1 )):1}
+	local dst=${@:$(( $# - 0 )):1}
+
+	if [[ -L ${dst} ]] ; then #330221
+		local lfile=$(readlink "${dst}")
+		[[ ${lfile} == /* ]] || lfile="${dst%/*}/${lfile}"
+		echo " Target is a symlink; replacing ${lfile}"
+		dst=${lfile}
+	fi
+
+	mv "${opts[@]}" "${src}" "${dst}"
+}
+
 scan() {
 	echo "Scanning Configuration files..."
 	rm -rf "${TMP}"/files > /dev/null 2>&1
@@ -121,7 +139,7 @@ scan() {
 
 				if [[ ${MATCHES} == 1 ]] ; then
 					echo "Automerging trivial changes in: ${live_file}"
-					mv "${cfg_file}" "${live_file}"
+					do_mv_ln "${cfg_file}" "${live_file}"
 					continue
 				else
 					: $(( ++count ))
@@ -404,12 +422,12 @@ do_cfg() {
 
 		case ${my_input} in
 			1)	echo "Replacing ${ofile} with ${file}"
-				mv ${mv_opts} ${file} ${ofile}
+				do_mv_ln ${mv_opts} "${file}" "${ofile}"
 				[ -n "${OVERWRITE_ALL}" ] && my_input=-1
 				continue
 				;;
 			2)	echo "Deleting ${file}"
-				rm ${rm_opts} ${file}
+				rm ${rm_opts} "${file}"
 				[ -n "${DELETE_ALL}" ] && my_input=-1
 				continue
 				;;
@@ -474,7 +492,7 @@ do_merge() {
 						chown --reference="${ofile}" "${mfile}"
 						chmod --reference="${ofile}" "${mfile}"
 					fi
-					mv ${mv_opts} "${mfile}" "${ofile}"
+					do_mv_ln ${mv_opts} "${mfile}" "${ofile}"
 					rm ${rm_opts} "${file}"
 					return 255
 					;;



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-11 19:41 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-11 19:41 UTC (permalink / raw
  To: gentoo-commits

commit:     e9bb70344f93509e34ef117e14420a60fef5b83e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 11 19:39:50 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 19:41:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9bb7034

etc-update: fix logic bug with protected files

The rewrite introduced a slight bug with protected files.  Fix that,
and rework the code slightly to make it obvious that we want a diff
set of options for files and dirs.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/etc-update |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 644512a..75c6ba1 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -75,13 +75,14 @@ scan() {
 
 		[[ -w ${path} ]] || die "Need write access to ${path}"
 
-		# Do not traverse hidden directories such as .svn or .git.
-		find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
 		if [[ ! -d ${path} ]] ; then
 			[[ ! -f ${path} ]] && continue
 			local my_basename="${path##*/}"
 			path="${path%/*}"
-			find_opts+=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+			find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+		else
+			# Do not traverse hidden directories such as .svn or .git.
+			find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
 		fi
 		find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-12  4:42 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-12  4:42 UTC (permalink / raw
  To: gentoo-commits

commit:     647bc427421ef6ad03f8ec2d4a2aad6b6b6c4925
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 12 04:40:12 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 12 04:40:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=647bc427

etc-update: ignore changes in whitespace (-b) for automerge

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/etc-update |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 75c6ba1..135de45 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -124,18 +124,16 @@ scan() {
 					else
 						diff -Bbua "${cfg_file}" "${live_file}" | \
 							sed -n -r \
-								-e '/^[+-]/{/^([+-][\t ]*(#|$)|-{3} |\+{3} )/d;q0}' \
-								-e '$q1'
-						MATCHES=$?
+								-e '/^[+-]/{/^([+-][\t ]*(#|$)|-{3} |\+{3} )/d;q1}'
+						: $(( MATCHES = ($? == 0) ))
 					fi
 
-				elif diff -Nua "${cfg_file}" "${live_file}" |
-					sed -n \
-						-e '/# .Header:/d' \
-						-e '/^[+-][^+-]/q1' \
-						-e '$q0'
-				then
-					MATCHES=1
+				else
+					diff -Nbua "${cfg_file}" "${live_file}" |
+						sed -n \
+							-e '/# .Header:/d' \
+							-e '/^[+-][^+-]/q1'
+					: $(( MATCHES = ($? == 0) ))
 				fi
 
 				if [[ ${MATCHES} == 1 ]] ; then
@@ -152,18 +150,17 @@ scan() {
 				fi
 			fi
 
-			if diff -Nua "${cfg_file}" "${rpath}/${ofile}" |
+			if ! diff -Nbua "${cfg_file}" "${rpath}/${ofile}" |
 				sed -n \
 					-e '/# .Header:/d' \
-					-e '/^[+-][^+-]/q1' \
-					-e '$q0'
+					-e '/^[+-][^+-]/q1'
 			then
-				mv "${cfg_file}" "${rpath}/${ofile}"
-				continue
-			else
 				echo "${cfg_file}" >> "${TMP}"/files/${count}
 				ofile="${rfile}"
 				opath="${rpath}"
+			else
+				mv "${cfg_file}" "${rpath}/${ofile}"
+				continue
 			fi
 		done
 	done



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-12  5:29 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-03-12  5:29 UTC (permalink / raw
  To: gentoo-commits

commit:     9ab1fa8bc9e3b93170b56ec99b29dde6d1f0cd53
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 12 05:29:32 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 12 05:29:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ab1fa8b

QA: detect pkg-config files that bleed LDFLAGS

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/misc-functions.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 2614151..d2de0a7 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -564,6 +564,13 @@ install_qa_check() {
 		done
 	done
 
+	# Look for leaking LDFLAGS into pkg-config files
+	f=$(egrep -sH '^Libs.*-Wl,(-O[012]|--hash-style)' "${ED}"/usr/*/pkgconfig/*.pc)
+	if [[ -n ${f} ]] ; then
+		eqawarn "QA Notice: pkg-config files with wrong LDFLAGS detected:"
+		eqawarn "${f//${D}}"
+	fi
+
 	# this should help to ensure that all (most?) shared libraries are executable
 	# and that all libtool scripts / static libraries are not executable
 	local j



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-17 19:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-17 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     237427dbf5eadf1e7b7bf2962b2ccbb352e527ab
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 17 19:48:30 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 17 19:48:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=237427db

repoman: ignore temp files, bug #406877

If the file isn't in the VCS new or changed set, then assume that
it's an irrelevant temporary file. This relies on commit
2dac56fa282645031eb29860abc403e983a04b2d to guarantee that Manifest
entries are not generated for file names containing prohibited
characters.

---
 bin/repoman |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ffedf2e..80fcde2 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1170,6 +1170,12 @@ if vcs:
 	modified_changelogs.update(x for x in chain(mychanged, mynew) \
 		if os.path.basename(x) == "ChangeLog")
 
+def vcs_new_changed(relative_path):
+	for x in chain(mychanged, mynew):
+		if x == relative_path:
+			return True
+	return False
+
 have_pmasked = False
 have_dev_keywords = False
 dofail = 0
@@ -1361,6 +1367,14 @@ for x in effective_scanlist:
 	for y in checkdirlist:
 		m = disallowed_filename_chars_re.search(y.strip(os.sep))
 		if m is not None:
+			y_relative = os.path.join(checkdir_relative, y)
+			if vcs is not None and not vcs_new_changed(y_relative):
+				# If the file isn't in the VCS new or changed set, then
+				# assume that it's an irrelevant temporary file (Manifest
+				# entries are not generated for file names containing
+				# prohibited characters). See bug #406877.
+				m = None
+		if m is not None:
 			stats["file.name"] += 1
 			fails["file.name"].append("%s/%s: char '%s'" % \
 				(checkdir, y, m.group(0)))
@@ -1529,6 +1543,14 @@ for x in effective_scanlist:
 			m = disallowed_filename_chars_re.search(
 				os.path.basename(y.rstrip(os.sep)))
 			if m is not None:
+				y_relative = os.path.join(checkdir_relative, "files", y)
+				if vcs is not None and not vcs_new_changed(y_relative):
+					# If the file isn't in the VCS new or changed set, then
+					# assume that it's an irrelevant temporary file (Manifest
+					# entries are not generated for file names containing
+					# prohibited characters). See bug #406877.
+					m = None
+			if m is not None:
 				stats["file.name"] += 1
 				fails["file.name"].append("%s/files/%s: char '%s'" % \
 					(checkdir, y, m.group(0)))



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-17 22:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-17 22:56 UTC (permalink / raw
  To: gentoo-commits

commit:     e769fdbec25f2e77953619bc131f15518a33ad1a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 17 22:56:33 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 17 22:56:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e769fdbe

etc-update: ignore non-existent CONFIG_PROTECT

---
 bin/etc-update |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 135de45..b076520 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -73,8 +73,6 @@ scan() {
 	for path in ${SCAN_PATHS} ; do
 		path="${EROOT%/}${path}"
 
-		[[ -w ${path} ]] || die "Need write access to ${path}"
-
 		if [[ ! -d ${path} ]] ; then
 			[[ ! -f ${path} ]] && continue
 			local my_basename="${path##*/}"
@@ -86,6 +84,11 @@ scan() {
 		fi
 		find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
 
+		if [ ! -w "${path}" ] ; then
+			[ -e "${path}" ] || continue
+			die "Need write access to ${path}"
+		fi
+
 		local file ofile b=$'\001'
 		for file in $(find "${path}"/ "${find_opts[@]}" |
 		              sed \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-17 23:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-17 23:29 UTC (permalink / raw
  To: gentoo-commits

commit:     e2d957d83109c678bce388b2f553fa2403711724
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 17 23:28:54 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 17 23:28:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2d957d8

etc-update: quote ${file}

---
 bin/etc-update |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index b076520..b4f9eec 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -391,7 +391,7 @@ do_cfg() {
 	local ofile=$2
 	local -i my_input=0
 
-	until (( my_input == -1 )) || [ ! -f ${file} ] ; do
+	until (( my_input == -1 )) || [ ! -f "${file}" ] ; do
 		if [[ "${OVERWRITE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
 			my_input=1
 		elif [[ "${DELETE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-21  7:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-21  7:40 UTC (permalink / raw
  To: gentoo-commits

commit:     1ac859dfea03701f02dcd25ba3b91fb17cf520cf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 21 07:40:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 21 07:40:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ac859df

Bug #361759: QA check for /etc/udev/rules.d

---
 bin/misc-functions.sh |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index d2de0a7..b083897 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -258,6 +258,18 @@ install_qa_check() {
 		eqawarn "$f"
 	fi
 
+	if [[ -d ${ED}/etc/udev/rules.d ]] ; then
+		f=
+		for x in $(ls "${ED}/etc/udev/rules.d") ; do
+			f+="  etc/udev/rules.d/$x\n"
+		done
+		if [[ -n $f ]] ; then
+			eqawarn "QA Notice: udev rules should be installed in /lib/udev/rules.d:"
+			eqawarn
+			eqawarn "$f"
+		fi
+	fi
+
 	# Now we look for all world writable files.
 	local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :")
 	if [[ -n ${unsafe_files} ]] ; then



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-23  5:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-23  5:38 UTC (permalink / raw
  To: gentoo-commits

commit:     67b8da916f1b4a601d09c3f867c005b39a04f28e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 05:37:39 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 05:37:39 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=67b8da91

repoman: disable dependency.unknown for blockers

This will fix bug #382407.

---
 bin/repoman |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c5db186..d393df1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1866,7 +1866,11 @@ for x in effective_scanlist:
 					if atom == "||":
 						continue
 
-					if not portdb.xmatch("match-all", atom) and \
+					# Skip dependency.unknown for blockers, so that we
+					# don't encourage people to remove necessary blockers,
+					# as discussed in bug #382407.
+					if atom.blocker is None and \
+						not portdb.xmatch("match-all", atom) and \
 						not atom.cp.startswith("virtual/"):
 						unknown_pkgs.add((mytype, atom.unevaluated_atom))
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-27 17:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-27 17:06 UTC (permalink / raw
  To: gentoo-commits

commit:     aefd607374b0c631bc3b9a962e0a5c55a2f5e6d2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 27 17:06:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 27 17:06:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aefd6073

etc-update: remove duplicate using_editor

---
 bin/etc-update |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index b4f9eec..794271f 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -642,7 +642,6 @@ chown ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${TMP}" || \
 
 # Get all the user settings from etc-update.conf
 cfg_vars=(
-	using_editor
 	clear_term
 	eu_automerge
 	rm_opts



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-03-27 17:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-03-27 17:36 UTC (permalink / raw
  To: gentoo-commits

commit:     b344222a9a4dfbd811e196bd755ccbec511d0721
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 27 17:35:44 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 27 17:35:44 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b344222a

etc-update: handle emacs diff cmd, bug #409849

---
 bin/etc-update |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 794271f..1edc91f 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -676,7 +676,9 @@ if [[ ${using_editor} == "0" ]] ; then
 		die "'${diff_command}' does not seem to work, aborting"
 	fi
 else
-	if ! cmd_var_is_valid "${diff_command}" ; then
+	# NOTE: cmd_var_is_valid doesn't work with diff_command="eval emacs..."
+	# because it uses type -P.
+	if ! type ${diff_command%%[[:space:]]*} >/dev/null; then
 		die "'${diff_command}' does not seem to work, aborting"
 	fi
 fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-01 16:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-01 16:48 UTC (permalink / raw
  To: gentoo-commits

commit:     87a330b69d7c617e0a14f3aaa028e697b67a7fff
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  1 16:48:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr  1 16:48:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87a330b6

repoman: disable header/timestamp check for svn

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 54d864f..4197900 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -547,7 +547,7 @@ if options.if_modified == "y" and vcs is None:
 	options.if_modified = "n"
 
 # Disable copyright/mtime check if vcs does not preserve mtime (bug #324075).
-vcs_preserves_mtime = vcs not in ('git',)
+vcs_preserves_mtime = vcs not in ('git', 'svn')
 
 vcs_local_opts = repoman_settings.get("REPOMAN_VCS_LOCAL_OPTS", "").split()
 vcs_global_opts = repoman_settings.get("REPOMAN_VCS_GLOBAL_OPTS")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-01 17:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-01 17:16 UTC (permalink / raw
  To: gentoo-commits

commit:     5aec6753e2a0cfd7992c41ceaadf2c42fce715ac
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  1 17:15:57 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr  1 17:15:57 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5aec6753

repoman: only assume cvs preserves mtimes

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 4197900..076d404 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -547,7 +547,7 @@ if options.if_modified == "y" and vcs is None:
 	options.if_modified = "n"
 
 # Disable copyright/mtime check if vcs does not preserve mtime (bug #324075).
-vcs_preserves_mtime = vcs not in ('git', 'svn')
+vcs_preserves_mtime = vcs in ('cvs',)
 
 vcs_local_opts = repoman_settings.get("REPOMAN_VCS_LOCAL_OPTS", "").split()
 vcs_global_opts = repoman_settings.get("REPOMAN_VCS_GLOBAL_OPTS")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-05 16:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-05 16:45 UTC (permalink / raw
  To: gentoo-commits

commit:     42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f
Author:     Sven Vermeulen <swift <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  5 16:40:55 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr  5 16:40:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=42694ba4

Support /sys/fs/selinux/context for bug #410687.

---
 bin/misc-functions.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b083897..4e81ddf 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1095,13 +1095,15 @@ preinst_selinux_labels() {
 		# SELinux file labeling (needs to always be last in dyn_preinst)
 		# only attempt to label if setfiles is executable
 		# and 'context' is available on selinuxfs.
-		if [ -f /selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
+		if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
+			[ -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
 			vecho ">>> Setting SELinux security labels"
 			(
 				eval "$(/usr/sbin/selinuxconfig)" || \
 					die "Failed to determine SELinux policy paths.";
 	
-				addwrite /selinux/context;
+				addwrite /selinux/context
+				addwrite /sys/fs/selinux/context
 	
 				/usr/sbin/setfiles "${file_contexts_path}" -r "${D}" "${D}"
 			) || die "Failed to set SELinux security labels."



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-13 21:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-13 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     0bb454d0aecba0be1dd197038eefc4be6be2580e
Author:     Zdenek Behan <rain <AT> matfyz <DOT> cz>
AuthorDate: Fri Apr 13 21:51:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 13 21:51:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0bb454d0

portageq mass_best_visible: optional "type" arg

---
 bin/portageq |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index fcdb9d9..dc465d2 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -504,21 +504,35 @@ def best_visible(argv):
 					writemsg_stdout("%s\n" % (pkg.cpv,), noiselevel=-1)
 					return os.EX_OK
 
+	# No package found, write out an empty line.
+	writemsg_stdout("\n", noiselevel=-1)
+
 	return 1
 best_visible.uses_root = True
 
 
 def mass_best_visible(argv):
-	"""<eroot> [<category/package>]+
+	"""<root> [<type>] [<category/package>]+
 	Returns category/package-version (without .ebuild).
+	The pkgtype argument defaults to "ebuild" if unspecified,
+	otherwise it must be one of ebuild, binary, or installed.
 	"""
+	type_map = {
+		"ebuild":"porttree",
+		"binary":"bintree",
+		"installed":"vartree"}
+
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
 		sys.exit(2)
 	try:
-		for pack in argv[1:]:
-			mylist=portage.db[argv[0]]["porttree"].dbapi.match(pack)
-			print(pack+":"+portage.best(mylist))
+		root = argv.pop(0)
+		pkgtype = "ebuild"
+		if argv[0] in type_map:
+			pkgtype = argv.pop(0)
+		for pack in argv:
+			writemsg_stdout("%s:" % pack, noiselevel=-1)
+			best_visible([root, pkgtype, pack])
 	except KeyError:
 		sys.exit(1)
 mass_best_visible.uses_root = True



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-14  0:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-14  0:37 UTC (permalink / raw
  To: gentoo-commits

commit:     361ea15f5da672bc0aec9d0b7bd7244591a286e2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 14 00:37:34 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 14 00:37:34 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=361ea15f

dohtml: support FEATURES=force-prefix

---
 bin/dohtml.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index 122daf3..f0a7f2c 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -91,7 +91,8 @@ class OptionsClass:
 		
 		if "PF" in os.environ:
 			self.PF = os.environ["PF"]
-		if os.environ.get("EAPI", "0") in ("0", "1", "2"):
+		if "force-prefix" not in os.environ.get("FEATURES", "").split() and \
+			os.environ.get("EAPI", "0") in ("0", "1", "2"):
 			self.ED = os.environ.get("D", "")
 		else:
 			self.ED = os.environ.get("ED", "")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-22 17:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-22 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     e706a3dbc922130fe52a6513e9b91af7afc843aa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 17:41:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 17:41:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e706a3db

repoman: support * and ~* keywords

These special keywords are used by Funtoo, and have been supported in
KeywordsManager since commit 9144faeb653b9f1dbe74c69f85cd48f26761aa2f.

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 651c0be..4d39cb8 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1967,7 +1967,7 @@ for x in effective_scanlist:
 				myskey=myskey[1:]
 			if myskey[0]=="~":
 				myskey=myskey[1:]
-			if mykey!="-*":
+			if mykey not in ("-*", "*", "~*"):
 				if myskey not in kwlist:
 					stats["KEYWORDS.invalid"] += 1
 					fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s" % mykey)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-22 19:50 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-04-22 19:50 UTC (permalink / raw
  To: gentoo-commits

commit:     771b63d4d6d4b1d4c8f987fddb8b6cc91a4a7fac
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Apr 22 19:49:49 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Apr 22 19:49:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=771b63d4

Print working directory in die message to simplify debugging.

---
 bin/isolated-functions.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 3630488..536b6d4 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -234,6 +234,7 @@ die() {
 		} > "${T}/die.env"
 		eerror "The ebuild environment file is located at '${T}/die.env'."
 	fi
+	eerror "Working directory: '$(pwd)'"
 	eerror "S: '${S}'"
 
 	[[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-22 21:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-22 21:10 UTC (permalink / raw
  To: gentoo-commits

commit:     7c46fe043747de8663908a07f09edb9f184244e7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 21:10:07 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 21:10:07 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7c46fe04

repoman: cleanup code for KEYWORDS.invalid

---
 bin/repoman |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index eedb588..606f1d6 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1965,12 +1965,12 @@ for x in effective_scanlist:
 		#keyword checks
 		myuse = myaux["KEYWORDS"].split()
 		for mykey in myuse:
-			myskey=mykey[:]
-			if myskey[0]=="-":
-				myskey=myskey[1:]
-			if myskey[0]=="~":
-				myskey=myskey[1:]
 			if mykey not in ("-*", "*", "~*"):
+				myskey = mykey
+				if myskey[:1] == "-":
+					myskey = myskey[1:]
+				if myskey[:1] == "~":
+					myskey = myskey[1:]
 				if myskey not in kwlist:
 					stats["KEYWORDS.invalid"] += 1
 					fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s" % mykey)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-22 21:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-22 21:59 UTC (permalink / raw
  To: gentoo-commits

commit:     bb4113adef8e412c7dfa934cbaf0123f08a071e1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 21:58:55 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 21:58:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bb4113ad

portageq: use return instead of sys.exit

---
 bin/portageq |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index dc465d2..280fe94 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -86,7 +86,7 @@ def has_version(argv):
 	"""
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 
 	warnings = []
 
@@ -116,11 +116,11 @@ def has_version(argv):
 	try:
 		mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
 		if mylist:
-			sys.exit(0)
+			return 0
 		else:
-			sys.exit(1)
+			return 1
 	except KeyError:
-		sys.exit(1)
+		return 1
 	except portage.exception.InvalidAtom:
 		portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
 			noiselevel=-1)
@@ -134,7 +134,7 @@ def best_version(argv):
 	"""
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 
 	warnings = []
 
@@ -165,7 +165,7 @@ def best_version(argv):
 		mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
 		print(portage.best(mylist))
 	except KeyError:
-		sys.exit(1)
+		return 1
 best_version.uses_root = True
 
 
@@ -175,19 +175,19 @@ def mass_best_version(argv):
 	"""
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 	try:
 		for pack in argv[1:]:
 			mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack)
 			print(pack+":"+portage.best(mylist))
 	except KeyError:
-		sys.exit(1)
+		return 1
 mass_best_version.uses_root = True
 
 def metadata(argv):
 	if (len(argv) < 4):
 		print("ERROR: insufficient parameters!", file=sys.stderr)
-		sys.exit(2)
+		return 2
 
 	eroot, pkgtype, pkgspec = argv[0:3]
 	metakeys = argv[3:]
@@ -197,7 +197,7 @@ def metadata(argv):
 		"installed":"vartree"}
 	if pkgtype not in type_map:
 		print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
-		sys.exit(1)
+		return 1
 	trees = portage.db
 	repo = portage.dep.dep_getrepo(pkgspec)
 	pkgspec = portage.dep.remove_slot(pkgspec)
@@ -207,7 +207,7 @@ def metadata(argv):
 			writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
 	except KeyError:
 		print("Package not found: '%s'" % pkgspec, file=sys.stderr)
-		sys.exit(1)
+		return 1
 
 metadata.__doc__ = """
 <eroot> <pkgtype> <category/package> [<key>]+
@@ -524,7 +524,7 @@ def mass_best_visible(argv):
 
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 	try:
 		root = argv.pop(0)
 		pkgtype = "ebuild"
@@ -534,7 +534,7 @@ def mass_best_visible(argv):
 			writemsg_stdout("%s:" % pack, noiselevel=-1)
 			best_visible([root, pkgtype, pack])
 	except KeyError:
-		sys.exit(1)
+		return 1
 mass_best_visible.uses_root = True
 
 
@@ -563,7 +563,7 @@ def match(argv):
 	"""
 	if len(argv) != 2:
 		print("ERROR: expected 2 parameters, got %d!" % len(argv))
-		sys.exit(2)
+		return 2
 	root, atom = argv
 	if not atom:
 		atom = "*/*"
@@ -718,7 +718,7 @@ def envvar(argv):
 
 	if len(argv) == 0:
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 
 	for arg in argv:
 		if verbose:
@@ -732,7 +732,7 @@ def get_repos(argv):
 	"""
 	if len(argv) < 1:
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 	print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories()))
 
 get_repos.uses_root = True
@@ -743,7 +743,7 @@ def get_repo_path(argv):
 	"""
 	if len(argv) < 2:
 		print("ERROR: insufficient parameters!")
-		sys.exit(2)
+		return 2
 	for arg in argv[1:]:
 		path = portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(arg)
 		if path is None:
@@ -761,7 +761,7 @@ def list_preserved_libs(argv):
 
 	if len(argv) != 1:
 		print("ERROR: wrong number of arguments")
-		sys.exit(2)
+		return 2
 	mylibs = portage.db[argv[0]]["vartree"].dbapi._plib_registry.getPreservedLibs()
 	rValue = 1
 	msg = []



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-28 20:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-28 20:19 UTC (permalink / raw
  To: gentoo-commits

commit:     7bf14ebd3feb75c368f32e06e1ac34e9ccbd35ed
Author:     James Le Cuirot <chewi <AT> aura-online <DOT> co <DOT> uk>
AuthorDate: Sat Apr 28 16:33:07 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 28 20:17:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7bf14ebd

ebuild.sh: source /etc/portage/env scripts after /etc/portage/bashrc

This will fix bug #413895.

---
 bin/ebuild.sh |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b1d1df1..173865c 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -375,7 +375,19 @@ source_all_bashrcs() {
 		for x in "${path_array[@]}" ; do
 			[ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc"
 		done
+	fi
+
+	if [ -r "${PORTAGE_BASHRC}" ] ; then
+		if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+			source "${PORTAGE_BASHRC}"
+		else
+			set -x
+			source "${PORTAGE_BASHRC}"
+			set +x
+		fi
+	fi
 
+	if [[ $EBUILD_PHASE != depend ]] ; then
 		# The user's bashrc is the ONLY non-portage bit of code that can
 		# change shopts without a QA violation.
 		for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
@@ -394,16 +406,6 @@ source_all_bashrcs() {
 		done
 	fi
 
-	if [ -r "${PORTAGE_BASHRC}" ] ; then
-		if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
-			source "${PORTAGE_BASHRC}"
-		else
-			set -x
-			source "${PORTAGE_BASHRC}"
-			set +x
-		fi
-	fi
-
 	[ ! -z "${OCC}" ] && export CC="${OCC}"
 	[ ! -z "${OCXX}" ] && export CXX="${OCXX}"
 }



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-04-30 19:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-04-30 19:17 UTC (permalink / raw
  To: gentoo-commits

commit:     39a26141b40486108be9d147a228708da797a0e4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 19:17:06 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 19:17:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=39a26141

repoman: check LIVEVCS.stable for gentoo only

This will fix bug #414123.

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 606f1d6..0163f8d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1797,7 +1797,7 @@ for x in effective_scanlist:
 		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
 		not be allowed to be marked stable
 		"""
-		if live_ebuild:
+		if live_ebuild and repo_config.name == "gentoo":
 			bad_stable_keywords = []
 			for keyword in keywords:
 				if not keyword.startswith("~") and \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-01 13:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-01 13:10 UTC (permalink / raw
  To: gentoo-commits

commit:     721b4b7d8a9f6cca32d946dd416d221cbc3088b2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May  1 13:10:42 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  1 13:10:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=721b4b7d

Quote atoms in die message for bug #414201.

This allows zsh users to copy/paste while avoiding = expansion.

---
 bin/isolated-functions.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 536b6d4..9b91e6b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -173,8 +173,8 @@ die() {
 		| while read -r n ; do eerror "  ${n#RETAIN-LEADING-SPACE}" ; done
 	eerror
 	fi
-	eerror "If you need support, post the output of 'emerge --info =$CATEGORY/$PF',"
-	eerror "the complete build log and the output of 'emerge -pqv =$CATEGORY/$PF'."
+	eerror "If you need support, post the output of \`emerge --info '=$CATEGORY/$PF'\`,"
+	eerror "the complete build log and the output of \`emerge -pqv '=$CATEGORY/$PF'\`."
 	if [[ -n ${EBUILD_OVERLAY_ECLASSES} ]] ; then
 		eerror "This ebuild used the following eclasses from overlays:"
 		local x



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-05  7:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-05  7:17 UTC (permalink / raw
  To: gentoo-commits

commit:     61571e4e8ee3f4f999782c542b4be84d8be8c729
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May  5 07:16:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May  5 07:16:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=61571e4e

Create NEEDED.ELF.2 despite RESTRICT=binchecks.

This info is too useful not to have (it's required for things like
preserve-libs), and it's tempting for ebuild authors to set
RESTRICT=binchecks for packages containing pre-built binaries.

---
 bin/misc-functions.sh |   80 ++++++++++++++++++++++++++----------------------
 1 files changed, 43 insertions(+), 37 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 4e81ddf..1098f18 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -433,43 +433,6 @@ install_qa_check() {
 			fi
 		fi
 
-		# Save NEEDED information after removing self-contained providers
-		rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2}
-		scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do
-			arch=${l%%;*}; l=${l#*;}
-			obj="/${l%%;*}"; l=${l#*;}
-			soname=${l%%;*}; l=${l#*;}
-			rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
-			needed=${l%%;*}; l=${l#*;}
-			if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then
-				# object doesn't contain $ORIGIN in its runpath attribute
-				echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-				echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
-			else
-				dir=${obj%/*}
-				# replace $ORIGIN with the dirname of the current object for the lookup
-				opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#")
-				sneeded=$(echo ${needed} | tr , ' ')
-				rneeded=""
-				for lib in ${sneeded}; do
-					found=0
-					for path in ${opath//:/ }; do
-						[ -e "${D}/${path}/${lib}" ] && found=1 && break
-					done
-					[ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}"
-				done
-				rneeded=${rneeded:1}
-				if [ -n "${rneeded}" ]; then
-					echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-					echo "${arch:3};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
-				fi
-			fi
-		done }
-
-		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \
-			echo "${QA_SONAME_NO_SYMLINK}" > \
-			"${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
-
 		if [[ ${insecure_rpath} -eq 1 ]] ; then
 			die "Aborting due to serious QA concerns with RUNPATH/RPATH"
 		elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then
@@ -547,6 +510,49 @@ install_qa_check() {
 		PORTAGE_QUIET=${tmp_quiet}
 	fi
 
+	# Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is
+	# too useful not to have (it's required for things like preserve-libs), and
+	# it's tempting for ebuild authors to set RESTRICT=binchecks for packages
+	# containing pre-built binaries.
+	if type -P scanelf > /dev/null ; then
+		# Save NEEDED information after removing self-contained providers
+		rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2}
+		scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do
+			arch=${l%%;*}; l=${l#*;}
+			obj="/${l%%;*}"; l=${l#*;}
+			soname=${l%%;*}; l=${l#*;}
+			rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
+			needed=${l%%;*}; l=${l#*;}
+			if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then
+				# object doesn't contain $ORIGIN in its runpath attribute
+				echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+				echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
+			else
+				dir=${obj%/*}
+				# replace $ORIGIN with the dirname of the current object for the lookup
+				opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#")
+				sneeded=$(echo ${needed} | tr , ' ')
+				rneeded=""
+				for lib in ${sneeded}; do
+					found=0
+					for path in ${opath//:/ }; do
+						[ -e "${D}/${path}/${lib}" ] && found=1 && break
+					done
+					[ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}"
+				done
+				rneeded=${rneeded:1}
+				if [ -n "${rneeded}" ]; then
+					echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+					echo "${arch:3};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
+				fi
+			fi
+		done }
+
+		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \
+			echo "${QA_SONAME_NO_SYMLINK}" > \
+			"${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
+	fi
+
 	local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:")
 	if [[ -n ${unsafe_files} ]] ; then
 		eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-05  7:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-05  7:32 UTC (permalink / raw
  To: gentoo-commits

commit:     72314d2e24aa96af614b052b8b29e6d02d37a641
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May  5 07:32:34 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May  5 07:32:34 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72314d2e

QA Notice for RESTRICT=binchecks + ELF files

---
 bin/misc-functions.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 1098f18..4a74984 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -551,6 +551,12 @@ install_qa_check() {
 		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \
 			echo "${QA_SONAME_NO_SYMLINK}" > \
 			"${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
+
+		if has binchecks ${RESTRICT} && \
+			[ -s "${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2" ] ; then
+			eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
+			eqawarn "$(while read -r x; do x=${x#*;} ; echo ${x%%;*} ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
+		fi
 	fi
 
 	local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-08  7:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-08  7:39 UTC (permalink / raw
  To: gentoo-commits

commit:     a0eb86870f1564b84f0b561013d8e597347727e4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May  8 07:39:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  8 07:39:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a0eb8687

NEEDED.ELF.2: include sonames from $ORIGIN

This reverts the behavior change from bug #205531 (see commit
5baa57a65368472c2c22b9bd2b30e634ef644b92). That special handling should
be unnecessary since the changes from bug #289180 (see commit
296fc63fee262600811520fccf4692f47a39ffba), where the
LinkageMapELF.findConsumers() exclude_providers argument is used to
exclude irrelevant consumers.

---
 bin/misc-functions.sh |   25 ++-----------------------
 1 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 4a74984..ab070aa 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -523,29 +523,8 @@ install_qa_check() {
 			soname=${l%%;*}; l=${l#*;}
 			rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
 			needed=${l%%;*}; l=${l#*;}
-			if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then
-				# object doesn't contain $ORIGIN in its runpath attribute
-				echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-				echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
-			else
-				dir=${obj%/*}
-				# replace $ORIGIN with the dirname of the current object for the lookup
-				opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#")
-				sneeded=$(echo ${needed} | tr , ' ')
-				rneeded=""
-				for lib in ${sneeded}; do
-					found=0
-					for path in ${opath//:/ }; do
-						[ -e "${D}/${path}/${lib}" ] && found=1 && break
-					done
-					[ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}"
-				done
-				rneeded=${rneeded:1}
-				if [ -n "${rneeded}" ]; then
-					echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-					echo "${arch:3};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
-				fi
-			fi
+			echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+			echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
 		done }
 
 		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-08 15:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-08 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     1987449799fe12c1066f2f46c75c4da99bc3405e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May  8 15:42:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  8 15:42:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19874497

Strip EPREFIX in RESTRICT=binchecks QA Notice.

---
 bin/misc-functions.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ab070aa..564af85 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -150,7 +150,7 @@ prepcompress() {
 install_qa_check() {
 	local f i qa_var x
 	[[ " ${FEATURES} " == *" force-prefix "* ]] || \
-		case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+		case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac
 
 	cd "${ED}" || die "cd failed"
 
@@ -534,7 +534,7 @@ install_qa_check() {
 		if has binchecks ${RESTRICT} && \
 			[ -s "${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2" ] ; then
 			eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
-			eqawarn "$(while read -r x; do x=${x#*;} ; echo ${x%%;*} ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
+			eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
 		fi
 	fi
 



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-09  0:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-09  0:46 UTC (permalink / raw
  To: gentoo-commits

commit:     476f99337da69662660bfe2a0406b9ac5b4678c4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  9 00:45:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  9 00:45:53 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=476f9933

die: fix ${T}/build.log{,.gz} message

---
 bin/isolated-functions.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 9b91e6b..dbf988b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -220,8 +220,8 @@ die() {
 		eerror "The complete build log is located at '${PORTAGE_LOG_FILE}'."
 		if [[ ${PORTAGE_LOG_FILE} != ${T}/* ]] ; then
 			# Display path to symlink in ${T}, as requested in bug #412865.
-			local log_ext=${PORTAGE_LOG_FILE##*/}
-			log_ext=${log_ext#*.}
+			local log_ext=log
+			[[ ${PORTAGE_LOG_FILE} != *.log ]] && log_ext+=.${PORTAGE_LOG_FILE##*.}
 			eerror "For convenience, a symlink to the build log is located at '${T}/build.${log_ext}'."
 		fi
 	fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-09 18:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-09 18:21 UTC (permalink / raw
  To: gentoo-commits

commit:     052cc1c657833fadb27c70889749547e1188103a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  9 18:21:15 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  9 18:21:15 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=052cc1c6

ebuild.sh: remove redundant EAPI=0 default

---
 bin/ebuild.sh |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d161bc6..2589113 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -670,8 +670,6 @@ if [[ $EBUILD_PHASE = depend ]] ; then
 		PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04
 		UNUSED_03 UNUSED_02 UNUSED_01"
 
-	[ "${EAPI+set}" = set ] || EAPI=0
-
 	# The extra $(echo) commands remove newlines.
 	if [ -n "${dbkey}" ] ; then
 		> "${dbkey}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-13 21:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-13 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     89b320a22b7e2504d00e18475e07e43ab56f2ad3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 13 21:42:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 13 21:42:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=89b320a2

egencache: use vercmp instead of pkgcmp

---
 bin/egencache |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 13860bc..2f53b40 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2009-2011 Gentoo Foundation
+# Copyright 2009-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -42,7 +42,7 @@ from portage.manifest import guessManifestFileType
 from portage.util import cmp_sort_key, writemsg_level
 from portage import cpv_getkey
 from portage.dep import Atom, isjustname
-from portage.versions import pkgcmp, pkgsplit, vercmp
+from portage.versions import pkgsplit, vercmp
 
 try:
 	from xml.etree import ElementTree
@@ -570,7 +570,7 @@ class GenUseLocalDesc(object):
 								return cmp_func(atomb.operator, atoma.operator)
 							# Version matching
 							elif atoma.cpv != atomb.cpv:
-								return pkgcmp(pkgsplit(atoma.cpv), pkgsplit(atomb.cpv))
+								return vercmp(atoma.version, atomb.version)
 							# Versions match, let's fallback to operator matching
 							else:
 								return cmp_func(ops.get(atoma.operator, -1),



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-13 21:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-13 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     9007f3699d8ca63d800340e9c269b4d4233f4866
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 13 21:43:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 13 21:43:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9007f369

repoman: simplify ebuild sort code

---
 bin/repoman |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 3d1a4b0..1fc9acc 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1347,17 +1347,6 @@ for x in effective_scanlist:
 			pkgs[pf] = Package(cpv=cpv, metadata=myaux,
 				root_config=root_config, type_name="ebuild")
 
-	# Sort ebuilds in ascending order for the KEYWORDS.dropped check.
-	pkgsplits = {}
-	for i in range(len(ebuildlist)):
-		ebuild_split = portage.pkgsplit(ebuildlist[i])
-		pkgsplits[ebuild_split] = ebuildlist[i]
-		ebuildlist[i] = ebuild_split
-	ebuildlist.sort(key=cmp_sort_key(portage.pkgcmp))
-	for i in range(len(ebuildlist)):
-		ebuildlist[i] = pkgsplits[ebuildlist[i]]
-	del pkgsplits
-
 	slot_keywords = {}
 
 	if len(pkgs) != len(ebuildlist):
@@ -1369,6 +1358,10 @@ for x in effective_scanlist:
 		can_force = False
 		continue
 
+	# Sort ebuilds in ascending order for the KEYWORDS.dropped check.
+	ebuildlist = sorted(pkgs.values())
+	ebuildlist = [pkg.pf for pkg in ebuildlist]
+
 	for y in checkdirlist:
 		m = disallowed_filename_chars_re.search(y.strip(os.sep))
 		if m is not None:



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-14  8:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-05-14  8:00 UTC (permalink / raw
  To: gentoo-commits

commit:     2adc44295a5b5c77640c32cd24ebbd8d52e5237b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 08:00:29 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 14 08:00:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2adc4429

multijob_post_fork: return child status

---
 bin/helper-functions.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
index 1c355e2..37f0b13 100644
--- a/bin/helper-functions.sh
+++ b/bin/helper-functions.sh
@@ -54,9 +54,11 @@ multijob_finish() {
 }
 
 multijob_post_fork() {
+	local ret=0
 	: $(( ++mj_num_jobs ))
 	if [[ ${mj_num_jobs} -ge ${mj_max_jobs} ]] ; then
 		multijob_finish_one
+		: $(( ret |= $? ))
 	fi
-	return 0
+	return ${ret}
 }



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-14 18:51 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-05-14 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     22795b488b882aa423e6bc330a81820f41ec0eb9
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 17:35:29 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon May 14 18:51:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=22795b48

multijob_post_fork: simpler handling of return value

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/helper-functions.sh |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
index 37f0b13..afe14af 100644
--- a/bin/helper-functions.sh
+++ b/bin/helper-functions.sh
@@ -54,11 +54,9 @@ multijob_finish() {
 }
 
 multijob_post_fork() {
-	local ret=0
 	: $(( ++mj_num_jobs ))
 	if [[ ${mj_num_jobs} -ge ${mj_max_jobs} ]] ; then
 		multijob_finish_one
-		: $(( ret |= $? ))
 	fi
-	return ${ret}
+	return $?
 }



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-05-24  5:50 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-05-24  5:50 UTC (permalink / raw
  To: gentoo-commits

commit:     d0ed9b0120792841dffd3d0ae7b3306e0f1d1583
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu May 24 03:48:16 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu May 24 05:51:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d0ed9b01

repoman: tweak elif vcs check style to be consistent

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 3697403..fd87847 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1129,7 +1129,7 @@ if vcs == "cvs":
 	if options.if_modified == "y":
 		myremoved = cvstree.findremoved(mycvstree, recursive=1, basedir="./")
 
-if vcs == "svn":
+elif vcs == "svn":
 	with os.popen("svn status") as f:
 		svnstatus = f.readlines()
 	mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ]



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-02  6:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-02  6:19 UTC (permalink / raw
  To: gentoo-commits

commit:     f04e6dbd3d6791f00752518ca59751607f8f36cc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  2 06:19:14 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  2 06:19:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f04e6dbd

repoman: inherit.missing non-fatal (experimental)

---
 bin/repoman |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 779e651..f62ec0f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -437,6 +437,10 @@ qawarnings = set((
 "LIVEVCS.unmasked",
 ))
 
+if portage.const._ENABLE_INHERIT_CHECK:
+	# This is experimental, so it's non-fatal.
+	qawarnings.add("inherit.missing")
+
 non_ascii_re = re.compile(r'[^\x00-\x7f]')
 
 missingvars = ["KEYWORDS", "LICENSE", "DESCRIPTION", "HOMEPAGE"]



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-02  6:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-02  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     74dbce53d3f44fc0065ddac6a640f15ff369a89f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  2 06:45:18 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  2 06:45:18 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=74dbce53

ebuild.sh: export EAPI for helpers

This fixes some cases where it wouldn't be exported since commit
20817801dd4ef0117bcc7b33c90650da1e920385.

---
 bin/ebuild.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2589113..9829f68 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -553,6 +553,9 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 
 		[ "${EAPI+set}" = set ] || EAPI=0
 
+		# export EAPI for helpers (especially since we unset it above)
+		export EAPI
+
 		if has "$EAPI" 0 1 2 3 3_pre2 ; then
 			export RDEPEND=${RDEPEND-${DEPEND}}
 			debug-print "RDEPEND: not set... Setting to: ${DEPEND}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-04 20:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-04 20:34 UTC (permalink / raw
  To: gentoo-commits

commit:     de996b1dd411bc2bc0363890dc284534d747174e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  4 20:34:09 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun  4 20:34:09 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=de996b1d

repoman: fix _mask_manager assignment

This broke in commit 09980f19e584b644b9e2cf4d5e1e0369b6062ca1.

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index f62ec0f..052ec94 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2060,7 +2060,7 @@ for x in effective_scanlist:
 						env=env)
 					dep_settings.categories = repoman_settings.categories
 					if options.without_mask:
-						dep_settings._mask_manager = \
+						dep_settings._mask_manager_obj = \
 							copy.deepcopy(dep_settings._mask_manager)
 						dep_settings._mask_manager._pmaskdict.clear()
 					arch_caches[prof.sub_path] = dep_settings



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-04 22:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-04 22:22 UTC (permalink / raw
  To: gentoo-commits

commit:     2c50bd9a82c3bb6dfbc63466ae8bfbd401fb3235
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  4 22:22:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun  4 22:22:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2c50bd9a

helper-functions.sh: multijob support bash <4.1

The redirect_alloc_fd() compatibility function is borrowed from Mike
Frysinger's proposed multiprocessing.eclass:

http://archives.gentoo.org/gentoo-dev/msg_5ecd3b1dd0720522807c136d8fd2cd5f.xml

---
 bin/helper-functions.sh |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
index afe14af..c7400fa 100644
--- a/bin/helper-functions.sh
+++ b/bin/helper-functions.sh
@@ -22,7 +22,7 @@ multijob_init() {
 	mj_control_pipe=$(mktemp -t multijob.XXXXXX)
 	rm "${mj_control_pipe}"
 	mkfifo "${mj_control_pipe}"
-	exec {mj_control_fd}<>${mj_control_pipe}
+	redirect_alloc_fd mj_control_fd "${mj_control_pipe}"
 	rm -f "${mj_control_pipe}"
 
 	# See how many children we can fork based on the user's settings.
@@ -60,3 +60,31 @@ multijob_post_fork() {
 	fi
 	return $?
 }
+
+# @FUNCTION: redirect_alloc_fd
+# @USAGE: <var> <file> [redirection]
+# @DESCRIPTION:
+# Find a free fd and redirect the specified file via it.  Store the new
+# fd in the specified variable.  Useful for the cases where we don't care
+# about the exact fd #.
+redirect_alloc_fd() {
+	local var=$1 file=$2 redir=${3:-"<>"}
+
+	if [[ $(( (BASH_VERSINFO[0] << 8) + BASH_VERSINFO[1] )) -ge $(( (4 << 8) + 1 )) ]] ; then
+			# Newer bash provides this functionality.
+			eval "exec {${var}}${redir}'${file}'"
+	else
+			# Need to provide the functionality ourselves.
+			local fd=10
+			while :; do
+					# Make sure the fd isn't open.  It could be a char device,
+					# or a symlink (possibly broken) to something else.
+					if [[ ! -e /dev/fd/${fd} ]] && [[ ! -L /dev/fd/${fd} ]] ; then
+							eval "exec ${fd}${redir}'${file}'" && break
+					fi
+					[[ ${fd} -gt 1024 ]] && die "redirect_alloc_fd failed"
+					: $(( ++fd ))
+			done
+			: $(( ${var} = fd ))
+	fi
+}



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-06  1:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-06  1:35 UTC (permalink / raw
  To: gentoo-commits

commit:     9dbf4d7d7fb7c6d0284cc25d8322dd84292d6dd9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  6 01:35:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 01:35:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9dbf4d7d

repoman: try to sign Manifest only if it exists

This case occurs with "thin-manifests = true" in metadata/layout.conf
when there are no distfiles (like for live ebuilds), as reported in
bug #419717.

---
 bin/repoman |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index e43fa1c..65ba459 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2751,7 +2751,10 @@ else:
 			for x in sorted(vcs_files_to_cps(
 				chain(myupdates, myremoved, mymanifests))):
 				repoman_settings["O"] = os.path.join(repodir, x)
-				gpgsign(os.path.join(repoman_settings["O"], "Manifest"))
+				manifest_path = os.path.join(repoman_settings["O"], "Manifest")
+				if not os.path.exists(manifest_path):
+					continue
+				gpgsign(manifest_path)
 		except portage.exception.PortageException as e:
 			portage.writemsg("!!! %s\n" % str(e))
 			portage.writemsg("!!! Disabled FEATURES='sign'\n")



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-11 23:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-11 23:24 UTC (permalink / raw
  To: gentoo-commits

commit:     908de31ae2049eef02432d73478a403ffcad1ead
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 11 23:23:59 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 23:23:59 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=908de31a

repoman: Manifest after ChangeLog, bug #420735

---
 bin/repoman |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 65ba459..d3a4d77 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2543,6 +2543,11 @@ else:
 			else:
 				myupdates.append(changelog_path)
 
+			if not options.pretend:
+				# regenerate Manifest for modified ChangeLog (bug #420735)
+				repoman_settings["O"] = checkdir
+				digestgen(mysettings=repoman_settings, myportdb=portdb)
+
 	if myautoadd:
 		print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
 		add_cmd = [vcs, "add"]



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-12  2:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-12  2:18 UTC (permalink / raw
  To: gentoo-commits

commit:     8063586060f7d4abfa02639ba72c0e9b38ed634a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 12 02:18:15 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 12 02:18:15 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80635860

repoman: tweak code for bug #420735

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index d3a4d77..c18626d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2543,7 +2543,7 @@ else:
 			else:
 				myupdates.append(changelog_path)
 
-			if not options.pretend:
+			if options.ask and not options.pretend:
 				# regenerate Manifest for modified ChangeLog (bug #420735)
 				repoman_settings["O"] = checkdir
 				digestgen(mysettings=repoman_settings, myportdb=portdb)



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-16  0:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-16  0:45 UTC (permalink / raw
  To: gentoo-commits

commit:     3833fd198efb1a8b90f15903f92676fea5cf9554
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 15 18:10:25 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 16 00:44:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3833fd19

repoman: warn about every 'pkgconfig' implementation in RDEPENDs

Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

---
 bin/repoman |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c18626d..7204f50 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -490,7 +490,10 @@ suspect_rdepend = frozenset([
 	"dev-util/gtk-doc-am",
 	"dev-util/intltool",
 	"dev-util/jam",
+	"dev-util/pkg-config-lite",
+	"dev-util/pkgconf",
 	"dev-util/pkgconfig",
+	"dev-util/pkgconfig-openbsd",
 	"dev-util/scons",
 	"dev-util/unifdef",
 	"dev-util/yacc",
@@ -505,6 +508,7 @@ suspect_rdepend = frozenset([
 	"sys-devel/m4",
 	"sys-devel/pmake",
 	"virtual/linux-sources",
+	"virtual/pkgconfig",
 	"x11-misc/bdftopcf",
 	"x11-misc/imake",
 ])



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-20 21:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-06-20 21:58 UTC (permalink / raw
  To: gentoo-commits

commit:     131b3b6718baa058f06d4f0ac8f919f717ae5338
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 21:56:49 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 21:56:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=131b3b67

misc-functions.sh: unwrap die messages

Jeremy Olexa <darkside <AT> gentoo.org> complained that die was not handling
these line continuations as it's supposed to. Maybe there's a bug in
die's line continuation sed expression, but it won't hurt to unwrap
these particular messages.

---
 bin/misc-functions.sh |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 564af85..9eec8bb 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -773,16 +773,15 @@ install_qa_check() {
 		fi
 		if [[ ${abort} == "yes" ]] ; then
 			if [[ $gentoo_bug = yes || $always_overflow = yes ]] ; then
-				die "install aborted due to" \
-					"severe warnings shown above"
+				die "install aborted due to severe warnings shown above"
 			else
 				echo "Please do not file a Gentoo bug and instead" \
 				"report the above QA issues directly to the upstream" \
 				"developers of this software." | fmt -w 70 | \
 				while read -r line ; do eqawarn "${line}" ; done
 				eqawarn "Homepage: ${HOMEPAGE}"
-				has stricter ${FEATURES} && die "install aborted due to" \
-					"severe warnings shown above"
+				has stricter ${FEATURES} && \
+					die "install aborted due to severe warnings shown above"
 			fi
 		fi
 	fi



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-25  1:26 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-06-25  1:26 UTC (permalink / raw
  To: gentoo-commits

commit:     d58624b74ee24d01e519e8ebb5c979fe4735faa4
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 25 01:25:10 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 25 01:25:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d58624b7

dohtml.py: Sort default list of extensions.

---
 bin/dohtml.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index f0a7f2c..96e78ef 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -13,8 +13,8 @@
 # Detailed usage:
 # dohtml <list-of-files> 
 #  - will install the files in the list of files (space-separated list) into 
-#    /usr/share/doc/${PF}/html, provided the file ends in .htm, .html, .css,
-#      .js, ,gif, .jpeg, .jpg, or .png.
+#    /usr/share/doc/${PF}/html, provided the file ends in .css, .gif, .htm,
+#    .html, .jpeg, .jpg, .js or .png.
 # dohtml -r <list-of-files-and-directories>
 #  - will do as 'dohtml', but recurse into all directories, as long as the 
 #    directory name is not CVS
@@ -99,10 +99,9 @@ class OptionsClass:
 		if "_E_DOCDESTTREE_" in os.environ:
 			self.DOCDESTTREE = os.environ["_E_DOCDESTTREE_"]
 		
-		self.allowed_exts = [ 'htm', 'html', 'css', 'js',
-			'gif', 'jpeg', 'jpg', 'png' ]
+		self.allowed_exts = ['css', 'gif', 'htm', 'html', 'jpeg', 'jpg', 'js', 'png']
 		self.allowed_files = []
-		self.disallowed_dirs = [ 'CVS' ]
+		self.disallowed_dirs = ['CVS']
 		self.recurse = False
 		self.verbose = False
 		self.doc_prefix = ""



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-06-25  4:16 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-06-25  4:16 UTC (permalink / raw
  To: gentoo-commits

commit:     c92b3b0fcccd61af78b3777e863938abe9f2ac34
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 25 04:12:01 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 25 04:12:01 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c92b3b0f

dohtml: Support PORTAGE_DOHTML_WARN_ON_SKIPPED_FILES environmental variable.

---
 bin/dohtml.py |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index ba16b46..3e80ef5 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -47,6 +47,10 @@ def eqawarn(lines):
 	os.spawnlp(os.P_WAIT, "bash", "bash", "-c", cmd)
 
 skipped_directories = []
+skipped_files = []
+warn_on_skipped_files = os.environ.get("PORTAGE_DOHTML_WARN_ON_SKIPPED_FILES") is not None
+unwarned_skipped_extensions = os.environ.get("PORTAGE_DOHTML_UNWARNED_SKIPPED_EXTENSIONS", "").split()
+unwarned_skipped_files = os.environ.get("PORTAGE_DOHTML_UNWARNED_SKIPPED_FILES", "").split()
 
 def install(basename, dirname, options, prefix=""):
 	fullpath = basename
@@ -64,10 +68,12 @@ def install(basename, dirname, options, prefix=""):
 		sys.stderr.write("!!! dohtml: %s does not exist\n" % fullpath)
 		return False
 	elif os.path.isfile(fullpath):
-		ext = os.path.splitext(basename)[1]
-		if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files:
+		ext = os.path.splitext(basename)[1][1:]
+		if ext in options.allowed_exts or basename in options.allowed_files:
 			dodir(destdir)
 			dofile(fullpath, destdir + "/" + basename)
+		elif warn_on_skipped_files and ext not in unwarned_skipped_extensions and basename not in unwarned_skipped_files:
+			skipped_files.append(fullpath)
 	elif options.recurse and os.path.isdir(fullpath) and \
 	     basename not in options.disallowed_dirs:
 		for i in os.listdir(fullpath):
@@ -169,7 +175,7 @@ def main():
 
 	if options.verbose:
 		print("Allowed extensions:", options.allowed_exts)
-		print("Document prefix : '" + options.doc_prefix	 + "'")
+		print("Document prefix : '" + options.doc_prefix + "'")
 		print("Allowed files :", options.allowed_files)
 
 	success = False
@@ -179,10 +185,10 @@ def main():
 		dirname  = os.path.dirname(x)
 		success |= install(basename, dirname, options)
 
-	global skipped_directories
 	for x in skipped_directories:
-		eqawarn(["QA Notice: dohtml on directory " + \
-			"'%s' without recursion option" % x])
+		eqawarn(["QA Notice: dohtml on directory '%s' without recursion option" % x])
+	for x in skipped_files:
+		eqawarn(["dohtml: skipped file '%s'" % x])
 
 	if success:
 		retcode = 0



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-07-03 21:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-07-03 21:35 UTC (permalink / raw
  To: gentoo-commits

commit:     9145dab7ffcc69a91b7f4a6378e991057d0daab7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  3 21:35:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul  3 21:35:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9145dab7

emaint: remove obsolete world category check

The reason for this check, as discussed in bug #166785, is no longer
relevant since emerge does not suggest to run `emaint --check world` in
this case anymore.

---
 bin/emaint |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/bin/emaint b/bin/emaint
index 1bee0fe..cf2ccb8 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -1,5 +1,6 @@
 #!/usr/bin/python -O
-# vim: noet :
+# Copyright 2005-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
@@ -36,7 +37,6 @@ class WorldHandler(object):
 	def __init__(self):
 		self.invalid = []
 		self.not_installed = []
-		self.invalid_category = []
 		self.okay = []
 		from portage._sets import load_default_config
 		setconfig = load_default_config(portage.settings,
@@ -44,7 +44,6 @@ class WorldHandler(object):
 		self._sets = setconfig.getSets()
 
 	def _check_world(self, onProgress):
-		categories = set(portage.settings.categories)
 		eroot = portage.settings['EROOT']
 		self.world_file = os.path.join(eroot, portage.const.WORLD_FILE)
 		self.found = os.access(self.world_file, os.R_OK)
@@ -73,9 +72,6 @@ class WorldHandler(object):
 			if not vardb.match(atom):
 				self.not_installed.append(atom)
 				okay = False
-			if portage.catsplit(atom.cp)[0] not in categories:
-				self.invalid_category.append(atom)
-				okay = False
 			if okay:
 				self.okay.append(atom)
 			if onProgress:
@@ -87,7 +83,6 @@ class WorldHandler(object):
 		if self.found:
 			errors += ["'%s' is not a valid atom" % x for x in self.invalid]
 			errors += ["'%s' is not installed" % x for x in self.not_installed]
-			errors += ["'%s' has a category that is not listed in /etc/portage/categories" % x for x in self.invalid_category]
 		else:
 			errors.append(self.world_file + " could not be opened for reading")
 		return errors



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-07-10  0:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-07-10  0:13 UTC (permalink / raw
  To: gentoo-commits

commit:     0177e7d1aa9267897032d7a4c7de9c6968c5072d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 10 00:04:58 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 10 00:11:02 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0177e7d1

migrate emaint to use the new title and label features of the progressbar.

---
 bin/emaint |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bin/emaint b/bin/emaint
index cf2ccb8..5f54f6a 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -610,19 +610,16 @@ def emaint_main(myargv):
 
 
 	if action == "-c/--check":
-		status = "Checking %s for problems"
 		func = "check"
 	else:
-		status = "Attempting to fix %s"
 		func = "fix"
 
 	isatty = os.environ.get('TERM') != 'dumb' and sys.stdout.isatty()
 	for task in tasks:
-		print(status % task.name())
 		inst = task()
 		onProgress = None
 		if isatty:
-			progressBar = portage.output.TermProgressBar()
+			progressBar = portage.output.TermProgressBar(title="Emaint", max_desc_length=26)
 			progressHandler = ProgressHandler()
 			onProgress = progressHandler.onProgress
 			def display():
@@ -632,6 +629,7 @@ def emaint_main(myargv):
 				lines, progressBar.term_columns = \
 					portage.output.get_term_size()
 			signal.signal(signal.SIGWINCH, sigwinch_handler)
+			progressBar.label(func + " " + inst.name())
 		result = getattr(inst, func)(onProgress=onProgress)
 		if isatty:
 			# make sure the final progress is displayed



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-07-18 20:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-07-18 20:23 UTC (permalink / raw
  To: gentoo-commits

commit:     d134e60407c65b04fd57fea3016cf9ba9e8c5236
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 18 20:23:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul 18 20:23:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d134e604

etc-update: fix --automode -5, bug #427068

---
 bin/etc-update |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 1edc91f..d763c1f 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -190,6 +190,7 @@ parse_automode_flag() {
 		parse_automode_flag -3
 		export mv_opts=" ${mv_opts} "
 		mv_opts="${mv_opts// -i / }"
+		NONINTERACTIVE_MV=true
 		;;
 	-3)
 		input=0
@@ -600,6 +601,7 @@ declare title="Gentoo's etc-update tool!"
 PREEN=false
 SET_X=false
 VERBOSE=false
+NONINTERACTIVE_MV=false
 while [[ -n $1 ]] ; do
 	case $1 in
 		-d|--debug)   SET_X=true;;
@@ -692,6 +694,11 @@ else
 	fi
 fi
 
+if ${NONINTERACTIVE_MV} ; then
+	export mv_opts=" ${mv_opts} "
+	mv_opts="${mv_opts// -i / }"
+fi
+
 if ${VERBOSE} ; then
 	for v in ${portage_vars[@]} ${cfg_vars[@]} TMP SCAN_PATHS ; do
 		echo "${v}=${!v}"



^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-07-31 23:12 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-07-31 23:12 UTC (permalink / raw
  To: gentoo-commits

commit:     0015d40c015cf10c710895d928a70633afb5f3a1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jul 31 23:11:27 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Tue Jul 31 23:11:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0015d40c

Use nanosecond precision in chpathtool when using Python >=3.3.

---
 bin/chpathtool.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index d0d49cb..85e608e 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2011 Gentoo Foundation
+# Copyright 2011-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import io
@@ -121,8 +121,12 @@ def chpath_inplace(filename, is_text_file, old, new):
 
 	f.close()
 	if modified:
-		orig_mtime = orig_stat[stat.ST_MTIME]
-		os.utime(filename, (orig_mtime, orig_mtime))
+		if sys.hexversion >= 0x3030000:
+			orig_mtime = orig_stat.st_mtime_ns
+			os.utime(filename, ns=(orig_mtime, orig_mtime))
+		else:
+			orig_mtime = orig_stat[stat.ST_MTIME]
+			os.utime(filename, (orig_mtime, orig_mtime))
 	return modified
 
 def chpath_inplace_symlink(filename, st, old, new):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-04 21:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-04 21:18 UTC (permalink / raw
  To: gentoo-commits

commit:     1cc39de72ac5311db748341ef9183586556719d9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  4 21:18:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  4 21:18:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1cc39de7

econf: add --disable-silent-rules, bug #379497#c6

---
 bin/phase-helpers.sh |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 946520b..480e73e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -420,11 +420,17 @@ econf() {
 			done
 		fi
 
+		local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
+
+		case "${conf_help}" in
+			*--disable-silent-rules*) set -- --disable-silent-rules "$@";;
+		esac
+
 		# EAPI=4 adds --disable-dependency-tracking to econf
-		if ! has "$EAPI" 0 1 2 3 3_pre2 && \
-			"${ECONF_SOURCE}/configure" --help 2>/dev/null | \
-			grep -q disable-dependency-tracking ; then
-			set -- --disable-dependency-tracking "$@"
+		if ! has "$EAPI" 0 1 2 3 3_pre2 ; then
+			case "${conf_help}" in
+				*--disable-dependency-tracking*) set -- --disable-dependency-tracking "$@";;
+			esac
 		fi
 
 		# if the profile defines a location to install libs to aside from default, pass it on.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-05 20:11 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-05 20:11 UTC (permalink / raw
  To: gentoo-commits

commit:     216bbf7eb993ca99d197ba4efa47808f4a7e57fd
Author:     Samuli Suominen <ssuominen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  5 20:10:26 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug  5 20:10:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=216bbf7e

repoman: libusb virtual.suspect, bug #417123

---
 bin/repoman |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 795c7ce..c5dce03 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -520,6 +520,9 @@ suspect_virtual = {
 	"dev-util/pkgconf":"virtual/pkgconfig",
 	"dev-util/pkgconfig":"virtual/pkgconfig",
 	"dev-util/pkgconfig-openbsd":"virtual/pkgconfig",
+	"dev-libs/libusb":"virtual/libusb",
+	"dev-libs/libusbx":"virtual/libusb",
+	"dev-libs/libusb-compat":"virtual/libusb",
 }
 
 metadata_dtd_uri = 'http://www.gentoo.org/dtd/metadata.dtd'


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-07 21:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-07 21:09 UTC (permalink / raw
  To: gentoo-commits

commit:     9168d4c184a16e9b992e22bb5d6f3d88b25309b9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  7 21:04:34 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug  7 21:04:34 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9168d4c1

Revert "econf: add --disable-silent-rules, bug #379497#c6"

This reverts commit 1cc39de72ac5311db748341ef9183586556719d9.

It may be unsafe to call configure --help with some configure scripts,
as noted in bug #379497, comment #34.

---
 bin/phase-helpers.sh |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 480e73e..946520b 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -420,17 +420,11 @@ econf() {
 			done
 		fi
 
-		local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
-
-		case "${conf_help}" in
-			*--disable-silent-rules*) set -- --disable-silent-rules "$@";;
-		esac
-
 		# EAPI=4 adds --disable-dependency-tracking to econf
-		if ! has "$EAPI" 0 1 2 3 3_pre2 ; then
-			case "${conf_help}" in
-				*--disable-dependency-tracking*) set -- --disable-dependency-tracking "$@";;
-			esac
+		if ! has "$EAPI" 0 1 2 3 3_pre2 && \
+			"${ECONF_SOURCE}/configure" --help 2>/dev/null | \
+			grep -q disable-dependency-tracking ; then
+			set -- --disable-dependency-tracking "$@"
 		fi
 
 		# if the profile defines a location to install libs to aside from default, pass it on.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-14  4:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-14  4:08 UTC (permalink / raw
  To: gentoo-commits

commit:     b0406968448e37b7ec1d3003722cd69b0d406fe3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 14 04:07:42 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 14 04:07:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b0406968

emerge-webrsync: adjust for 00:45 snapshots

The time changed from 01:45 to 00:45 some time ago.

---
 bin/emerge-webrsync |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index bfd9aa2..47d4519 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -333,7 +333,7 @@ do_latest_snapshot() {
 
 	vecho "Fetching most recent snapshot ..."
 
-	# The snapshot for a given day is generated at 01:45 UTC on the following
+	# The snapshot for a given day is generated at 00:45 UTC on the following
 	# day, so the current day's snapshot (going by UTC time) hasn't been
 	# generated yet.  Therefore, always start by looking for the previous day's
 	# snapshot (for attempts=1, subtract 1 day from the current UTC time).
@@ -349,10 +349,10 @@ do_latest_snapshot() {
 	local start_time=$(get_utc_date_in_seconds)
 	local start_hour=$(get_date_part ${start_time} "%H")
 
-	# Daily snapshots are created at 1:45 AM and are not
-	# available until after 2 AM. Don't waste time trying
+	# Daily snapshots are created at 00:45 and are not
+	# available until after 01:00. Don't waste time trying
 	# to fetch a snapshot before it's been created.
-	if [ ${start_hour} -lt 2 ] ; then
+	if [ ${start_hour} -lt 1 ] ; then
 		(( start_time -= 86400 ))
 	fi
 	local snapshot_date=$(get_date_part ${start_time} "%Y%m%d")
@@ -361,8 +361,8 @@ do_latest_snapshot() {
 	while (( ${attempts} <  40 )) ; do
 		(( attempts++ ))
 		(( snapshot_date_seconds -= 86400 ))
-		# snapshots are created at 1:45 AM
-		(( approx_snapshot_time = snapshot_date_seconds + 86400 + 6300 ))
+		# snapshots are created at 00:45
+		(( approx_snapshot_time = snapshot_date_seconds + 86400 + 2700 ))
 		(( timestamp_difference = existing_timestamp - approx_snapshot_time ))
 		[ ${timestamp_difference} -lt 0 ] && (( timestamp_difference = -1 * timestamp_difference ))
 		snapshot_date=$(get_date_part ${snapshot_date_seconds} "%Y%m%d")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-15  1:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-15  1:03 UTC (permalink / raw
  To: gentoo-commits

commit:     644c0dd5daad47b6392d99c706afaea56e17ee31
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 15 01:03:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 15 01:03:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=644c0dd5

emerge-webrsync: add -k/--keep option

---
 bin/emerge-webrsync |   39 ++++++++++++++++++++++++---------------
 1 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 47d4519..57e3052 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
 # Rewritten from the old, Perl-based emerge-webrsync script
@@ -39,11 +39,10 @@ else
 	eecho "could not find 'portageq'; aborting"
 	exit 1
 fi
-eval $("${portageq}" envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \
+eval $("${portageq}" envvar -v DISTDIR FEATURES FETCHCOMMAND GENTOO_MIRRORS \
 	PORTAGE_BIN_PATH PORTAGE_GPG_DIR \
 	PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_TMPDIR PORTDIR \
 	SYNC http_proxy ftp_proxy)
-DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync"
 export http_proxy ftp_proxy
 
 # If PORTAGE_NICENESS is overriden via the env then it will
@@ -56,6 +55,7 @@ source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
 
 do_verbose=0
 do_debug=0
+keep=false
 
 if has webrsync-gpg ${FEATURES} ; then
 	WEBSYNC_VERIFY_SIGNATURE=1
@@ -131,7 +131,7 @@ fetch_file() {
 	vecho "Fetching file ${FILE} ..."
 	# already set DISTDIR=
 	eval "${FETCHCOMMAND}" ${opts}
-	[ -s "${FILE}" ]
+	[ -s "${DISTDIR}/${FILE}" ]
 }
 
 check_file_digest() {
@@ -142,7 +142,9 @@ check_file_digest() {
 	vecho "Checking digest ..."
 
 	if type -P md5sum > /dev/null; then
-		md5sum -c $digest && r=0
+		local md5sum_output=$(md5sum "${file}")
+		local digest_content=$(< "${digest}")
+		[ "${md5sum_output%%[[:space:]]*}" = "${digest_content%%[[:space:]]*}" ] && r=0
 	elif type -P md5 > /dev/null; then
 		[ "$(md5 -q "${file}")" == "$(cut -d ' ' -f 1 "${digest}")" ] && r=0
 	else
@@ -201,7 +203,7 @@ sync_local() {
 		fi
 
 		# Free disk space
-		rm -f "${file}"
+		${keep} || rm -f "${file}"
 
 		chown portage:portage portage > /dev/null 2>&1 && \
 			chown -R portage:portage portage
@@ -251,6 +253,7 @@ do_snapshot() {
 
 	for mirror in ${GENTOO_MIRRORS} ; do
 
+		mirror=${mirror%/}
 		vecho "Trying to retrieve ${date} snapshot from ${mirror} ..."
 
 		for compression in ${compressions} ; do
@@ -258,7 +261,7 @@ do_snapshot() {
 			local digest="${file}.md5sum"
 			local signature="${file}.gpgsig"
 
-			if [ -s "${file}" -a -s "${digest}" -a -s "${signature}" ] ; then
+			if [ -s "${DISTDIR}/${file}" -a -s "${DISTDIR}/${digest}" -a -s "${DISTDIR}/${signature}" ] ; then
 				check_file_digest "${DISTDIR}/${digest}" "${DISTDIR}/${file}" && \
 				check_file_signature "${DISTDIR}/${signature}" "${DISTDIR}/${file}" && \
 				have_files=1
@@ -281,7 +284,7 @@ do_snapshot() {
 			if [ ${have_files} -eq 1 ]; then
 
 				vecho "Getting snapshot timestamp ..."
-				local snapshot_timestamp=$(get_snapshot_timestamp "${file}")
+				local snapshot_timestamp=$(get_snapshot_timestamp "${DISTDIR}/${file}")
 
 				if [ ${ignore_timestamp} == 0 ]; then
 					if [ ${snapshot_timestamp} -lt $(get_portage_timestamp) ]; then
@@ -310,7 +313,7 @@ do_snapshot() {
 				#
 				# Remove files and use a different mirror
 				#
-				rm -f "${file}" "${digest}" "${signature}"
+				rm -f "${DISTDIR}/${file}" "${DISTDIR}/${digest}" "${DISTDIR}/${signature}"
 			fi
 		done
 
@@ -318,12 +321,12 @@ do_snapshot() {
 	done
 
 	if [ ${have_files} -eq 1 ]; then
-		sync_local "${file}" && r=0
+		sync_local "${DISTDIR}/${file}" && r=0
 	else
 		vecho "${date} snapshot was not found"
 	fi
-	
-	rm -f "${file}" "${digest}" "${signature}"
+
+	${keep} || rm -f "${DISTDIR}/${file}" "${DISTDIR}/${digest}" "${DISTDIR}/${signature}"
 	return "${r}"
 }
 
@@ -411,6 +414,7 @@ usage() {
 	
 	Options:
 	  --revert=yyyymmdd   Revert to snapshot
+	  -k, --keep          Keep snapshots in DISTDIR (don't delete)
 	  -q, --quiet         Only output errors
 	  -v, --verbose       Enable verbose output
 	  -x, --debug         Enable debug output
@@ -427,14 +431,12 @@ usage() {
 main() {
 	local arg
 	local revert_date
-	
-	[ ! -d "${DISTDIR}" ] && mkdir -p "${DISTDIR}"
-	cd "${DISTDIR}"
 
 	for arg in "$@" ; do
 		local v=${arg#*=}
 		case ${arg} in
 			-h|--help)    usage ;;
+			-k|--keep)    keep=true ;;
 			-q|--quiet)   PORTAGE_QUIET=1 ;;
 			-v|--verbose) do_verbose=1 ;;
 			-x|--debug)   do_debug=1 ;;
@@ -443,6 +445,13 @@ main() {
 		esac
 	done
 
+	TMPDIR=${PORTAGE_TMPDIR}/emerge-webrsync
+	${keep} || DISTDIR=${TMPDIR}
+
+	[ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}"
+	[ ! -d "${DISTDIR}" ] && mkdir -p "${DISTDIR}"
+	cd "${TMPDIR}" || exit 1
+
 	# This is a sanity check to help prevent people like funtoo users
 	# from accidentally wiping out their git tree.
 	if [[ -n $SYNC && ${SYNC#rsync:} = $SYNC ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-15  2:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-15  2:00 UTC (permalink / raw
  To: gentoo-commits

commit:     a343db38d0e4da0126c33d305386b187a6f00205
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 15 02:00:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 15 02:00:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a343db38

emerge-webrsync: check permission, bug #142202

---
 bin/emerge-webrsync |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 57e3052..0a036d2 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -22,9 +22,9 @@ vvecho() { [[ ${do_verbose} -eq 1 ]] && echo "$@" ; }
 # Only echo if not in verbose mode
 nvecho() { [[ ${do_verbose} -eq 0 ]] && echo "$@" ; }
 # warning echos
-wecho() { echo "${argv0}: warning: $*" 1>&2 ; }
+wecho() { echo "${argv0##*/}: warning: $*" 1>&2 ; }
 # error echos
-eecho() { echo "${argv0}: error: $*" 1>&2 ; }
+eecho() { echo "${argv0##*/}: error: $*" 1>&2 ; }
 
 argv0=$0
 
@@ -445,6 +445,12 @@ main() {
 		esac
 	done
 
+	[[ -d ${PORTDIR} ]] || mkdir -p "${PORTDIR}"
+	if [[ ! -w ${PORTDIR} ]] ; then
+		eecho "PORTDIR is not writable: ${PORTDIR}"
+		exit 1
+	fi
+
 	TMPDIR=${PORTAGE_TMPDIR}/emerge-webrsync
 	${keep} || DISTDIR=${TMPDIR}
 
@@ -452,6 +458,16 @@ main() {
 	[ ! -d "${DISTDIR}" ] && mkdir -p "${DISTDIR}"
 	cd "${TMPDIR}" || exit 1
 
+	if ${keep} && [[ ! -w ${DISTDIR} ]] ; then
+		eecho "DISTDIR is not writable: ${DISTDIR}"
+		exit 1
+	fi
+
+	if [[ ! -w ${TMPDIR} ]] ; then
+		eecho "TMPDIR is not writable: ${TMPDIR}"
+		exit 1
+	fi
+
 	# This is a sanity check to help prevent people like funtoo users
 	# from accidentally wiping out their git tree.
 	if [[ -n $SYNC && ${SYNC#rsync:} = $SYNC ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-15  2:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-15  2:55 UTC (permalink / raw
  To: gentoo-commits

commit:     b711786c8fe6231a2d33b0a3070355339cbeb36d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 15 02:55:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 15 02:55:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b711786c

emerge-webrsync: preserve ownership for usersync

---
 bin/emerge-webrsync |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 0a036d2..80d6294 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -42,7 +42,7 @@ fi
 eval $("${portageq}" envvar -v DISTDIR FEATURES FETCHCOMMAND GENTOO_MIRRORS \
 	PORTAGE_BIN_PATH PORTAGE_GPG_DIR \
 	PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_TMPDIR PORTDIR \
-	SYNC http_proxy ftp_proxy)
+	SYNC USERLAND http_proxy ftp_proxy)
 export http_proxy ftp_proxy
 
 # If PORTAGE_NICENESS is overriden via the env then it will
@@ -187,9 +187,21 @@ sync_local() {
 
 	vecho "Syncing local tree ..."
 
+	local ownership="portage:portage"
+	if has usersync ${FEATURES} ; then
+		case "${USERLAND}" in
+			BSD)
+				ownership=$(stat -f '%Su:%Sg' "${PORTDIR}")
+				;;
+			*)
+				ownership=$(stat -c '%U:%G' "${PORTDIR}")
+				;;
+		esac
+	fi
+
 	if type -P tarsync > /dev/null ; then
-		local chown_opts="-o portage -g portage"
-		chown portage:portage portage > /dev/null 2>&1 || chown_opts=""
+		local chown_opts="-o ${ownership%:*} -g ${ownership#*:}"
+		chown ${ownership} "${PORTDIR}" > /dev/null 2>&1 || chown_opts=""
 		if ! tarsync $(vvecho -v) -s 1 ${chown_opts} \
 			-e /distfiles -e /packages -e /local "${file}" "${PORTDIR}"; then
 			eecho "tarsync failed; tarball is corrupt? (${file})"
@@ -205,8 +217,8 @@ sync_local() {
 		# Free disk space
 		${keep} || rm -f "${file}"
 
-		chown portage:portage portage > /dev/null 2>&1 && \
-			chown -R portage:portage portage
+		chown ${ownership} portage > /dev/null 2>&1 && \
+			chown -R ${ownership} portage
 		cd portage
 		rsync -av --progress --stats --delete --delete-after \
 			--exclude='/distfiles' --exclude='/packages' \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-15  3:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-15  3:04 UTC (permalink / raw
  To: gentoo-commits

commit:     e672b5ccbbbe38eda5c733fc799a20d92a8bdf75
Author:     Jan Pobrislo <ccx <AT> volny <DOT> cz>
AuthorDate: Wed Aug 15 03:03:23 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 15 03:03:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e672b5cc

emerge-webrsync: PORTAGE_RSYNC_OPTS, bug #364105

---
 bin/emerge-webrsync |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 80d6294..5644abf 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -41,7 +41,8 @@ else
 fi
 eval $("${portageq}" envvar -v DISTDIR FEATURES FETCHCOMMAND GENTOO_MIRRORS \
 	PORTAGE_BIN_PATH PORTAGE_GPG_DIR \
-	PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_TMPDIR PORTDIR \
+	PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS \
+	PORTAGE_RSYNC_OPTS PORTAGE_TMPDIR PORTDIR \
 	SYNC USERLAND http_proxy ftp_proxy)
 export http_proxy ftp_proxy
 
@@ -220,9 +221,7 @@ sync_local() {
 		chown ${ownership} portage > /dev/null 2>&1 && \
 			chown -R ${ownership} portage
 		cd portage
-		rsync -av --progress --stats --delete --delete-after \
-			--exclude='/distfiles' --exclude='/packages' \
-			--exclude='/local' ${PORTAGE_RSYNC_EXTRA_OPTS} . "${PORTDIR%%/}"
+		rsync ${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS} . "${PORTDIR%%/}"
 		cd ..
 
 		vecho "Cleaning up ..."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-17 19:10 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-08-17 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     8aa4f965d3baeaea9dc56938c67bb20d8af835a3
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 16 21:46:58 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Aug 16 21:46:58 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8aa4f965

egencache: add a standard -j flags for --jobs

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/egencache |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index a75a341..d0c073c 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -102,7 +102,7 @@ def parse_args(args):
 	update.add_option("--cache-dir",
 		help="location of the metadata cache",
 		dest="cache_dir")
-	update.add_option("--jobs",
+	update.add_option("-j", "--jobs",
 		action="store",
 		help="max ebuild processes to spawn")
 	update.add_option("--load-average",


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-19  0:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-19  0:00 UTC (permalink / raw
  To: gentoo-commits

commit:     9ed46667dbeee834f03c5f40d5231c0695bc4e7a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 18 23:59:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 18 23:59:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ed46667

emerge-webrsync: use ${PORTAGE_TMPDIR}/portage

For consistency with commit 83e677766650e73071813c0d46547647e5f66029.

---
 bin/emerge-webrsync |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 11d608f..5cba6b0 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -464,23 +464,23 @@ main() {
 		exit 1
 	fi
 
-	TMPDIR=${PORTAGE_TMPDIR}/emerge-webrsync
-	${keep} || DISTDIR=${TMPDIR}
+	[[ -d ${PORTAGE_TMPDIR}/portage ]] || mkdir -p "${PORTAGE_TMPDIR}/portage"
+	TMPDIR=$(mktemp -d "${PORTAGE_TMPDIR}/portage/webrsync-XXXXXX")
+	if [[ ! -w ${TMPDIR} ]] ; then
+		eecho "TMPDIR is not writable: ${TMPDIR}"
+		exit 1
+	fi
+	trap 'cd / ; rm -rf "${TMPDIR}"' EXIT
+	cd "${TMPDIR}" || exit 1
 
-	[ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}"
+	${keep} || DISTDIR=${TMPDIR}
 	[ ! -d "${DISTDIR}" ] && mkdir -p "${DISTDIR}"
-	cd "${TMPDIR}" || exit 1
 
 	if ${keep} && [[ ! -w ${DISTDIR} ]] ; then
 		eecho "DISTDIR is not writable: ${DISTDIR}"
 		exit 1
 	fi
 
-	if [[ ! -w ${TMPDIR} ]] ; then
-		eecho "TMPDIR is not writable: ${TMPDIR}"
-		exit 1
-	fi
-
 	# This is a sanity check to help prevent people like funtoo users
 	# from accidentally wiping out their git tree.
 	if [[ -n $SYNC && ${SYNC#rsync:} = $SYNC ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-19  4:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-19  4:03 UTC (permalink / raw
  To: gentoo-commits

commit:     f55d7ef2b68e42e46e1ddc5747e7e3a75b7e6869
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 19 04:03:11 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug 19 04:03:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f55d7ef2

emerge-webrsync: fix date usage for BSD

---
 bin/emerge-webrsync |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 5cba6b0..a962ab5 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -101,7 +101,9 @@ get_date_part() {
 get_utc_second_from_string() {
 	local s="$1"
 	if [[ ${USERLAND} == BSD ]] ; then
-		date -juf "%Y%m%d" "$s" +"%s"
+		# Specify zeros for the least significant digits, or else those
+		# digits are inherited from the current system clock time.
+		date -juf "%Y%m%d%H%M.%S" "${s}0000.00" +"%s"
 	else
 		date -d "${s:0:4}-${s:4:2}-${s:6:2}" -u +"%s"
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-29 16:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-29 16:43 UTC (permalink / raw
  To: gentoo-commits

commit:     9f14ed80e65a18da06e0834961ea032e3e830319
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 29 16:43:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 29 16:43:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f14ed80

EAPI 5: src_test support for parallel tests

See bug #363005 and the PMS patch:
http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=3ec4b3c22582a8ec206bce1e93bab377d7b264b5

---
 bin/phase-helpers.sh |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a00475c..3f02c07 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -544,13 +544,19 @@ _eapi0_src_test() {
 	# we call it in 'nonfatal' mode, we use emake_cmd
 	# to emulate the desired parts of emake behavior.
 	local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
-	if $emake_cmd -j1 check -n &> /dev/null; then
+	local internal_opts=
+	case "$EAPI" in
+		0|1|2|3|4|4-python|4-slot-abi)
+			internal_opts+=" -j1"
+			;;
+	esac
+	if $emake_cmd ${internal_opts} check -n &> /dev/null; then
 		vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
-		$emake_cmd -j1 check || \
+		$emake_cmd ${internal_opts} check || \
 			die "Make check failed. See above for details."
-	elif $emake_cmd -j1 test -n &> /dev/null; then
+	elif $emake_cmd ${internal_opts} test -n &> /dev/null; then
 		vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
-		$emake_cmd -j1 test || \
+		$emake_cmd ${internal_opts} test || \
 			die "Make test failed. See above for details."
 	else
 		vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-30  5:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-30  5:05 UTC (permalink / raw
  To: gentoo-commits

commit:     6b4b621f1abcf21d3bfa54b323126a3ef11eb52c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 30 05:04:42 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 30 05:04:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b4b621f

EAPI 5: User patches (no-op dummy stub for now)

A real apply_user_patches implementation will be a bit more work, so
for now we'll just implement the minimum amount necessary to satisfy
the spec:
http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=a8bf7862967cce36b7f1b408934a774126da2538

---
 bin/phase-functions.sh |   23 ++++++++++++++++++++++-
 bin/phase-helpers.sh   |   15 +++++++++++++++
 bin/save-ebuild-env.sh |    4 +++-
 3 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index c23be74..ff7d855 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -277,7 +277,8 @@ dyn_clean() {
 			"$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \
 			"$PORTAGE_BUILDDIR"/.die_hooks \
 			"$PORTAGE_BUILDDIR"/.ipc_{in,out,lock} \
-			"$PORTAGE_BUILDDIR"/.exit_status
+			"$PORTAGE_BUILDDIR"/.exit_status \
+			"$PORTAGE_BUILDDIR"/.apply_user_patches
 
 		rm -rf "${PORTAGE_BUILDDIR}/build-info"
 		rm -rf "${WORKDIR}"
@@ -381,6 +382,14 @@ dyn_prepare() {
 		die "Failed to create $PORTAGE_BUILDDIR/.prepared"
 	vecho ">>> Source prepared."
 	ebuild_phase post_src_prepare
+	case "${EAPI}" in
+		0|1|2|3|4|4-python|4-slot-abi)
+			;;
+		*)
+			[[ ! -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && \
+				die "src_prepare must call apply_user_patches at least once"
+			;;
+	esac
 
 	trap - SIGINT SIGQUIT
 }
@@ -804,6 +813,18 @@ _ebuild_phase_funcs() {
 						eval "default_src_install() { _eapi4_src_install \"\$@\" ; }"
 						[[ $phase_func = src_install ]] && \
 							eval "default() { _eapi4_$phase_func \"\$@\" ; }"
+						case "$eapi" in
+							4|4-python|4-slot-abi)
+								;;
+							*)
+								! declare -F src_prepare >/dev/null && \
+									src_prepare() { _eapi5_src_prepare "$@" ; }
+								default_src_prepare() { _eapi5_src_prepare "$@" ; }
+								[[ $phase_func = src_prepare ]] && \
+									eval "default() { _eapi5_$phase_func \"\$@\" ; }"
+								apply_user_patches() { _eapi5_apply_user_patches "$@" ; }
+								;;
+						esac
 						;;
 				esac
 

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3f02c07..3230870 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -598,6 +598,21 @@ _eapi4_src_install() {
 	fi
 }
 
+_eapi5_src_prepare() {
+	apply_user_patches
+}
+
+apply_user_patches() {
+	die "apply_user_patches is not supported with EAPI ${EAPI}"
+}
+
+_eapi5_apply_user_patches() {
+	# This is a no-op that is just enough to fullfill the spec.
+	[[ -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && return 1
+	> "${PORTAGE_BUILDDIR}/.apply_user_patches" || die
+	return 1
+}
+
 # @FUNCTION: has_version
 # @USAGE: <DEPEND ATOM>
 # @DESCRIPTION:

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 47a2aca..4bf6e4e 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -46,7 +46,8 @@ save_ebuild_env() {
 	done
 	unset x
 
-	unset -f assert assert_sigpipe_ok dump_trace die diefunc \
+	unset -f apply_user_patches assert assert_sigpipe_ok \
+		dump_trace die diefunc \
 		quiet_mode vecho elog_base eqawarn elog \
 		esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
 		KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
@@ -67,6 +68,7 @@ save_ebuild_env() {
 		save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
 		set_unless_changed unset_unless_changed source_all_bashrcs \
 		ebuild_main ebuild_phase ebuild_phase_with_hooks \
+		_eapi5_apply_user_patches _eapi5_src_prepare \
 		_ebuild_arg_to_phase _ebuild_phase_funcs default \
 		_hasg _hasgq _unpack_tar \
 		${QA_INTERCEPTORS}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-30  5:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-30  5:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c6fa9f21c738f8450efd5e11f7bd526f81e11340
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 30 05:25:33 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 30 05:25:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6fa9f21

EAPI 5: econf --disable-silent-rules

See bug #379497 and the PMS patch:
http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=b7750e67b4772c1064543defb7df6a556f09807b

---
 bin/phase-helpers.sh |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3230870..4efcf0d 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -421,11 +421,27 @@ econf() {
 		fi
 
 		# EAPI=4 adds --disable-dependency-tracking to econf
-		if ! has "$EAPI" 0 1 2 3 && \
-			"${ECONF_SOURCE}/configure" --help 2>/dev/null | \
-			grep -q disable-dependency-tracking ; then
-			set -- --disable-dependency-tracking "$@"
-		fi
+		case "${EAPI}" in
+			0|1|2|3)
+				;;
+			*)
+				local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
+				case "${conf_help}" in
+					*--disable-dependency-tracking*)
+						set -- --disable-dependency-tracking "$@"
+						;;
+				esac
+				case "${EAPI}" in
+					4|4-python|4-slot-abi)
+						;;
+					*)
+						case "${conf_help}" in
+							*--disable-silent-rules*)
+								set -- --disable-silent-rules "$@"
+								;;
+						esac
+				esac
+		esac
 
 		# if the profile defines a location to install libs to aside from default, pass it on.
 		# if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-30  5:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-30  5:30 UTC (permalink / raw
  To: gentoo-commits

commit:     7d7387b34fdfb6ac8e736ca4e73f1e3f8fa1a705
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 30 05:25:33 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 30 05:29:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d7387b3

EAPI 5: econf --disable-silent-rules

See bug #379497 and the PMS patch:
http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=b7750e67b4772c1064543defb7df6a556f09807b

---
 bin/phase-helpers.sh |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3230870..db1548e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -421,11 +421,29 @@ econf() {
 		fi
 
 		# EAPI=4 adds --disable-dependency-tracking to econf
-		if ! has "$EAPI" 0 1 2 3 && \
-			"${ECONF_SOURCE}/configure" --help 2>/dev/null | \
-			grep -q disable-dependency-tracking ; then
-			set -- --disable-dependency-tracking "$@"
-		fi
+		case "${EAPI}" in
+			0|1|2|3)
+				;;
+			*)
+				local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
+				case "${conf_help}" in
+					*--disable-dependency-tracking*)
+						set -- --disable-dependency-tracking "$@"
+						;;
+				esac
+				case "${EAPI}" in
+					4|4-python|4-slot-abi)
+						;;
+					*)
+						case "${conf_help}" in
+							*--disable-silent-rules*)
+								set -- --disable-silent-rules "$@"
+								;;
+						esac
+						;;
+				esac
+				;;
+		esac
 
 		# if the profile defines a location to install libs to aside from default, pass it on.
 		# if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-30 16:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-30 16:33 UTC (permalink / raw
  To: gentoo-commits

commit:     00144cc82328074c6d190e6848a8b74c13823793
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 30 16:33:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 30 16:33:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=00144cc8

dyn_prepare: init state for apply_user_patches

---
 bin/phase-functions.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ff7d855..85d44a1 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -372,6 +372,7 @@ dyn_prepare() {
 	else
 		die "The source directory '${S}' doesn't exist"
 	fi
+	rm -f "${PORTAGE_BUILDDIR}/.apply_user_patches" || die
 
 	trap abort_prepare SIGINT SIGQUIT
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-31  1:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-31  1:49 UTC (permalink / raw
  To: gentoo-commits

commit:     bcf4ab871ededc3d535165757ba5597669e33dcb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 31 01:49:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 31 01:49:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcf4ab87

EAPI 5: --host-root option for best/has_version

See bug #401239 and the PMS patch:
http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=25fb5fca6674215ea8aaa3d0ec3dd3df451eec07

---
 bin/phase-helpers.sh |   68 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 56 insertions(+), 12 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index db1548e..6899488 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -632,28 +632,50 @@ _eapi5_apply_user_patches() {
 }
 
 # @FUNCTION: has_version
-# @USAGE: <DEPEND ATOM>
+# @USAGE: [--host-root] <DEPEND ATOM>
 # @DESCRIPTION:
 # Return true if given package is installed. Otherwise return false.
 # Callers may override the ROOT variable in order to match packages from an
 # alternative ROOT.
 has_version() {
 
-	local eroot
+	local atom eroot host_root=false root=${ROOT}
+	while [ $# -gt 0 ] ; do
+		case "$1" in
+			--host-root)
+				host_root=true
+				;;
+			*)
+				[[ -n ${atom} ]] && die "${FUNCNAME[0]}: unused argument: $1"
+				atom=$1
+				;;
+		esac
+		shift
+	done
+
+	if ${host_root} ; then
+		case "${EAPI}" in
+			0|1|2|3|4|4-python|4-slot-abi)
+				die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
+				;;
+		esac
+		root=/
+	fi
+
 	case "$EAPI" in
 		0|1|2)
 			[[ " ${FEATURES} " == *" force-prefix "* ]] && \
-				eroot=${ROOT%/}${EPREFIX}/ || eroot=${ROOT}
+				eroot=${root%/}${EPREFIX}/ || eroot=${root}
 			;;
 		*)
-			eroot=${ROOT%/}${EPREFIX}/
+			eroot=${root%/}${EPREFIX}/
 			;;
 	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1"
+		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "${atom}"
 	else
 		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "$1"
+		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "${atom}"
 	fi
 	local retval=$?
 	case "${retval}" in
@@ -667,28 +689,50 @@ has_version() {
 }
 
 # @FUNCTION: best_version
-# @USAGE: <DEPEND ATOM>
+# @USAGE: [--host-root] <DEPEND ATOM>
 # @DESCRIPTION:
 # Returns the best/most-current match.
 # Callers may override the ROOT variable in order to match packages from an
 # alternative ROOT.
 best_version() {
 
-	local eroot
+	local atom eroot host_root=false root=${ROOT}
+	while [ $# -gt 0 ] ; do
+		case "$1" in
+			--host-root)
+				host_root=true
+				;;
+			*)
+				[[ -n ${atom} ]] && die "${FUNCNAME[0]}: unused argument: $1"
+				atom=$1
+				;;
+		esac
+		shift
+	done
+
+	if ${host_root} ; then
+		case "${EAPI}" in
+			0|1|2|3|4|4-python|4-slot-abi)
+				die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
+				;;
+		esac
+		root=/
+	fi
+
 	case "$EAPI" in
 		0|1|2)
 			[[ " ${FEATURES} " == *" force-prefix "* ]] && \
-				eroot=${ROOT%/}${EPREFIX}/ || eroot=${ROOT}
+				eroot=${root%/}${EPREFIX}/ || eroot=${root}
 			;;
 		*)
-			eroot=${ROOT%/}${EPREFIX}/
+			eroot=${root%/}${EPREFIX}/
 			;;
 	esac
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1"
+		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "${atom}"
 	else
 		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "$1"
+		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "${atom}"
 	fi
 	local retval=$?
 	case "${retval}" in


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-31 14:47 Ulrich Mueller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Mueller @ 2012-08-31 14:47 UTC (permalink / raw
  To: gentoo-commits

commit:     b9e2daded3663c59bf11b04e952bdfb4eb5deabf
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 31 14:24:09 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Aug 31 14:46:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b9e2dade

EAPI 5: usex helper function

See bug #382963.

---
 bin/ebuild.sh          |    2 +-
 bin/phase-helpers.sh   |   14 ++++++++++++++
 bin/save-ebuild-env.sh |    5 +++++
 3 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d3ca9d9..51e90d7 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -33,7 +33,7 @@ else
 	done
 	# These dummy functions return false in older EAPIs, in order to ensure that
 	# `use multislot` is false for the "depend" phase.
-	for x in use useq usev ; do
+	for x in use useq usev usex ; do
 		eval "${x}() {
 			if has \"\${EAPI:-0}\" 4-python; then
 				die \"\${FUNCNAME}() calls are not allowed in global scope\"

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6899488..5f170fc 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -174,6 +174,20 @@ usev() {
 	return 1
 }
 
+case ${EAPI} in
+	0|1|2|3|4) ;;
+	*)
+		usex() {
+			if use "$1"; then
+				echo "${2-yes}$4"
+			else
+				echo "${3-no}$5"
+			fi
+			return 0
+		}
+		;;
+esac
+
 use() {
 	local u=$1
 	local found=0

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 4bf6e4e..a6d1c61 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -73,6 +73,11 @@ save_ebuild_env() {
 		_hasg _hasgq _unpack_tar \
 		${QA_INTERCEPTORS}
 
+	case ${EAPI} in
+		0|1|2|3|4) ;;
+		*) unset -f usex ;;
+	esac
+
 	# portage config variables and variables set directly by portage
 	unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
 		DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-31 14:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-31 14:52 UTC (permalink / raw
  To: gentoo-commits

commit:     4d7e4d6c89477f1feb2672a6a32b104287c1383d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 31 14:51:49 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 31 14:51:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d7e4d6c

Fix usex for EAPI 4-python|4-slot-abi.

---
 bin/phase-helpers.sh   |    2 +-
 bin/save-ebuild-env.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5f170fc..f23abdf 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -175,7 +175,7 @@ usev() {
 }
 
 case ${EAPI} in
-	0|1|2|3|4) ;;
+	0|1|2|3|4|4-python|4-slot-abi) ;;
 	*)
 		usex() {
 			if use "$1"; then

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index a6d1c61..845a97f 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -74,7 +74,7 @@ save_ebuild_env() {
 		${QA_INTERCEPTORS}
 
 	case ${EAPI} in
-		0|1|2|3|4) ;;
+		0|1|2|3|4|4-python|4-slot-abi) ;;
 		*) unset -f usex ;;
 	esac
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-31 14:55 Ulrich Mueller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Mueller @ 2012-08-31 14:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c88ae8c651dd8fc032c248af006ce3f76b4466ce
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 31 14:55:16 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Aug 31 14:55:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c88ae8c6

Update years in header.

---
 bin/save-ebuild-env.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 845a97f..75e4843 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @FUNCTION: save_ebuild_env


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-08-31 16:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-08-31 16:37 UTC (permalink / raw
  To: gentoo-commits

commit:     821fe40222e75ba08e5456577321fa5d1f12e69a
Author:     Gregory M. Turner <gmturner007 <AT> ameritech <DOT> net>
AuthorDate: Fri Aug 31 16:34:02 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 31 16:34:02 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=821fe402

portageq: clarify meaning of uses_root

o s/uses_root/uses_eroot/g -- This name was chosen
  before its meaning was changed; update it to reflect its purporse.

o Fix a left-over "<root>" arg-doc that never got updated to "<eroot>"

o If a provided eroot argument was shorter than the ${EPREFIX}, portageq
  was truncating it down to nothing and activating relative root,
  which means this became equivalent to an explicit argument of
  "${PWD}/${EPREFIX}/".  This is obviously wrong; and a simple case
  of failing to sanity-check inputs from an interface that changed in a
  backward-incompatible way.

  There's no provision in portageq to query EROOT's that don't end in
  ${EPREFIX}; so if the user makes such a request, instead of doing
  something pathological, dump a helpful error message and bail with
  a nonzero exit code.

Signed-off-by: Gregory M. Turner <gmturner007 <AT> ameritech.net>

---
 bin/portageq |   49 +++++++++++++++++++++++++++++--------------------
 1 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index d9abb0b..eeea277 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -125,7 +125,7 @@ def has_version(argv):
 		portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
 			noiselevel=-1)
 		return 2
-has_version.uses_root = True
+has_version.uses_eroot = True
 
 
 def best_version(argv):
@@ -166,7 +166,7 @@ def best_version(argv):
 		print(portage.best(mylist))
 	except KeyError:
 		return 1
-best_version.uses_root = True
+best_version.uses_eroot = True
 
 
 def mass_best_version(argv):
@@ -182,7 +182,7 @@ def mass_best_version(argv):
 			print(pack+":"+portage.best(mylist))
 	except KeyError:
 		return 1
-mass_best_version.uses_root = True
+mass_best_version.uses_eroot = True
 
 def metadata(argv):
 	if (len(argv) < 4):
@@ -216,7 +216,7 @@ Available keys: %s
 """  % ','.join(sorted(x for x in portage.auxdbkeys \
 if not x.startswith('UNUSED_')))
 
-metadata.uses_root = True
+metadata.uses_eroot = True
 
 def contents(argv):
 	"""<eroot> <category/package>
@@ -238,7 +238,7 @@ def contents(argv):
 		treetype="vartree", vartree=vartree)
 	writemsg_stdout(''.join('%s\n' % x for x in sorted(db.getcontents())),
 		noiselevel=-1)
-contents.uses_root = True
+contents.uses_eroot = True
 
 def owners(argv):
 	"""<eroot> [<filename>]+
@@ -319,7 +319,7 @@ def owners(argv):
 		return 0
 	return 1
 
-owners.uses_root = True
+owners.uses_eroot = True
 
 def is_protected(argv):
 	"""<eroot> <filename>
@@ -366,7 +366,7 @@ def is_protected(argv):
 		return 0
 	return 1
 
-is_protected.uses_root = True
+is_protected.uses_eroot = True
 
 def filter_protected(argv):
 	"""<eroot>
@@ -426,7 +426,7 @@ def filter_protected(argv):
 
 	return 0
 
-filter_protected.uses_root = True
+filter_protected.uses_eroot = True
 
 def best_visible(argv):
 	"""<eroot> [pkgtype] <atom>
@@ -508,11 +508,11 @@ def best_visible(argv):
 	writemsg_stdout("\n", noiselevel=-1)
 
 	return 1
-best_visible.uses_root = True
+best_visible.uses_eroot = True
 
 
 def mass_best_visible(argv):
-	"""<root> [<type>] [<category/package>]+
+	"""<eroot> [<type>] [<category/package>]+
 	Returns category/package-version (without .ebuild).
 	The pkgtype argument defaults to "ebuild" if unspecified,
 	otherwise it must be one of ebuild, binary, or installed.
@@ -535,7 +535,7 @@ def mass_best_visible(argv):
 			best_visible([root, pkgtype, pack])
 	except KeyError:
 		return 1
-mass_best_visible.uses_root = True
+mass_best_visible.uses_eroot = True
 
 
 def all_best_visible(argv):
@@ -552,7 +552,7 @@ def all_best_visible(argv):
 		mybest=portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg))
 		if mybest:
 			print(mybest)
-all_best_visible.uses_root = True
+all_best_visible.uses_eroot = True
 
 
 def match(argv):
@@ -601,7 +601,7 @@ def match(argv):
 		results = vardb.match(atom)
 	for cpv in results:
 		print(cpv)
-match.uses_root = True
+match.uses_eroot = True
 
 def expand_virtual(argv):
 	"""<eroot> <atom>
@@ -637,7 +637,7 @@ def expand_virtual(argv):
 
 	return os.EX_OK
 
-expand_virtual.uses_root = True
+expand_virtual.uses_eroot = True
 
 def vdb_path(argv):
 	"""
@@ -733,7 +733,7 @@ def get_repos(argv):
 		return 2
 	print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories()))
 
-get_repos.uses_root = True
+get_repos.uses_eroot = True
 
 def get_repo_path(argv):
 	"""<eroot> <repo_id>+
@@ -748,7 +748,7 @@ def get_repo_path(argv):
 			path = ""
 		print(path)
 
-get_repo_path.uses_root = True
+get_repo_path.uses_eroot = True
 
 def list_preserved_libs(argv):
 	"""<eroot>
@@ -771,7 +771,7 @@ def list_preserved_libs(argv):
 		msg.append('\n')
 	writemsg_stdout(''.join(msg), noiselevel=-1)
 	return rValue
-list_preserved_libs.uses_root = True
+list_preserved_libs.uses_eroot = True
 
 #-----------------------------------------------------------------------------
 #
@@ -860,8 +860,8 @@ def main():
 		usage(sys.argv)
 		sys.exit(os.EX_USAGE)
 	function = globals()[cmd]
-	uses_root = getattr(function, "uses_root", False) and len(sys.argv) > 2
-	if uses_root:
+	uses_eroot = getattr(function, "uses_eroot", False) and len(sys.argv) > 2
+	if uses_eroot:
 		if not os.path.isdir(sys.argv[2]):
 			sys.stderr.write("Not a directory: '%s'\n" % sys.argv[2])
 			sys.stderr.write("Run portageq with --help for info\n")
@@ -869,10 +869,19 @@ def main():
 			sys.exit(os.EX_USAGE)
 		eprefix = portage.const.EPREFIX
 		eroot = portage.util.normalize_path(sys.argv[2])
+
 		if eprefix:
+			if not eroot.endswith(eprefix):
+				sys.stderr.write("ERROR: This version of portageq"
+						 " only supports <eroot>s ending in"
+						 " '%s'. The provided <eroot>, '%s',"
+						 " doesn't.\n" % (eprefix, eroot));
+				sys.stderr.flush()
+				sys.exit(os.EX_USAGE)
 			root = eroot[:1-len(eprefix)]
 		else:
 			root = eroot
+
 		os.environ["ROOT"] = root
 
 	args = sys.argv[2:]
@@ -881,7 +890,7 @@ def main():
 			args[i] = portage._unicode_decode(args[i])
 
 	try:
-		if uses_root:
+		if uses_eroot:
 			args[0] = portage.settings['EROOT']
 		retval = function(args)
 		if retval:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-02  2:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-02  2:24 UTC (permalink / raw
  To: gentoo-commits

commit:     9b3549dbfccad30a09c4564587a42f1027b4c676
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  2 02:24:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  2 02:24:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9b3549db

apply_user_patches: die if EBUILD_PHASE is wrong

---
 bin/phase-helpers.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f23abdf..46f7132 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -639,6 +639,8 @@ apply_user_patches() {
 }
 
 _eapi5_apply_user_patches() {
+	[[ ${EBUILD_PHASE} == prepare ]] || \
+		die "apply_user_patches may only be called during src_prepare"
 	# This is a no-op that is just enough to fullfill the spec.
 	[[ -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && return 1
 	> "${PORTAGE_BUILDDIR}/.apply_user_patches" || die


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-02 21:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-02 21:56 UTC (permalink / raw
  To: gentoo-commits

commit:     50f098aee0282d5294b94c8c3c0074b3126724e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  2 21:56:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  2 21:56:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=50f098ae

Unconditionally insert our pym dir in sys.path.

This is especially necessary when running in prefix mode, since
sys.path may contain the path for a different version of portage.

---
 bin/archive-conf     |   13 ++++++-------
 bin/binhost-snapshot |   13 +++++--------
 bin/clean_locks      |   13 +++++--------
 bin/dispatch-conf    |   12 ++++--------
 bin/ebuild           |   11 ++++-------
 bin/egencache        |   11 ++++-------
 bin/emaint           |   11 ++++-------
 bin/emerge           |   11 ++++-------
 bin/env-update       |   13 ++++++-------
 bin/fixpackages      |   13 +++++--------
 bin/glsa-check       |   13 +++++--------
 bin/portageq         |    9 ++-------
 bin/quickpkg         |   11 ++++-------
 bin/regenworld       |   13 +++++--------
 bin/repoman          |   10 ++++------
 15 files changed, 67 insertions(+), 110 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index 7978668..af34db6 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -12,12 +12,11 @@
 from __future__ import print_function
 
 import sys
-try:
-    import portage
-except ImportError:
-    from os import path as osp
-    sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-    import portage
+
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 
 from portage import os
 from portage import dispatch_conf

diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index 9d2697d..fe2cf6b 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import io
@@ -13,13 +13,10 @@ try:
 except ImportError:
 	from urlparse import urlparse
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(
-		osp.realpath(__file__))), "pym"))
-	import portage
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 
 def parse_args(argv):
 	prog_name = os.path.basename(argv[0])

diff --git a/bin/clean_locks b/bin/clean_locks
index 8c4299c..09ee3e5 100755
--- a/bin/clean_locks
+++ b/bin/clean_locks
@@ -1,17 +1,14 @@
 #!/usr/bin/python -O
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
 import sys, errno
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 
 if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 35979db..e5f7680 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -16,14 +16,10 @@ from __future__ import print_function
 from stat import ST_GID, ST_MODE, ST_UID
 from random import random
 import atexit, re, shutil, stat, sys
-
-try:
-    import portage
-except ImportError:
-    from os import path as osp
-    sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-    import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 from portage import dispatch_conf
 from portage import _unicode_decode

diff --git a/bin/ebuild b/bin/ebuild
index 65e5bef..a21ef64 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -64,13 +64,10 @@ parser.add_option("--skip-manifest", help="skip all manifest checks",
 
 opts, pargs = parser.parse_args(args=sys.argv[1:])
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 portage.dep._internal_warnings = True
 from portage import os
 from portage import _encodings

diff --git a/bin/egencache b/bin/egencache
index d0c073c..a0766b1 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -28,13 +28,10 @@ import time
 import textwrap
 import re
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os, _encodings, _unicode_encode, _unicode_decode
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision

diff --git a/bin/emaint b/bin/emaint
index bee46c4..fd9f346 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -26,13 +26,10 @@ try:
 except KeyboardInterrupt:
 	sys.exit(1)
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage.emaint.main import emaint_main
 
 try:

diff --git a/bin/emerge b/bin/emerge
index a9a5643..f618068 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -35,13 +35,10 @@ else:
 
 signal.signal(debug_signum, debug_signal)
 
-try:
-	from _emerge.main import emerge_main
-except ImportError:
-	from os import path as osp
-	import sys
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	from _emerge.main import emerge_main
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+from _emerge.main import emerge_main
 
 if __name__ == "__main__":
 	import sys

diff --git a/bin/env-update b/bin/env-update
index 8a69f2b..cee3fd6 100755
--- a/bin/env-update
+++ b/bin/env-update
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -25,12 +25,11 @@ if len(sys.argv) > 1:
 	print("!!! Invalid command line options!\n")
 	usage(1)
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
+
 try:
 	portage.env_update(makelinks)
 except IOError as e:

diff --git a/bin/fixpackages b/bin/fixpackages
index dc43ed2..da08520 100755
--- a/bin/fixpackages
+++ b/bin/fixpackages
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -7,13 +7,10 @@ from __future__ import print_function
 import os
 import sys
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 from portage.output import EOutput
 from textwrap import wrap

diff --git a/bin/glsa-check b/bin/glsa-check
index a840c32..eddc905 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -1,18 +1,15 @@
 #!/usr/bin/python
-# Copyright 2008-2011 Gentoo Foundation
+# Copyright 2008-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
 import sys
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 from portage.output import *
 

diff --git a/bin/portageq b/bin/portageq
index eeea277..849a866 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -34,13 +34,8 @@ if os.environ.get("SANDBOX_ON") == "1":
 			":".join(filter(None, sandbox_write))
 	del sandbox_write
 
-try:
-	import portage
-except ImportError:
-	sys.path.insert(0, pym_path)
-	import portage
-del pym_path
-
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 from portage.eapi import eapi_has_repo_deps
 from portage.util import writemsg, writemsg_stdout

diff --git a/bin/quickpkg b/bin/quickpkg
index 76259c5..a6439e2 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -11,13 +11,10 @@ import signal
 import sys
 import tarfile
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 from portage import xpak
 from portage.dbapi.dep_expand import dep_expand

diff --git a/bin/regenworld b/bin/regenworld
index 3199fdf..a283344 100755
--- a/bin/regenworld
+++ b/bin/regenworld
@@ -1,17 +1,14 @@
 #!/usr/bin/python
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
 import sys
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
-
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 from portage import os
 from portage._sets.files import StaticFileSet, WorldSelectedSet
 

diff --git a/bin/repoman b/bin/repoman
index dd065c8..d7c69b3 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -33,12 +33,10 @@ except ImportError:
 from itertools import chain
 from stat import S_ISDIR
 
-try:
-	import portage
-except ImportError:
-	from os import path as osp
-	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
-	import portage
+from os import path as osp
+pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
+sys.path.insert(0, pym_path)
+import portage
 portage._disable_legacy_globals()
 portage.dep._internal_warnings = True
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-04  1:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-04  1:34 UTC (permalink / raw
  To: gentoo-commits

commit:     24a91dd6fb9bd9acdc5a72d2e830128c0f06bf98
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  4 01:33:26 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  4 01:33:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=24a91dd6

etc-update: add --quiet for bug #416917

---
 bin/etc-update |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index d763c1f..347ba1a 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -62,7 +62,7 @@ do_mv_ln() {
 }
 
 scan() {
-	echo "Scanning Configuration files..."
+	${QUIET} || echo "Scanning Configuration files..."
 	rm -rf "${TMP}"/files > /dev/null 2>&1
 	mkdir "${TMP}"/files || die "Failed mkdir command!"
 	count=0
@@ -107,13 +107,13 @@ scan() {
 			for mpath in ${CONFIG_PROTECT_MASK}; do
 				mpath="${EROOT%/}${mpath}"
 				if [[ "${rpath}" == "${mpath}"* ]] ; then
-					echo "Updating masked file: ${live_file}"
+					${QUIET} || echo "Updating masked file: ${live_file}"
 					mv "${cfg_file}" "${live_file}"
 					continue 2
 				fi
 			done
 			if [[ ! -f ${file} ]] ; then
-				echo "Skipping non-file ${file} ..."
+				${QUIET} || echo "Skipping non-file ${file} ..."
 				continue
 			fi
 
@@ -140,7 +140,7 @@ scan() {
 				fi
 
 				if [[ ${MATCHES} == 1 ]] ; then
-					echo "Automerging trivial changes in: ${live_file}"
+					${QUIET} || echo "Automerging trivial changes in: ${live_file}"
 					do_mv_ln "${cfg_file}" "${live_file}"
 					continue
 				else
@@ -548,9 +548,9 @@ die() {
 	local msg=$1 exitcode=${2:-1}
 
 	if [ ${exitcode} -eq 0 ] ; then
-		printf 'Exiting: %b\n' "${msg}"
+		${QUIET} || printf 'Exiting: %b\n' "${msg}"
 		scan > /dev/null
-		[ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
+		! ${QUIET} && [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
 	else
 		error "${msg}"
 	fi
@@ -575,6 +575,7 @@ usage() {
 	  -d, --debug    Enable shell debugging
 	  -h, --help     Show help and run away
 	  -p, --preen    Automerge trivial changes only and quit
+	  -q, --quiet    Show only essential output
 	  -v, --verbose  Show settings and such along the way
 	  -V, --version  Show version and trundle away
 
@@ -600,6 +601,7 @@ declare title="Gentoo's etc-update tool!"
 
 PREEN=false
 SET_X=false
+QUIET=false
 VERBOSE=false
 NONINTERACTIVE_MV=false
 while [[ -n $1 ]] ; do
@@ -607,6 +609,7 @@ while [[ -n $1 ]] ; do
 		-d|--debug)   SET_X=true;;
 		-h|--help)    usage;;
 		-p|--preen)   PREEN=true;;
+		-q|--quiet)   QUIET=true;;
 		-v|--verbose) VERBOSE=true;;
 		-V|--version) emerge --version; exit 0;;
 		--automode)   parse_automode_flag $2 && shift || usage 1 "Invalid mode '$2'";;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-08  5:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-08  5:35 UTC (permalink / raw
  To: gentoo-commits

commit:     7da74976e44534bcb286bd9bcb7a7847ba4d6a14
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  8 05:35:03 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep  8 05:35:03 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7da74976

egencache: skip metadata-transfer if possible

If there is an existing metadata/md5-cache directory, then it's not
necessary to forcibly enable metadata-transfer.

---
 bin/egencache |   42 +++++++++++++++++++++++++++++-------------
 1 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index a0766b1..18ab45d 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -35,6 +35,7 @@ import portage
 from portage import os, _encodings, _unicode_encode, _unicode_decode
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision
+from portage.cache.flat_hash import md5_database
 from portage.manifest import guessManifestFileType
 from portage.util import cmp_sort_key, writemsg_level
 from portage import cpv_getkey
@@ -867,13 +868,40 @@ def egencache_main(args):
 		parser.error('No action specified')
 		return 1
 
+	repo_path = None
+	if options.repo is not None:
+		repo_path = settings.repositories.treemap.get(options.repo)
+		if repo_path is None:
+			parser.error("Unable to locate repository named '%s'" % \
+				(options.repo,))
+			return 1
+	else:
+		repo_path = settings.repositories.mainRepoLocation()
+		if not repo_path:
+			parser.error("PORTDIR is undefined")
+			return 1
+
 	if options.update and 'metadata-transfer' not in settings.features:
-		settings.features.add('metadata-transfer')
+		metadata_transfer = True
+		repo_config = settings.repositories.get_repo_for_location(repo_path)
+		cache = repo_config.get_pregenerated_cache(
+			portage.dbapi.dbapi._known_keys, readonly=True)
+		if cache is not None:
+			if isinstance(cache, md5_database) and \
+				os.path.isdir(cache.location):
+				metadata_transfer = False
+			cache = None
+
+		if metadata_transfer:
+			settings.features.add('metadata-transfer')
 
 	settings.lock()
 
 	portdb = portage.portdbapi(mysettings=settings)
 
+	# Limit ebuilds to the specified repo.
+	portdb.porttrees = [repo_path]
+
 	if options.update:
 		if options.cache_dir is not None:
 			# already validated earlier
@@ -889,18 +917,6 @@ def egencache_main(args):
 					level=logging.ERROR, noiselevel=-1)
 				return 1
 
-	if options.repo is not None:
-		repo_path = portdb.getRepositoryPath(options.repo)
-		if repo_path is None:
-			parser.error("Unable to locate repository named '%s'" % \
-				(options.repo,))
-			return 1
-
-		# Limit ebuilds to the specified repo.
-		portdb.porttrees = [repo_path]
-	else:
-		portdb.porttrees = [portdb.porttree_root]
-
 	ret = [os.EX_OK]
 
 	if options.update:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-08 16:15 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-08 16:15 UTC (permalink / raw
  To: gentoo-commits

commit:     d23756ce3cb10fecbb8735fbbc784ef76e1621f3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  8 16:15:39 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep  8 16:15:39 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d23756ce

best/has_version: --host-root first arg only

---
 bin/phase-helpers.sh |   34 ++++++++++++----------------------
 1 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 0587991..18877f0 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -656,18 +656,13 @@ _eapi5_apply_user_patches() {
 has_version() {
 
 	local atom eroot host_root=false root=${ROOT}
-	while [ $# -gt 0 ] ; do
-		case "$1" in
-			--host-root)
-				host_root=true
-				;;
-			*)
-				[[ -n ${atom} ]] && die "${FUNCNAME[0]}: unused argument: $1"
-				atom=$1
-				;;
-		esac
+	if [[ $1 == --host-root ]] ; then
+		host_root=true
 		shift
-	done
+	fi
+	atom=$1
+	shift
+	[ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
 
 	if ${host_root} ; then
 		case "${EAPI}" in
@@ -713,18 +708,13 @@ has_version() {
 best_version() {
 
 	local atom eroot host_root=false root=${ROOT}
-	while [ $# -gt 0 ] ; do
-		case "$1" in
-			--host-root)
-				host_root=true
-				;;
-			*)
-				[[ -n ${atom} ]] && die "${FUNCNAME[0]}: unused argument: $1"
-				atom=$1
-				;;
-		esac
+	if [[ $1 == --host-root ]] ; then
+		host_root=true
 		shift
-	done
+	fi
+	atom=$1
+	shift
+	[ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
 
 	if ${host_root} ; then
 		case "${EAPI}" in


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-08 16:50 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-08 16:50 UTC (permalink / raw
  To: gentoo-commits

commit:     85dc824f7b7c595482cadc084411a455c2f00d32
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  8 16:50:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep  8 16:50:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=85dc824f

egencache: skip metadata-transfer more often

---
 bin/egencache |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 18ab45d..1b4fa0c 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -35,7 +35,6 @@ import portage
 from portage import os, _encodings, _unicode_encode, _unicode_decode
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision
-from portage.cache.flat_hash import md5_database
 from portage.manifest import guessManifestFileType
 from portage.util import cmp_sort_key, writemsg_level
 from portage import cpv_getkey
@@ -887,8 +886,10 @@ def egencache_main(args):
 		cache = repo_config.get_pregenerated_cache(
 			portage.dbapi.dbapi._known_keys, readonly=True)
 		if cache is not None:
-			if isinstance(cache, md5_database) and \
-				os.path.isdir(cache.location):
+			if cache.complete_eclass_entries:
+				# If the portdbapi's pregenerated cache supports eclass
+				# validation, then there's no need to forcibly enable
+				# metadata-transfer.
 				metadata_transfer = False
 			cache = None
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-08 20:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-08 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     08b350a53b52adb18947ce2f1ffc56a8d59b02ba
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  8 20:31:50 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep  8 20:31:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=08b350a5

egencache: tweak metadata-transfer logic

Now is won't force metadata-transfer unless it's absolutely necessary.

---
 bin/egencache |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 1b4fa0c..f7b4471 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -881,20 +881,14 @@ def egencache_main(args):
 			return 1
 
 	if options.update and 'metadata-transfer' not in settings.features:
-		metadata_transfer = True
+		# Forcibly enable metadata-transfer if portdbapi has a pregenerated
+		# cache that does not support eclass validation.
 		repo_config = settings.repositories.get_repo_for_location(repo_path)
 		cache = repo_config.get_pregenerated_cache(
 			portage.dbapi.dbapi._known_keys, readonly=True)
-		if cache is not None:
-			if cache.complete_eclass_entries:
-				# If the portdbapi's pregenerated cache supports eclass
-				# validation, then there's no need to forcibly enable
-				# metadata-transfer.
-				metadata_transfer = False
-			cache = None
-
-		if metadata_transfer:
+		if cache is not None and not cache.complete_eclass_entries:
 			settings.features.add('metadata-transfer')
+		cache = None
 
 	settings.lock()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-10  0:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-10  0:53 UTC (permalink / raw
  To: gentoo-commits

commit:     45bc97f98b41fe4e2286dfb50d1c9f263b0da8a4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 00:53:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 00:53:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=45bc97f9

repoman: fix popen unicode handling, bug #310789

---
 bin/repoman |   88 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 61 insertions(+), 27 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index d7c69b3..1f4daed 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -9,6 +9,7 @@
 from __future__ import print_function
 
 import calendar
+import codecs
 import copy
 import errno
 import formatter
@@ -741,6 +742,36 @@ else:
 def caterror(mycat):
 	err(mycat+" is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
 
+class repoman_popen(portage.proxy.objectproxy.ObjectProxy):
+	"""
+	Implements an interface similar to os.popen(), but with customized
+	unicode handling (see bug #310789) and without the shell.
+	"""
+
+	__slots__ = ('_proc', '_stdout')
+
+	def __init__(self, cmd):
+		args = portage.util.shlex_split(cmd)
+		encoding = _encodings['fs']
+		if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
+			# Python 3.1 does not support bytes in Popen args.
+			args = [_unicode_encode(x,
+				encoding=encoding, errors='strict') for x in args]
+		proc = subprocess.Popen(args, stdout=subprocess.PIPE)
+		object.__setattr__(self, '_proc', proc)
+		object.__setattr__(self, '_stdout',
+			codecs.getreader(encoding)(proc.stdout, 'strict'))
+
+	def _get_target(self):
+		return object.__getattribute__(self, '_stdout')
+
+	__enter__ = _get_target
+
+	def __exit__(self, exc_type, exc_value, traceback):
+		proc = object.__getattribute__(self, '_proc')
+		proc.wait()
+		proc.stdout.close()
+
 class ProfileDesc(object):
 	__slots__ = ('abs_path', 'arch', 'status', 'sub_path', 'tree_path',)
 	def __init__(self, arch, status, sub_path, tree_path):
@@ -1150,7 +1181,7 @@ if vcs == "cvs":
 		myremoved = cvstree.findremoved(mycvstree, recursive=1, basedir="./")
 
 elif vcs == "svn":
-	with os.popen("svn status") as f:
+	with repoman_popen("svn status") as f:
 		svnstatus = f.readlines()
 	mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ]
 	mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ]
@@ -1158,23 +1189,23 @@ elif vcs == "svn":
 		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
 
 elif vcs == "git":
-	with os.popen("git diff-index --name-only "
+	with repoman_popen("git diff-index --name-only "
 		"--relative --diff-filter=M HEAD") as f:
 		mychanged = f.readlines()
 	mychanged = ["./" + elem[:-1] for elem in mychanged]
 
-	with os.popen("git diff-index --name-only "
+	with repoman_popen("git diff-index --name-only "
 		"--relative --diff-filter=A HEAD") as f:
 		mynew = f.readlines()
 	mynew = ["./" + elem[:-1] for elem in mynew]
 	if options.if_modified == "y":
-		with os.popen("git diff-index --name-only "
+		with repoman_popen("git diff-index --name-only "
 			"--relative --diff-filter=D HEAD") as f:
 			myremoved = f.readlines()
 		myremoved = ["./" + elem[:-1] for elem in myremoved]
 
 elif vcs == "bzr":
-	with os.popen("bzr status -S .") as f:
+	with repoman_popen("bzr status -S .") as f:
 		bzrstatus = f.readlines()
 	mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
 	mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "NK" or elem[0:1] == "R" ) ]
@@ -1182,13 +1213,13 @@ elif vcs == "bzr":
 		myremoved = [ "./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "K" or elem[0:1] == "R" ) ]
 
 elif vcs == "hg":
-	with os.popen("hg status --no-status --modified .") as f:
+	with repoman_popen("hg status --no-status --modified .") as f:
 		mychanged = f.readlines()
 	mychanged = ["./" + elem.rstrip() for elem in mychanged]
-	mynew = os.popen("hg status --no-status --added .").readlines()
+	mynew = repoman_popen("hg status --no-status --added .").readlines()
 	mynew = ["./" + elem.rstrip() for elem in mynew]
 	if options.if_modified == "y":
-		with os.popen("hg status --no-status --removed .") as f:
+		with repoman_popen("hg status --no-status --removed .") as f:
 			myremoved = f.readlines()
 		myremoved = ["./" + elem.rstrip() for elem in myremoved]
 
@@ -1426,10 +1457,10 @@ for x in effective_scanlist:
 
 	if vcs in ("git", "hg") and check_ebuild_notadded:
 		if vcs == "git":
-			myf = os.popen("git ls-files --others %s" % \
+			myf = repoman_popen("git ls-files --others %s" % \
 				(portage._shell_quote(checkdir_relative),))
 		if vcs == "hg":
-			myf = os.popen("hg status --no-status --unknown %s" % \
+			myf = repoman_popen("hg status --no-status --unknown %s" % \
 				(portage._shell_quote(checkdir_relative),))
 		for l in myf:
 			if l[:-1][-7:] == ".ebuild":
@@ -1443,9 +1474,11 @@ for x in effective_scanlist:
 			if vcs == "cvs":
 				myf=open(checkdir+"/CVS/Entries","r")
 			if vcs == "svn":
-				myf = os.popen("svn status --depth=files --verbose " + checkdir)
+				myf = repoman_popen("svn status --depth=files --verbose " +
+					portage._shell_quote(checkdir))
 			if vcs == "bzr":
-				myf = os.popen("bzr ls -v --kind=file " + checkdir)
+				myf = repoman_popen("bzr ls -v --kind=file " +
+					portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 			for l in myl:
@@ -1473,7 +1506,8 @@ for x in effective_scanlist:
 					if l[-7:] == ".ebuild":
 						eadded.append(os.path.basename(l[:-7]))
 			if vcs == "svn":
-				myf = os.popen("svn status " + checkdir)
+				myf = repoman_popen("svn status " +
+					portage._shell_quote(checkdir))
 				myl=myf.readlines()
 				myf.close()
 				for l in myl:
@@ -2318,7 +2352,7 @@ else:
 			err("Error retrieving CVS tree; exiting.")
 	if vcs == "svn":
 		try:
-			with os.popen("svn status --no-ignore") as f:
+			with repoman_popen("svn status --no-ignore") as f:
 				svnstatus = f.readlines()
 			myunadded = [ "./"+elem.rstrip().split()[1] for elem in svnstatus if elem.startswith("?") or elem.startswith("I") ]
 		except SystemExit as e:
@@ -2327,12 +2361,12 @@ else:
 			err("Error retrieving SVN info; exiting.")
 	if vcs == "git":
 		# get list of files not under version control or missing
-		myf = os.popen("git ls-files --others")
+		myf = repoman_popen("git ls-files --others")
 		myunadded = [ "./" + elem[:-1] for elem in myf ]
 		myf.close()
 	if vcs == "bzr":
 		try:
-			with os.popen("bzr status -S .") as f:
+			with repoman_popen("bzr status -S .") as f:
 				bzrstatus = f.readlines()
 			myunadded = [ "./"+elem.rstrip().split()[1].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("?") or elem[0:2] == " D" ]
 		except SystemExit as e:
@@ -2340,14 +2374,14 @@ else:
 		except:
 			err("Error retrieving bzr info; exiting.")
 	if vcs == "hg":
-		with os.popen("hg status --no-status --unknown .") as f:
+		with repoman_popen("hg status --no-status --unknown .") as f:
 			myunadded = f.readlines()
 		myunadded = ["./" + elem.rstrip() for elem in myunadded]
 		
 		# Mercurial doesn't handle manually deleted files as removed from
 		# the repository, so the user need to remove them before commit,
 		# using "hg remove [FILES]"
-		with os.popen("hg status --no-status --deleted .") as f:
+		with repoman_popen("hg status --no-status --deleted .") as f:
 			mydeleted = f.readlines()
 		mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
 
@@ -2393,36 +2427,36 @@ else:
 
 
 	if vcs == "svn":
-		with os.popen("svn status") as f:
+		with repoman_popen("svn status") as f:
 			svnstatus = f.readlines()
 		mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if (elem[:1] in "MR" or elem[1:2] in "M")]
 		mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A")]
 		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
 
 		# Subversion expands keywords specified in svn:keywords properties.
-		with os.popen("svn propget -R svn:keywords") as f:
+		with repoman_popen("svn propget -R svn:keywords") as f:
 			props = f.readlines()
 		expansion = dict(("./" + prop.split(" - ")[0], prop.split(" - ")[1].split()) \
 			for prop in props if " - " in prop)
 
 	elif vcs == "git":
-		with os.popen("git diff-index --name-only "
+		with repoman_popen("git diff-index --name-only "
 			"--relative --diff-filter=M HEAD") as f:
 			mychanged = f.readlines()
 		mychanged = ["./" + elem[:-1] for elem in mychanged]
 
-		with os.popen("git diff-index --name-only "
+		with repoman_popen("git diff-index --name-only "
 			"--relative --diff-filter=A HEAD") as f:
 			mynew = f.readlines()
 		mynew = ["./" + elem[:-1] for elem in mynew]
 
-		with os.popen("git diff-index --name-only "
+		with repoman_popen("git diff-index --name-only "
 			"--relative --diff-filter=D HEAD") as f:
 			myremoved = f.readlines()
 		myremoved = ["./" + elem[:-1] for elem in myremoved]
 
 	if vcs == "bzr":
-		with os.popen("bzr status -S .") as f:
+		with repoman_popen("bzr status -S .") as f:
 			bzrstatus = f.readlines()
 		mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
 		mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] in "NK" or elem[0:1] == "R" ) ]
@@ -2431,15 +2465,15 @@ else:
 		# Bazaar expands nothing.
 
 	if vcs == "hg":
-		with os.popen("hg status --no-status --modified .") as f:
+		with repoman_popen("hg status --no-status --modified .") as f:
 			mychanged = f.readlines()
 		mychanged = ["./" + elem.rstrip() for elem in mychanged]
 
-		with os.popen("hg status --no-status --added .") as f:
+		with repoman_popen("hg status --no-status --added .") as f:
 			mynew = f.readlines()
 		mynew = ["./" + elem.rstrip() for elem in mynew]
 
-		with os.popen("hg status --no-status --removed .") as f:
+		with repoman_popen("hg status --no-status --removed .") as f:
 			myremoved = f.readlines()
 		myremoved = ["./" + elem.rstrip() for elem in myremoved]
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-10  1:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-10  1:26 UTC (permalink / raw
  To: gentoo-commits

commit:     bfe6ea5116870f278b701601f4f6ffc677bff293
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 01:26:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 01:26:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bfe6ea51

repoman: fix getstatusoutput unicode, bug #310789

---
 bin/repoman |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 1f4daed..c11ec09 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -57,7 +57,6 @@ except (ImportError, SystemError, RuntimeError, Exception):
 	sys.exit(1)
 
 from portage import os
-from portage import subprocess_getstatusoutput
 from portage import _encodings
 from portage import _unicode_encode
 from repoman.checks import run_checks
@@ -742,6 +741,26 @@ else:
 def caterror(mycat):
 	err(mycat+" is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
 
+def repoman_getstatusoutput(cmd):
+	"""
+	Implements an interface similar to getstatusoutput(), but with
+	customized unicode handling (see bug #310789) and without the shell.
+	"""
+	args = portage.util.shlex_split(cmd)
+	encoding = _encodings['fs']
+	if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
+		# Python 3.1 does not support bytes in Popen args.
+		args = [_unicode_encode(x,
+			encoding=encoding, errors='strict') for x in args]
+	proc = subprocess.Popen(args, stdout=subprocess.PIPE,
+		stderr=subprocess.STDOUT)
+	output = portage._unicode_decode(proc.communicate()[0],
+		encoding=encoding, errors='strict')
+	if output and output[-1] == "\n":
+		# getstatusoutput strips one newline
+		output = output[:-1]
+	return (proc.wait(), output)
+
 class repoman_popen(portage.proxy.objectproxy.ObjectProxy):
 	"""
 	Implements an interface similar to os.popen(), but with customized
@@ -998,7 +1017,7 @@ def vcs_files_to_cps(vcs_file_iter):
 
 def git_supports_gpg_sign():
 	status, cmd_output = \
-		subprocess_getstatusoutput("git --version")
+		repoman_getstatusoutput("git --version")
 	cmd_output = cmd_output.split()
 	if cmd_output:
 		version = re.match(r'^(\d+)\.(\d+)\.(\d+)', cmd_output[-1])
@@ -1676,9 +1695,10 @@ for x in effective_scanlist:
 		if xmllint_capable and not metadata_bad:
 			# xmlint can produce garbage output even on success, so only dump
 			# the ouput when it fails.
-			st, out = subprocess_getstatusoutput(
-				"xmllint --nonet --noout --dtdvalid '%s' '%s'" % \
-				 (metadata_dtd, os.path.join(checkdir, "metadata.xml")))
+			st, out = repoman_getstatusoutput(
+				"xmllint --nonet --noout --dtdvalid %s %s" % \
+				 (portage._shell_quote(metadata_dtd),
+				 portage._shell_quote(os.path.join(checkdir, "metadata.xml"))))
 			if st != os.EX_OK:
 				print(red("!!!") + " metadata.xml is invalid:")
 				for z in out.splitlines():
@@ -2674,7 +2694,8 @@ else:
 
 				headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
 
-			myout = subprocess_getstatusoutput("egrep -q "+headerstring+" "+myfile)
+			myout = repoman_getstatusoutput("egrep -q " + headerstring + " " +
+				portage._shell_quote(myfile))
 			if myout[0] == 0:
 				myheaders.append(myfile)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-10 19:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-10 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     04f8e1e2b542c5a524ac8ab5e95f427bfe5a2de7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 19:46:50 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 19:46:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04f8e1e2

use(): use set -f and handle IFS

---
 bin/phase-helpers.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 18877f0..bb5e057 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -215,11 +215,15 @@ use() {
 				"in IUSE for ${CATEGORY}/${PF}"
 	fi
 
+	local IFS=$' \t\n' prev_shopts=$- ret
+	set -f
 	if has ${u} ${USE} ; then
-		return ${found}
+		ret=${found}
 	else
-		return $((!found))
+		ret=$((!found))
 	fi
+	[[ ${prev_shopts} == *f* ]] || set +f
+	return ${ret}
 }
 
 use_with() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-10 20:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-10 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     f01d7a8ca158ec60df76a3e8ae5b80ac3f62429e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 20:33:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 20:33:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f01d7a8c

repoman: ElementTree.parse: encode unicode path

This fixes another issue like bug #310789.

---
 bin/repoman |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c11ec09..54a7c5b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1665,7 +1665,8 @@ for x in effective_scanlist:
 		# read metadata.xml into memory
 		try:
 			_metadata_xml = xml.etree.ElementTree.parse(
-				os.path.join(checkdir, "metadata.xml"),
+				_unicode_encode(os.path.join(checkdir, "metadata.xml"),
+				encoding=_encodings['fs'], errors='strict'),
 				parser=xml.etree.ElementTree.XMLParser(
 					target=_MetadataTreeBuilder()))
 		except (ExpatError, SyntaxError, EnvironmentError) as e:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-10 20:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-10 20:45 UTC (permalink / raw
  To: gentoo-commits

commit:     11d08aca93d6a458cdf71473c22c205d66df57f6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 20:45:23 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 20:45:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11d08aca

repoman: fix os.system() unicode, bug #310789

---
 bin/repoman |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 54a7c5b..53d138c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2786,7 +2786,13 @@ else:
 		if options.pretend:
 			print("("+gpgcmd+")")
 		else:
-			rValue = os.system(gpgcmd)
+			# Encode unicode manually for bug #310789.
+			gpgcmd = portage.util.shlex_split(gpgcmd)
+			if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
+				# Python 3.1 does not support bytes in Popen args.
+				gpgcmd = [_unicode_encode(arg,
+					encoding=_encodings['fs'], errors='strict') for arg in gpgcmd]
+			rValue = subprocess.call(gpgcmd)
 			if rValue == os.EX_OK:
 				os.rename(filename+".asc", filename)
 			else:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-12  4:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-12  4:52 UTC (permalink / raw
  To: gentoo-commits

commit:     62f4f330fc5ed840eba9d32da353afe789e2805b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 12 04:52:33 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 12 04:52:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62f4f330

egencache: encode unicode file paths safely

This will fix cases similar to the one fixed in commit
f01d7a8ca158ec60df76a3e8ae5b80ac3f62429e for bug #310789.

---
 bin/egencache |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index f7b4471..0035674 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -541,7 +541,8 @@ class GenUseLocalDesc(object):
 		for cp in self._portdb.cp_all():
 			metadata_path = os.path.join(repo_path, cp, 'metadata.xml')
 			try:
-				metadata = ElementTree.parse(metadata_path,
+				metadata = ElementTree.parse(_unicode_encode(metadata_path,
+					encoding=_encodings['fs'], errors='strict'),
 					parser=ElementTree.XMLParser(
 					target=_MetadataTreeBuilder()))
 			except IOError:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-12  6:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-12  6:33 UTC (permalink / raw
  To: gentoo-commits

commit:     d52a8a54012d0cfb5b2cd4128b9cda58eeddef33
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 12 06:33:26 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 12 06:33:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d52a8a54

save-ebuild-env: don't filter apply_user_patches

Except for EAPI 5_pre1.

---
 bin/save-ebuild-env.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 6d6ed41..cdc7c42 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -46,7 +46,7 @@ save_ebuild_env() {
 	done
 	unset x
 
-	unset -f apply_user_patches assert assert_sigpipe_ok \
+	unset -f assert assert_sigpipe_ok \
 		dump_trace die diefunc \
 		quiet_mode vecho elog_base eqawarn elog \
 		esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
@@ -78,6 +78,10 @@ save_ebuild_env() {
 		*) unset -f usex ;;
 	esac
 
+	case "${EAPI}" in
+		5_pre1) unset -f apply_user_patches ;;
+	esac
+
 	# portage config variables and variables set directly by portage
 	unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
 		DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-14  7:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-14  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     25a5296f29bc7153fa29e2dfe8de9d08d40d9944
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Sep 14 04:40:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 06:55:44 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25a5296f

drop dead functions

Specifically, esyslog, {un,}set_unless_changed, and remove_path_entry.

---
 bin/bashrc-functions.sh   |   55 ---------------------------------------------
 bin/ebuild.sh             |   10 +------
 bin/isolated-functions.sh |   18 --------------
 bin/save-ebuild-env.sh    |    6 ++--
 4 files changed, 5 insertions(+), 84 deletions(-)

diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
index 4da5585..9fdf999 100644
--- a/bin/bashrc-functions.sh
+++ b/bin/bashrc-functions.sh
@@ -33,61 +33,6 @@ strip_duplicate_slashes() {
 	fi
 }
 
-# this is a function for removing any directory matching a passed in pattern from
-# PATH
-remove_path_entry() {
-	save_IFS
-	IFS=":"
-	stripped_path="${PATH}"
-	while [ -n "$1" ]; do
-		cur_path=""
-		for p in ${stripped_path}; do
-			if [ "${p/${1}}" == "${p}" ]; then
-				cur_path="${cur_path}:${p}"
-			fi
-		done
-		stripped_path="${cur_path#:*}"
-		shift
-	done
-	restore_IFS
-	PATH="${stripped_path}"
-}
-
-# Set given variables unless these variable have been already set (e.g. during emerge
-# invocation) to values different than values set in make.conf.
-set_unless_changed() {
-	if [[ $# -lt 1 ]]; then
-		die "${FUNCNAME}() requires at least 1 argument: VARIABLE=VALUE"
-	fi
-
-	local argument value variable
-	for argument in "$@"; do
-		if [[ ${argument} != *=* ]]; then
-			die "${FUNCNAME}(): Argument '${argument}' has incorrect syntax"
-		fi
-		variable="${argument%%=*}"
-		value="${argument#*=}"
-		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-			eval "${variable}=\"\${value}\""
-		fi
-	done
-}
-
-# Unset given variables unless these variable have been set (e.g. during emerge
-# invocation) to values different than values set in make.conf.
-unset_unless_changed() {
-	if [[ $# -lt 1 ]]; then
-		die "${FUNCNAME}() requires at least 1 argument: VARIABLE"
-	fi
-
-	local variable
-	for variable in "$@"; do
-		if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-			unset ${variable}
-		fi
-	done
-}
-
 KV_major() {
 	[[ -z $1 ]] && return 1
 

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 51e90d7..5178a37 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -23,8 +23,8 @@ else
 	for x in diropts docompress exeopts get_KV insopts \
 		keepdir KV_major KV_micro KV_minor KV_to_int \
 		libopts register_die_hook register_success_hook \
-		remove_path_entry set_unless_changed strip_duplicate_slashes \
-		unset_unless_changed use_with use_enable ; do
+		strip_duplicate_slashes \
+		use_with use_enable ; do
 		eval "${x}() {
 			if has \"\${EAPI:-0}\" 4-python; then
 				die \"\${FUNCNAME}() calls are not allowed in global scope\"
@@ -136,12 +136,6 @@ fi
 # the sandbox is disabled by default except when overridden in the relevant stages
 export SANDBOX_ON=0
 
-esyslog() {
-	# Custom version of esyslog() to take care of the "Red Star" bug.
-	# MUST follow functions.sh to override the "" parameter problem.
-	return 0
-}
-
 # Ensure that $PWD is sane whenever possible, to protect against
 # exploitation of insecure search path for python -c in ebuilds.
 # See bug #239560.

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 37e5f2d..154506e 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -294,24 +294,6 @@ elog() {
 	return 0
 }
 
-esyslog() {
-	local pri=
-	local tag=
-
-	if [ -x /usr/bin/logger ]
-	then
-		pri="$1"
-		tag="$2"
-
-		shift 2
-		[ -z "$*" ] && return 0
-
-		/usr/bin/logger -p "${pri}" -t "${tag}" -- "$*"
-	fi
-
-	return 0
-}
-
 einfo() {
 	elog_base INFO "$*"
 	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 37438a5..6b38e5d 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -49,7 +49,7 @@ save_ebuild_env() {
 	unset -f assert assert_sigpipe_ok \
 		dump_trace die \
 		quiet_mode vecho elog_base eqawarn elog \
-		esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
+		einfo einfon ewarn eerror ebegin _eend eend KV_major \
 		KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
 		has_phase_defined_up_to \
 		hasv hasq qa_source qa_call \
@@ -64,9 +64,9 @@ save_ebuild_env() {
 		dyn_compile dyn_test dyn_install \
 		dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
 		debug-print-section helpers_die inherit EXPORT_FUNCTIONS \
-		nonfatal register_success_hook remove_path_entry \
+		nonfatal register_success_hook \
 		save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
-		set_unless_changed unset_unless_changed source_all_bashrcs \
+		source_all_bashrcs \
 		ebuild_main ebuild_phase ebuild_phase_with_hooks \
 		_ebuild_arg_to_phase _ebuild_phase_funcs default \
 		_hasg _hasgq _unpack_tar \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-14  7:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-14  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     2bafee5c926a644e58099bb5dbb3eec7cd80518c
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Sep 14 04:56:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 06:55:44 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2bafee5c

Drop diefunc protection.

The last usage of it was added 67e88b82726a93eda^, 01/20/08; 4.5 years
later, the compatibility measure is no longer needed.

---
 bin/isolated-functions.sh |    6 ------
 bin/save-ebuild-env.sh    |    2 +-
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index d33c0b6..37e5f2d 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -245,12 +245,6 @@ die() {
 	exit 1
 }
 
-# We need to implement diefunc() since environment.bz2 files contain
-# calls to it (due to alias expansion).
-diefunc() {
-	die "${@}"
-}
-
 quiet_mode() {
 	[[ ${PORTAGE_QUIET} -eq 1 ]]
 }

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index d8883cb..37438a5 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -47,7 +47,7 @@ save_ebuild_env() {
 	unset x
 
 	unset -f assert assert_sigpipe_ok \
-		dump_trace die diefunc \
+		dump_trace die \
 		quiet_mode vecho elog_base eqawarn elog \
 		esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
 		KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-14  7:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-14  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     5a3fb946698ec789e724158ec5742cdc49ac7473
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Sep 14 06:29:44 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 07:14:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a3fb946

Convert funcs of ebuild.sh to __ prefixed namespace.

---
 bin/ebuild.sh             |   26 +++++++++++++-------------
 bin/isolated-functions.sh |    8 ++++----
 bin/misc-functions.sh     |    2 +-
 bin/phase-functions.sh    |    4 ++--
 bin/save-ebuild-env.sh    |    6 +++---
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2f68b2e..a6ff453 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -66,7 +66,7 @@ export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2}
 # with shell opts (shopts).  Ebuilds/eclasses changing shopts should reset them 
 # when they are done.
 
-qa_source() {
+__qa_source() {
 	local shopts=$(shopt) OLDIFS="$IFS"
 	local retval
 	source "$@"
@@ -79,7 +79,7 @@ qa_source() {
 	return $retval
 }
 
-qa_call() {
+__qa_call() {
 	local shopts=$(shopt) OLDIFS="$IFS"
 	local retval
 	"$@"
@@ -102,7 +102,7 @@ unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
 [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
 
 # sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex)
-_sb_append_var() {
+__sb_append_var() {
 	local _v=$1 ; shift
 	local var="SANDBOX_${_v}"
 	[[ -z $1 || -n $2 ]] && die "Usage: add$(echo ${_v} | \
@@ -111,11 +111,11 @@ _sb_append_var() {
 }
 # bash-4 version:
 # local var="SANDBOX_${1^^}"
-# addread() { _sb_append_var ${0#add} "$@" ; }
-addread()    { _sb_append_var READ    "$@" ; }
-addwrite()   { _sb_append_var WRITE   "$@" ; }
-adddeny()    { _sb_append_var DENY    "$@" ; }
-addpredict() { _sb_append_var PREDICT "$@" ; }
+# addread() { __sb_append_var ${0#add} "$@" ; }
+addread()    { __sb_append_var READ    "$@" ; }
+addwrite()   { __sb_append_var WRITE   "$@" ; }
+adddeny()    { __sb_append_var DENY    "$@" ; }
+addpredict() { __sb_append_var PREDICT "$@" ; }
 
 addwrite "${PORTAGE_TMPDIR}"
 addread "/:${PORTAGE_TMPDIR}"
@@ -274,7 +274,7 @@ inherit() {
 		#turn on glob expansion
 		set +f
 
-		qa_source "$location" || die "died sourcing $location in inherit()"
+		__qa_source "$location" || die "died sourcing $location in inherit()"
 		
 		#turn off glob expansion
 		set -f
@@ -342,7 +342,7 @@ EXPORT_FUNCTIONS() {
 
 PORTAGE_BASHRCS_SOURCED=0
 
-# @FUNCTION: source_all_bashrcs
+# @FUNCTION: __source_all_bashrcs
 # @DESCRIPTION:
 # Source a relevant bashrc files and perform other miscellaneous
 # environment initialization when appropriate.
@@ -353,7 +353,7 @@ PORTAGE_BASHRCS_SOURCED=0
 #  * A "default" function which is an alias for the default phase
 #    function for the current phase.
 #
-source_all_bashrcs() {
+__source_all_bashrcs() {
 	[[ $PORTAGE_BASHRCS_SOURCED = 1 ]] && return 0
 	PORTAGE_BASHRCS_SOURCED=1
 	local x
@@ -367,7 +367,7 @@ source_all_bashrcs() {
 		local path_array=($PROFILE_PATHS)
 		restore_IFS
 		for x in "${path_array[@]}" ; do
-			[ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc"
+			[ -f "$x/profile.bashrc" ] && __qa_source "$x/profile.bashrc"
 		done
 	fi
 
@@ -516,7 +516,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		has noauto $FEATURES ; then
 		# The bashrcs get an opportunity here to set aliases that will be expanded
 		# during sourcing of ebuilds and eclasses.
-		source_all_bashrcs
+		__source_all_bashrcs
 
 		# When EBUILD_PHASE != depend, INHERITED comes pre-initialized
 		# from cache. In order to make INHERITED content independent of

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 076e31f..fa84c7e 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -51,13 +51,13 @@ __dump_trace() {
 	declare -i strip=${1:-1}
 	local filespacing=$2 linespacing=$3
 
-	# The qa_call() function and anything before it are portage internals
+	# The __qa_call() function and anything before it are portage internals
 	# that the user will not be interested in. Therefore, the stack trace
-	# should only show calls that come after qa_call().
+	# should only show calls that come after __qa_call().
 	(( n = ${#FUNCNAME[@]} - 1 ))
 	(( p = ${#BASH_ARGV[@]} ))
 	while (( n > 0 )) ; do
-		[ "${FUNCNAME[${n}]}" == "qa_call" ] && break
+		[ "${FUNCNAME[${n}]}" == "__qa_call" ] && break
 		(( p -= ${BASH_ARGC[${n}]} ))
 		(( n-- ))
 	done
@@ -124,7 +124,7 @@ die() {
 	# setup spacing to make output easier to read
 	(( n = ${#FUNCNAME[@]} - 1 ))
 	while (( n > 0 )) ; do
-		[ "${FUNCNAME[${n}]}" == "qa_call" ] && break
+		[ "${FUNCNAME[${n}]}" == "__qa_call" ] && break
 		(( n-- ))
 	done
 	(( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 ))

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index fe38e23..486b8d2 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1254,7 +1254,7 @@ install_hooks() {
 }
 
 if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
-	source_all_bashrcs
+	__source_all_bashrcs
 	[ "$PORTAGE_DEBUG" == "1" ] && set -x
 	for x in ${MISC_FUNCTIONS_ARGS}; do
 		${x}

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 71f4787..7048419 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -198,7 +198,7 @@ __preprocess_ebuild_env() {
 }
 
 __ebuild_phase() {
-	declare -F "$1" >/dev/null && qa_call $1
+	declare -F "$1" >/dev/null && __qa_call $1
 }
 
 __ebuild_phase_with_hooks() {
@@ -865,7 +865,7 @@ __ebuild_main() {
 	[[ -n $phase_func ]] && __ebuild_phase_funcs "$EAPI" "$phase_func"
 	unset phase_func
 
-	source_all_bashrcs
+	__source_all_bashrcs
 
 	case ${1} in
 	nofetch)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 8db3ecb..c2082ab 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -52,8 +52,8 @@ __save_ebuild_env() {
 		einfo einfon ewarn eerror ebegin __eend eend KV_major \
 		KV_minor KV_micro KV_to_int get_KV __1 __1 has \
 		__has_phase_defined_up_to \
-		hasv hasq qa_source qa_call \
-		addread addwrite adddeny addpredict _sb_append_var \
+		hasv hasq __qa_source __qa_call \
+		addread addwrite adddeny addpredict __sb_append_var \
 		use usev useq has_version portageq \
 		best_version use_with use_enable register_die_hook \
 		keepdir unpack __strip_duplicate_slashes econf einstall \
@@ -67,7 +67,7 @@ __save_ebuild_env() {
 		debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
 		nonfatal register_success_hook \
 		__save_ebuild_env __filter_readonly_variables __preprocess_ebuild_env \
-		source_all_bashrcs \
+		__source_all_bashrcs \
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		_hasg _hasgq _unpack_tar \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-14  7:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-14  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     4c14931d6ae701bd83bbe526001d2b7ba664b58e
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Sep 14 06:08:00 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 07:14:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c14931d

Convert funcs of save-ebuild-env.sh to __ prefixed namespace.

---
 bin/phase-functions.sh |   20 ++++++++++----------
 bin/save-ebuild-env.sh |    6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 8585a71..71f4787 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -143,7 +143,7 @@ __filter_readonly_variables() {
 # @FUNCTION: __preprocess_ebuild_env
 # @DESCRIPTION:
 # Filter any readonly variables from ${T}/environment, source it, and then
-# save it via save_ebuild_env(). This process should be sufficient to prevent
+# save it via __save_ebuild_env(). This process should be sufficient to prevent
 # any stale variables or functions from an arbitrary environment from
 # interfering with the current environment. This is useful when an existing
 # environment needs to be loaded from a binary or installed package.
@@ -174,15 +174,15 @@ __preprocess_ebuild_env() {
 		# until we've merged them with our current values.
 		export SANDBOX_ON=0
 
-		# It's remotely possible that save_ebuild_env() has been overridden
+		# It's remotely possible that __save_ebuild_env() has been overridden
 		# by the above source command. To protect ourselves, we override it
 		# here with our own version. ${PORTAGE_BIN_PATH} is safe to use here
 		# because it's already filtered above.
 		source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || exit $?
 
-		# Rely on save_ebuild_env() to filter out any remaining variables
+		# Rely on __save_ebuild_env() to filter out any remaining variables
 		# and functions that could interfere with the current environment.
-		save_ebuild_env || exit $?
+		__save_ebuild_env || exit $?
 		>> "$T/environment.success" || exit $?
 	) > "${T}/environment.filtered"
 	local retval
@@ -586,9 +586,9 @@ __dyn_install() {
 	# local variables can leak into the saved environment.
 	unset f
 
-	save_ebuild_env --exclude-init-phases | __filter_readonly_variables \
+	__save_ebuild_env --exclude-init-phases | __filter_readonly_variables \
 		--filter-path --filter-sandbox --allow-extra-vars > environment
-	assert "save_ebuild_env failed"
+	assert "__save_ebuild_env failed"
 
 	${PORTAGE_BZIP2_COMMAND} -f9 environment
 
@@ -887,11 +887,11 @@ __ebuild_main() {
 		if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then
 			# Update environment.bz2 in case installation phases
 			# need to pass some variables to uninstallation phases.
-			save_ebuild_env --exclude-init-phases | \
+			__save_ebuild_env --exclude-init-phases | \
 				__filter_readonly_variables --filter-path \
 				--filter-sandbox --allow-extra-vars \
 				| ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV"
-			assert "save_ebuild_env failed"
+			assert "__save_ebuild_env failed"
 		fi
 		;;
 	unpack|prepare|configure|compile|test|clean|install)
@@ -987,9 +987,9 @@ __ebuild_main() {
 	# Save the env only for relevant phases.
 	if ! has "${1}" clean help info nofetch ; then
 		umask 002
-		save_ebuild_env | __filter_readonly_variables \
+		__save_ebuild_env | __filter_readonly_variables \
 			--filter-features > "$T/environment"
-		assert "save_ebuild_env failed"
+		assert "__save_ebuild_env failed"
 		chown portage:portage "$T/environment" &>/dev/null
 		chmod g+w "$T/environment" &>/dev/null
 	fi

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index f3a723b..8db3ecb 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -2,7 +2,7 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-# @FUNCTION: save_ebuild_env
+# @FUNCTION: __save_ebuild_env
 # @DESCRIPTION:
 # echo the current environment to stdout, filtering out redundant info.
 #
@@ -10,7 +10,7 @@
 # be excluded from the output. These function are not needed for installation
 # or removal of the packages, and can therefore be safely excluded.
 #
-save_ebuild_env() {
+__save_ebuild_env() {
 	(
 	if has --exclude-init-phases $* ; then
 		unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ \
@@ -66,7 +66,7 @@ save_ebuild_env() {
 		__dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
 		debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
 		nonfatal register_success_hook \
-		save_ebuild_env __filter_readonly_variables __preprocess_ebuild_env \
+		__save_ebuild_env __filter_readonly_variables __preprocess_ebuild_env \
 		source_all_bashrcs \
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-14 17:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-14 17:09 UTC (permalink / raw
  To: gentoo-commits

commit:     565adddf0ce3d492a605c9353865867e7cc226e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 14 17:09:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 17:09:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=565adddf

save-ebuild-env: fix for __dyn* renames

---
 bin/save-ebuild-env.sh |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index c2082ab..3b1a1da 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -61,15 +61,18 @@ __save_ebuild_env() {
 		into insinto exeinto docinto \
 		insopts diropts exeopts libopts docompress \
 		__abort_handler __abort_prepare __abort_configure __abort_compile \
-		__abort_test __abort_install __dyn_prepare dyn_configure \
-		__dyn_compile dyn_test dyn_install \
-		__dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
+		__abort_test __abort_install __dyn_prepare __dyn_configure \
+		__dyn_compile __dyn_test __dyn_install \
+		__dyn_preinst __dyn_pretend __dyn_help \
+		debug-print debug-print-function \
 		debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
 		nonfatal register_success_hook \
-		__save_ebuild_env __filter_readonly_variables __preprocess_ebuild_env \
+		__save_ebuild_env __set_colors __filter_readonly_variables \
+		__preprocess_ebuild_env \
 		__source_all_bashrcs \
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
+		__unset_colors \
 		_hasg _hasgq _unpack_tar \
 		${QA_INTERCEPTORS}
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-14 17:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-14 17:17 UTC (permalink / raw
  To: gentoo-commits

commit:     7fdef103bb0ece06310d322456bb138f935bfbd0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 14 17:17:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 14 17:17:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7fdef103

Use __ prefix for _hasg, _hasgq, and _unpack_tar.

---
 bin/phase-helpers.sh   |   20 ++++++++++----------
 bin/save-ebuild-env.sh |    4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6a249e1..ddc96ed 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -294,7 +294,7 @@ unpack() {
 		fi
 		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
 
-		_unpack_tar() {
+		__unpack_tar() {
 			if [ "${y}" == "tar" ]; then
 				$1 -c -- "$srcdir$x" | tar xof -
 				__assert_sigpipe_ok "$myfail"
@@ -324,10 +324,10 @@ unpack() {
 				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
 			gz|Z|z)
-				_unpack_tar "gzip -d"
+				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
-				_unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
+				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7Z|7z)
 				local my_output
@@ -374,13 +374,13 @@ unpack() {
 				fi
 				;;
 			lzma)
-				_unpack_tar "lzma -d"
+				__unpack_tar "lzma -d"
 				;;
 			xz)
 				if has $eapi 0 1 2 ; then
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				else
-					_unpack_tar "xz -d"
+					__unpack_tar "xz -d"
 				fi
 				;;
 			*)
@@ -400,14 +400,14 @@ econf() {
 	[[ " ${FEATURES} " == *" force-prefix "* ]] || \
 		case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
 
-	_hasg() {
+	__hasg() {
 		local x s=$1
 		shift
 		for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
 		return 1
 	}
 
-	_hasgq() { _hasg "$@" >/dev/null ; }
+	__hasgq() { __hasg "$@" >/dev/null ; }
 
 	local phase_func=$(__ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
 	if [[ -n $phase_func ]] ; then
@@ -469,9 +469,9 @@ econf() {
 		if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
 			CONF_LIBDIR=${!LIBDIR_VAR}
 		fi
-		if [[ -n ${CONF_LIBDIR} ]] && ! _hasgq --libdir=\* "$@" ; then
-			export CONF_PREFIX=$(_hasg --exec-prefix=\* "$@")
-			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(_hasg --prefix=\* "$@")
+		if [[ -n ${CONF_LIBDIR} ]] && ! __hasgq --libdir=\* "$@" ; then
+			export CONF_PREFIX=$(__hasg --exec-prefix=\* "$@")
+			[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(__hasg --prefix=\* "$@")
 			: ${CONF_PREFIX:=${EPREFIX}/usr}
 			CONF_PREFIX=${CONF_PREFIX#*=}
 			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 3b1a1da..de8e1fb 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -67,13 +67,13 @@ __save_ebuild_env() {
 		debug-print debug-print-function \
 		debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
 		nonfatal register_success_hook \
+		__hasg __hasgq \
 		__save_ebuild_env __set_colors __filter_readonly_variables \
 		__preprocess_ebuild_env \
 		__source_all_bashrcs \
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
-		__unset_colors \
-		_hasg _hasgq _unpack_tar \
+		__unpack_tar __unset_colors \
 		${QA_INTERCEPTORS}
 
 	case "${EAPI}" in


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-17  1:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-17  1:36 UTC (permalink / raw
  To: gentoo-commits

commit:     8bdba93c1a5d3b7500dec73a12fa9c40b43b9e2a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 17 01:36:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 17 01:36:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8bdba93c

__strip_duplicate_slashes: quote paths

---
 bin/bashrc-functions.sh |    2 +-
 bin/phase-helpers.sh    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
index 30a7a8e..f1b6bb5 100644
--- a/bin/bashrc-functions.sh
+++ b/bin/bashrc-functions.sh
@@ -29,7 +29,7 @@ __strip_duplicate_slashes() {
 		while [[ ${removed} == *//* ]] ; do
 			removed=${removed//\/\///}
 		done
-		echo ${removed}
+		echo "${removed}"
 	fi
 }
 

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ddc96ed..157725f 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -476,7 +476,7 @@ econf() {
 			CONF_PREFIX=${CONF_PREFIX#*=}
 			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
 			[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
-			set -- --libdir="$(__strip_duplicate_slashes ${CONF_PREFIX}${CONF_LIBDIR})" "$@"
+			set -- --libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")" "$@"
 		fi
 
 		set -- \
@@ -521,7 +521,7 @@ einstall() {
 	unset LIBDIR_VAR
 	if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
 		EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
-		EI_DESTLIBDIR="$(__strip_duplicate_slashes ${EI_DESTLIBDIR})"
+		EI_DESTLIBDIR="$(__strip_duplicate_slashes "${EI_DESTLIBDIR}")"
 		LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
 		unset EI_DESTLIBDIR
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-24  0:13 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-09-24  0:13 UTC (permalink / raw
  To: gentoo-commits

commit:     7fb9758506341ffc05585fbd18f2be58ef0e16c2
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 24 00:07:36 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Sep 24 00:13:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7fb97585

scan all lib subdirs

Rather than hardcoding lib/lib32/lib64, scan all dirs starting with "lib".

URL: https://bugs.gentoo.org/435834
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/misc-functions.sh |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 1159ca5..ac08bd9 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -577,10 +577,9 @@ install_qa_check() {
 	# this should help to ensure that all (most?) shared libraries are executable
 	# and that all libtool scripts / static libraries are not executable
 	local j
-	for i in "${ED}"opt/*/lib{,32,64} \
-	         "${ED}"lib{,32,64}       \
-	         "${ED}"usr/lib{,32,64}   \
-	         "${ED}"usr/X11R6/lib{,32,64} ; do
+	for i in "${ED}"opt/*/lib* \
+	         "${ED}"lib* \
+	         "${ED}"usr/lib* ; do
 		[[ ! -d ${i} ]] && continue
 
 		for j in "${i}"/*.so.* "${i}"/*.so ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-24  3:47 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2012-09-24  3:47 UTC (permalink / raw
  To: gentoo-commits

commit:     ca46b021359ffa13a808f99dd635a6958b369be5
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 24 00:16:54 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Sep 24 00:16:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca46b021

use `readlink -f` if it works

Rather than always re-implementing `readlink -f` in shell, probe the host
tool first to see if it works.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/misc-functions.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ac08bd9..c8b7cc8 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -43,7 +43,20 @@ install_symlink_html_docs() {
 }
 
 # replacement for "readlink -f" or "realpath"
+READLINK_F_WORKS=""
 canonicalize() {
+	if [[ -z ${READLINK_F_WORKS} ]] ; then
+		if [[ $(readlink -f -- /../ 2>/dev/null) == "/" ]] ; then
+			READLINK_F_WORKS=true
+		else
+			READLINK_F_WORKS=false
+		fi
+	fi
+	if ${READLINK_F_WORKS} ; then
+		readlink -f -- "$@"
+		return
+	fi
+
 	local f=$1 b n=10 wd=$(pwd)
 	while (( n-- > 0 )); do
 		while [[ ${f: -1} = / && ${#f} -gt 1 ]]; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-24 22:30 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-09-24 22:30 UTC (permalink / raw
  To: gentoo-commits

commit:     dc46bef30fefdcd9305bfb92f24c83758129279f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Sep 24 22:27:09 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Sep 24 22:27:09 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dc46bef3

portageq: Automatically do not include imported functions in the list of commands.

---
 bin/portageq |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 3e7577b..142f880 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -773,11 +773,9 @@ list_preserved_libs.uses_eroot = True
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use',
-	'exithandler', 'expand_new_virt', 'main',
-	'usage', 'writemsg', 'writemsg_stdout'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
 commands = sorted(k for k, v in globals().items() \
-	if k not in non_commands and isinstance(v, types.FunctionType))
+	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 
 def usage(argv):
 	print(">>> Portage information query tool")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-27 17:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-27 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     4c1145787195dcd1cc9a459d4cada72155d3ad81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 27 17:38:37 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 27 17:38:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c114578

ebuild.sh: EAPI conditional usex dummy

This probably makes no difference in practice, since it only affects
the "depend" phase. Note that we're allowed to use EAPI conditionals
here, since we parse the EAPI on the python side and pass it to bash.

---
 bin/ebuild.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index aa3dcdd..1b15bd0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -33,7 +33,11 @@ else
 	done
 	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 	# `use multislot` is false for the "depend" phase.
-	for x in use useq usev usex ; do
+		funcs="use useq usev"
+		if ___eapi_has_usex; then
+			funcs+=" usex"
+		fi
+		for x in ${funcs} ; do
 		eval "${x}() {
 			if ___eapi_disallows_helpers_in_global_scope; then
 				die \"\${FUNCNAME}() calls are not allowed in global scope\"
@@ -47,7 +51,7 @@ else
 	for x in best_version has_version portageq ; do
 		eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }"
 	done
-	unset x
+	unset funcs x
 fi
 
 # Don't use sandbox's BASH_ENV for new shells because it does


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-27 19:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-27 19:12 UTC (permalink / raw
  To: gentoo-commits

commit:     d5ec77f886ba5891de2d2dcc25700327596df588
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 27 19:12:03 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 27 19:12:03 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5ec77f8

Fix indent from last commit.

---
 bin/ebuild.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1b15bd0..b4deb9c 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -33,11 +33,11 @@ else
 	done
 	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 	# `use multislot` is false for the "depend" phase.
-		funcs="use useq usev"
-		if ___eapi_has_usex; then
-			funcs+=" usex"
-		fi
-		for x in ${funcs} ; do
+	funcs="use useq usev"
+	if ___eapi_has_usex; then
+		funcs+=" usex"
+	fi
+	for x in ${funcs} ; do
 		eval "${x}() {
 			if ___eapi_disallows_helpers_in_global_scope; then
 				die \"\${FUNCNAME}() calls are not allowed in global scope\"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-30  8:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-30  8:40 UTC (permalink / raw
  To: gentoo-commits

commit:     314791e319e3ac7ce75f3a6f9ae9cc5c2b837df6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 30 08:40:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 30 08:40:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=314791e3

phase-functions.sh: remove redundant chown/chmod

These calls trigger warnings in prefix mode, since commit
45bedf9cdc10fafd94858f67d62b36d35dd99544. They are redundant, since the
permissions are handled the _post_phase_userpriv_perms function.

---
 bin/phase-functions.sh |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 7a0baf4..7a1d6c5 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -971,8 +971,6 @@ __ebuild_main() {
 		__save_ebuild_env | __filter_readonly_variables \
 			--filter-features > "$T/environment"
 		assert "__save_ebuild_env failed"
-		chown portage:portage "$T/environment" &>/dev/null
-		chmod g+w "$T/environment" &>/dev/null
 	fi
 	[[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-30 17:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-30 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     6983b1a1dd21f931ba751b727bd1a3c460383840
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 30 17:23:01 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 30 17:23:01 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6983b1a1

phase-functions.sh: chgrp $T/environment

This partially reverts commit 314791e319e3ac7ce75f3a6f9ae9cc5c2b837df6,
in order to cover possible cases where it may not actually be
redundant, like if ebuild(1) is used to call pkg_setup as root, and
then a different user calls src_unpack. We use PORTAGE_GRPNAME if set,
in order to avoid triggering irrelevant warnings for unprivileged
prefix users (see chown and chgrp wrappers in commit
45bedf9cdc10fafd94858f67d62b36d35dd99544). This mirrors the approach
taken in commit 1c3c3b802014ac6356af09d149aaaffce6c14dc3 of the prefix
branch.

---
 bin/phase-functions.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 7a1d6c5..714f7a6 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -971,6 +971,8 @@ __ebuild_main() {
 		__save_ebuild_env | __filter_readonly_variables \
 			--filter-features > "$T/environment"
 		assert "__save_ebuild_env failed"
+		chgrp "${PORTAGE_GRPNAME:-portage}" "$T/environment"
+		chmod g+w "$T/environment"
 	fi
 	[[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-09-30 17:31 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-09-30 17:31 UTC (permalink / raw
  To: gentoo-commits

commit:     9c40728fefe0c5d7f23821cacd641106d45569ac
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 30 17:30:47 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 30 17:30:47 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c40728f

debug-print: chgrp ${PORTAGE_GRPNAME:-portage}

This fixes warnings for prefix users (see commits
1c3c3b802014ac6356af09d149aaaffce6c14dc3 and
6983b1a1dd21f931ba751b727bd1a3c460383840).

---
 bin/ebuild.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b4deb9c..a74a848 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -176,8 +176,8 @@ debug-print() {
 		# default target
 		printf '%s\n' "${@}" >> "${T}/eclass-debug.log"
 		# let the portage user own/write to this file
-		chgrp portage "${T}/eclass-debug.log" &>/dev/null
-		chmod g+w "${T}/eclass-debug.log" &>/dev/null
+		chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/eclass-debug.log"
+		chmod g+w "${T}/eclass-debug.log"
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-03 23:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-03 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     916df01c378dc4a04961effdc209dab791d3e53f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  3 23:53:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct  3 23:53:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=916df01c

repoman: avoid Manifest double signature

---
 bin/repoman |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 6caf791..18a3b30 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2765,6 +2765,16 @@ else:
 			else:
 				raise portage.exception.PortageException("!!! gpg exited with '" + str(rValue) + "' status")
 
+	def need_signature(filename):
+		try:
+			with open(_unicode_encode(filename,
+				encoding=_encodings['fs'], errors='strict'), 'rb') as f:
+				return b"BEGIN PGP SIGNED MESSAGE" not in f.readline()
+		except IOError as e:
+			if e.errno in (errno.ENOENT, errno.ESTALE):
+				return False
+			raise
+
 	# When files are removed and re-added, the cvs server will put /Attic/
 	# inside the $Header path. This code detects the problem and corrects it
 	# so that the Manifest will generate correctly. See bug #169500.
@@ -2807,7 +2817,7 @@ else:
 				chain(myupdates, myremoved, mymanifests))):
 				repoman_settings["O"] = os.path.join(repodir, x)
 				manifest_path = os.path.join(repoman_settings["O"], "Manifest")
-				if not os.path.exists(manifest_path):
+				if not need_signature(manifest_path):
 					continue
 				gpgsign(manifest_path)
 		except portage.exception.PortageException as e:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-04 22:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-04 22:18 UTC (permalink / raw
  To: gentoo-commits

commit:     8e5dcfaf9c57da3be20ae673f65c3b5b8d9827c2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  4 22:17:57 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct  4 22:17:57 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8e5dcfaf

ebuild.sh: comment on noauto behavior

---
 bin/ebuild.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a74a848..de54e22 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -520,10 +520,12 @@ if ___eapi_enables_globstar; then
 	shopt -s globstar
 fi
 
+# Source the ebuild every time for FEATURES=noauto, so that ebuild
+# modifications take effect immediately.
 if ! has "$EBUILD_PHASE" clean cleanrm ; then
 	if [[ $EBUILD_PHASE = depend || ! -f $T/environment || \
-		-f $PORTAGE_BUILDDIR/.ebuild_changed ]] || \
-		has noauto $FEATURES ; then
+		-f $PORTAGE_BUILDDIR/.ebuild_changed || \
+		" ${FEATURES} " == *" noauto "* ]] ; then
 		# The bashrcs get an opportunity here to set aliases that will be expanded
 		# during sourcing of ebuilds and eclasses.
 		__source_all_bashrcs


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-07 21:31 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-07 21:31 UTC (permalink / raw
  To: gentoo-commits

commit:     b91eefc82e995ba3463d212f95fa9228c5cf53ae
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  7 21:31:39 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  7 21:31:39 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b91eefc8

repoman: identical Manifest commit message

This will fix bug #437546.

---
 bin/repoman |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 18a3b30..ff3f8f7 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2859,14 +2859,7 @@ else:
 
 		fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
 		mymsg = os.fdopen(fd, "wb")
-		# strip the closing parenthesis
-		mymsg.write(_unicode_encode(commitmessage[:-1]))
-		if signed:
-			mymsg.write(_unicode_encode(
-				", signed Manifest commit with key %s)" % \
-				repoman_settings["PORTAGE_GPG_KEY"]))
-		else:
-			mymsg.write(b", unsigned Manifest commit)")
+		mymsg.write(_unicode_encode(commitmessage))
 		mymsg.close()
 
 		commit_cmd = []


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-08 16:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-08 16:26 UTC (permalink / raw
  To: gentoo-commits

commit:     ae5d657a2c7e5fcf23607e8b061f049e56f8137f
Author:     Tim Boudreau <niftiness <AT> gmail <DOT> com>
AuthorDate: Mon Oct  8 16:25:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct  8 16:25:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ae5d657a

dyn_spec: s/Copyright/License/, bug #437588

Fixes 'Unknown tag' error with rpm 4.10.0.

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 986264e..7db6676 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1175,7 +1175,7 @@ Summary: ${DESCRIPTION}
 Name: ${PN}
 Version: ${PV}
 Release: ${PR}
-Copyright: GPL
+License: GPL
 Group: portage/${CATEGORY}
 Source: ${PF}.tar.gz
 Buildroot: ${D}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-14 19:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-14 19:26 UTC (permalink / raw
  To: gentoo-commits

commit:     8651a9e838e4028e74e115f26e263639c1835173
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 14 19:25:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 14 19:25:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8651a9e8

Revert "repoman: identical Manifest commit message"

This reverts commit b91eefc82e995ba3463d212f95fa9228c5cf53ae.
See bug #437546, comment #3.

---
 bin/repoman |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 8dd85d0..ecf1bd2 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2859,7 +2859,14 @@ else:
 
 		fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
 		mymsg = os.fdopen(fd, "wb")
-		mymsg.write(_unicode_encode(commitmessage))
+		# strip the closing parenthesis
+		mymsg.write(_unicode_encode(commitmessage[:-1]))
+		if signed:
+			mymsg.write(_unicode_encode(
+				", signed Manifest commit with key %s)" % \
+				repoman_settings["PORTAGE_GPG_KEY"]))
+		else:
+			mymsg.write(b", unsigned Manifest commit)")
 		mymsg.close()
 
 		commit_cmd = []


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-14 19:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-14 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     30f3a3fb492bf956d928352037e12d948a8a7a35
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 14 19:48:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 14 19:48:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=30f3a3fb

repoman: identical Manifest commit message

Include the signed/unsigned part it the initial commit message,
so that it's identical to the Manifest commit message. See
bug #437546, comment #3.

---
 bin/repoman |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ecf1bd2..edd7649 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2533,6 +2533,11 @@ else:
 		(portage_version, vcs, unameout)
 	if options.force:
 		commitmessage += ", RepoMan options: --force"
+	if sign_manifests:
+		commitmessage += ", signed Manifest commit with key %s" % \
+			repoman_settings["PORTAGE_GPG_KEY"]
+	else:
+		commitmessage += ", unsigned Manifest commit"
 	commitmessage += ")"
 
 	if options.echangelog in ('y', 'force'):
@@ -2859,14 +2864,7 @@ else:
 
 		fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
 		mymsg = os.fdopen(fd, "wb")
-		# strip the closing parenthesis
-		mymsg.write(_unicode_encode(commitmessage[:-1]))
-		if signed:
-			mymsg.write(_unicode_encode(
-				", signed Manifest commit with key %s)" % \
-				repoman_settings["PORTAGE_GPG_KEY"]))
-		else:
-			mymsg.write(b", unsigned Manifest commit)")
+		mymsg.write(_unicode_encode(commitmessage))
 		mymsg.close()
 
 		commit_cmd = []


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-14 20:17 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-14 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     e3edc37982a4a0c89db5d4b28b58de77cea1bcf2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 14 20:16:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 14 20:16:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e3edc379

repoman: special git commit footer, bug #438364

---
 bin/repoman |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index edd7649..40ff097 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2524,21 +2524,33 @@ else:
 		sys.stderr.write("Failed to insert portage version in message!\n")
 		sys.stderr.flush()
 		portage_version = "Unknown"
-	unameout = platform.system() + " "
-	if platform.system() in ["Darwin", "SunOS"]:
-		unameout += platform.processor()
-	else:
-		unameout += platform.machine()
-	commitmessage += "\n\n(Portage version: %s/%s/%s" % \
-		(portage_version, vcs, unameout)
-	if options.force:
-		commitmessage += ", RepoMan options: --force"
-	if sign_manifests:
-		commitmessage += ", signed Manifest commit with key %s" % \
-			repoman_settings["PORTAGE_GPG_KEY"]
+
+	if vcs == "git":
+		# Use new footer only for git (see bug #438364).
+		commit_footer = "\n\nPackage-manager: portage-%s" % portage_version
+		if options.force:
+			commit_footer += "\nRepoMan-options: --force"
+		if sign_manifests:
+			commit_footer += "\nManifest-sign-key: %s" % \
+				repoman_settings.get("PORTAGE_GPG_KEY", "")
 	else:
-		commitmessage += ", unsigned Manifest commit"
-	commitmessage += ")"
+		unameout = platform.system() + " "
+		if platform.system() in ["Darwin", "SunOS"]:
+			unameout += platform.processor()
+		else:
+			unameout += platform.machine()
+		commit_footer += "\n\n(Portage version: %s/%s/%s" % \
+			(portage_version, vcs, unameout)
+		if options.force:
+			commit_footer += ", RepoMan options: --force"
+		if sign_manifests:
+			commit_footer += ", signed Manifest commit with key %s" % \
+				repoman_settings.get("PORTAGE_GPG_KEY", "")
+		else:
+			commit_footer += ", unsigned Manifest commit"
+		commit_footer += ")"
+
+	commitmessage += commit_footer
 
 	if options.echangelog in ('y', 'force'):
 		logging.info("checking for unmodified ChangeLog files")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-14 20:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-14 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     9a155334b90615d1d7f1579487286280317f5e5c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 14 20:31:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 14 20:31:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9a155334

repoman: initial caps for git commit msg footers

---
 bin/repoman |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 40ff097..4fa092a 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2527,11 +2527,11 @@ else:
 
 	if vcs == "git":
 		# Use new footer only for git (see bug #438364).
-		commit_footer = "\n\nPackage-manager: portage-%s" % portage_version
+		commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
 		if options.force:
-			commit_footer += "\nRepoMan-options: --force"
+			commit_footer += "\nRepoMan-Options: --force"
 		if sign_manifests:
-			commit_footer += "\nManifest-sign-key: %s" % \
+			commit_footer += "\nManifest-Sign-Key: %s" % \
 				repoman_settings.get("PORTAGE_GPG_KEY", "")
 	else:
 		unameout = platform.system() + " "


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-15  0:11 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-15  0:11 UTC (permalink / raw
  To: gentoo-commits

commit:     b3e9be9d551588e646726adff7001ded44a130b3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 15 00:11:23 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 15 00:11:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b3e9be9d

repoman: fix commit_footer NameError

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 4fa092a..d1f0b86 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2539,7 +2539,7 @@ else:
 			unameout += platform.processor()
 		else:
 			unameout += platform.machine()
-		commit_footer += "\n\n(Portage version: %s/%s/%s" % \
+		commit_footer = "\n\n(Portage version: %s/%s/%s" % \
 			(portage_version, vcs, unameout)
 		if options.force:
 			commit_footer += ", RepoMan options: --force"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-16 21:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-16 21:46 UTC (permalink / raw
  To: gentoo-commits

commit:     d40c242a4c9a9b666fd8730734b149bce2dd7cd9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 16 21:46:44 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 21:46:44 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d40c242a

repoman: validate PORTAGE_GPG_KEY

---
 bin/repoman |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index d1f0b86..c59791c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -88,6 +88,7 @@ util.initialize_logger()
 max_desc_len = 100
 allowed_filename_chars="a-zA-Z0-9._-+:"
 pv_toolong_re = re.compile(r'[0-9]{19,}')
+GPG_KEY_ID_REGEX = r'(0x)?([0-9a-fA-F]{8}|[0-9a-fA-F]{16}|[0-9a-fA-F]{24}|[0-9a-fA-F]{32})!?'
 bad = create_color_func("BAD")
 
 # A sane umask is needed for files that portage creates.
@@ -605,6 +606,14 @@ if repo_config.sign_commit:
 sign_manifests = "sign" in repoman_settings.features and \
 	repo_config.sign_manifest
 
+if sign_manifests and options.mode in ("commit",) and \
+	repoman_settings.get("PORTAGE_GPG_KEY") and \
+	re.match(r'^%s$' % GPG_KEY_ID_REGEX,
+	repoman_settings["PORTAGE_GPG_KEY"]) is None:
+	logging.error("PORTAGE_GPG_KEY value is invalid: %s" %
+		repoman_settings["PORTAGE_GPG_KEY"])
+	sys.exit(1)
+
 manifest_hashes = repo_config.manifest_hashes
 if manifest_hashes is None:
 	manifest_hashes = portage.const.MANIFEST2_HASH_DEFAULTS


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-16 22:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-16 22:35 UTC (permalink / raw
  To: gentoo-commits

commit:     d9dbb33033fd779228054925ec4d51e535050f45
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 16 22:35:03 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 22:35:03 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d9dbb330

repoman: allow 40 digit gpg key

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c59791c..a959106 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -88,7 +88,7 @@ util.initialize_logger()
 max_desc_len = 100
 allowed_filename_chars="a-zA-Z0-9._-+:"
 pv_toolong_re = re.compile(r'[0-9]{19,}')
-GPG_KEY_ID_REGEX = r'(0x)?([0-9a-fA-F]{8}|[0-9a-fA-F]{16}|[0-9a-fA-F]{24}|[0-9a-fA-F]{32})!?'
+GPG_KEY_ID_REGEX = r'(0x)?([0-9a-fA-F]{8}|[0-9a-fA-F]{16}|[0-9a-fA-F]{24}|[0-9a-fA-F]{32}|[0-9a-fA-F]{40})!?'
 bad = create_color_func("BAD")
 
 # A sane umask is needed for files that portage creates.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-17 22:46 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-17 22:46 UTC (permalink / raw
  To: gentoo-commits

commit:     e72d8353f7a9493e0508c367e416423b52ea22ce
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Oct 17 22:41:38 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Wed Oct 17 22:41:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e72d8353

Make keepdir() compatible with subslots.

---
 bin/phase-helpers.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 67d09a4..5055060 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -150,7 +150,7 @@ keepdir() {
 	fi
 	if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
 		shift
-		find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
+		find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT%/*}\n" \
 			| tr "\n" "\0" | \
 			while read -r -d $'\0' ; do
 				>> "$REPLY" || \
@@ -158,7 +158,7 @@ keepdir() {
 			done
 	else
 		for x in "$@"; do
-			>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
+			>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
 				die "Failed to create .keep in ${ED}${x}"
 		done
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-17 22:54 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-17 22:54 UTC (permalink / raw
  To: gentoo-commits

commit:     3f6ebaf5f56f2c31e3639ec16c8e21db0a734cc8
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Oct 17 22:54:14 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Wed Oct 17 22:54:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f6ebaf5

Make __source_all_bashrcs() and install_symlink_html_docs() compatible with subslots.

---
 bin/ebuild.sh         |    2 +-
 bin/misc-functions.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b042441..d83789c 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -398,7 +398,7 @@ __source_all_bashrcs() {
 	if [[ $EBUILD_PHASE != depend ]] ; then
 		# The user's bashrc is the ONLY non-portage bit of code that can
 		# change shopts without a QA violation.
-		for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
+		for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT%/*},${P},${PF}}; do
 			if [ -r "${x}" ]; then
 				# If $- contains x, then tracing has already been enabled
 				# elsewhere for some reason. We preserve it's state so as

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 4a1c46d..f3b0cc0 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -34,7 +34,7 @@ install_symlink_html_docs() {
 			if [ -z "${SLOT}" -o "${SLOT}" = "0" ] ; then
 				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}"
 			else
-				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}-${SLOT}"
+				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}-${SLOT%/*}"
 			fi
 			einfo "Symlinking ${mysympath} to the HTML documentation"
 			dodir "${DOC_SYMLINKS_DIR}/${CATEGORY}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-18  1:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-18  1:59 UTC (permalink / raw
  To: gentoo-commits

commit:     d25923e5770329b6b692ec2c05bb2dafaa4e7d4c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 01:59:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 01:59:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d25923e5

repoman: fix KEYWORDS.dropped for EAPI 5 sub-slot

---
 bin/repoman |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ba0ec9a..1502d6b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1806,9 +1806,9 @@ for x in effective_scanlist:
 		ebuild_archs = set(kw.lstrip("~") for kw in keywords \
 			if not kw.startswith("-"))
 
-		previous_keywords = slot_keywords.get(myaux["SLOT"])
+		previous_keywords = slot_keywords.get(pkg.slot)
 		if previous_keywords is None:
-			slot_keywords[myaux["SLOT"]] = set()
+			slot_keywords[pkg.slot] = set()
 		elif ebuild_archs and not live_ebuild:
 			dropped_keywords = previous_keywords.difference(ebuild_archs)
 			if dropped_keywords:
@@ -1817,7 +1817,7 @@ for x in effective_scanlist:
 					relative_path + ": %s" % \
 					" ".join(sorted(dropped_keywords)))
 
-		slot_keywords[myaux["SLOT"]].update(ebuild_archs)
+		slot_keywords[pkg.slot].update(ebuild_archs)
 
 		# KEYWORDS="-*" is a stupid replacement for package.mask and screws general KEYWORDS semantics
 		if "-*" in keywords:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-24 21:04 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-10-24 21:04 UTC (permalink / raw
  To: gentoo-commits

commit:     5ebd980500d788ec6adfe2d004d22f954e5ab54d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Oct 24 21:00:20 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Wed Oct 24 21:00:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5ebd9805

install_symlink_html_docs(): Additional fix for compatibility with subslots.

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index f3b0cc0..9b28058 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -31,7 +31,7 @@ install_symlink_html_docs() {
 		done
 		if [ -n "${mydocdir}" ] ; then
 			local mysympath
-			if [ -z "${SLOT}" -o "${SLOT}" = "0" ] ; then
+			if [ -z "${SLOT}" -o "${SLOT%/*}" = "0" ] ; then
 				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}"
 			else
 				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}-${SLOT%/*}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-25  3:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-25  3:21 UTC (permalink / raw
  To: gentoo-commits

commit:     f48625c547398ee5f92d33e16b1a837c3c595ae9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 25 03:21:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 25 03:21:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f48625c5

Use checkbashisms for init.d scripts, bug #439490

---
 bin/misc-functions.sh |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9b28058..db023e4 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -558,6 +558,23 @@ install_qa_check() {
 		done
 	done
 
+	local checkbashisms=$(type -P checkbashisms)
+	if [[ -n ${checkbashisms} ]] ; then
+		for d in /etc/init.d ; do
+			[[ -d ${ED}${d} ]] || continue
+			for i in "${ED}${d}"/* ; do
+				[[ -e ${i} ]] || continue
+				[[ -L ${i} ]] && continue
+				f=$("${checkbashisms}" -f "${i}" 2>&1)
+				[[ $? != 0 && -n ${f} ]] || continue
+				eqawarn "QA Notice: shell script appears to use non-POSIX feature(s):"
+				while read -r ;
+					do eqawarn "   ${REPLY}"
+				done <<< "${f//${ED}}"
+			done
+		done
+	fi
+
 	# Look for leaking LDFLAGS into pkg-config files
 	f=$(egrep -sH '^Libs.*-Wl,(-O[012]|--hash-style)' "${ED}"/usr/*/pkgconfig/*.pc)
 	if [[ -n ${f} ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-10-27 10:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-10-27 10:01 UTC (permalink / raw
  To: gentoo-commits

commit:     5a07c8e08793d35e2d9d67836ea022136bb6830e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 27 10:00:50 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 27 10:00:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a07c8e0

die: use local IFS setting

This is needed at least for splitting ${EBUILD_OVERLAY_ECLASSES}, in
order to avoid potentially strange results.

---
 bin/isolated-functions.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index f8e7862..246c25f 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -107,6 +107,8 @@ __helpers_die() {
 }
 
 die() {
+	local IFS=$' \t\n'
+
 	if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
 		echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2
 		return 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-11-25 10:41 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-25 10:41 UTC (permalink / raw
  To: gentoo-commits

commit:     3dea53c2be83088d05c82a0c3dbbe7e6e1a6edea
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Nov 25 10:40:06 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Nov 25 10:40:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3dea53c2

unpack(): Handle suffixes in case-insensitive way.

---
 bin/phase-helpers.sh |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index bc00e44..8a78f37 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -276,14 +276,18 @@ unpack() {
 	local srcdir
 	local x
 	local y
+	local suffix
 	local myfail
 	local eapi=${EAPI:-0}
 	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
 
 	for x in "$@"; do
 		__vecho ">>> Unpacking ${x} to ${PWD}"
+		suffix=${x##*.}
+		suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
 		y=${x%.*}
 		y=${y##*.}
+		y=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
 
 		if [[ ${x} == "./"* ]] ; then
 			srcdir=""
@@ -308,7 +312,7 @@ unpack() {
 		}
 
 		myfail="failure unpacking ${x}"
-		case "${x##*.}" in
+		case "${suffix}" in
 			tar)
 				tar xof "$srcdir$x" || die "$myfail"
 				;;
@@ -319,19 +323,19 @@ unpack() {
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
 				__assert_sigpipe_ok "$myfail"
 				;;
-			ZIP|zip|jar)
+			zip|jar)
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
 				( set +x ; while true ; do echo n || break ; done ) | \
 				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
-			gz|Z|z)
+			gz|z)
 				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
-			7Z|7z)
+			7z)
 				local my_output
 				my_output="$(7z x -y "${srcdir}${x}")"
 				if [ $? -ne 0 ]; then
@@ -339,10 +343,10 @@ unpack() {
 					die "$myfail"
 				fi
 				;;
-			RAR|rar)
+			rar)
 				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
 				;;
-			LHa|LHA|lha|lzh)
+			lha|lzh)
 				lha xfq "${srcdir}${x}" || die "$myfail"
 				;;
 			a)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-11-25 10:41 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-25 10:41 UTC (permalink / raw
  To: gentoo-commits

commit:     ddee4fef83539a5bc66b3c76086dd6ba2ab1f77c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Nov 25 10:33:10 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Nov 25 10:33:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ddee4fef

__sb_append_var(): Quote tr arguments to avoid filename expansion. Avoid a subshell.

---
 bin/ebuild.sh |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d83789c..80bdd80 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -113,8 +113,7 @@ unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
 __sb_append_var() {
 	local _v=$1 ; shift
 	local var="SANDBOX_${_v}"
-	[[ -z $1 || -n $2 ]] && die "Usage: add$(echo ${_v} | \
-		LC_ALL=C tr [:upper:] [:lower:]) <colon-delimited list of paths>"
+	[[ -z $1 || -n $2 ]] && die "Usage: add$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${_v}") <colon-delimited list of paths>"
 	export ${var}="${!var:+${!var}:}$1"
 }
 # bash-4 version:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-11-29  5:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-11-29  5:37 UTC (permalink / raw
  To: gentoo-commits

commit:     0d850ef6ac4e98089e9ff938ebe3573953cabee2
Author:     Lucas Bickel <hairmare <AT> purplehaze <DOT> ch>
AuthorDate: Thu Nov 15 21:50:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 29 05:37:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0d850ef6

fix ebuild rpm command for rpm 4.10.0

* changes dyn_spec to use a sources_dir in the sandbox
* remove deprecated Buildroot from specfile
* call rpmbuild with --target instead of Buildroot
* grab machine_name from $CHOST and use as --target in rpmbuild
* use dir in sandbox instead of /usr/src/rpm/RPMS

---
 bin/misc-functions.sh |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 853489a..e0e0c87 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1199,7 +1199,7 @@ __dyn_package() {
 }
 
 __dyn_spec() {
-	local sources_dir=/usr/src/rpm/SOURCES
+	local sources_dir=${T}/rpmbuild/SOURCES
 	mkdir -p "${sources_dir}"
 	declare -a tar_args=("${EBUILD}")
 	[[ -d ${FILESDIR} ]] && tar_args=("${EBUILD}" "${FILESDIR}")
@@ -1215,7 +1215,6 @@ Release: ${PR}
 License: GPL
 Group: portage/${CATEGORY}
 Source: ${PF}.tar.gz
-Buildroot: ${D}
 %description
 ${DESCRIPTION}
 
@@ -1242,12 +1241,11 @@ __dyn_rpm() {
 	fi
 
 	cd "${T}" || die "cd failed"
-	local machine_name=$(uname -m)
-	local dest_dir=${EPREFIX}/usr/src/rpm/RPMS/${machine_name}
-	addwrite ${EPREFIX}/usr/src/rpm
+	local machine_name=${CHOST%%-*}
+	local dest_dir=${T}/rpmbuild/RPMS/${machine_name}
 	addwrite "${RPMDIR}"
 	__dyn_spec
-	rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file"
+	rpmbuild -bb --clean --rmsource "${PF}.spec" --buildroot "${D}" --target "${CHOST}" || die "Failed to integrate rpm spec file"
 	install -D "${dest_dir}/${PN}-${PV}-${PR}.${machine_name}.rpm" \
 		"${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
 		die "Failed to move rpm"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-11-29  5:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-11-29  5:58 UTC (permalink / raw
  To: gentoo-commits

commit:     d3540b8aa468e872c6a6b41074c8567f489e9768
Author:     Lucas Bickel <hairmare <AT> purplehaze <DOT> ch>
AuthorDate: Thu Nov 15 21:50:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 29 05:58:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3540b8a

fix ebuild rpm command for rpm 4.10.0

* changes dyn_spec to use a sources_dir in the sandbox
* remove deprecated Buildroot from specfile
* call rpmbuild with --target instead of Buildroot
* grab machine_name from $CHOST and use as --target in rpmbuild
* use dir in sandbox instead of /usr/src/rpm/RPMS

---
 bin/misc-functions.sh |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 853489a..6f84526 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1199,7 +1199,7 @@ __dyn_package() {
 }
 
 __dyn_spec() {
-	local sources_dir=/usr/src/rpm/SOURCES
+	local sources_dir=${T}/rpmbuild/SOURCES
 	mkdir -p "${sources_dir}"
 	declare -a tar_args=("${EBUILD}")
 	[[ -d ${FILESDIR} ]] && tar_args=("${EBUILD}" "${FILESDIR}")
@@ -1215,7 +1215,6 @@ Release: ${PR}
 License: GPL
 Group: portage/${CATEGORY}
 Source: ${PF}.tar.gz
-Buildroot: ${D}
 %description
 ${DESCRIPTION}
 
@@ -1242,12 +1241,12 @@ __dyn_rpm() {
 	fi
 
 	cd "${T}" || die "cd failed"
-	local machine_name=$(uname -m)
-	local dest_dir=${EPREFIX}/usr/src/rpm/RPMS/${machine_name}
-	addwrite ${EPREFIX}/usr/src/rpm
+	local machine_name=${CHOST%%-*}
+	local dest_dir=${T}/rpmbuild/RPMS/${machine_name}
 	addwrite "${RPMDIR}"
 	__dyn_spec
-	rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file"
+	HOME=${T} \
+	rpmbuild -bb --clean --rmsource "${PF}.spec" --buildroot "${D}" --target "${CHOST}" || die "Failed to integrate rpm spec file"
 	install -D "${dest_dir}/${PN}-${PV}-${PR}.${machine_name}.rpm" \
 		"${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
 		die "Failed to move rpm"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-11-29 21:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-11-29 21:40 UTC (permalink / raw
  To: gentoo-commits

commit:     a7ce4f6067cafd636119f05bba6c0ed1e9814802
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 29 21:39:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 29 21:39:53 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a7ce4f60

repoman: handle missing @DEPRECATED lic group

---
 bin/repoman |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index a38ffe1..161d87c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -925,12 +925,10 @@ for x in repoman_settings.archlist():
 		print(red("up with the "+x+" team."))
 		print()
 
-global_noiselimit = portage.util.noiselimit
-# Suppress error message if @DEPRECATED license group doesn't exist
-portage.util.noiselimit = -2
-liclist_deprecated = \
-	set(repoman_settings._license_manager.expandLicenseTokens(["@DEPRECATED"]))
-portage.util.noiselimit = global_noiselimit
+liclist_deprecated = set()
+if "DEPRECATED" in repoman_settings._license_manager._license_groups:
+	liclist_deprecated.update(
+		repoman_settings._license_manager.expandLicenseTokens(["@DEPRECATED"]))
 
 if not liclist:
 	logging.fatal("Couldn't find licenses?")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-11 11:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-11 11:09 UTC (permalink / raw
  To: gentoo-commits

commit:     4cab89345f8c236cdc91f596b5168763f6051ab2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 11 11:09:27 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 11 11:09:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4cab8934

xattr-helper.py: fix backslash quoting

---
 bin/xattr-helper.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index d40217c..b832f5e 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -94,11 +94,14 @@ def dump_xattrs(file_in, file_out):
 		attrs = xattr.list(pathname)
 		if not attrs:
 			continue
-		file_out.write(b'# file: ' + quote(pathname, b'\n\r') + b'\n')
+
+		# NOTE: Always quote backslashes, in order to ensure that they are
+		# not interpreted as quotes when they are processed by unquote.
+		file_out.write(b'# file: ' + quote(pathname, b'\n\r\\\\') + b'\n')
 		for attr in attrs:
 			attr = unicode_encode(attr)
-			file_out.write(quote(attr, b'=\n\r') + b'="' +
-				quote(xattr.get(pathname, attr), b'\\\0\n\r"') + b'"\n')
+			file_out.write(quote(attr, b'=\n\r\\\\') + b'="' +
+				quote(xattr.get(pathname, attr), b'\0\n\r"\\\\') + b'"\n')
 
 def restore_xattrs(file_in):
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-11 17:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-11 17:14 UTC (permalink / raw
  To: gentoo-commits

commit:     e20cbf882cdbaae447d785ebadc980d29dfa2a4b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 11 17:14:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 11 17:14:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e20cbf88

xattr-helper.py: fix AssertionError string format

---
 bin/xattr-helper.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index b832f5e..e63f2cb 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -113,13 +113,13 @@ def restore_xattrs(file_in):
 			parts = line.split(b'=', 1)
 			if len(parts) == 2:
 				if pathname is None:
-					raise AssertionError('line %d: missing pathname' % i + 1)
+					raise AssertionError('line %d: missing pathname' % (i + 1,))
 				attr = unquote(parts[0])
 				# strip trailing newline and quotes 
 				value = unquote(parts[1].rstrip(b'\n')[1:-1])
 				xattr.set(pathname, attr, value)
 			elif line.strip():
-				raise AssertionError("line %d: malformed entry" % i + 1)
+				raise AssertionError("line %d: malformed entry" % (i + 1,))
 
 def main(argv):
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-15 22:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-15 22:24 UTC (permalink / raw
  To: gentoo-commits

commit:     7ff768b5d785c14f3c6951bae95a9efb836f2ed8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 15 22:23:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 15 22:23:53 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7ff768b5

repoman keywords.dropped: handle * and ~*

---
 bin/repoman |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 161d87c..9087deb 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1833,8 +1833,11 @@ for x in effective_scanlist:
 		previous_keywords = slot_keywords.get(pkg.slot)
 		if previous_keywords is None:
 			slot_keywords[pkg.slot] = set()
-		elif ebuild_archs and not live_ebuild:
+		elif ebuild_archs and "*" not in ebuild_archs and not live_ebuild:
 			dropped_keywords = previous_keywords.difference(ebuild_archs)
+			if dropped_keywords and "~*" in ebuild_archs:
+				dropped_keywords = [kw for kw in dropped_keywords
+					if not kw.startswith("~")]
 			if dropped_keywords:
 				stats["KEYWORDS.dropped"] += 1
 				fails["KEYWORDS.dropped"].append(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-15 23:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-15 23:08 UTC (permalink / raw
  To: gentoo-commits

commit:     185104a43b62f6e68fb7209024a67ea263b6e108
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 15 22:23:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 15 23:08:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=185104a4

repoman keywords.dropped: handle * and ~*

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 161d87c..41bce80 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1833,7 +1833,7 @@ for x in effective_scanlist:
 		previous_keywords = slot_keywords.get(pkg.slot)
 		if previous_keywords is None:
 			slot_keywords[pkg.slot] = set()
-		elif ebuild_archs and not live_ebuild:
+		elif ebuild_archs and "*" not in ebuild_archs and not live_ebuild:
 			dropped_keywords = previous_keywords.difference(ebuild_archs)
 			if dropped_keywords:
 				stats["KEYWORDS.dropped"] += 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-15 23:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-15 23:42 UTC (permalink / raw
  To: gentoo-commits

commit:     37044b4493e8de520c7b394f5d7c43c26b9b064b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 15 23:41:48 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 15 23:41:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=37044b44

repoman: check deps for * and ~* keywords

---
 bin/repoman |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 41bce80..60792d7 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1881,18 +1881,31 @@ for x in effective_scanlist:
 			arches = [[repoman_settings["ARCH"], repoman_settings["ARCH"],
 				repoman_settings["ACCEPT_KEYWORDS"].split()]]
 		else:
-			arches=[]
-			for keyword in myaux["KEYWORDS"].split():
+			arches = set()
+			for keyword in keywords:
 				if (keyword[0]=="-"):
 					continue
 				elif (keyword[0]=="~"):
-					arches.append([keyword, keyword[1:], [keyword[1:], keyword]])
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add((keyword, expanded_arch, (arch, keyword)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
 				else:
-					arches.append([keyword, keyword, [keyword]])
+					if keyword == "*":
+						for expanded_arch in profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add((keyword, expanded_arch, (keyword,)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
 			if not arches:
 				# Use an empty profile for checking dependencies of
 				# packages that have empty KEYWORDS.
-				arches.append(['**', '**', ['**']])
+				arches.add(('**', '**', ('**',)))
 
 		unknown_pkgs = set()
 		baddepsyntax = False
@@ -2119,14 +2132,22 @@ for x in effective_scanlist:
 			# user is intent on forcing the commit anyway.
 			continue
 
+		relevant_profiles = []
 		for keyword,arch,groups in arches:
 
 			if arch not in profiles:
 				# A missing profile will create an error further down
 				# during the KEYWORDS verification.
 				continue
+			relevant_profiles.extend((keyword, groups, prof)
+				for prof in profiles[arch])
+
+		def sort_key(item):
+			return item[2].sub_path
+
+		relevant_profiles.sort(key=sort_key)
 
-			for prof in profiles[arch]:
+		for keyword, groups, prof in relevant_profiles:
 
 				if prof.status not in ("stable", "dev") or \
 					prof.status == "dev" and not options.include_dev:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-16  8:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-16  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     bcb28cd73e74d3d45376ab517ea219979b79eeed
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 16 08:56:26 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 16 08:56:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcb28cd7

repoman: fix dep check for * and ~* keywords

We want the effective ACCEPT_KEYWORDS to correspond to the current
profile's arch (rather than using wildcards).

---
 bin/repoman |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 60792d7..fb2a9ad 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1891,7 +1891,8 @@ for x in effective_scanlist:
 						for expanded_arch in profiles:
 							if expanded_arch == "**":
 								continue
-							arches.add((keyword, expanded_arch, (arch, keyword)))
+							arches.add((keyword, expanded_arch,
+								(expanded_arch, "~" + expanded_arch)))
 					else:
 						arches.add((keyword, arch, (arch, keyword)))
 				else:
@@ -1899,7 +1900,8 @@ for x in effective_scanlist:
 						for expanded_arch in profiles:
 							if expanded_arch == "**":
 								continue
-							arches.add((keyword, expanded_arch, (keyword,)))
+							arches.add((keyword, expanded_arch,
+								(expanded_arch,)))
 					else:
 						arches.add((keyword, keyword, (keyword,)))
 			if not arches:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-21 22:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-21 22:02 UTC (permalink / raw
  To: gentoo-commits

commit:     c4cd97883bb936d21f8e995cb1f7e989fe851cff
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 21 22:01:48 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 21 22:01:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c4cd9788

repoman: exempt virtuals from KEYWORDS.stable

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index fb2a9ad..b0e5851 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1820,7 +1820,7 @@ for x in effective_scanlist:
 				not keyword.startswith("-"):
 				stable_keywords.append(keyword)
 		if stable_keywords:
-			if ebuild_path in new_ebuilds:
+			if ebuild_path in new_ebuilds and catdir != "virtual":
 				stable_keywords.sort()
 				stats["KEYWORDS.stable"] += 1
 				fails["KEYWORDS.stable"].append(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-26 22:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-26 22:47 UTC (permalink / raw
  To: gentoo-commits

commit:     d93959f2f295b47a0b17c33ee8df1633a0e479ee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 26 22:47:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 26 22:47:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d93959f2

repoman: fix git_supports_gpg_sign

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index b0e5851..45a7ca5 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1022,7 +1022,7 @@ def git_supports_gpg_sign():
 	if cmd_output:
 		version = re.match(r'^(\d+)\.(\d+)\.(\d+)', cmd_output[-1])
 		if version is not None:
-			version = [int(x) for x in version.groups()[1:]]
+			version = [int(x) for x in version.groups()]
 			if version[0] > 1 or \
 				(version[0] == 1 and version[1] > 7) or \
 				(version[0] == 1 and version[1] == 7 and version[2] >= 9):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2012-12-29  1:11 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2012-12-29  1:11 UTC (permalink / raw
  To: gentoo-commits

commit:     e94233871e20fd3852e511ed1bd91c2826870f50
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 29 01:11:15 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 29 01:11:15 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9423387

egencache: fix --strict-manifests=n

---
 bin/egencache |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 8870d99..79a996d 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -928,7 +928,7 @@ def egencache_main(args):
 		if options.strict_manifests == "y":
 			settings.features.add("strict")
 		else:
-			settings.features.add("discard")
+			settings.features.discard("strict")
 
 	if options.update and 'metadata-transfer' not in settings.features:
 		# Forcibly enable metadata-transfer if portdbapi has a pregenerated


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-01 23:50 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-01 23:50 UTC (permalink / raw
  To: gentoo-commits

commit:     0c38140e331c040530bf1d6c5716696162790bda
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  1 23:50:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan  1 23:50:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c38140e

use(): fatal missing IUSE in EAPI 5, bug #449708

---
 bin/phase-helpers.sh |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 8a78f37..383f9ff 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -212,9 +212,15 @@ use() {
 
 	# Make sure we have this USE flag in IUSE
 	elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
-		[[ $u =~ $PORTAGE_IUSE ]] || \
+		if [[ ! $u =~ $PORTAGE_IUSE ]] ; then
+			if [[ ! ${EAPI} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]] ; then
+				# This is only strict starting with EAPI 5, since implicit IUSE
+				# is not well defined for earlier EAPIs (see bug #449708).
+				die "USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}"
+			fi
 			eqawarn "QA Notice: USE Flag '${u}' not" \
 				"in IUSE for ${CATEGORY}/${PF}"
+		fi
 	fi
 
 	local IFS=$' \t\n' prev_shopts=$- ret


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-02  0:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-02  0:30 UTC (permalink / raw
  To: gentoo-commits

commit:     63bf20d0925ca76c98477a108a6d4c3fa8fde885
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  1 14:15:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 00:28:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=63bf20d0

repoman: tell user which mirror identifiers contain SRC_URI

before the patch:
    $ repoman full

    RepoMan scours the neighborhood...
      metadata.missing              1
       dev-haskell/qthaskellc/metadata.xml
      SRC_URI.mirror                1
       dev-haskell/qthaskellc/qthaskellc-1.1.4.ebuild: 'http://download.berlios.de/' found in thirdpartymirrors

after the patch:
    $ repoman full

    RepoMan scours the neighborhood...
      metadata.missing              1
       dev-haskell/qthaskellc/metadata.xml
      SRC_URI.mirror                1
       dev-haskell/qthaskellc/qthaskellc-1.1.4.ebuild: 'http://download.berlios.de/' found in thirdpartymirrors: 'mirror://berlios'

Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

---
 bin/repoman |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 45a7ca5..92ae667 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1267,12 +1267,12 @@ check_ebuild_notadded = not \
 	(vcs == "svn" and repolevel < 3 and options.mode != "commit")
 
 # Build a regex from thirdpartymirrors for the SRC_URI.mirror check.
-thirdpartymirrors = []
-for v in repoman_settings.thirdpartymirrors().values():
+thirdpartymirrors = {}
+for k, v in repoman_settings.thirdpartymirrors().items():
 	for v in v:
 		if not v.endswith("/"):
 			v += "/"
-		thirdpartymirrors.append(v)
+		thirdpartymirrors[v] = k
 
 class _MetadataTreeBuilder(xml.etree.ElementTree.TreeBuilder):
 	"""
@@ -1772,7 +1772,7 @@ for x in effective_scanlist:
 			for uri in portage.dep.use_reduce( \
 				myaux["SRC_URI"], matchall=True, is_src_uri=True, eapi=eapi, flat=True):
 				contains_mirror = False
-				for mirror in thirdpartymirrors:
+				for mirror, mirror_alias in thirdpartymirrors.items():
 					if uri.startswith(mirror):
 						contains_mirror = True
 						break
@@ -1781,8 +1781,8 @@ for x in effective_scanlist:
 
 				stats["SRC_URI.mirror"] += 1
 				fails["SRC_URI.mirror"].append(
-					"%s: '%s' found in thirdpartymirrors" % \
-					(relative_path, mirror))
+					"%s: '%s' found in thirdpartymirrors: 'mirror://%s'" % \
+					(relative_path, mirror, mirror_alias))
 
 		if myaux.get("PROVIDE"):
 			stats["virtual.oldstyle"]+=1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-02  0:44 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-02  0:44 UTC (permalink / raw
  To: gentoo-commits

commit:     b6a683adf5445569e69aac53d5458a625ce33ac8
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 00:44:33 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 00:44:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b6a683ad

repoman: improve thirdpartymirrors output

---
 bin/repoman |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 92ae667..57ddf72 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1779,10 +1779,11 @@ for x in effective_scanlist:
 				if not contains_mirror:
 					continue
 
+				new_uri = "mirror://%s/%s" % (mirror_alias, uri[len(mirror):])
 				stats["SRC_URI.mirror"] += 1
 				fails["SRC_URI.mirror"].append(
-					"%s: '%s' found in thirdpartymirrors: 'mirror://%s'" % \
-					(relative_path, mirror, mirror_alias))
+					"%s: '%s' found in thirdpartymirrors, use '%s'" % \
+					(relative_path, mirror, new_uri))
 
 		if myaux.get("PROVIDE"):
 			stats["virtual.oldstyle"]+=1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-04  6:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-04  6:30 UTC (permalink / raw
  To: gentoo-commits

commit:     439151bb5b0bd2ac4c9d2dd218fe377ce0b988e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 06:29:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 06:29:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=439151bb

ebuild-ipc: use PipeReader in _wait

---
 bin/ebuild-ipc.py |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 52ea05c..e91c69c 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -41,6 +41,9 @@ import portage
 portage._internal_caller = True
 portage._disable_legacy_globals()
 
+from portage.util._eventloop.global_event_loop import global_event_loop
+from _emerge.PipeReader import PipeReader
+
 class EbuildIpc(object):
 
 	# Timeout for each individual communication attempt (we retry
@@ -99,23 +102,22 @@ class EbuildIpc(object):
 
 		start_time = time.time()
 
-		while True:
-			try:
-				events = select.select([pr], [], [],
-					self._COMMUNICATE_RETRY_TIMEOUT_SECONDS)
-			except select.error as e:
-				portage.util.writemsg_level(
-					"ebuild-ipc: %s: %s\n" % \
-					(portage.localization._('during select'), e),
-					level=logging.ERROR, noiselevel=-1)
-				continue
+		pipe_reader = PipeReader(input_files={"pipe_read":pr},
+			scheduler=global_event_loop())
+		pipe_reader.start()
 
-			if events[0]:
-				break
+		eof = pipe_reader.poll() is not None
+
+		while not eof:
+			pipe_reader.scheduler.iteration()
 
-			if self._daemon_is_alive():
+			eof = pipe_reader.poll() is not None
+			if eof:
+				break
+			elif self._daemon_is_alive():
 				self._timeout_retry_msg(start_time, msg)
 			else:
+				pipe_reader.cancel()
 				self._no_daemon_msg()
 				try:
 					os.kill(pid, signal.SIGKILL)
@@ -258,7 +260,6 @@ class EbuildIpc(object):
 
 		msg = portage.localization._('during write')
 		retval = self._wait(pid, pr, msg)
-		os.close(pr)
 
 		if retval != os.EX_OK:
 			portage.util.writemsg_level(
@@ -288,7 +289,6 @@ class EbuildIpc(object):
 
 		os.close(pw)
 		retval = self._wait(pid, pr, portage.localization._('during read'))
-		os.close(pr)
 		os.close(input_fd)
 		return retval
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-04  7:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-04  7:07 UTC (permalink / raw
  To: gentoo-commits

commit:     06d31ef00da24352a6614f20bccfc892d2120ed9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 07:07:00 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 07:07:00 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06d31ef0

ebuild-ipc: use PipeReader in _receive_reply

---
 bin/ebuild-ipc.py |   61 +++++-----------------------------------------------
 1 files changed, 6 insertions(+), 55 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index e91c69c..ceab4d5 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -5,12 +5,10 @@
 # This is a helper which ebuild processes can use
 # to communicate with portage's main python process.
 
-import errno
 import logging
 import os
 import pickle
 import platform
-import select
 import signal
 import sys
 import time
@@ -49,7 +47,6 @@ class EbuildIpc(object):
 	# Timeout for each individual communication attempt (we retry
 	# as long as the daemon process appears to be alive).
 	_COMMUNICATE_RETRY_TIMEOUT_SECONDS = 15
-	_BUFSIZE = 4096
 
 	def __init__(self):
 		self.fifo_dir = os.environ['PORTAGE_BUILDDIR']
@@ -148,41 +145,13 @@ class EbuildIpc(object):
 
 	def _receive_reply(self, input_fd):
 
-		# Timeouts are handled by the parent process, so just
-		# block until input is available. For maximum portability,
-		# use a single atomic read.
 		buf = None
-		while True:
-			try:
-				events = select.select([input_fd], [], [])
-			except select.error as e:
-				portage.util.writemsg_level(
-					"ebuild-ipc: %s: %s\n" % \
-					(portage.localization._('during select for read'), e),
-					level=logging.ERROR, noiselevel=-1)
-				continue
 
-			if events[0]:
-				# For maximum portability, use os.read() here since
-				# array.fromfile() and file.read() are both known to
-				# erroneously return an empty string from this
-				# non-blocking fifo stream on FreeBSD (bug #337465).
-				try:
-					buf = os.read(input_fd, self._BUFSIZE)
-				except OSError as e:
-					if e.errno != errno.EAGAIN:
-						portage.util.writemsg_level(
-							"ebuild-ipc: %s: %s\n" % \
-							(portage.localization._('read error'), e),
-							level=logging.ERROR, noiselevel=-1)
-						break
-					# Assume that another event will be generated
-					# if there's any relevant data.
-					continue
-
-				# Only one (atomic) read should be necessary.
-				if buf:
-					break
+		pipe_reader = PipeReader(input_files={"input_fd":input_fd},
+			scheduler=global_event_loop())
+		pipe_reader.start()
+		pipe_reader.wait()
+		buf = pipe_reader.getvalue() 
 
 		retval = 2
 
@@ -272,25 +241,7 @@ class EbuildIpc(object):
 			self._no_daemon_msg()
 			return 2
 
-		pr, pw = os.pipe()
-		pid = os.fork()
-
-		if pid == 0:
-			retval = 2
-			try:
-				os.close(pr)
-				retval = self._receive_reply(input_fd)
-			except SystemExit:
-				raise
-			except:
-				traceback.print_exc()
-			finally:
-				os._exit(retval)
-
-		os.close(pw)
-		retval = self._wait(pid, pr, portage.localization._('during read'))
-		os.close(input_fd)
-		return retval
+		return self._receive_reply(input_fd)
 
 def ebuild_ipc_main(args):
 	ebuild_ipc = EbuildIpc()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-04  7:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-04  7:14 UTC (permalink / raw
  To: gentoo-commits

commit:     6eff7ea1d28da8af9a30a5b8c1dcd05ed9b7638d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 07:14:07 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 07:14:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6eff7ea1

ebuild-ipc: fix waiting message

It got disabled by commit 439151bb5b0bd2ac4c9d2dd218fe377ce0b988e6.

---
 bin/ebuild-ipc.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index ceab4d5..ca707fa 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -46,7 +46,7 @@ class EbuildIpc(object):
 
 	# Timeout for each individual communication attempt (we retry
 	# as long as the daemon process appears to be alive).
-	_COMMUNICATE_RETRY_TIMEOUT_SECONDS = 15
+	_COMMUNICATE_RETRY_TIMEOUT_MS = 15000
 
 	def __init__(self):
 		self.fifo_dir = os.environ['PORTAGE_BUILDDIR']
@@ -106,7 +106,7 @@ class EbuildIpc(object):
 		eof = pipe_reader.poll() is not None
 
 		while not eof:
-			pipe_reader.scheduler.iteration()
+			pipe_reader._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT_MS)
 
 			eof = pipe_reader.poll() is not None
 			if eof:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-04  7:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-04  7:34 UTC (permalink / raw
  To: gentoo-commits

commit:     60cfa786a1506e5fccfb02c3307c38399b5a532f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 07:34:05 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 07:34:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60cfa786

ebuild-ipc: fix read timeout msg / daemon check

It got disabled in commit 06d31ef00da24352a6614f20bccfc892d2120ed9.

---
 bin/ebuild-ipc.py |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index ca707fa..4046d8d 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -145,12 +145,26 @@ class EbuildIpc(object):
 
 	def _receive_reply(self, input_fd):
 
-		buf = None
+		start_time = time.time()
 
 		pipe_reader = PipeReader(input_files={"input_fd":input_fd},
 			scheduler=global_event_loop())
 		pipe_reader.start()
-		pipe_reader.wait()
+
+		eof = pipe_reader.poll() is not None
+
+		while not eof:
+			pipe_reader._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT_MS)
+			eof = pipe_reader.poll() is not None
+			if not eof:
+				if self._daemon_is_alive():
+					self._timeout_retry_msg(start_time,
+						portage.localization._('during read'))
+				else:
+					pipe_reader.cancel()
+					self._no_daemon_msg()
+					return 2
+
 		buf = pipe_reader.getvalue() 
 
 		retval = 2


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-04 13:23 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-04 13:23 UTC (permalink / raw
  To: gentoo-commits

commit:     e489dcef3fd91ecf4a0960bdd7ed1de0a992f72b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 13:22:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 13:22:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e489dcef

ebuild-ipc: add FifoWriter class

---
 bin/ebuild-ipc.py |   79 ++++++++++++++---------------------------------------
 1 files changed, 21 insertions(+), 58 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 4046d8d..d351e94 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -12,7 +12,6 @@ import platform
 import signal
 import sys
 import time
-import traceback
 
 def debug_signal(signum, frame):
 	import pdb
@@ -39,9 +38,20 @@ import portage
 portage._internal_caller = True
 portage._disable_legacy_globals()
 
+from portage.util._async.ForkProcess import ForkProcess
 from portage.util._eventloop.global_event_loop import global_event_loop
 from _emerge.PipeReader import PipeReader
 
+class FifoWriter(ForkProcess):
+
+	__slots__ = ('buf', 'fifo',)
+
+	def _run(self):
+		# Atomically write the whole buffer into the fifo.
+		with open(self.fifo, 'wb', 0) as f:
+			f.write(self.buf)
+		return os.EX_OK
+
 class EbuildIpc(object):
 
 	# Timeout for each individual communication attempt (we retry
@@ -90,7 +100,7 @@ class EbuildIpc(object):
 			'ebuild-ipc: daemon process not detected\n'),
 			level=logging.ERROR, noiselevel=-1)
 
-	def _wait(self, pid, pr, msg):
+	def _run_writer(self, fifo_writer, msg):
 		"""
 		Wait on pid and return an appropriate exit code. This
 		may return unsuccessfully due to timeout if the daemon
@@ -99,49 +109,24 @@ class EbuildIpc(object):
 
 		start_time = time.time()
 
-		pipe_reader = PipeReader(input_files={"pipe_read":pr},
-			scheduler=global_event_loop())
-		pipe_reader.start()
-
-		eof = pipe_reader.poll() is not None
+		fifo_writer.start()
+		eof = fifo_writer.poll() is not None
 
 		while not eof:
-			pipe_reader._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT_MS)
+			fifo_writer._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT_MS)
 
-			eof = pipe_reader.poll() is not None
+			eof = fifo_writer.poll() is not None
 			if eof:
 				break
 			elif self._daemon_is_alive():
 				self._timeout_retry_msg(start_time, msg)
 			else:
-				pipe_reader.cancel()
+				fifo_writer.cancel()
 				self._no_daemon_msg()
-				try:
-					os.kill(pid, signal.SIGKILL)
-					os.waitpid(pid, 0)
-				except OSError as e:
-					portage.util.writemsg_level(
-						"ebuild-ipc: %s\n" % (e,),
-						level=logging.ERROR, noiselevel=-1)
+				fifo_writer.wait()
 				return 2
 
-		try:
-			wait_retval = os.waitpid(pid, 0)
-		except OSError as e:
-			portage.util.writemsg_level(
-				"ebuild-ipc: %s: %s\n" % (msg, e),
-				level=logging.ERROR, noiselevel=-1)
-			return 2
-
-		if not os.WIFEXITED(wait_retval[1]):
-			portage.util.writemsg_level(
-				"ebuild-ipc: %s: %s\n" % (msg,
-				portage.localization._('subprocess failure: %s') % \
-				wait_retval[1]),
-				level=logging.ERROR, noiselevel=-1)
-			return 2
-
-		return os.WEXITSTATUS(wait_retval[1])
+		return fifo_writer.wait()
 
 	def _receive_reply(self, input_fd):
 
@@ -218,31 +203,9 @@ class EbuildIpc(object):
 		# un-interrupted, while the parent handles all timeout
 		# considerations. This helps to avoid possible race conditions
 		# from interference between timeouts and blocking IO operations.
-		pr, pw = os.pipe()
-		pid = os.fork()
-
-		if pid == 0:
-			retval = 2
-			try:
-				os.close(pr)
-
-				# File streams are in unbuffered mode since we do atomic
-				# read and write of whole pickles.
-				output_file = open(self.ipc_in_fifo, 'wb', 0)
-				output_file.write(pickle.dumps(args))
-				output_file.close()
-				retval = os.EX_OK
-			except SystemExit:
-				raise
-			except:
-				traceback.print_exc()
-			finally:
-				os._exit(retval)
-
-		os.close(pw)
-
 		msg = portage.localization._('during write')
-		retval = self._wait(pid, pr, msg)
+		retval = self._run_writer(FifoWriter(buf=pickle.dumps(args),
+			fifo=self.ipc_in_fifo, scheduler=global_event_loop()), msg)
 
 		if retval != os.EX_OK:
 			portage.util.writemsg_level(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-12  0:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-12  0:09 UTC (permalink / raw
  To: gentoo-commits

commit:     59b5352c457d0f5449d6ff9fb06646fe473cc594
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 12 00:09:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 12 00:09:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=59b5352c

Tweak init.d qa check for bug #451386.

---
 bin/misc-functions.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 6f84526..5fd0eab 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -554,6 +554,10 @@ install_qa_check() {
 			[[ -L ${i} ]] && continue
 			# if empty conf.d/init.d dir exists (baselayout), then i will be "/etc/conf.d/*" and not exist
 			[[ ! -e ${i} ]] && continue
+			if [[ ${d} == /etc/init.d && ${i} != *.sh ]] ; then
+				# skip non-shell-script for bug #451386
+				[[ $(head -n1 "${i}") =~ ^#!.*[[:space:]/](runscript|sh)$ ]] || continue
+			fi
 			bash -n "${i}" || die "The init.d file has syntax errors: ${i}"
 		done
 	done


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-18 17:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-18 17:27 UTC (permalink / raw
  To: gentoo-commits

commit:     ef714a6eff72dec7f4ac2104694f29cdc695db9d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 18 17:27:26 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 18 17:27:26 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ef714a6e

egencache: unicode_literals for TextIOWrapper

---
 bin/egencache |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 87673a0..797105c 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -2,7 +2,8 @@
 # Copyright 2009-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from __future__ import print_function
+# unicode_literals for compat with TextIOWrapper in Python 2
+from __future__ import print_function, unicode_literals
 
 import platform
 import signal
@@ -524,14 +525,14 @@ class GenUseLocalDesc(object):
 				encoding=_encodings['fs'], errors='strict'),
 				mode='a', encoding=_encodings['repo.content'],
 				errors='backslashreplace')
-			output.write(_unicode_decode('\n'))
+			output.write('\n')
 		else:
-			output.write(textwrap.dedent(_unicode_decode('''\
+			output.write(textwrap.dedent('''\
 				# This file is deprecated as per GLEP 56 in favor of metadata.xml. Please add
 				# your descriptions to your package's metadata.xml ONLY.
 				# * generated automatically using egencache *
 
-				''')))
+				'''))
 
 		# The cmp function no longer exists in python3, so we'll
 		# implement our own here under a slightly different name
@@ -616,8 +617,7 @@ class GenUseLocalDesc(object):
 								resatoms = sorted(reskeys, key=cmp_sort_key(atomcmp))
 								resdesc = resdict[reskeys[resatoms[-1]]]
 
-						output.write(_unicode_decode(
-							'%s:%s - %s\n' % (cp, flag, resdesc)))
+						output.write('%s:%s - %s\n' % (cp, flag, resdesc))
 
 		output.close()
 
@@ -714,12 +714,12 @@ class GenChangeLogs(object):
 			self.returncode |= 2
 			return
 
-		output.write(textwrap.dedent(_unicode_decode('''\
+		output.write(textwrap.dedent('''\
 			# ChangeLog for %s
 			# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
 			# $Header: $
 
-			''' % (cp, time.strftime('%Y')))))
+			''' % (cp, time.strftime('%Y'))))
 
 		# now grab all the commits
 		commits = self.grab(['git', 'rev-list', 'HEAD', '--', '.']).split()
@@ -783,11 +783,10 @@ class GenChangeLogs(object):
 			# Reverse the sort order for headers.
 			for c in reversed(changed):
 				if c.startswith('+') and c.endswith('.ebuild'):
-					output.write(_unicode_decode(
-						'*%s (%s)\n' % (c[1:-7], date)))
+					output.write('*%s (%s)\n' % (c[1:-7], date))
 					wroteheader = True
 			if wroteheader:
-				output.write(_unicode_decode('\n'))
+				output.write('\n')
 
 			# strip '<cp>: ', '[<cp>] ', and similar
 			body[0] = re.sub(r'^\W*' + re.escape(cp) + r'\W+', '', body[0])
@@ -807,13 +806,12 @@ class GenChangeLogs(object):
 
 			# don't break filenames on hyphens
 			self._wrapper.break_on_hyphens = False
-			output.write(_unicode_decode(
-				self._wrapper.fill(
-				'%s; %s %s:' % (date, author, ', '.join(changed)))))
+			output.write(self._wrapper.fill(
+				'%s; %s %s:' % (date, author, ', '.join(changed))))
 			# but feel free to break commit messages there
 			self._wrapper.break_on_hyphens = True
-			output.write(_unicode_decode(
-				'\n%s\n\n' % '\n'.join(self._wrapper.fill(x) for x in body)))
+			output.write(
+				'\n%s\n\n' % '\n'.join(self._wrapper.fill(x) for x in body))
 
 		output.close()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-19  6:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-19  6:40 UTC (permalink / raw
  To: gentoo-commits

commit:     5ffdeee2e2cc7738cc4d9280d8758addf463c560
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 19 06:40:11 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 19 06:40:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5ffdeee2

glsa-check: explicit imports, fix glsaconfig ref

---
 bin/glsa-check |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index b2da90a..f1aef04 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -13,7 +13,7 @@ sys.path.insert(0, pym_path)
 import portage
 portage._internal_caller = True
 from portage import os
-from portage.output import *
+from portage.output import green, red, nocolor, white
 
 from optparse import OptionGroup, OptionParser
 
@@ -100,7 +100,8 @@ elif mode == "list" and not params:
 	params.append("new")
 
 # delay this for speed increase
-from portage.glsa import *
+from portage.glsa import (Glsa, GlsaTypeException, GlsaFormatException,
+	get_applied_glsas, get_glsa_list)
 
 eroot = portage.settings['EROOT']
 vardb = portage.db[eroot]["vartree"].dbapi
@@ -225,7 +226,7 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 					# using emerge for the actual merging as it contains the dependency
 					# code and we want to be consistent in behaviour. Also this functionality
 					# will be integrated in emerge later, so it shouldn't hurt much.
-					emergecmd = "emerge --oneshot " + glsaconfig["EMERGE_OPTS"] + " =" + pkg
+					emergecmd = "emerge --oneshot " + " =" + pkg
 					if verbose:
 						sys.stderr.write(emergecmd+"\n")
 					exitcode = os.system(emergecmd)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-20 15:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-20 15:43 UTC (permalink / raw
  To: gentoo-commits

commit:     2247df0227c7c3a1b36126c870bc122aa2cf3785
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 20 15:42:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 20 15:42:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2247df02

repoman: fix TypeError: must be char, not unicode

---
 bin/repoman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 11f2b13..bfa8d7d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1084,7 +1084,7 @@ def parsedate(s):
 	m = month_map.get(b)
 	if m is None:
 		return None
-	m = str(m).rjust(2, '0')
+	m = "%02d" % m
 
 	return time.strptime(':'.join((Y, m, d, H_M_S)), '%Y:%m:%d:%H:%M:%S')
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-25 22:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-25 22:35 UTC (permalink / raw
  To: gentoo-commits

commit:     dcd23891682e74a4a3383720e0b08d21dbe5979d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 25 22:35:29 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 25 22:35:29 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dcd23891

Tweak die message for fail-clean, bug #454050.

---
 bin/isolated-functions.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 246c25f..1f8a27e 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -219,7 +219,8 @@ die() {
 
 	if [[ -n ${PORTAGE_LOG_FILE} ]] ; then
 		eerror "The complete build log is located at '${PORTAGE_LOG_FILE}'."
-		if [[ ${PORTAGE_LOG_FILE} != ${T}/* ]] ; then
+		if [[ ${PORTAGE_LOG_FILE} != ${T}/* ]] && \
+			! has fail-clean ${FEATURES} ; then
 			# Display path to symlink in ${T}, as requested in bug #412865.
 			local log_ext=log
 			[[ ${PORTAGE_LOG_FILE} != *.log ]] && log_ext+=.${PORTAGE_LOG_FILE##*.}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-01-27 21:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-01-27 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     8170e9c06501572c9fb01356059a179493b18438
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 27 21:26:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 27 21:26:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8170e9c0

repoman: remove obsolete RMD160 requirement

---
 bin/repoman |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index bfa8d7d..58d4f23 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -646,19 +646,6 @@ if options.mode in ("commit", "fix", "manifest"):
 			logging.error(line)
 		sys.exit(1)
 
-if "commit" == options.mode and \
-	repo_config.name == "gentoo" and \
-	"RMD160" in manifest_hashes and \
-	"RMD160" not in portage.checksum.hashorigin_map:
-	msg = "Please install " \
-	"pycrypto or enable python's ssl USE flag in order " \
-	"to enable RMD160 hash support. See bug #198398 for " \
-	"more information."
-	prefix = bad(" * ")
-	for line in textwrap.wrap(msg, 70):
-		print(prefix + line)
-	sys.exit(1)
-
 if options.echangelog is None and repo_config.update_changelog:
 	options.echangelog = 'y'
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-03  5:52 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-02-03  5:52 UTC (permalink / raw
  To: gentoo-commits

commit:     5652fecb44e99221f446c6ac7088d4f0da53c623
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  3 05:52:11 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb  3 05:52:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5652fecb

install_qa_check: use #k rather than %k with scanelf

No need to use `sed` to remove the string when scanelf itself supports it.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/misc-functions.sh |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 5fd0eab..ddd9179 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -191,8 +191,7 @@ install_qa_check() {
 		[[ "${FFLAGS}" == *-frecord-gcc-switches* ]] && \
 		[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] ; then
 		rm -f "${T}"/scanelf-ignored-CFLAGS.log
-		for x in $(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | \
-			sed -e "s:\!.GCC.command.line ::") ; do
+		for x in $(scanelf -qyRF '#k%p' -k '!.GCC.command.line' "${ED}") ; do
 			# Separate out file types that are known to support
 			# .GCC.command.line sections, using the `file` command
 			# similar to how prepstrip uses it.
@@ -398,7 +397,7 @@ install_qa_check() {
 		# Check for files built without respecting LDFLAGS
 		if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && \
 			! has binchecks ${RESTRICT} ; then
-			f=$(scanelf -qyRF '%k %p' -k .hash "${ED}" | sed -e "s:\.hash ::")
+			f=$(scanelf -qyRF '#k%p' -k .hash "${ED}")
 			if [[ -n ${f} ]] ; then
 				echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log
 				if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-04 17:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-02-04 17:53 UTC (permalink / raw
  To: gentoo-commits

commit:     2a90b77f1606f4ab7b829672c87cba29670410e3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  4 17:53:22 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  4 17:53:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a90b77f

econf: preserve configure timestamp, bug #440304

---
 bin/phase-helpers.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 383f9ff..7426229 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -439,8 +439,13 @@ econf() {
 	if [ -x "${ECONF_SOURCE}/configure" ]; then
 		if [[ -n $CONFIG_SHELL && \
 			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
-			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
+			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" "$ECONF_SOURCE/configure" > \
+				"$ECONF_SOURCE/configure._portage_tmp_.$$" || \
 				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
+			# preserve timestamp, see bug #440304
+			touch -r "$ECONF_SOURCE/configure" "$ECONF_SOURCE/configure._portage_tmp_.$$" || die
+			mv "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
+			chmod +x "$ECONF_SOURCE/configure" || die
 		fi
 		if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
 			find "${WORKDIR}" -type f '(' \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-05  8:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-02-05  8:39 UTC (permalink / raw
  To: gentoo-commits

commit:     75b469eace9a0dbd5187cb78531ed064ec29a461
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  5 08:39:30 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  5 08:39:30 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=75b469ea

econf: teak timestamp preservation

Use the sed -i so we can keep the same inode, avoiding potential issues
with loss of file metadata.

---
 bin/phase-helpers.sh |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 7426229..d278dd6 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -439,13 +439,12 @@ econf() {
 	if [ -x "${ECONF_SOURCE}/configure" ]; then
 		if [[ -n $CONFIG_SHELL && \
 			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
-			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" "$ECONF_SOURCE/configure" > \
-				"$ECONF_SOURCE/configure._portage_tmp_.$$" || \
-				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
 			# preserve timestamp, see bug #440304
 			touch -r "$ECONF_SOURCE/configure" "$ECONF_SOURCE/configure._portage_tmp_.$$" || die
-			mv "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
-			chmod +x "$ECONF_SOURCE/configure" || die
+			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
+				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
+			touch -r "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
+			rm -f "$ECONF_SOURCE/configure._portage_tmp_.$$"
 		fi
 		if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
 			find "${WORKDIR}" -type f '(' \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-11  7:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-02-11  7:20 UTC (permalink / raw
  To: gentoo-commits

commit:     75690c9a815b7d8526388efda36037736b6143ba
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 11 07:19:51 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 11 07:19:51 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=75690c9a

Check lib*/udev/rules.d for bug #455606.

---
 bin/misc-functions.sh |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index f23545e..b2b9e35 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -248,16 +248,17 @@ install_qa_check() {
 		eqawarn "$f"
 	fi
 
-	if [[ -d ${ED}/etc/udev/rules.d ]] ; then
-		f=
-		for x in $(ls "${ED}/etc/udev/rules.d") ; do
-			f+="  etc/udev/rules.d/$x\n"
-		done
-		if [[ -n $f ]] ; then
-			eqawarn "QA Notice: udev rules should be installed in /lib/udev/rules.d:"
-			eqawarn
-			eqawarn "$f"
-		fi
+	set +f
+	f=
+	for x in "${ED}etc/udev/rules.d/"* "${ED}lib"*"/udev/rules.d/"* ; do
+		[[ -e ${x} ]] || continue
+		[[ ${x} == ${ED}lib/udev/rules.d/* ]] && continue
+		f+="  ${x#${ED}}\n"
+	done
+	if [[ -n $f ]] ; then
+		eqawarn "QA Notice: udev rules should be installed in /lib/udev/rules.d:"
+		eqawarn
+		eqawarn "$f"
 	fi
 
 	# Now we look for all world writable files.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-14  5:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-02-14  5:33 UTC (permalink / raw
  To: gentoo-commits

commit:     75e23508033925701d86966f1cc97d4647cdfdb5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 14 05:32:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 14 05:32:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=75e23508

repoman: warn if not FEATURES=sign, bug #457034

---
 bin/repoman |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c1bb357..270b86f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -609,6 +609,17 @@ if repo_config.sign_commit:
 sign_manifests = "sign" in repoman_settings.features and \
 	repo_config.sign_manifest
 
+if repo_config.sign_manifest and repo_config.name == "gentoo" and \
+	options.mode in ("commit",) and not sign_manifests:
+	msg = ("The '%s' repository has manifest signatures enabled, "
+	"but FEATURES=sign is currently disabled. In order to avoid this "
+	"warning, enable FEATURES=sign in make.conf. Alternatively, "
+	"repositories can disable manifest signatures by setting "
+	"'sign-manifests = false' in metadata/layout.conf.") % \
+	(repo_config.name,)
+	for line in textwrap.wrap(msg, 60):
+		logging.warn(line)
+
 if sign_manifests and options.mode in ("commit",) and \
 	repoman_settings.get("PORTAGE_GPG_KEY") and \
 	re.match(r'^%s$' % GPG_KEY_ID_REGEX,


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-14 16:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-02-14 16:47 UTC (permalink / raw
  To: gentoo-commits

commit:     e62aa344cba45aca2f317ecaae025ed4240659fd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 14 16:47:41 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 14 16:47:41 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e62aa344

EXTRA_ECONF: support quoted args, bug #457136

---
 bin/phase-helpers.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ac1c076..4812db3 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -494,6 +494,9 @@ econf() {
 			set -- --libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")" "$@"
 		fi
 
+		# Handle arguments containing quoted whitespace (see bug #457136).
+		eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
+
 		set -- \
 			--prefix="${EPREFIX}"/usr \
 			${CBUILD:+--build=${CBUILD}} \
@@ -505,7 +508,7 @@ econf() {
 			--sysconfdir="${EPREFIX}"/etc \
 			--localstatedir="${EPREFIX}"/var/lib \
 			"$@" \
-			${EXTRA_ECONF}
+			"${EXTRA_ECONF[@]}"
 		__vecho "${ECONF_SOURCE}/configure" "$@"
 
 		if ! "${ECONF_SOURCE}/configure" "$@" ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-17 22:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-02-17 22:53 UTC (permalink / raw
  To: gentoo-commits

commit:     f8ab2bb9ee83798c58e4d3fb31f34cce3479f120
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 17 22:53:03 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 17 22:53:03 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f8ab2bb9

portageq: fix 'Unicode equal comparison failed'

---
 bin/portageq |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 826c92d..212949e 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -891,7 +891,7 @@ def usage(argv):
 	# Show our commands -- we do this by scanning the functions in this
 	# file, and formatting each functions documentation.
 	#
-	help_mode = '--help' in sys.argv
+	help_mode = '--help' in argv
 	for name in commands:
 		# Drop non-functions
 		obj = globals()[name]
@@ -905,12 +905,12 @@ def usage(argv):
 
 		lines = doc.lstrip("\n").split("\n")
 		print("   " + name + " " + lines[0].strip())
-		if (len(sys.argv) > 1):
+		if len(argv) > 1:
 			if (not help_mode):
 				lines = lines[:-1]
 			for line in lines[1:]:
 				print("      " + line.strip())
-	if (len(sys.argv) == 1):
+	if len(argv) == 1:
 		print("\nRun portageq with --help for info")
 
 atom_validate_strict = "EBUILD_PHASE" in os.environ
@@ -929,39 +929,42 @@ else:
 	def elog(elog_funcname, lines):
 		pass
 
-def main():
+def main(argv):
+
+	if argv and isinstance(argv[0], bytes):
+		argv = [portage._unicode_decode(x) for x in argv]
 
 	nocolor = os.environ.get('NOCOLOR')
 	if nocolor in ('yes', 'true'):
 		portage.output.nocolor()
 
-	if len(sys.argv) < 2:
-		usage(sys.argv)
+	if len(argv) < 2:
+		usage(argv)
 		sys.exit(os.EX_USAGE)
 
-	for x in sys.argv:
+	for x in argv:
 		if x in ("-h", "--help"):
-			usage(sys.argv)
+			usage(argv)
 			sys.exit(os.EX_OK)
 		elif x == "--version":
 			print("Portage", portage.VERSION)
 			sys.exit(os.EX_OK)
 
-	cmd = sys.argv[1]
+	cmd = argv[1]
 	function = globals().get(cmd)
 	if function is None or cmd not in commands:
-		usage(sys.argv)
+		usage(argv)
 		sys.exit(os.EX_USAGE)
 	function = globals()[cmd]
-	uses_eroot = getattr(function, "uses_eroot", False) and len(sys.argv) > 2
+	uses_eroot = getattr(function, "uses_eroot", False) and len(argv) > 2
 	if uses_eroot:
-		if not os.path.isdir(sys.argv[2]):
-			sys.stderr.write("Not a directory: '%s'\n" % sys.argv[2])
+		if not os.path.isdir(argv[2]):
+			sys.stderr.write("Not a directory: '%s'\n" % argv[2])
 			sys.stderr.write("Run portageq with --help for info\n")
 			sys.stderr.flush()
 			sys.exit(os.EX_USAGE)
 		eprefix = portage.const.EPREFIX
-		eroot = portage.util.normalize_path(sys.argv[2])
+		eroot = portage.util.normalize_path(argv[2])
 
 		if eprefix:
 			if not eroot.endswith(eprefix):
@@ -977,10 +980,7 @@ def main():
 
 		os.environ["ROOT"] = root
 
-	args = sys.argv[2:]
-	if args and isinstance(args[0], bytes):
-		for i in range(len(args)):
-			args[i] = portage._unicode_decode(args[i])
+	args = argv[2:]
 
 	try:
 		if uses_eroot:
@@ -1004,6 +1004,6 @@ def main():
 		portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
 		sys.exit(1)
 
-main()
+main(sys.argv)
 
 #-----------------------------------------------------------------------------


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-02-18  2:09 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-02-18  2:09 UTC (permalink / raw
  To: gentoo-commits

commit:     328dfc62a7f1252d8c940a4c267345b2b6aa7a53
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 18 02:02:09 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 18 02:02:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=328dfc62

repoman: clean up style in a lot of places

Shouldn't be any functional changes in here.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/repoman |  449 +++++++++++++++++++++++++++++------------------------------
 1 files changed, 222 insertions(+), 227 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 270b86f..a77b5de 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -120,10 +120,10 @@ def exithandler(signum=None, frame=None):
 	else:
 		sys.exit(128 + signum)
 
-signal.signal(signal.SIGINT,exithandler)
+signal.signal(signal.SIGINT, exithandler)
 
 class RepomanHelpFormatter(optparse.IndentedHelpFormatter):
-	"""Repoman needs it's own HelpFormatter for now, because the default ones
+	"""Repoman needs its own HelpFormatter for now, because the default ones
 	murder the help text."""
 
 	def __init__(self, indent_increment=1, max_help_position=24, width=150, short_first=1):
@@ -179,7 +179,7 @@ def ParseArgs(argv, qahelp):
 	parser.description = green(" ".join((os.path.basename(argv[0]), "1.2")))
 	parser.description += "\nCopyright 1999-2007 Gentoo Foundation"
 	parser.description += "\nDistributed under the terms of the GNU General Public License v2"
-	parser.description += "\nmodes: " + " | ".join(map(green,mode_keys))
+	parser.description += "\nmodes: " + " | ".join(map(green, mode_keys))
 
 	parser.add_option('-a', '--ask', dest='ask', action='store_true', default=False,
 		help='Request a confirmation before commiting')
@@ -300,86 +300,86 @@ def ParseArgs(argv, qahelp):
 
 	return (opts, args)
 
-qahelp={
-	"CVS/Entries.IO_error":"Attempting to commit, and an IO error was encountered access the Entries file",
-	"ebuild.invalidname":"Ebuild files with a non-parseable or syntactically incorrect name (or using 2.1 versioning extensions)",
-	"ebuild.namenomatch":"Ebuild files that do not have the same name as their parent directory",
-	"changelog.ebuildadded":"An ebuild was added but the ChangeLog was not modified",
-	"changelog.missing":"Missing ChangeLog files",
-	"ebuild.notadded":"Ebuilds that exist but have not been added to cvs",
-	"ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety",
-	"changelog.notadded":"ChangeLogs that exist but have not been added to cvs",
+qahelp = {
+	"CVS/Entries.IO_error": "Attempting to commit, and an IO error was encountered access the Entries file",
+	"ebuild.invalidname": "Ebuild files with a non-parseable or syntactically incorrect name (or using 2.1 versioning extensions)",
+	"ebuild.namenomatch": "Ebuild files that do not have the same name as their parent directory",
+	"changelog.ebuildadded": "An ebuild was added but the ChangeLog was not modified",
+	"changelog.missing": "Missing ChangeLog files",
+	"ebuild.notadded": "Ebuilds that exist but have not been added to cvs",
+	"ebuild.patches": "PATCHES variable should be a bash array to ensure white space safety",
+	"changelog.notadded": "ChangeLogs that exist but have not been added to cvs",
 	"dependency.bad": "User-visible ebuilds with unsatisfied dependencies (matched against *visible* ebuilds)",
 	"dependency.badmasked": "Masked ebuilds with unsatisfied dependencies (matched against *all* ebuilds)",
 	"dependency.badindev": "User-visible ebuilds with unsatisfied dependencies (matched against *visible* ebuilds) in developing arch",
 	"dependency.badmaskedindev": "Masked ebuilds with unsatisfied dependencies (matched against *all* ebuilds) in developing arch",
 	"dependency.badtilde": "Uses the ~ dep operator with a non-zero revision part, which is useless (the revision is ignored)",
 	"dependency.syntax": "Syntax error in dependency string (usually an extra/missing space/parenthesis)",
-	"dependency.unknown" : "Ebuild has a dependency that refers to an unknown package (which may be valid if it is a blocker for a renamed/removed package, or is an alternative choice provided by an overlay)",
-	"file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the executable bit",
-	"file.size":"Files in the files directory must be under 20 KiB",
-	"file.size.fatal":"Files in the files directory must be under 60 KiB",
-	"file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars,
-	"file.UTF8":"File is not UTF8 compliant",
-	"inherit.deprecated":"Ebuild inherits a deprecated eclass",
-	"inherit.missing":"Ebuild uses functions from an eclass but does not inherit it",
-	"inherit.unused":"Ebuild inherits an eclass but does not use it",
-	"java.eclassesnotused":"With virtual/jdk in DEPEND you must inherit a java eclass",
-	"wxwidgets.eclassnotused":"Ebuild DEPENDs on x11-libs/wxGTK without inheriting wxwidgets.eclass",
-	"KEYWORDS.dropped":"Ebuilds that appear to have dropped KEYWORDS for some arch",
-	"KEYWORDS.missing":"Ebuilds that have a missing or empty KEYWORDS variable",
-	"KEYWORDS.stable":"Ebuilds that have been added directly with stable KEYWORDS",
-	"KEYWORDS.stupid":"Ebuilds that use KEYWORDS=-* instead of package.mask",
-	"LICENSE.missing":"Ebuilds that have a missing or empty LICENSE variable",
-	"LICENSE.virtual":"Virtuals that have a non-empty LICENSE variable",
-	"DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
-	"DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
-	"EAPI.definition":"EAPI definition does not conform to PMS section 7.3.1 (first non-comment, non-blank line)",
-	"EAPI.deprecated":"Ebuilds that use features that are deprecated in the current EAPI",
-	"EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
-	"EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
-	"SLOT.invalid":"Ebuilds that have a missing or invalid SLOT variable value",
-	"HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable",
-	"HOMEPAGE.virtual":"Virtuals that have a non-empty HOMEPAGE variable",
-	"PDEPEND.suspect":"PDEPEND contains a package that usually only belongs in DEPEND.",
-	"LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)",
-	"PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)",
-	"PROPERTIES.syntax":"Syntax error in PROPERTIES (usually an extra/missing space/parenthesis)",
-	"RESTRICT.syntax":"Syntax error in RESTRICT (usually an extra/missing space/parenthesis)",
-	"REQUIRED_USE.syntax":"Syntax error in REQUIRED_USE (usually an extra/missing space/parenthesis)",
-	"SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)",
-	"SRC_URI.mirror":"A uri listed in profiles/thirdpartymirrors is found in SRC_URI",
-	"ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error or digest verification failure",
-	"ebuild.output":"A simple sourcing of the ebuild produces output; this breaks ebuild policy.",
-	"ebuild.nesteddie":"Placing 'die' inside ( ) prints an error, but doesn't stop the ebuild.",
-	"variable.invalidchar":"A variable contains an invalid character that is not part of the ASCII character set",
-	"variable.readonly":"Assigning a readonly variable",
-	"variable.usedwithhelpers":"Ebuild uses D, ROOT, ED, EROOT or EPREFIX with helpers",
-	"LIVEVCS.stable":"This ebuild is a live checkout from a VCS but has stable keywords.",
-	"LIVEVCS.unmasked":"This ebuild is a live checkout from a VCS but has keywords and is not masked in the global package.mask.",
-	"IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or its metadata.xml file",
-	"IUSE.missing":"This ebuild has a USE conditional which references a flag that is not listed in IUSE",
-	"LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
-	"LICENSE.deprecated":"This ebuild is listing a deprecated license.",
-	"KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
-	"RDEPEND.implicit":"RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND assignment (prior to EAPI 4)",
-	"RDEPEND.suspect":"RDEPEND contains a package that usually only belongs in DEPEND.",
-	"RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.",
-	"digest.assumed":"Existing digest must be assumed correct (Package level only)",
-	"digest.missing":"Some files listed in SRC_URI aren't referenced in the Manifest",
-	"digest.unused":"Some files listed in the Manifest aren't referenced in SRC_URI",
-	"ebuild.majorsyn":"This ebuild has a major syntax error that may cause the ebuild to fail partially or fully",
-	"ebuild.minorsyn":"This ebuild has a minor syntax error that contravenes gentoo coding style",
-	"ebuild.badheader":"This ebuild has a malformed header",
-	"manifest.bad":"Manifest has missing or incorrect digests",
-	"metadata.missing":"Missing metadata.xml files",
-	"metadata.bad":"Bad metadata.xml files",
-	"metadata.warning":"Warnings in metadata.xml files",
-	"portage.internal":"The ebuild uses an internal Portage function or variable",
-	"virtual.oldstyle":"The ebuild PROVIDEs an old-style virtual (see GLEP 37)",
-	"virtual.suspect":"Ebuild contains a package that usually should be pulled via virtual/, not directly.",
-	"usage.obsolete":"The ebuild makes use of an obsolete construct",
-	"upstream.workaround":"The ebuild works around an upstream bug, an upstream bug should be filed and tracked in bugs.gentoo.org"
+	"dependency.unknown": "Ebuild has a dependency that refers to an unknown package (which may be valid if it is a blocker for a renamed/removed package, or is an alternative choice provided by an overlay)",
+	"file.executable": "Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the executable bit",
+	"file.size": "Files in the files directory must be under 20 KiB",
+	"file.size.fatal": "Files in the files directory must be under 60 KiB",
+	"file.name": "File/dir name must be composed of only the following chars: %s " % allowed_filename_chars,
+	"file.UTF8": "File is not UTF8 compliant",
+	"inherit.deprecated": "Ebuild inherits a deprecated eclass",
+	"inherit.missing": "Ebuild uses functions from an eclass but does not inherit it",
+	"inherit.unused": "Ebuild inherits an eclass but does not use it",
+	"java.eclassesnotused": "With virtual/jdk in DEPEND you must inherit a java eclass",
+	"wxwidgets.eclassnotused": "Ebuild DEPENDs on x11-libs/wxGTK without inheriting wxwidgets.eclass",
+	"KEYWORDS.dropped": "Ebuilds that appear to have dropped KEYWORDS for some arch",
+	"KEYWORDS.missing": "Ebuilds that have a missing or empty KEYWORDS variable",
+	"KEYWORDS.stable": "Ebuilds that have been added directly with stable KEYWORDS",
+	"KEYWORDS.stupid": "Ebuilds that use KEYWORDS=-* instead of package.mask",
+	"LICENSE.missing": "Ebuilds that have a missing or empty LICENSE variable",
+	"LICENSE.virtual": "Virtuals that have a non-empty LICENSE variable",
+	"DESCRIPTION.missing": "Ebuilds that have a missing or empty DESCRIPTION variable",
+	"DESCRIPTION.toolong": "DESCRIPTION is over %d characters" % max_desc_len,
+	"EAPI.definition": "EAPI definition does not conform to PMS section 7.3.1 (first non-comment, non-blank line)",
+	"EAPI.deprecated": "Ebuilds that use features that are deprecated in the current EAPI",
+	"EAPI.incompatible": "Ebuilds that use features that are only available with a different EAPI",
+	"EAPI.unsupported": "Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
+	"SLOT.invalid": "Ebuilds that have a missing or invalid SLOT variable value",
+	"HOMEPAGE.missing": "Ebuilds that have a missing or empty HOMEPAGE variable",
+	"HOMEPAGE.virtual": "Virtuals that have a non-empty HOMEPAGE variable",
+	"PDEPEND.suspect": "PDEPEND contains a package that usually only belongs in DEPEND.",
+	"LICENSE.syntax": "Syntax error in LICENSE (usually an extra/missing space/parenthesis)",
+	"PROVIDE.syntax": "Syntax error in PROVIDE (usually an extra/missing space/parenthesis)",
+	"PROPERTIES.syntax": "Syntax error in PROPERTIES (usually an extra/missing space/parenthesis)",
+	"RESTRICT.syntax": "Syntax error in RESTRICT (usually an extra/missing space/parenthesis)",
+	"REQUIRED_USE.syntax": "Syntax error in REQUIRED_USE (usually an extra/missing space/parenthesis)",
+	"SRC_URI.syntax": "Syntax error in SRC_URI (usually an extra/missing space/parenthesis)",
+	"SRC_URI.mirror": "A uri listed in profiles/thirdpartymirrors is found in SRC_URI",
+	"ebuild.syntax": "Error generating cache entry for ebuild; typically caused by ebuild syntax error or digest verification failure",
+	"ebuild.output": "A simple sourcing of the ebuild produces output; this breaks ebuild policy.",
+	"ebuild.nesteddie": "Placing 'die' inside ( ) prints an error, but doesn't stop the ebuild.",
+	"variable.invalidchar": "A variable contains an invalid character that is not part of the ASCII character set",
+	"variable.readonly": "Assigning a readonly variable",
+	"variable.usedwithhelpers": "Ebuild uses D, ROOT, ED, EROOT or EPREFIX with helpers",
+	"LIVEVCS.stable": "This ebuild is a live checkout from a VCS but has stable keywords.",
+	"LIVEVCS.unmasked": "This ebuild is a live checkout from a VCS but has keywords and is not masked in the global package.mask.",
+	"IUSE.invalid": "This ebuild has a variable in IUSE that is not in the use.desc or its metadata.xml file",
+	"IUSE.missing": "This ebuild has a USE conditional which references a flag that is not listed in IUSE",
+	"LICENSE.invalid": "This ebuild is listing a license that doesnt exist in portages license/ dir.",
+	"LICENSE.deprecated": "This ebuild is listing a deprecated license.",
+	"KEYWORDS.invalid": "This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
+	"RDEPEND.implicit": "RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND assignment (prior to EAPI 4)",
+	"RDEPEND.suspect": "RDEPEND contains a package that usually only belongs in DEPEND.",
+	"RESTRICT.invalid": "This ebuild contains invalid RESTRICT values.",
+	"digest.assumed": "Existing digest must be assumed correct (Package level only)",
+	"digest.missing": "Some files listed in SRC_URI aren't referenced in the Manifest",
+	"digest.unused": "Some files listed in the Manifest aren't referenced in SRC_URI",
+	"ebuild.majorsyn": "This ebuild has a major syntax error that may cause the ebuild to fail partially or fully",
+	"ebuild.minorsyn": "This ebuild has a minor syntax error that contravenes gentoo coding style",
+	"ebuild.badheader": "This ebuild has a malformed header",
+	"manifest.bad": "Manifest has missing or incorrect digests",
+	"metadata.missing": "Missing metadata.xml files",
+	"metadata.bad": "Bad metadata.xml files",
+	"metadata.warning": "Warnings in metadata.xml files",
+	"portage.internal": "The ebuild uses an internal Portage function or variable",
+	"virtual.oldstyle": "The ebuild PROVIDEs an old-style virtual (see GLEP 37)",
+	"virtual.suspect": "Ebuild contains a package that usually should be pulled via virtual/, not directly.",
+	"usage.obsolete": "The ebuild makes use of an obsolete construct",
+	"upstream.workaround": "The ebuild works around an upstream bug, an upstream bug should be filed and tracked in bugs.gentoo.org"
 }
 
 qacats = list(qahelp)
@@ -436,7 +436,7 @@ missingvars = ["KEYWORDS", "LICENSE", "DESCRIPTION", "HOMEPAGE"]
 allvars = set(x for x in portage.auxdbkeys if not x.startswith("UNUSED_"))
 allvars.update(Package.metadata_keys)
 allvars = sorted(allvars)
-commitmessage=None
+commitmessage = None
 for x in missingvars:
 	x += ".missing"
 	if x not in qacats:
@@ -513,7 +513,7 @@ metadata_dtd_uri = 'http://www.gentoo.org/dtd/metadata.dtd'
 metadata_dtd_ctime_interval = 60 * 60 * 24 * 7 # 7 days
 
 # file.executable
-no_exec = frozenset(["Manifest","ChangeLog","metadata.xml"])
+no_exec = frozenset(["Manifest", "ChangeLog", "metadata.xml"])
 
 options, arguments = ParseArgs(sys.argv, qahelp)
 
@@ -716,7 +716,7 @@ repolevel = len(reposplit)
 # check if it's in $PORTDIR/$CATEGORY/$PN , otherwise bail if commiting.
 # Reason for this is if they're trying to commit in just $FILESDIR/*, the Manifest needs updating.
 # this check ensures that repoman knows where it is, and the manifest recommit is at least possible.
-if options.mode == 'commit' and repolevel not in [1,2,3]:
+if options.mode == 'commit' and repolevel not in [1, 2, 3]:
 	print(red("***")+" Commit attempts *must* be from within a vcs co, category, or package directory.")
 	print(red("***")+" Attempting to commit from a packages files directory will be blocked for instance.")
 	print(red("***")+" This is intended behaviour, to ensure the manifest is recommitted for a package.")
@@ -729,10 +729,10 @@ if repolevel == 1:
 	startdir = repodir
 else:
 	startdir = normalize_path(mydir)
-	startdir = os.path.join(repodir, *startdir.split(os.sep)[-2-repolevel+3:])
+	startdir = os.path.join(repodir, *startdir.split(os.sep)[-2 - repolevel + 3:])
 
 def caterror(mycat):
-	err(mycat+" is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
+	err(mycat + " is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add " + catdir + " to " + repodir + "/profiles/categories\nif it is a new category.")
 
 def repoman_getstatusoutput(cmd):
 	"""
@@ -860,18 +860,18 @@ for path in portdb.porttrees:
 				continue
 			if len(arch) != 3:
 				err("wrong format: \"" + bad(x.strip()) + "\" in " + \
-					desc_path + " line %d" % (i+1, ))
+					desc_path + " line %d" % (i + 1, ))
 			elif arch[0] not in kwlist:
 				err("invalid arch: \"" + bad(arch[0]) + "\" in " + \
-					desc_path + " line %d" % (i+1, ))
+					desc_path + " line %d" % (i + 1, ))
 			elif arch[2] not in valid_profile_types:
 				err("invalid profile type: \"" + bad(arch[2]) + "\" in " + \
-					desc_path + " line %d" % (i+1, ))
+					desc_path + " line %d" % (i + 1, ))
 			profile_desc = ProfileDesc(arch[0], arch[2], arch[1], path)
 			if not os.path.isdir(profile_desc.abs_path):
 				logging.error(
 					"Invalid %s profile (%s) for arch %s in %s line %d",
-					arch[2], arch[1], arch[0], desc_path, i+1)
+					arch[2], arch[1], arch[0], desc_path, i + 1)
 				continue
 			if os.path.exists(
 				os.path.join(profile_desc.abs_path, 'deprecated')):
@@ -918,9 +918,9 @@ for x in repoman_settings.archlist():
 	if x[0] == "~":
 		continue
 	if x not in profiles:
-		print(red("\""+x+"\" doesn't have a valid profile listed in profiles.desc."))
+		print(red("\"" + x + "\" doesn't have a valid profile listed in profiles.desc."))
 		print(red("You need to either \"cvs update\" your profiles dir or follow this"))
-		print(red("up with the "+x+" team."))
+		print(red("up with the " + x + " team."))
 		print()
 
 liclist_deprecated = set()
@@ -940,34 +940,34 @@ if not uselist:
 	logging.fatal("Couldn't find use.desc?")
 	sys.exit(1)
 
-scanlist=[]
-if repolevel==2:
-	#we are inside a category directory
-	catdir=reposplit[-1]
+scanlist = []
+if repolevel == 2:
+	# we are inside a category directory
+	catdir = reposplit[-1]
 	if catdir not in categories:
 		caterror(catdir)
-	mydirlist=os.listdir(startdir)
+	mydirlist = os.listdir(startdir)
 	for x in mydirlist:
 		if x == "CVS" or x.startswith("."):
 			continue
-		if os.path.isdir(startdir+"/"+x):
-			scanlist.append(catdir+"/"+x)
+		if os.path.isdir(startdir + "/" + x):
+			scanlist.append(catdir + "/" + x)
 	repo_subdir = catdir + os.sep
-elif repolevel==1:
+elif repolevel == 1:
 	for x in categories:
-		if not os.path.isdir(startdir+"/"+x):
+		if not os.path.isdir(startdir + "/" + x):
 			continue
-		for y in os.listdir(startdir+"/"+x):
+		for y in os.listdir(startdir + "/" + x):
 			if y == "CVS" or y.startswith("."):
 				continue
-			if os.path.isdir(startdir+"/"+x+"/"+y):
-				scanlist.append(x+"/"+y)
+			if os.path.isdir(startdir + "/" + x + "/" + y):
+				scanlist.append(x + "/" + y)
 	repo_subdir = ""
-elif repolevel==3:
+elif repolevel == 3:
 	catdir = reposplit[-2]
 	if catdir not in categories:
 		caterror(catdir)
-	scanlist.append(catdir+"/"+reposplit[-1])
+	scanlist.append(catdir + "/" + reposplit[-1])
 	repo_subdir = scanlist[-1] + os.sep
 else:
 	msg = 'Repoman is unable to determine PORTDIR or PORTDIR_OVERLAY' + \
@@ -999,7 +999,7 @@ def vcs_files_to_cps(vcs_file_iter):
 		if category in categories:
 			for filename in vcs_file_iter:
 				f_split = filename.split(os.sep)
-				# ['.', pn,...]
+				# ['.', pn, ...]
 				if len(f_split) > 2:
 					modified_cps.append(category + "/" + f_split[1])
 
@@ -1007,7 +1007,7 @@ def vcs_files_to_cps(vcs_file_iter):
 		# repolevel == 1
 		for filename in vcs_file_iter:
 			f_split = filename.split(os.sep)
-			# ['.', category, pn,...]
+			# ['.', category, pn, ...]
 			if len(f_split) > 3 and f_split[1] in categories:
 				modified_cps.append("/".join(f_split[1:3]))
 
@@ -1049,12 +1049,12 @@ def dev_keywords(profiles):
 
 dev_keywords = dev_keywords(profiles)
 
-stats={}
-fails={}
+stats = {}
+fails = {}
 
 for x in qacats:
-	stats[x]=0
-	fails[x]=[]
+	stats[x] = 0
+	fails[x] = []
 
 xmllint_capable = False
 metadata_dtd = os.path.join(repoman_settings["DISTDIR"], 'metadata.dtd')
@@ -1160,14 +1160,14 @@ if options.mode == "manifest":
 	pass
 elif not find_binary('xmllint'):
 	print(red("!!! xmllint not found. Can't check metadata.xml.\n"))
-	if options.xml_parse or repolevel==3:
+	if options.xml_parse or repolevel == 3:
 		print(red("!!!")+" sorry, xmllint is needed.  failing\n")
 		sys.exit(1)
 else:
 	if not fetch_metadata_dtd():
 		sys.exit(1)
-	#this can be problematic if xmllint changes their output
-	xmllint_capable=True
+	# this can be problematic if xmllint changes their output
+	xmllint_capable = True
 
 if options.mode == 'commit' and vcs:
 	utilities.detect_vcs_conflicts(options, vcs)
@@ -1196,10 +1196,10 @@ if vcs == "cvs":
 elif vcs == "svn":
 	with repoman_popen("svn status") as f:
 		svnstatus = f.readlines()
-	mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ]
-	mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ]
+	mychanged = ["./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR"]
+	mynew     = ["./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A")]
 	if options.if_modified == "y":
-		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
+		myremoved = ["./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
 
 elif vcs == "git":
 	with repoman_popen("git diff-index --name-only "
@@ -1220,10 +1220,10 @@ elif vcs == "git":
 elif vcs == "bzr":
 	with repoman_popen("bzr status -S .") as f:
 		bzrstatus = f.readlines()
-	mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
-	mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "NK" or elem[0:1] == "R" ) ]
+	mychanged = ["./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M"]
+	mynew     = ["./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and (elem[1:2] == "NK" or elem[0:1] == "R")]
 	if options.if_modified == "y":
-		myremoved = [ "./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "K" or elem[0:1] == "R" ) ]
+		myremoved = ["./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
 
 elif vcs == "hg":
 	with repoman_popen("hg status --no-status --modified .") as f:
@@ -1255,7 +1255,7 @@ dofail = 0
 
 # NOTE: match-all caches are not shared due to potential
 # differences between profiles in _get_implicit_iuse.
-arch_caches={}
+arch_caches = {}
 arch_xmatch_caches = {}
 shared_xmatch_caches = {"cp-list":{}}
 
@@ -1300,9 +1300,9 @@ for x in effective_scanlist:
 	logging.info("checking package %s" % x)
 	# save memory by discarding xmatch caches from previous package(s)
 	arch_xmatch_caches.clear()
-	eadded=[]
-	catdir,pkgdir=x.split("/")
-	checkdir=repodir+"/"+x
+	eadded = []
+	catdir, pkgdir = x.split("/")
+	checkdir = repodir + "/" + x
 	checkdir_relative = ""
 	if repolevel < 3:
 		checkdir_relative = os.path.join(pkgdir, checkdir_relative)
@@ -1384,8 +1384,8 @@ for x in effective_scanlist:
 	if options.mode == 'manifest-check':
 		continue
 
-	checkdirlist=os.listdir(checkdir)
-	ebuildlist=[]
+	checkdirlist = os.listdir(checkdir)
+	ebuildlist = []
 	pkgs = {}
 	allvalid = True
 	for y in checkdirlist:
@@ -1456,7 +1456,7 @@ for x in effective_scanlist:
 				encoding=_encodings['fs'], errors='strict'),
 				mode='r', encoding=_encodings['repo.content'])
 			for l in f:
-				line +=1
+				line += 1
 		except UnicodeDecodeError as ue:
 			stats["file.UTF8"] += 1
 			s = ue.object[:ue.start]
@@ -1486,7 +1486,7 @@ for x in effective_scanlist:
 	if vcs in ("cvs", "svn", "bzr") and check_ebuild_notadded:
 		try:
 			if vcs == "cvs":
-				myf=open(checkdir+"/CVS/Entries","r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 			if vcs == "svn":
 				myf = repoman_popen("svn status --depth=files --verbose " +
 					portage._shell_quote(checkdir))
@@ -1497,12 +1497,12 @@ for x in effective_scanlist:
 			myf.close()
 			for l in myl:
 				if vcs == "cvs":
-					if l[0]!="/":
+					if l[0] != "/":
 						continue
-					splitl=l[1:].split("/")
+					splitl = l[1:].split("/")
 					if not len(splitl):
 						continue
-					if splitl[0][-7:]==".ebuild":
+					if splitl[0][-7:] == ".ebuild":
 						eadded.append(splitl[0][:-7])
 				if vcs == "svn":
 					if l[:1] == "?":
@@ -1522,7 +1522,7 @@ for x in effective_scanlist:
 			if vcs == "svn":
 				myf = repoman_popen("svn status " +
 					portage._shell_quote(checkdir))
-				myl=myf.readlines()
+				myl = myf.readlines()
 				myf.close()
 				for l in myl:
 					if l[0] == "A":
@@ -1532,7 +1532,7 @@ for x in effective_scanlist:
 		except IOError:
 			if vcs == "cvs":
 				stats["CVS/Entries.IO_error"] += 1
-				fails["CVS/Entries.IO_error"].append(checkdir+"/CVS/Entries")
+				fails["CVS/Entries.IO_error"].append(checkdir + "/CVS/Entries")
 			else:
 				raise
 			continue
@@ -1540,7 +1540,7 @@ for x in effective_scanlist:
 	mf = repoman_settings.repositories.get_repo_for_location(
 		os.path.dirname(os.path.dirname(checkdir)))
 	mf = mf.load_manifest(checkdir, repoman_settings["DISTDIR"])
-	mydigests=mf.getTypeDigests("DIST")
+	mydigests = mf.getTypeDigests("DIST")
 
 	fetchlist_dict = portage.FetchlistDict(checkdir, repoman_settings, portdb)
 	myfiles_all = []
@@ -1556,7 +1556,7 @@ for x in effective_scanlist:
 				# This will be reported as an "ebuild.syntax" error.
 				pass
 			else:
-				stats["SRC_URI.syntax"] = stats["SRC_URI.syntax"] + 1
+				stats["SRC_URI.syntax"] += 1
 				fails["SRC_URI.syntax"].append(
 					"%s.ebuild SRC_URI: %s" % (mykey, e))
 	del fetchlist_dict
@@ -1570,15 +1570,15 @@ for x in effective_scanlist:
 		for entry in mydigests:
 			if entry not in myfiles_all:
 				stats["digest.unused"] += 1
-				fails["digest.unused"].append(checkdir+"::"+entry)
+				fails["digest.unused"].append(checkdir + "::" + entry)
 		for entry in myfiles_all:
 			if entry not in mydigests:
 				stats["digest.missing"] += 1
-				fails["digest.missing"].append(checkdir+"::"+entry)
+				fails["digest.missing"].append(checkdir + "::" + entry)
 	del myfiles_all
 
-	if os.path.exists(checkdir+"/files"):
-		filesdirlist=os.listdir(checkdir+"/files")
+	if os.path.exists(checkdir + "/files"):
+		filesdirlist = os.listdir(checkdir + "/files")
 
 		# recurse through files directory
 		# use filesdirlist as a stack, appending directories as needed so people can't hide > 20k files in a subdirectory.
@@ -1598,18 +1598,18 @@ for x in effective_scanlist:
 				# !!! VCS "portability" alert!  Need some function isVcsDir() or alike !!!
 				if y == "CVS" or y == ".svn":
 					continue
-				for z in os.listdir(checkdir+"/files/"+y):
+				for z in os.listdir(checkdir + "/files/" + y):
 					if z == "CVS" or z == ".svn":
 						continue
-					filesdirlist.append(y+"/"+z)
+					filesdirlist.append(y + "/" + z)
 			# Current policy is no files over 20 KiB, these are the checks. File size between
 			# 20 KiB and 60 KiB causes a warning, while file size over 60 KiB causes an error.
 			elif mystat.st_size > 61440:
 				stats["file.size.fatal"] += 1
-				fails["file.size.fatal"].append("("+ str(mystat.st_size//1024) + " KiB) "+x+"/files/"+y)
+				fails["file.size.fatal"].append("(" + str(mystat.st_size//1024) + " KiB) " + x + "/files/" + y)
 			elif mystat.st_size > 20480:
 				stats["file.size"] += 1
-				fails["file.size"].append("("+ str(mystat.st_size//1024) + " KiB) "+x+"/files/"+y)
+				fails["file.size"].append("(" + str(mystat.st_size//1024) + " KiB) " + x + "/files/" + y)
 
 			index = repo_config.find_invalid_path_char(y)
 			if index != -1:
@@ -1627,15 +1627,15 @@ for x in effective_scanlist:
 	del mydigests
 
 	if check_changelog and "ChangeLog" not in checkdirlist:
-		stats["changelog.missing"]+=1
-		fails["changelog.missing"].append(x+"/ChangeLog")
+		stats["changelog.missing"] += 1
+		fails["changelog.missing"].append(x + "/ChangeLog")
 
 	musedict = {}
-	#metadata.xml file check
+	# metadata.xml file check
 	if "metadata.xml" not in checkdirlist:
-		stats["metadata.missing"]+=1
-		fails["metadata.missing"].append(x+"/metadata.xml")
-	#metadata.xml parse check
+		stats["metadata.missing"] += 1
+		fails["metadata.missing"].append(x + "/metadata.xml")
+	# metadata.xml parse check
 	else:
 		metadata_bad = False
 
@@ -1696,9 +1696,9 @@ for x in effective_scanlist:
 			if st != os.EX_OK:
 				print(red("!!!") + " metadata.xml is invalid:")
 				for z in out.splitlines():
-					print(red("!!! ")+z)
-				stats["metadata.bad"]+=1
-				fails["metadata.bad"].append(x+"/metadata.xml")
+					print(red("!!! ") + z)
+				stats["metadata.bad"] += 1
+				fails["metadata.bad"].append(x + "/metadata.xml")
 
 		del metadata_bad
 	muselist = frozenset(musedict)
@@ -1725,19 +1725,19 @@ for x in effective_scanlist:
 
 		if vcs in ("cvs", "svn", "bzr") and check_ebuild_notadded and y not in eadded:
 			#ebuild not added to vcs
-			stats["ebuild.notadded"]=stats["ebuild.notadded"]+1
-			fails["ebuild.notadded"].append(x+"/"+y+".ebuild")
-		myesplit=portage.pkgsplit(y)
+			stats["ebuild.notadded"] += 1
+			fails["ebuild.notadded"].append(x + "/" + y + ".ebuild")
+		myesplit = portage.pkgsplit(y)
 		if myesplit is None or myesplit[0] != x.split("/")[-1] \
 			    or pv_toolong_re.search(myesplit[1]) \
 			    or pv_toolong_re.search(myesplit[2]):
-			stats["ebuild.invalidname"]=stats["ebuild.invalidname"]+1
-			fails["ebuild.invalidname"].append(x+"/"+y+".ebuild")
+			stats["ebuild.invalidname"] += 1
+			fails["ebuild.invalidname"].append(x + "/" + y + ".ebuild")
 			continue
-		elif myesplit[0]!=pkgdir:
-			print(pkgdir,myesplit[0])
-			stats["ebuild.namenomatch"]=stats["ebuild.namenomatch"]+1
-			fails["ebuild.namenomatch"].append(x+"/"+y+".ebuild")
+		elif myesplit[0] != pkgdir:
+			print(pkgdir, myesplit[0])
+			stats["ebuild.namenomatch"] += 1
+			fails["ebuild.namenomatch"].append(x + "/" + y + ".ebuild")
 			continue
 
 		pkg = pkgs[y]
@@ -1746,7 +1746,7 @@ for x in effective_scanlist:
 			allvalid = False
 			for k, msgs in pkg.invalid.items():
 				for msg in msgs:
-					stats[k] = stats[k] + 1
+					stats[k] += 1
 					fails[k].append("%s: %s" % (relative_path, msg))
 			continue
 
@@ -1785,7 +1785,7 @@ for x in effective_scanlist:
 					(relative_path, mirror, new_uri))
 
 		if myaux.get("PROVIDE"):
-			stats["virtual.oldstyle"]+=1
+			stats["virtual.oldstyle"] += 1
 			fails["virtual.oldstyle"].append(relative_path)
 
 		for pos, missing_var in enumerate(missingvars):
@@ -1795,15 +1795,15 @@ for x in effective_scanlist:
 					continue
 				if live_ebuild and missing_var == "KEYWORDS":
 					continue
-				myqakey=missingvars[pos]+".missing"
-				stats[myqakey]=stats[myqakey]+1
-				fails[myqakey].append(x+"/"+y+".ebuild")
+				myqakey = missingvars[pos] + ".missing"
+				stats[myqakey] += 1
+				fails[myqakey].append(x + "/" + y + ".ebuild")
 
 		if catdir == "virtual":
 			for var in ("HOMEPAGE", "LICENSE"):
 				if myaux.get(var):
 					myqakey = var + ".virtual"
-					stats[myqakey] = stats[myqakey] + 1
+					stats[myqakey] += 1
 					fails[myqakey].append(relative_path)
 
 		# 14 is the length of DESCRIPTION=""
@@ -1853,7 +1853,7 @@ for x in effective_scanlist:
 					haskeyword = True
 			if not haskeyword:
 				stats["KEYWORDS.stupid"] += 1
-				fails["KEYWORDS.stupid"].append(x+"/"+y+".ebuild")
+				fails["KEYWORDS.stupid"].append(x + "/" + y + ".ebuild")
 
 		"""
 		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
@@ -1883,9 +1883,9 @@ for x in effective_scanlist:
 		else:
 			arches = set()
 			for keyword in keywords:
-				if (keyword[0]=="-"):
+				if keyword[0] == "-":
 					continue
-				elif (keyword[0]=="~"):
+				elif keyword[0] == "~":
 					arch = keyword[1:]
 					if arch == "*":
 						for expanded_arch in profiles:
@@ -1913,7 +1913,7 @@ for x in effective_scanlist:
 		baddepsyntax = False
 		badlicsyntax = False
 		badprovsyntax = False
-		catpkg = catdir+"/"+y
+		catpkg = catdir + "/" + y
 
 		inherited_java_eclass = "java-pkg-2" in inherited or \
 			"java-pkg-opt-2" in inherited
@@ -1927,7 +1927,7 @@ for x in effective_scanlist:
 			runtime = mytype in Package._runtime_keys
 			token_class = None
 			if mytype.endswith("DEPEND"):
-				token_class=portage.dep.Atom
+				token_class = portage.dep.Atom
 
 			try:
 				atoms = portage.dep.use_reduce(mydepstr, matchall=1, flat=True, \
@@ -1998,7 +1998,7 @@ for x in effective_scanlist:
 
 			type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
 
-		for m,b in zip(type_list, badsyntax):
+		for m, b in zip(type_list, badsyntax):
 			if m.endswith("DEPEND"):
 				qacat = "dependency.syntax"
 			else:
@@ -2024,7 +2024,7 @@ for x in effective_scanlist:
 				myuse.append(flag_name)
 
 		# uselist checks - metadata
-		for mypos in range(len(myuse)-1,-1,-1):
+		for mypos in range(len(myuse)-1, -1, -1):
 			if myuse[mypos] and (myuse[mypos] in muselist):
 				del myuse[mypos]
 
@@ -2037,8 +2037,8 @@ for x in effective_scanlist:
 					" '%s'") % (eapi, myflag))
 
 		for mypos in range(len(myuse)):
-			stats["IUSE.invalid"]=stats["IUSE.invalid"]+1
-			fails["IUSE.invalid"].append(x+"/"+y+".ebuild: %s" % myuse[mypos])
+			stats["IUSE.invalid"] += 1
+			fails["IUSE.invalid"].append(x + "/" + y + ".ebuild: %s" % myuse[mypos])
 
 		# license checks
 		if not badlicsyntax:
@@ -2051,10 +2051,10 @@ for x in effective_scanlist:
 				# Need to check for "||" manually as no portage
 				# function will remove it without removing values.
 				if lic not in liclist and lic != "||":
-					stats["LICENSE.invalid"]=stats["LICENSE.invalid"]+1
-					fails["LICENSE.invalid"].append(x+"/"+y+".ebuild: %s" % lic)
+					stats["LICENSE.invalid"] += 1
+					fails["LICENSE.invalid"].append(x + "/" + y + ".ebuild: %s" % lic)
 				elif lic in liclist_deprecated:
-					stats["LICENSE.deprecated"] = stats["LICENSE.deprecated"] + 1
+					stats["LICENSE.deprecated"] += 1
 					fails["LICENSE.deprecated"].append("%s: %s" % (relative_path, lic))
 
 		#keyword checks
@@ -2068,17 +2068,17 @@ for x in effective_scanlist:
 					myskey = myskey[1:]
 				if myskey not in kwlist:
 					stats["KEYWORDS.invalid"] += 1
-					fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s" % mykey)
+					fails["KEYWORDS.invalid"].append(x + "/" + y + ".ebuild: %s" % mykey)
 				elif myskey not in profiles:
 					stats["KEYWORDS.invalid"] += 1
-					fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s (profile invalid)" % mykey)
+					fails["KEYWORDS.invalid"].append(x + "/" + y + ".ebuild: %s (profile invalid)" % mykey)
 
 		#restrict checks
 		myrestrict = None
 		try:
 			myrestrict = portage.dep.use_reduce(myaux["RESTRICT"], matchall=1, flat=True)
 		except portage.exception.InvalidDependString as e:
-			stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1
+			stats["RESTRICT.syntax"] += 1
 			fails["RESTRICT.syntax"].append(
 				"%s: RESTRICT: %s" % (relative_path, e))
 			del e
@@ -2088,7 +2088,7 @@ for x in effective_scanlist:
 			if mybadrestrict:
 				stats["RESTRICT.invalid"] += len(mybadrestrict)
 				for mybad in mybadrestrict:
-					fails["RESTRICT.invalid"].append(x+"/"+y+".ebuild: %s" % mybad)
+					fails["RESTRICT.invalid"].append(x + "/" + y + ".ebuild: %s" % mybad)
 		#REQUIRED_USE check
 		required_use = myaux["REQUIRED_USE"]
 		if required_use:
@@ -2101,7 +2101,7 @@ for x in effective_scanlist:
 				portage.dep.check_required_use(required_use, (),
 					pkg.iuse.is_valid_flag, eapi=eapi)
 			except portage.exception.InvalidDependString as e:
-				stats["REQUIRED_USE.syntax"] = stats["REQUIRED_USE.syntax"] + 1
+				stats["REQUIRED_USE.syntax"] += 1
 				fails["REQUIRED_USE.syntax"].append(
 					"%s: REQUIRED_USE: %s" % (relative_path, e))
 				del e
@@ -2135,8 +2135,7 @@ for x in effective_scanlist:
 			continue
 
 		relevant_profiles = []
-		for keyword,arch,groups in arches:
-
+		for keyword, arch, groups in arches:
 			if arch not in profiles:
 				# A missing profile will create an error further down
 				# during the KEYWORDS verification.
@@ -2207,10 +2206,10 @@ for x in effective_scanlist:
 						if options.ignore_masked:
 							continue
 						#we are testing deps for a masked package; give it some lee-way
-						suffix="masked"
+						suffix = "masked"
 						matchmode = "minimum-all"
 					else:
-						suffix=""
+						suffix = ""
 						matchmode = "minimum-visible"
 
 					if not have_dev_keywords:
@@ -2218,7 +2217,7 @@ for x in effective_scanlist:
 							bool(dev_keywords.intersection(keywords))
 
 					if prof.status == "dev":
-						suffix=suffix+"indev"
+						suffix = suffix + "indev"
 
 					for mytype in Package._dep_keys:
 
@@ -2262,12 +2261,12 @@ for x in effective_scanlist:
 								#if we emptied out our list, continue:
 								if not atoms:
 									continue
-								stats[mykey]=stats[mykey]+1
+								stats[mykey] += 1
 								fails[mykey].append("%s: %s: %s(%s) %s" % \
 									(relative_path, mytype, keyword,
 									prof, repr(atoms)))
 						else:
-							stats[mykey]=stats[mykey]+1
+							stats[mykey] += 1
 							fails[mykey].append("%s: %s: %s(%s) %s" % \
 								(relative_path, mytype, keyword,
 								prof, repr(atoms)))
@@ -2296,11 +2295,11 @@ if options.if_modified == "y" and len(effective_scanlist) < 1:
 if options.mode == "manifest":
 	sys.exit(dofail)
 
-#dofail will be set to 1 if we have failed in at least one non-warning category
-dofail=0
-#dowarn will be set to 1 if we tripped any warnings
-dowarn=0
-#dofull will be set if we should print a "repoman full" informational message
+# dofail will be set to 1 if we have failed in at least one non-warning category
+dofail = 0
+# dowarn will be set to 1 if we tripped any warnings
+dowarn = 0
+# dofull will be set if we should print a "repoman full" informational message
 dofull = options.mode != 'full'
 
 for x in qacats:
@@ -2335,20 +2334,20 @@ del console_writer, f, style_file
 qa_output = qa_output.getvalue()
 qa_output = qa_output.splitlines(True)
 
-def grouplist(mylist,seperator="/"):
+def grouplist(mylist, seperator="/"):
 	"""(list,seperator="/") -- Takes a list of elements; groups them into
 	same initial element categories. Returns a dict of {base:[sublist]}
 	From: ["blah/foo","spork/spatula","blah/weee/splat"]
 	To:   {"blah":["foo","weee/splat"], "spork":["spatula"]}"""
-	mygroups={}
+	mygroups = {}
 	for x in mylist:
-		xs=x.split(seperator)
-		if xs[0]==".":
-			xs=xs[1:]
+		xs = x.split(seperator)
+		if xs[0] == ".":
+			xs = xs[1:]
 		if xs[0] not in mygroups:
-			mygroups[xs[0]]=[seperator.join(xs[1:])]
+			mygroups[xs[0]] = [seperator.join(xs[1:])]
 		else:
-			mygroups[xs[0]]+=[seperator.join(xs[1:])]
+			mygroups[xs[0]] += [seperator.join(xs[1:])]
 	return mygroups
 
 suggest_ignore_masked = False
@@ -2399,8 +2398,8 @@ else:
 	myunadded = []
 	if vcs == "cvs":
 		try:
-			myvcstree=portage.cvstree.getentries("./",recursive=1)
-			myunadded=portage.cvstree.findunadded(myvcstree,recursive=1,basedir="./")
+			myvcstree = portage.cvstree.getentries("./", recursive=1)
+			myunadded = portage.cvstree.findunadded(myvcstree, recursive=1, basedir="./")
 		except SystemExit as e:
 			raise  # TODO propagate this
 		except:
@@ -2409,7 +2408,7 @@ else:
 		try:
 			with repoman_popen("svn status --no-ignore") as f:
 				svnstatus = f.readlines()
-			myunadded = [ "./"+elem.rstrip().split()[1] for elem in svnstatus if elem.startswith("?") or elem.startswith("I") ]
+			myunadded = ["./" + elem.rstrip().split()[1] for elem in svnstatus if elem.startswith("?") or elem.startswith("I")]
 		except SystemExit as e:
 			raise  # TODO propagate this
 		except:
@@ -2417,13 +2416,13 @@ else:
 	if vcs == "git":
 		# get list of files not under version control or missing
 		myf = repoman_popen("git ls-files --others")
-		myunadded = [ "./" + elem[:-1] for elem in myf ]
+		myunadded = ["./" + elem[:-1] for elem in myf]
 		myf.close()
 	if vcs == "bzr":
 		try:
 			with repoman_popen("bzr status -S .") as f:
 				bzrstatus = f.readlines()
-			myunadded = [ "./"+elem.rstrip().split()[1].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("?") or elem[0:2] == " D" ]
+			myunadded = ["./" + elem.rstrip().split()[1].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("?") or elem[0:2] == " D"]
 		except SystemExit as e:
 			raise  # TODO propagate this
 		except:
@@ -2441,23 +2440,23 @@ else:
 		mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
 
 
-	myautoadd=[]
+	myautoadd = []
 	if myunadded:
-		for x in range(len(myunadded)-1,-1,-1):
-			xs=myunadded[x].split("/")
-			if xs[-1]=="files":
+		for x in range(len(myunadded)-1, -1, -1):
+			xs = myunadded[x].split("/")
+			if xs[-1] == "files":
 				print("!!! files dir is not added! Please correct this.")
 				sys.exit(-1)
-			elif xs[-1]=="Manifest":
+			elif xs[-1] == "Manifest":
 				# It's a manifest... auto add
-				myautoadd+=[myunadded[x]]
+				myautoadd += [myunadded[x]]
 				del myunadded[x]
 
 	if myunadded:
 		print(red("!!! The following files are in your local tree but are not added to the master"))
 		print(red("!!! tree. Please remove them from the local tree or add them to the master tree."))
 		for x in myunadded:
-			print("   ",x)
+			print("   ", x)
 		print()
 		print()
 		sys.exit(1)
@@ -2466,7 +2465,7 @@ else:
 		print(red("!!! The following files are removed manually from your local tree but are not"))
 		print(red("!!! removed from the repository. Please remove them, using \"hg remove [FILES]\"."))
 		for x in mydeleted:
-			print("   ",x)
+			print("   ", x)
 		print()
 		print()
 		sys.exit(1)
@@ -2475,18 +2474,17 @@ else:
 		mycvstree = cvstree.getentries("./", recursive=1)
 		mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
 		mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
-		myremoved=portage.cvstree.findremoved(mycvstree,recursive=1,basedir="./")
+		myremoved = portage.cvstree.findremoved(mycvstree, recursive=1, basedir="./")
 		bin_blob_pattern = re.compile("^-kb$")
 		no_expansion = set(portage.cvstree.findoption(mycvstree, bin_blob_pattern,
 			recursive=1, basedir="./"))
 
-
 	if vcs == "svn":
 		with repoman_popen("svn status") as f:
 			svnstatus = f.readlines()
-		mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if (elem[:1] in "MR" or elem[1:2] in "M")]
-		mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A")]
-		myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
+		mychanged = ["./" + elem.split()[-1:][0] for elem in svnstatus if (elem[:1] in "MR" or elem[1:2] in "M")]
+		mynew     = ["./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A")]
+		myremoved = ["./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D")]
 
 		# Subversion expands keywords specified in svn:keywords properties.
 		with repoman_popen("svn propget -R svn:keywords") as f:
@@ -2513,10 +2511,10 @@ else:
 	if vcs == "bzr":
 		with repoman_popen("bzr status -S .") as f:
 			bzrstatus = f.readlines()
-		mychanged = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M" ]
-		mynew     = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] in "NK" or elem[0:1] == "R" ) ]
-		myremoved = [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("-") ]
-		myremoved = [ "./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and ( elem[1:2] == "K" or elem[0:1] == "R" ) ]
+		mychanged = ["./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and elem[1:2] == "M"]
+		mynew     = ["./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem and (elem[1:2] in "NK" or elem[0:1] == "R")]
+		myremoved = ["./" + elem.split()[-1:][0].split('/')[-1:][0] for elem in bzrstatus if elem.startswith("-")]
+		myremoved = ["./" + elem.split()[-3:-2][0].split('/')[-1:][0] for elem in bzrstatus if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
 		# Bazaar expands nothing.
 
 	if vcs == "hg":
@@ -2835,7 +2833,7 @@ else:
 				gpgvars[k] = v
 		gpgcmd = portage.util.varexpand(gpgcmd, mydict=gpgvars)
 		if options.pretend:
-			print("("+gpgcmd+")")
+			print("(" + gpgcmd + ")")
 		else:
 			# Encode unicode manually for bug #310789.
 			gpgcmd = portage.util.shlex_split(gpgcmd)
@@ -2845,7 +2843,7 @@ else:
 					encoding=_encodings['fs'], errors='strict') for arg in gpgcmd]
 			rValue = subprocess.call(gpgcmd)
 			if rValue == os.EX_OK:
-				os.rename(filename+".asc", filename)
+				os.rename(filename + ".asc", filename)
 			else:
 				raise portage.exception.PortageException("!!! gpg exited with '" + str(rValue) + "' status")
 
@@ -2931,7 +2929,6 @@ else:
 				sys.exit(retval)
 
 	if True:
-
 		myfiles = mymanifests[:]
 		# If there are no header (SVN/CVS keywords) changes in
 		# the files, this Manifest commit must include the
@@ -2968,7 +2965,6 @@ else:
 			else:
 				retval = spawn(commit_cmd, env=os.environ)
 				if retval != os.EX_OK:
-
 					if repo_config.sign_commit and vcs == 'git' and \
 						not git_supports_gpg_sign():
 						# Inform user that newer git is needed (bug #403323).
@@ -2992,4 +2988,3 @@ else:
 		print("repoman was too scared by not seeing any familiar version control file that he forgot to commit anything")
 	print(green("RepoMan sez:"), "\"If everyone were like you, I'd be out of business!\"\n")
 sys.exit(0)
-


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-02  3:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-02  3:24 UTC (permalink / raw
  To: gentoo-commits

commit:     02db319dd7a3c5ca3f499e70f4ab922cc3c71717
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  2 03:23:47 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 03:23:47 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=02db319d

repoman: check metadata.xml doctype, bug #328113

---
 bin/repoman |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index a77b5de..07f0adc 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -508,6 +508,7 @@ suspect_virtual = {
 	"dev-libs/libusb-compat":"virtual/libusb",
 }
 
+metadata_doctype_name = 'pkgmetadata'
 metadata_dtd_uri = 'http://www.gentoo.org/dtd/metadata.dtd'
 # force refetch if the local copy creation time is older than this
 metadata_dtd_ctime_interval = 60 * 60 * 24 * 7 # 7 days
@@ -1278,8 +1279,12 @@ class _MetadataTreeBuilder(xml.etree.ElementTree.TreeBuilder):
 	Implements doctype() as required to avoid deprecation warnings with
 	>=python-2.7.
 	"""
+	def __init__(self, data):
+		xml.etree.ElementTree.TreeBuilder.__init__(self)
+		self._portage_data = data
+
 	def doctype(self, name, pubid, system):
-		pass
+		self._portage_data["DOCTYPE"] = (name, pubid, system)
 
 try:
 	herd_base = make_herd_base(os.path.join(repoman_settings["PORTDIR"], "metadata/herds.xml"))
@@ -1638,6 +1643,7 @@ for x in effective_scanlist:
 	# metadata.xml parse check
 	else:
 		metadata_bad = False
+		xml_info = {}
 
 		# read metadata.xml into memory
 		try:
@@ -1645,13 +1651,33 @@ for x in effective_scanlist:
 				_unicode_encode(os.path.join(checkdir, "metadata.xml"),
 				encoding=_encodings['fs'], errors='strict'),
 				parser=xml.etree.ElementTree.XMLParser(
-					target=_MetadataTreeBuilder()))
+					target=_MetadataTreeBuilder(xml_info)))
 		except (ExpatError, SyntaxError, EnvironmentError) as e:
 			metadata_bad = True
 			stats["metadata.bad"] += 1
 			fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
 			del e
 		else:
+			if "DOCTYPE" not in xml_info:
+				metadata_bad = True
+				stats["metadata.bad"] += 1
+				fails["metadata.bad"].append("%s/metadata.xml: %s" % (x,
+					"DOCTYPE is missing"))
+			else:
+				doctype_name, doctype_pubid, doctype_system = \
+					xml_info["DOCTYPE"]
+				if doctype_system != metadata_dtd_uri:
+					stats["metadata.bad"] += 1
+					fails["metadata.bad"].append("%s/metadata.xml: "
+						"DOCTYPE: SYSTEM should refer to '%s', not '%s'" %
+						(x, metadata_dtd_uri, doctype_system))
+
+				if doctype_name != metadata_doctype_name:
+					stats["metadata.bad"] += 1
+					fails["metadata.bad"].append("%s/metadata.xml: "
+						"DOCTYPE: name should be '%s', not '%s'" %
+						(x, metadata_doctype_name, doctype_name))
+
 			# load USE flags from metadata.xml
 			try:
 				musedict = utilities.parse_metadata_use(_metadata_xml)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-02  3:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-02  3:42 UTC (permalink / raw
  To: gentoo-commits

commit:     b25ce9b03c74eee0a10341f65c3219f77d177150
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  2 03:42:06 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 03:42:06 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b25ce9b0

repoman: fix separator variable name

---
 bin/repoman |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 07f0adc..19e8073 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2360,20 +2360,20 @@ del console_writer, f, style_file
 qa_output = qa_output.getvalue()
 qa_output = qa_output.splitlines(True)
 
-def grouplist(mylist, seperator="/"):
-	"""(list,seperator="/") -- Takes a list of elements; groups them into
+def grouplist(mylist, separator="/"):
+	"""(list,separator="/") -- Takes a list of elements; groups them into
 	same initial element categories. Returns a dict of {base:[sublist]}
 	From: ["blah/foo","spork/spatula","blah/weee/splat"]
 	To:   {"blah":["foo","weee/splat"], "spork":["spatula"]}"""
 	mygroups = {}
 	for x in mylist:
-		xs = x.split(seperator)
+		xs = x.split(separator)
 		if xs[0] == ".":
 			xs = xs[1:]
 		if xs[0] not in mygroups:
-			mygroups[xs[0]] = [seperator.join(xs[1:])]
+			mygroups[xs[0]] = [separator.join(xs[1:])]
 		else:
-			mygroups[xs[0]] += [seperator.join(xs[1:])]
+			mygroups[xs[0]] += [separator.join(xs[1:])]
 	return mygroups
 
 suggest_ignore_masked = False


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-02  3:44 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-02  3:44 UTC (permalink / raw
  To: gentoo-commits

commit:     7509930d67c24899a6bb41323048a3b9cd9011da
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  2 03:44:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 03:44:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7509930d

repoman: remove unused grouplist function

---
 bin/repoman |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 07f0adc..5c58bea 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2360,22 +2360,6 @@ del console_writer, f, style_file
 qa_output = qa_output.getvalue()
 qa_output = qa_output.splitlines(True)
 
-def grouplist(mylist, seperator="/"):
-	"""(list,seperator="/") -- Takes a list of elements; groups them into
-	same initial element categories. Returns a dict of {base:[sublist]}
-	From: ["blah/foo","spork/spatula","blah/weee/splat"]
-	To:   {"blah":["foo","weee/splat"], "spork":["spatula"]}"""
-	mygroups = {}
-	for x in mylist:
-		xs = x.split(seperator)
-		if xs[0] == ".":
-			xs = xs[1:]
-		if xs[0] not in mygroups:
-			mygroups[xs[0]] = [seperator.join(xs[1:])]
-		else:
-			mygroups[xs[0]] += [seperator.join(xs[1:])]
-	return mygroups
-
 suggest_ignore_masked = False
 suggest_include_dev = False
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-03  8:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-03  8:12 UTC (permalink / raw
  To: gentoo-commits

commit:     065e277f7b3c36b9da16d03962510feeda5a5d7a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  3 08:12:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar  3 08:12:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=065e277f

repoman: skip doctype check for python 2.6 or 3.1

---
 bin/repoman |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 5c58bea..5618cf1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1658,7 +1658,11 @@ for x in effective_scanlist:
 			fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
 			del e
 		else:
-			if "DOCTYPE" not in xml_info:
+			if sys.hexversion < 0x2070000 or \
+				(sys.hexversion > 0x3000000 and sys.hexversion < 0x3020000):
+				# doctype is not parsed with python 2.6 or 3.1
+				pass
+			elif "DOCTYPE" not in xml_info:
 				metadata_bad = True
 				stats["metadata.bad"] += 1
 				fails["metadata.bad"].append("%s/metadata.xml: %s" % (x,


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-03 17:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-03 17:59 UTC (permalink / raw
  To: gentoo-commits

commit:     9b2d0beb3200553380889395e296a6bf961dd0d3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  3 17:59:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar  3 17:59:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9b2d0beb

repoman: check metadata.xml xml decl, bug #328113

---
 bin/repoman |   93 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 71 insertions(+), 22 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 5618cf1..8c49c06 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -508,6 +508,9 @@ suspect_virtual = {
 	"dev-libs/libusb-compat":"virtual/libusb",
 }
 
+metadata_xml_encoding = 'UTF-8'
+metadata_xml_declaration = '<?xml version="1.0" encoding="%s"?>' % \
+	(metadata_xml_encoding,)
 metadata_doctype_name = 'pkgmetadata'
 metadata_dtd_uri = 'http://www.gentoo.org/dtd/metadata.dtd'
 # force refetch if the local copy creation time is older than this
@@ -1274,17 +1277,38 @@ for k, v in repoman_settings.thirdpartymirrors().items():
 			v += "/"
 		thirdpartymirrors[v] = k
 
+class _XMLParser(xml.etree.ElementTree.XMLParser):
+
+	def __init__(self, data, **kwargs):
+		xml.etree.ElementTree.XMLParser.__init__(self, **kwargs)
+		self._portage_data = data
+		if hasattr(self, 'parser'):
+			self._base_XmlDeclHandler = self.parser.XmlDeclHandler
+			self.parser.XmlDeclHandler = self._portage_XmlDeclHandler
+			self._base_StartDoctypeDeclHandler = \
+				self.parser.StartDoctypeDeclHandler
+			self.parser.StartDoctypeDeclHandler = \
+				self._portage_StartDoctypeDeclHandler
+
+	def _portage_XmlDeclHandler(self, version, encoding, standalone):
+		if self._base_XmlDeclHandler is not None:
+			self._base_XmlDeclHandler(version, encoding, standalone)
+		self._portage_data["XML_DECLARATION"] = (version, encoding, standalone)
+
+	def _portage_StartDoctypeDeclHandler(self, doctypeName, systemId, publicId,
+		has_internal_subset):
+		if self._base_StartDoctypeDeclHandler is not None:
+			self._base_StartDoctypeDeclHandler(doctypeName, systemId, publicId,
+				has_internal_subset)
+		self._portage_data["DOCTYPE"] = (doctypeName, systemId, publicId)
+
 class _MetadataTreeBuilder(xml.etree.ElementTree.TreeBuilder):
 	"""
 	Implements doctype() as required to avoid deprecation warnings with
 	>=python-2.7.
 	"""
-	def __init__(self, data):
-		xml.etree.ElementTree.TreeBuilder.__init__(self)
-		self._portage_data = data
-
 	def doctype(self, name, pubid, system):
-		self._portage_data["DOCTYPE"] = (name, pubid, system)
+		pass
 
 try:
 	herd_base = make_herd_base(os.path.join(repoman_settings["PORTDIR"], "metadata/herds.xml"))
@@ -1644,43 +1668,68 @@ for x in effective_scanlist:
 	else:
 		metadata_bad = False
 		xml_info = {}
+		xml_parser = _XMLParser(xml_info, target=_MetadataTreeBuilder())
 
 		# read metadata.xml into memory
 		try:
 			_metadata_xml = xml.etree.ElementTree.parse(
 				_unicode_encode(os.path.join(checkdir, "metadata.xml"),
 				encoding=_encodings['fs'], errors='strict'),
-				parser=xml.etree.ElementTree.XMLParser(
-					target=_MetadataTreeBuilder(xml_info)))
+				parser=xml_parser)
 		except (ExpatError, SyntaxError, EnvironmentError) as e:
 			metadata_bad = True
 			stats["metadata.bad"] += 1
 			fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
 			del e
 		else:
-			if sys.hexversion < 0x2070000 or \
+			if not hasattr(xml_parser, 'parser') or \
+				sys.hexversion < 0x2070000 or \
 				(sys.hexversion > 0x3000000 and sys.hexversion < 0x3020000):
 				# doctype is not parsed with python 2.6 or 3.1
 				pass
-			elif "DOCTYPE" not in xml_info:
-				metadata_bad = True
-				stats["metadata.bad"] += 1
-				fails["metadata.bad"].append("%s/metadata.xml: %s" % (x,
-					"DOCTYPE is missing"))
 			else:
-				doctype_name, doctype_pubid, doctype_system = \
-					xml_info["DOCTYPE"]
-				if doctype_system != metadata_dtd_uri:
+				if "XML_DECLARATION" not in xml_info:
 					stats["metadata.bad"] += 1
 					fails["metadata.bad"].append("%s/metadata.xml: "
-						"DOCTYPE: SYSTEM should refer to '%s', not '%s'" %
-						(x, metadata_dtd_uri, doctype_system))
+						"xml declaration is missing on first line, "
+						"should be '%s'" % (x, metadata_xml_declaration))
+				else:
+					xml_version, xml_encoding, xml_standalone = \
+						xml_info["XML_DECLARATION"]
+					if xml_encoding is None or \
+						xml_encoding.upper() != metadata_xml_encoding:
+						stats["metadata.bad"] += 1
+						if xml_encoding is None:
+							encoding_problem = "but it is undefined"
+						else:
+							encoding_problem = "not '%s'" % xml_encoding
+						fails["metadata.bad"].append("%s/metadata.xml: "
+							"xml declaration encoding should be '%s', %s" %
+							(x, metadata_xml_encoding, encoding_problem))
 
-				if doctype_name != metadata_doctype_name:
+				if "DOCTYPE" not in xml_info:
+					metadata_bad = True
 					stats["metadata.bad"] += 1
-					fails["metadata.bad"].append("%s/metadata.xml: "
-						"DOCTYPE: name should be '%s', not '%s'" %
-						(x, metadata_doctype_name, doctype_name))
+					fails["metadata.bad"].append("%s/metadata.xml: %s" % (x,
+						"DOCTYPE is missing"))
+				else:
+					doctype_name, doctype_system, doctype_pubid = \
+						xml_info["DOCTYPE"]
+					if doctype_system != metadata_dtd_uri:
+						stats["metadata.bad"] += 1
+						if doctype_system is None:
+							system_problem = "but it is undefined"
+						else:
+							system_problem = "not '%s'" % doctype_system
+						fails["metadata.bad"].append("%s/metadata.xml: "
+							"DOCTYPE: SYSTEM should refer to '%s', %s" %
+							(x, metadata_dtd_uri, system_problem))
+
+					if doctype_name != metadata_doctype_name:
+						stats["metadata.bad"] += 1
+						fails["metadata.bad"].append("%s/metadata.xml: "
+							"DOCTYPE: name should be '%s', not '%s'" %
+							(x, metadata_doctype_name, doctype_name))
 
 			# load USE flags from metadata.xml
 			try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-06 22:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-06 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     b86a460dc7adb027a32e2dfdce73c6fe8d3d694d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  6 22:16:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar  6 22:16:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b86a460d

Clarify "Excessive files" QA die message.

---
 bin/misc-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ba4fb0f..18a5d55 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -650,7 +650,7 @@ install_qa_check() {
 		eqawarn "QA Notice: Excessive files found in the / partition"
 		eqawarn "${f}"
 		__vecho -ne '\n'
-		die "static archives (*.a) and libtool library files (*.la) do not belong in /"
+		die "static archives (*.a) and libtool library files (*.la) belong in /usr/lib*, not /lib*"
 	fi
 
 	# Verify that the libtool files don't contain bogus $D entries.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-09  7:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-09  7:53 UTC (permalink / raw
  To: gentoo-commits

commit:     754acf1df332b3e3bda1c140c6a4d22db78b167e
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 12 07:43:34 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  9 07:52:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=754acf1d

install_qa_check_prefix: drop removal of etc/{init,conf}.d files

This allows to use OpenRC on Prefix systems.

Signed-off-by: XU Benda <heroxbd <AT> gmail.com>

---
 bin/misc-functions.sh |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 18a5d55..ce3d681 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -882,16 +882,6 @@ install_qa_check_prefix() {
 	# all further checks rely on ${ED} existing
 	[[ -d ${ED} ]] || return
 
-	# this does not really belong here, but it's closely tied to
-	# the code below; many runscripts generate positives here, and we
-	# know they don't work (bug #196294) so as long as that one
-	# remains an issue, simply remove them as they won't work
-	# anyway, avoid etc/init.d/functions.sh from being thrown away
-	if [[ ( -d "${ED}"/etc/conf.d || -d "${ED}"/etc/init.d ) && ! -f "${ED}"/etc/init.d/functions.sh ]] ; then
-		ewarn "removed /etc/init.d and /etc/conf.d directories until bug #196294 has been resolved"
-		rm -Rf "${ED}"/etc/{conf,init}.d
-	fi
-
 	# check shebangs, bug #282539
 	rm -f "${T}"/non-prefix-shebangs-errs
 	local WHITELIST=" /usr/bin/env "


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-17 20:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-17 20:02 UTC (permalink / raw
  To: gentoo-commits

commit:     8c66242ffe35e7e55b940c908175630d08d0b516
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 17 20:02:17 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 17 20:02:42 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8c66242f

portageq: remove unused imports

---
 bin/portageq |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 212949e..48e7651 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -40,7 +40,6 @@ portage._internal_caller = True
 from portage import os
 from portage.eapi import eapi_has_repo_deps
 from portage.util import writemsg, writemsg_stdout
-from portage.output import colormap
 portage.proxy.lazyimport.lazyimport(globals(),
 	'subprocess',
 	'_emerge.Package:Package',
@@ -245,7 +244,6 @@ def owners(argv):
 		sys.stderr.flush()
 		return 2
 
-	from portage import catsplit, dblink
 	eroot = argv[0]
 	vardb = portage.db[eroot]["vartree"].dbapi
 	root = portage.settings['ROOT']


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-17 22:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-17 22:37 UTC (permalink / raw
  To: gentoo-commits

commit:     6523f38d467de86eb8f0a258fdff464d40d9ec38
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 17 22:36:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 17 22:36:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6523f38d

portageq: emulate subset of Pkgcore's pquery

Pkgcore pquery compatible options:

Repository matching options:
  --repo=REPO           repo to use (default is PORTDIR if omitted)
  --all-repos           search all repos

Package matching options:
  --herd=HERD           exact match on a herd
  --maintainer-email=MAINTAINER_EMAIL
                        comma-separated list of maintainer email regexes to
                        search for

Output formatting:
  -n, --no-version      collapse multiple matching versions together

---
 bin/portageq |  157 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 146 insertions(+), 11 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 48e7651..617d485 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -20,6 +20,7 @@ try:
 except KeyboardInterrupt:
 	sys.exit(128 + signal.SIGINT)
 
+import optparse
 import os
 import types
 
@@ -41,11 +42,13 @@ from portage import os
 from portage.eapi import eapi_has_repo_deps
 from portage.util import writemsg, writemsg_stdout
 portage.proxy.lazyimport.lazyimport(globals(),
+	're',
 	'subprocess',
 	'_emerge.Package:Package',
 	'_emerge.RootConfig:RootConfig',
 	'portage.dbapi._expand_new_virt:expand_new_virt',
 	'portage._sets.base:InternalPackageSet',
+	'portage.xml.metadata:MetaDataXML'
 )
 
 def eval_atom_use(atom):
@@ -874,11 +877,11 @@ list_preserved_libs.uses_eroot = True
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'pquery', 'usage'])
 commands = sorted(k for k, v in globals().items() \
 	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 
-def usage(argv):
+def usage(argv, parser=None, pquery_option_groups=None):
 	print(">>> Portage information query tool")
 	print(">>> %s" % portage.VERSION)
 	print(">>> Usage: portageq <command> [<option> ...]")
@@ -908,6 +911,15 @@ def usage(argv):
 				lines = lines[:-1]
 			for line in lines[1:]:
 				print("      " + line.strip())
+
+	if pquery_option_groups is not None:
+		parser.formatter.store_option_strings(parser)
+		print()
+		print('Pkgcore pquery compatible options:')
+		print()
+		for optgroup in pquery_option_groups:
+			print(optgroup.format_help(parser.formatter))
+
 	if len(argv) == 1:
 		print("\nRun portageq with --help for info")
 
@@ -927,6 +939,88 @@ else:
 	def elog(elog_funcname, lines):
 		pass
 
+class MaintainerEmailMatcher(object):
+	def __init__(self, maintainer_emails):
+		self._re = re.compile("^(%s)" % "|".join(maintainer_emails))
+
+	def __call__(self, metadata_xml):
+		match = False
+		matcher = self._re.match
+		for x in metadata_xml.maintainers():
+			if x.email is not None and matcher(x.email) is not None:
+				match = True
+				break
+		return match
+
+class HerdMatcher(object):
+	def __init__(self, herds):
+		self._herds = frozenset(herds)
+
+	def __call__(self, metadata_xml):
+		match = False
+		herds = self._herds
+		return any(x in herds for x in metadata_xml.herds())
+
+def pquery(parser, pquery_option_groups, opts, args):
+
+	xml_matchers = []
+	if opts.maintainer_email:
+		maintainer_emails = []
+		for x in opts.maintainer_email:
+			maintainer_emails.extend(x.split(","))
+		xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
+	if opts.herd is not None:
+		herds  = []
+		for x in opts.herd:
+			herds.extend(x.split(","))
+		xml_matchers.append(HerdMatcher(herds))
+
+	portdb = portage.db[portage.root]['porttree'].dbapi
+
+	repos = []
+	if opts.all_repos:
+		repos.extend(portdb.repositories.get_repo_for_location(location)
+			for location in portdb.porttrees)
+	elif opts.repo is not None:
+		repos.append(portdb.repositories[opts.repo])
+	else:
+		repos.append(portdb.repositories.mainRepo())
+
+	for category in sorted(portdb.categories):
+		for cp in portdb.cp_all(categories=(category,)):
+			matches = []
+			for repo in repos:
+				match = True
+				if xml_matchers:
+					metadata_xml_path = os.path.join(
+						repo.location, cp, 'metadata.xml')
+					try:
+						metadata_xml = MetaDataXML(metadata_xml_path, None)
+					except (EnvironmentError, SyntaxError):
+						match = False
+					else:
+						for matcher in xml_matchers:
+							if not matcher(metadata_xml):
+								match = False
+								break
+				if not match:
+					continue
+				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
+				matches.extend(cpv_list)
+
+			if not matches:
+				continue
+
+			if opts.no_version:
+				writemsg_stdout("%s\n" % (cp,), noiselevel=-1)
+			else:
+				matches = sorted(set(matches),
+					key=portage.versions.cpv_sort_key())
+				for cpv in matches:
+					writemsg_stdout("%s\n" % (cpv,), noiselevel=-1)
+
+	return os.EX_OK
+
 def main(argv):
 
 	if argv and isinstance(argv[0], bytes):
@@ -936,18 +1030,58 @@ def main(argv):
 	if nocolor in ('yes', 'true'):
 		portage.output.nocolor()
 
+	parser = optparse.OptionParser(add_help_option=False)
+	actions = optparse.OptionGroup(parser, 'Actions')
+	actions.add_option("-h", "--help", action="store_true")
+	actions.add_option("--version", action="store_true")
+	parser.add_option_group(actions)
+
+	pquery_option_groups = []
+
+	repo_optgroup = optparse.OptionGroup(parser,
+		'Repository matching options')
+	repo_optgroup.add_option("--repo", action="store",
+		help="repo to use (default is PORTDIR if omitted)")
+	repo_optgroup.add_option("--all-repos", action="store_true",
+		help="search all repos")
+	parser.add_option_group(repo_optgroup)
+	pquery_option_groups.append(repo_optgroup)
+
+	matching_optgroup = optparse.OptionGroup(parser,
+		'Package matching options')
+	matching_optgroup.add_option("--herd", action="append",
+		help="exact match on a herd")
+	matching_optgroup.add_option("--maintainer-email", action="append",
+		help="comma-separated list of maintainer email regexes to search for")
+	parser.add_option_group(matching_optgroup)
+	pquery_option_groups.append(matching_optgroup)
+
+	formatting_optgroup = optparse.OptionGroup(parser,
+		'Output formatting')
+	formatting_optgroup.add_option("-n", "--no-version", action="store_true",
+		help="collapse multiple matching versions together")
+	parser.add_option_group(formatting_optgroup)
+	pquery_option_groups.append(formatting_optgroup)
+
+	opts, args = parser.parse_args(argv[1:])
+
+	if opts.help:
+		usage(argv, parser=parser, pquery_option_groups=pquery_option_groups)
+		return os.EX_OK
+	elif opts.version:
+		print("Portage", portage.VERSION)
+		return os.EX_OK
+
+	if (opts.herd is not None or
+		opts.maintainer_email is not None):
+		return pquery(parser, pquery_option_groups, opts, args)
+
+	argv = argv[:1] + args
+
 	if len(argv) < 2:
 		usage(argv)
 		sys.exit(os.EX_USAGE)
 
-	for x in argv:
-		if x in ("-h", "--help"):
-			usage(argv)
-			sys.exit(os.EX_OK)
-		elif x == "--version":
-			print("Portage", portage.VERSION)
-			sys.exit(os.EX_OK)
-
 	cmd = argv[1]
 	function = globals().get(cmd)
 	if function is None or cmd not in commands:
@@ -1002,6 +1136,7 @@ def main(argv):
 		portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
 		sys.exit(1)
 
-main(sys.argv)
+if __name__ == '__main__':
+	sys.exit(main(sys.argv))
 
 #-----------------------------------------------------------------------------


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-17 22:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-17 22:38 UTC (permalink / raw
  To: gentoo-commits

commit:     5251fd64876bfbbfe5e98ac9340c7fadf6aa66c7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 17 22:36:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 17 22:38:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5251fd64

portageq: emulate subset of Pkgcore's pquery

Pkgcore pquery compatible options:

Repository matching options:
  --repo=REPO           repo to use (default is PORTDIR if omitted)
  --all-repos           search all repos

Package matching options:
  --herd=HERD           exact match on a herd
  --maintainer-email=MAINTAINER_EMAIL
                        comma-separated list of maintainer email regexes to
                        search for

Output formatting:
  -n, --no-version      collapse multiple matching versions together

---
 bin/portageq |  156 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 145 insertions(+), 11 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 48e7651..01edd15 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -20,6 +20,7 @@ try:
 except KeyboardInterrupt:
 	sys.exit(128 + signal.SIGINT)
 
+import optparse
 import os
 import types
 
@@ -41,11 +42,13 @@ from portage import os
 from portage.eapi import eapi_has_repo_deps
 from portage.util import writemsg, writemsg_stdout
 portage.proxy.lazyimport.lazyimport(globals(),
+	're',
 	'subprocess',
 	'_emerge.Package:Package',
 	'_emerge.RootConfig:RootConfig',
 	'portage.dbapi._expand_new_virt:expand_new_virt',
 	'portage._sets.base:InternalPackageSet',
+	'portage.xml.metadata:MetaDataXML'
 )
 
 def eval_atom_use(atom):
@@ -874,11 +877,11 @@ list_preserved_libs.uses_eroot = True
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'pquery', 'usage'])
 commands = sorted(k for k, v in globals().items() \
 	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 
-def usage(argv):
+def usage(argv, parser=None, pquery_option_groups=None):
 	print(">>> Portage information query tool")
 	print(">>> %s" % portage.VERSION)
 	print(">>> Usage: portageq <command> [<option> ...]")
@@ -908,6 +911,15 @@ def usage(argv):
 				lines = lines[:-1]
 			for line in lines[1:]:
 				print("      " + line.strip())
+
+	if pquery_option_groups is not None:
+		parser.formatter.store_option_strings(parser)
+		print()
+		print('Pkgcore pquery compatible options:')
+		print()
+		for optgroup in pquery_option_groups:
+			print(optgroup.format_help(parser.formatter))
+
 	if len(argv) == 1:
 		print("\nRun portageq with --help for info")
 
@@ -927,6 +939,87 @@ else:
 	def elog(elog_funcname, lines):
 		pass
 
+class MaintainerEmailMatcher(object):
+	def __init__(self, maintainer_emails):
+		self._re = re.compile("^(%s)" % "|".join(maintainer_emails))
+
+	def __call__(self, metadata_xml):
+		match = False
+		matcher = self._re.match
+		for x in metadata_xml.maintainers():
+			if x.email is not None and matcher(x.email) is not None:
+				match = True
+				break
+		return match
+
+class HerdMatcher(object):
+	def __init__(self, herds):
+		self._herds = frozenset(herds)
+
+	def __call__(self, metadata_xml):
+		herds = self._herds
+		return any(x in herds for x in metadata_xml.herds())
+
+def pquery(parser, pquery_option_groups, opts, args):
+
+	xml_matchers = []
+	if opts.maintainer_email:
+		maintainer_emails = []
+		for x in opts.maintainer_email:
+			maintainer_emails.extend(x.split(","))
+		xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
+	if opts.herd is not None:
+		herds  = []
+		for x in opts.herd:
+			herds.extend(x.split(","))
+		xml_matchers.append(HerdMatcher(herds))
+
+	portdb = portage.db[portage.root]['porttree'].dbapi
+
+	repos = []
+	if opts.all_repos:
+		repos.extend(portdb.repositories.get_repo_for_location(location)
+			for location in portdb.porttrees)
+	elif opts.repo is not None:
+		repos.append(portdb.repositories[opts.repo])
+	else:
+		repos.append(portdb.repositories.mainRepo())
+
+	for category in sorted(portdb.categories):
+		for cp in portdb.cp_all(categories=(category,)):
+			matches = []
+			for repo in repos:
+				match = True
+				if xml_matchers:
+					metadata_xml_path = os.path.join(
+						repo.location, cp, 'metadata.xml')
+					try:
+						metadata_xml = MetaDataXML(metadata_xml_path, None)
+					except (EnvironmentError, SyntaxError):
+						match = False
+					else:
+						for matcher in xml_matchers:
+							if not matcher(metadata_xml):
+								match = False
+								break
+				if not match:
+					continue
+				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
+				matches.extend(cpv_list)
+
+			if not matches:
+				continue
+
+			if opts.no_version:
+				writemsg_stdout("%s\n" % (cp,), noiselevel=-1)
+			else:
+				matches = sorted(set(matches),
+					key=portage.versions.cpv_sort_key())
+				for cpv in matches:
+					writemsg_stdout("%s\n" % (cpv,), noiselevel=-1)
+
+	return os.EX_OK
+
 def main(argv):
 
 	if argv and isinstance(argv[0], bytes):
@@ -936,18 +1029,58 @@ def main(argv):
 	if nocolor in ('yes', 'true'):
 		portage.output.nocolor()
 
+	parser = optparse.OptionParser(add_help_option=False)
+	actions = optparse.OptionGroup(parser, 'Actions')
+	actions.add_option("-h", "--help", action="store_true")
+	actions.add_option("--version", action="store_true")
+	parser.add_option_group(actions)
+
+	pquery_option_groups = []
+
+	repo_optgroup = optparse.OptionGroup(parser,
+		'Repository matching options')
+	repo_optgroup.add_option("--repo", action="store",
+		help="repo to use (default is PORTDIR if omitted)")
+	repo_optgroup.add_option("--all-repos", action="store_true",
+		help="search all repos")
+	parser.add_option_group(repo_optgroup)
+	pquery_option_groups.append(repo_optgroup)
+
+	matching_optgroup = optparse.OptionGroup(parser,
+		'Package matching options')
+	matching_optgroup.add_option("--herd", action="append",
+		help="exact match on a herd")
+	matching_optgroup.add_option("--maintainer-email", action="append",
+		help="comma-separated list of maintainer email regexes to search for")
+	parser.add_option_group(matching_optgroup)
+	pquery_option_groups.append(matching_optgroup)
+
+	formatting_optgroup = optparse.OptionGroup(parser,
+		'Output formatting')
+	formatting_optgroup.add_option("-n", "--no-version", action="store_true",
+		help="collapse multiple matching versions together")
+	parser.add_option_group(formatting_optgroup)
+	pquery_option_groups.append(formatting_optgroup)
+
+	opts, args = parser.parse_args(argv[1:])
+
+	if opts.help:
+		usage(argv, parser=parser, pquery_option_groups=pquery_option_groups)
+		return os.EX_OK
+	elif opts.version:
+		print("Portage", portage.VERSION)
+		return os.EX_OK
+
+	if (opts.herd is not None or
+		opts.maintainer_email is not None):
+		return pquery(parser, pquery_option_groups, opts, args)
+
+	argv = argv[:1] + args
+
 	if len(argv) < 2:
 		usage(argv)
 		sys.exit(os.EX_USAGE)
 
-	for x in argv:
-		if x in ("-h", "--help"):
-			usage(argv)
-			sys.exit(os.EX_OK)
-		elif x == "--version":
-			print("Portage", portage.VERSION)
-			sys.exit(os.EX_OK)
-
 	cmd = argv[1]
 	function = globals().get(cmd)
 	if function is None or cmd not in commands:
@@ -1002,6 +1135,7 @@ def main(argv):
 		portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
 		sys.exit(1)
 
-main(sys.argv)
+if __name__ == '__main__':
+	sys.exit(main(sys.argv))
 
 #-----------------------------------------------------------------------------


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-17 23:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-17 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     7aab4998882319e668bf48be2279dcbbec4022b9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 17 22:36:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 17 23:44:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7aab4998

portageq: emulate subset of Pkgcore's pquery

Pkgcore pquery compatible options:

Repository matching options:
  --repo=REPO           repo to use (default is PORTDIR if omitted)
  --all-repos           search all repos

Package matching options:
  --herd=HERD           exact match on a herd
  --maintainer-email=MAINTAINER_EMAIL
                        comma-separated list of maintainer email regexes to
                        search for

Output formatting:
  -n, --no-version      collapse multiple matching versions together

---
 bin/portageq |  156 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 145 insertions(+), 11 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 48e7651..d482772 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -20,6 +20,7 @@ try:
 except KeyboardInterrupt:
 	sys.exit(128 + signal.SIGINT)
 
+import optparse
 import os
 import types
 
@@ -41,11 +42,13 @@ from portage import os
 from portage.eapi import eapi_has_repo_deps
 from portage.util import writemsg, writemsg_stdout
 portage.proxy.lazyimport.lazyimport(globals(),
+	're',
 	'subprocess',
 	'_emerge.Package:Package',
 	'_emerge.RootConfig:RootConfig',
 	'portage.dbapi._expand_new_virt:expand_new_virt',
 	'portage._sets.base:InternalPackageSet',
+	'portage.xml.metadata:MetaDataXML'
 )
 
 def eval_atom_use(atom):
@@ -874,11 +877,11 @@ list_preserved_libs.uses_eroot = True
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'pquery', 'usage'])
 commands = sorted(k for k, v in globals().items() \
 	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 
-def usage(argv):
+def usage(argv, parser=None, pquery_option_groups=None):
 	print(">>> Portage information query tool")
 	print(">>> %s" % portage.VERSION)
 	print(">>> Usage: portageq <command> [<option> ...]")
@@ -908,6 +911,15 @@ def usage(argv):
 				lines = lines[:-1]
 			for line in lines[1:]:
 				print("      " + line.strip())
+
+	if pquery_option_groups is not None:
+		parser.formatter.store_option_strings(parser)
+		print()
+		print('Pkgcore pquery compatible options:')
+		print()
+		for optgroup in pquery_option_groups:
+			print(optgroup.format_help(parser.formatter))
+
 	if len(argv) == 1:
 		print("\nRun portageq with --help for info")
 
@@ -927,6 +939,87 @@ else:
 	def elog(elog_funcname, lines):
 		pass
 
+class MaintainerEmailMatcher(object):
+	def __init__(self, maintainer_emails):
+		self._re = re.compile("^(%s)$" % "|".join(maintainer_emails))
+
+	def __call__(self, metadata_xml):
+		match = False
+		matcher = self._re.match
+		for x in metadata_xml.maintainers():
+			if x.email is not None and matcher(x.email) is not None:
+				match = True
+				break
+		return match
+
+class HerdMatcher(object):
+	def __init__(self, herds):
+		self._herds = frozenset(herds)
+
+	def __call__(self, metadata_xml):
+		herds = self._herds
+		return any(x in herds for x in metadata_xml.herds())
+
+def pquery(parser, pquery_option_groups, opts, args):
+
+	xml_matchers = []
+	if opts.maintainer_email:
+		maintainer_emails = []
+		for x in opts.maintainer_email:
+			maintainer_emails.extend(x.split(","))
+		xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
+	if opts.herd is not None:
+		herds  = []
+		for x in opts.herd:
+			herds.extend(x.split(","))
+		xml_matchers.append(HerdMatcher(herds))
+
+	portdb = portage.db[portage.root]['porttree'].dbapi
+
+	repos = []
+	if opts.all_repos:
+		repos.extend(portdb.repositories.get_repo_for_location(location)
+			for location in portdb.porttrees)
+	elif opts.repo is not None:
+		repos.append(portdb.repositories[opts.repo])
+	else:
+		repos.append(portdb.repositories.mainRepo())
+
+	for category in sorted(portdb.categories):
+		for cp in portdb.cp_all(categories=(category,)):
+			matches = []
+			for repo in repos:
+				match = True
+				if xml_matchers:
+					metadata_xml_path = os.path.join(
+						repo.location, cp, 'metadata.xml')
+					try:
+						metadata_xml = MetaDataXML(metadata_xml_path, None)
+					except (EnvironmentError, SyntaxError):
+						match = False
+					else:
+						for matcher in xml_matchers:
+							if not matcher(metadata_xml):
+								match = False
+								break
+				if not match:
+					continue
+				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
+				matches.extend(cpv_list)
+
+			if not matches:
+				continue
+
+			if opts.no_version:
+				writemsg_stdout("%s\n" % (cp,), noiselevel=-1)
+			else:
+				matches = sorted(set(matches),
+					key=portage.versions.cpv_sort_key())
+				for cpv in matches:
+					writemsg_stdout("%s\n" % (cpv,), noiselevel=-1)
+
+	return os.EX_OK
+
 def main(argv):
 
 	if argv and isinstance(argv[0], bytes):
@@ -936,18 +1029,58 @@ def main(argv):
 	if nocolor in ('yes', 'true'):
 		portage.output.nocolor()
 
+	parser = optparse.OptionParser(add_help_option=False)
+	actions = optparse.OptionGroup(parser, 'Actions')
+	actions.add_option("-h", "--help", action="store_true")
+	actions.add_option("--version", action="store_true")
+	parser.add_option_group(actions)
+
+	pquery_option_groups = []
+
+	repo_optgroup = optparse.OptionGroup(parser,
+		'Repository matching options')
+	repo_optgroup.add_option("--repo", action="store",
+		help="repo to use (default is PORTDIR if omitted)")
+	repo_optgroup.add_option("--all-repos", action="store_true",
+		help="search all repos")
+	parser.add_option_group(repo_optgroup)
+	pquery_option_groups.append(repo_optgroup)
+
+	matching_optgroup = optparse.OptionGroup(parser,
+		'Package matching options')
+	matching_optgroup.add_option("--herd", action="append",
+		help="exact match on a herd")
+	matching_optgroup.add_option("--maintainer-email", action="append",
+		help="comma-separated list of maintainer email regexes to search for")
+	parser.add_option_group(matching_optgroup)
+	pquery_option_groups.append(matching_optgroup)
+
+	formatting_optgroup = optparse.OptionGroup(parser,
+		'Output formatting')
+	formatting_optgroup.add_option("-n", "--no-version", action="store_true",
+		help="collapse multiple matching versions together")
+	parser.add_option_group(formatting_optgroup)
+	pquery_option_groups.append(formatting_optgroup)
+
+	opts, args = parser.parse_args(argv[1:])
+
+	if opts.help:
+		usage(argv, parser=parser, pquery_option_groups=pquery_option_groups)
+		return os.EX_OK
+	elif opts.version:
+		print("Portage", portage.VERSION)
+		return os.EX_OK
+
+	if (opts.herd is not None or
+		opts.maintainer_email is not None):
+		return pquery(parser, pquery_option_groups, opts, args)
+
+	argv = argv[:1] + args
+
 	if len(argv) < 2:
 		usage(argv)
 		sys.exit(os.EX_USAGE)
 
-	for x in argv:
-		if x in ("-h", "--help"):
-			usage(argv)
-			sys.exit(os.EX_OK)
-		elif x == "--version":
-			print("Portage", portage.VERSION)
-			sys.exit(os.EX_OK)
-
 	cmd = argv[1]
 	function = globals().get(cmd)
 	if function is None or cmd not in commands:
@@ -1002,6 +1135,7 @@ def main(argv):
 		portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
 		sys.exit(1)
 
-main(sys.argv)
+if __name__ == '__main__':
+	sys.exit(main(sys.argv))
 
 #-----------------------------------------------------------------------------


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-18  6:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-18  6:27 UTC (permalink / raw
  To: gentoo-commits

commit:     994f497d524bd814471cf6bec4d0fb44938204d9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 06:26:53 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 06:26:53 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=994f497d

portageq: support atoms for pquery mode

---
 bin/portageq |   89 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 77 insertions(+), 12 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index d482772..f91ec81 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -46,6 +46,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 	'subprocess',
 	'_emerge.Package:Package',
 	'_emerge.RootConfig:RootConfig',
+	'_emerge.is_valid_package_atom:insert_category_into_atom',
 	'portage.dbapi._expand_new_virt:expand_new_virt',
 	'portage._sets.base:InternalPackageSet',
 	'portage.xml.metadata:MetaDataXML'
@@ -962,6 +963,40 @@ class HerdMatcher(object):
 
 def pquery(parser, pquery_option_groups, opts, args):
 
+	portdb = portage.db[portage.root]['porttree'].dbapi
+
+	need_metadata = False
+	extended_syntax = False
+	atoms = []
+	for arg in args:
+		if "/" not in arg.split(":")[0]:
+			atom = insert_category_into_atom(arg, '*')
+			if atom is None:
+				writemsg("ERROR: Invalid atom: '%s'\n" % arg,
+					noiselevel=-1)
+				return 2
+		else:
+			atom = arg
+
+		try:
+			atom = portage.dep.Atom(atom, allow_wildcard=True, allow_repo=True)
+		except portage.exception.InvalidAtom:
+			writemsg("ERROR: Invalid atom: '%s'\n" % arg,
+				noiselevel=-1)
+			return 2
+
+		if atom.slot is not None:
+			need_metadata = True
+		if atom.extended_syntax:
+			extended_syntax = True
+
+		atoms.append(atom)
+
+	if "*/*" in atoms:
+		del atoms[:]
+		need_metadata = False
+		extended_syntax = False
+
 	xml_matchers = []
 	if opts.maintainer_email:
 		maintainer_emails = []
@@ -974,8 +1009,6 @@ def pquery(parser, pquery_option_groups, opts, args):
 			herds.extend(x.split(","))
 		xml_matchers.append(HerdMatcher(herds))
 
-	portdb = portage.db[portage.root]['porttree'].dbapi
-
 	repos = []
 	if opts.all_repos:
 		repos.extend(portdb.repositories.get_repo_for_location(location)
@@ -985,8 +1018,27 @@ def pquery(parser, pquery_option_groups, opts, args):
 	else:
 		repos.append(portdb.repositories.mainRepo())
 
-	for category in sorted(portdb.categories):
-		for cp in portdb.cp_all(categories=(category,)):
+	if extended_syntax or not atoms:
+		names = None
+		categories = list(portdb.categories)
+	else:
+		categories = []
+		names = []
+		for atom in atoms:
+			category, name = portage.catsplit(atom.cp)
+			categories.append(category)
+			names.append(name)
+		categories = list(set(categories))
+		names = sorted(set(names))
+
+	categories.sort()
+
+	for category in categories:
+		if names is None:
+			cp_list = portdb.cp_all(categories=(category,))
+		else:
+			cp_list = [category + "/" + name for name in names]
+		for cp in cp_list:
 			matches = []
 			for repo in repos:
 				match = True
@@ -1005,7 +1057,22 @@ def pquery(parser, pquery_option_groups, opts, args):
 				if not match:
 					continue
 				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
-				matches.extend(cpv_list)
+				if atoms:
+					for cpv in cpv_list:
+						for atom in atoms:
+							if atom.repo is not None and \
+								atom.repo != repo.name:
+								continue
+							if not portage.match_from_list(atom, [cpv]):
+								continue
+							if need_metadata:
+								cpv = portdb._pkg_str(cpv, repo.name)
+								if not portage.match_from_list(atom, [cpv]):
+									continue
+							matches.append(cpv)
+							break
+				else:
+					matches.extend(cpv_list)
 
 			if not matches:
 				continue
@@ -1071,8 +1138,11 @@ def main(argv):
 		print("Portage", portage.VERSION)
 		return os.EX_OK
 
-	if (opts.herd is not None or
-		opts.maintainer_email is not None):
+	cmd = None
+	if args and args[0] in commands:
+		cmd = args[0]
+
+	if cmd is None:
 		return pquery(parser, pquery_option_groups, opts, args)
 
 	argv = argv[:1] + args
@@ -1081,11 +1151,6 @@ def main(argv):
 		usage(argv)
 		sys.exit(os.EX_USAGE)
 
-	cmd = argv[1]
-	function = globals().get(cmd)
-	if function is None or cmd not in commands:
-		usage(argv)
-		sys.exit(os.EX_USAGE)
 	function = globals()[cmd]
 	uses_eroot = getattr(function, "uses_eroot", False) and len(argv) > 2
 	if uses_eroot:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-18  8:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-18  8:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d0672a5194176b5b91d58681e4b86f154b4d6f20
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 08:32:41 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 08:32:41 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d0672a51

portageq: visiblity filter for pquery mode

---
 bin/portageq |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index f91ec81..c320dba 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -964,6 +964,8 @@ class HerdMatcher(object):
 def pquery(parser, pquery_option_groups, opts, args):
 
 	portdb = portage.db[portage.root]['porttree'].dbapi
+	root_config = RootConfig(portdb.settings,
+		portage.db[portage.root], None)
 
 	need_metadata = False
 	extended_syntax = False
@@ -997,6 +999,9 @@ def pquery(parser, pquery_option_groups, opts, args):
 		need_metadata = False
 		extended_syntax = False
 
+	if not opts.no_filters:
+		need_metadata = True
+
 	xml_matchers = []
 	if opts.maintainer_email:
 		maintainer_emails = []
@@ -1059,6 +1064,7 @@ def pquery(parser, pquery_option_groups, opts, args):
 				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
 				if atoms:
 					for cpv in cpv_list:
+						pkg = None
 						for atom in atoms:
 							if atom.repo is not None and \
 								atom.repo != repo.name:
@@ -1066,8 +1072,23 @@ def pquery(parser, pquery_option_groups, opts, args):
 							if not portage.match_from_list(atom, [cpv]):
 								continue
 							if need_metadata:
-								cpv = portdb._pkg_str(cpv, repo.name)
-								if not portage.match_from_list(atom, [cpv]):
+								if pkg is None:
+									try:
+										metadata = dict(zip(
+											Package.metadata_keys,
+											portdb.aux_get(cpv,
+											Package.metadata_keys,
+											myrepo=repo.name)))
+									except KeyError:
+										continue
+									pkg = Package(built=False, cpv=cpv,
+										installed=False, metadata=metadata,
+										root_config=root_config,
+										type_name="ebuild")
+
+								if not (opts.no_filters or pkg.visible):
+									continue
+								if not portage.match_from_list(atom, [pkg]):
 									continue
 							matches.append(cpv)
 							break
@@ -1106,6 +1127,8 @@ def main(argv):
 
 	repo_optgroup = optparse.OptionGroup(parser,
 		'Repository matching options')
+	repo_optgroup.add_option("--no-filters", action="store_true",
+		help="no visibility filters (ACCEPT_KEYWORDS, package masking, etc)")
 	repo_optgroup.add_option("--repo", action="store",
 		help="repo to use (default is PORTDIR if omitted)")
 	repo_optgroup.add_option("--all-repos", action="store_true",


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-18 10:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-18 10:09 UTC (permalink / raw
  To: gentoo-commits

commit:     8c53b2505670ec7ddec7a80eef939fcc400569c7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 10:09:22 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 10:09:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8c53b250

portageq: optimize cat/name expansion for pquery

---
 bin/portageq |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index c320dba..1b3658f 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -968,7 +968,6 @@ def pquery(parser, pquery_option_groups, opts, args):
 		portage.db[portage.root], None)
 
 	need_metadata = False
-	extended_syntax = False
 	atoms = []
 	for arg in args:
 		if "/" not in arg.split(":")[0]:
@@ -989,15 +988,12 @@ def pquery(parser, pquery_option_groups, opts, args):
 
 		if atom.slot is not None:
 			need_metadata = True
-		if atom.extended_syntax:
-			extended_syntax = True
 
 		atoms.append(atom)
 
 	if "*/*" in atoms:
 		del atoms[:]
 		need_metadata = False
-		extended_syntax = False
 
 	if not opts.no_filters:
 		need_metadata = True
@@ -1023,18 +1019,32 @@ def pquery(parser, pquery_option_groups, opts, args):
 	else:
 		repos.append(portdb.repositories.mainRepo())
 
-	if extended_syntax or not atoms:
+	if not atoms:
 		names = None
 		categories = list(portdb.categories)
 	else:
+		category_wildcard = False
+		name_wildcard = False
 		categories = []
 		names = []
 		for atom in atoms:
 			category, name = portage.catsplit(atom.cp)
 			categories.append(category)
 			names.append(name)
-		categories = list(set(categories))
-		names = sorted(set(names))
+			if "*" in category:
+				category_wildcard = True
+			if "*" in name:
+				name_wildcard = True
+
+		if category_wildcard:
+			categories = list(portdb.categories)
+		else:
+			categories = list(set(categories))
+
+		if name_wildcard:
+			names = None
+		else:
+			names = sorted(set(names))
 
 	categories.sort()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-18 11:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-18 11:06 UTC (permalink / raw
  To: gentoo-commits

commit:     1938f73159b843911e07b9dad9d13443be06540d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 11:06:41 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 11:06:41 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1938f731

portageq: add pquery to global command list

---
 bin/portageq |  143 +++++++++++++++++++++++++++++++---------------------------
 1 files changed, 76 insertions(+), 67 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 1b3658f..a691a56 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -873,73 +873,6 @@ def list_preserved_libs(argv):
 	return rValue
 list_preserved_libs.uses_eroot = True
 
-#-----------------------------------------------------------------------------
-#
-# DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
-#
-
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'pquery', 'usage'])
-commands = sorted(k for k, v in globals().items() \
-	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
-
-def usage(argv, parser=None, pquery_option_groups=None):
-	print(">>> Portage information query tool")
-	print(">>> %s" % portage.VERSION)
-	print(">>> Usage: portageq <command> [<option> ...]")
-	print("")
-	print("Available commands:")
-
-	#
-	# Show our commands -- we do this by scanning the functions in this
-	# file, and formatting each functions documentation.
-	#
-	help_mode = '--help' in argv
-	for name in commands:
-		# Drop non-functions
-		obj = globals()[name]
-
-		doc = obj.__doc__
-		if (doc == None):
-			print("   " + name)
-			print("      MISSING DOCUMENTATION!")
-			print("")
-			continue
-
-		lines = doc.lstrip("\n").split("\n")
-		print("   " + name + " " + lines[0].strip())
-		if len(argv) > 1:
-			if (not help_mode):
-				lines = lines[:-1]
-			for line in lines[1:]:
-				print("      " + line.strip())
-
-	if pquery_option_groups is not None:
-		parser.formatter.store_option_strings(parser)
-		print()
-		print('Pkgcore pquery compatible options:')
-		print()
-		for optgroup in pquery_option_groups:
-			print(optgroup.format_help(parser.formatter))
-
-	if len(argv) == 1:
-		print("\nRun portageq with --help for info")
-
-atom_validate_strict = "EBUILD_PHASE" in os.environ
-eapi = None
-if atom_validate_strict:
-	eapi = os.environ.get('EAPI')
-
-	def elog(elog_funcname, lines):
-		cmd = "source '%s/isolated-functions.sh' ; " % \
-			os.environ["PORTAGE_BIN_PATH"]
-		for line in lines:
-			cmd += "%s %s ; " % (elog_funcname, portage._shell_quote(line))
-		subprocess.call([portage.const.BASH_BINARY, "-c", cmd])
-
-else:
-	def elog(elog_funcname, lines):
-		pass
-
 class MaintainerEmailMatcher(object):
 	def __init__(self, maintainer_emails):
 		self._re = re.compile("^(%s)$" % "|".join(maintainer_emails))
@@ -962,6 +895,9 @@ class HerdMatcher(object):
 		return any(x in herds for x in metadata_xml.herds())
 
 def pquery(parser, pquery_option_groups, opts, args):
+	"""[options] [atom]+
+	Emulates a subset of Pkgcore's pquery tool.
+	"""
 
 	portdb = portage.db[portage.root]['porttree'].dbapi
 	root_config = RootConfig(portdb.settings,
@@ -1118,6 +1054,75 @@ def pquery(parser, pquery_option_groups, opts, args):
 
 	return os.EX_OK
 
+pquery.uses_eroot = False
+
+#-----------------------------------------------------------------------------
+#
+# DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
+#
+
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
+commands = sorted(k for k, v in globals().items() \
+	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
+
+def usage(argv, parser=None, pquery_option_groups=None):
+	print(">>> Portage information query tool")
+	print(">>> %s" % portage.VERSION)
+	print(">>> Usage: portageq <command> [<option> ...]")
+	print("")
+	print("Available commands:")
+
+	#
+	# Show our commands -- we do this by scanning the functions in this
+	# file, and formatting each functions documentation.
+	#
+	help_mode = '--help' in argv
+	for name in commands:
+		# Drop non-functions
+		obj = globals()[name]
+
+		doc = obj.__doc__
+		if (doc == None):
+			print("   " + name)
+			print("      MISSING DOCUMENTATION!")
+			print("")
+			continue
+
+		lines = doc.lstrip("\n").split("\n")
+		print("   " + name + " " + lines[0].strip())
+		if len(argv) > 1:
+			if (not help_mode):
+				lines = lines[:-1]
+			for line in lines[1:]:
+				print("      " + line.strip())
+
+	if pquery_option_groups is not None:
+		parser.formatter.store_option_strings(parser)
+		print()
+		print('Pkgcore pquery compatible options:')
+		print()
+		for optgroup in pquery_option_groups:
+			print(optgroup.format_help(parser.formatter))
+
+	if len(argv) == 1:
+		print("\nRun portageq with --help for info")
+
+atom_validate_strict = "EBUILD_PHASE" in os.environ
+eapi = None
+if atom_validate_strict:
+	eapi = os.environ.get('EAPI')
+
+	def elog(elog_funcname, lines):
+		cmd = "source '%s/isolated-functions.sh' ; " % \
+			os.environ["PORTAGE_BIN_PATH"]
+		for line in lines:
+			cmd += "%s %s ; " % (elog_funcname, portage._shell_quote(line))
+		subprocess.call([portage.const.BASH_BINARY, "-c", cmd])
+
+else:
+	def elog(elog_funcname, lines):
+		pass
+
 def main(argv):
 
 	if argv and isinstance(argv[0], bytes):
@@ -1175,6 +1180,10 @@ def main(argv):
 	if args and args[0] in commands:
 		cmd = args[0]
 
+	if cmd == 'pquery':
+		cmd = None
+		args = args[1:]
+
 	if cmd is None:
 		return pquery(parser, pquery_option_groups, opts, args)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-18 12:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-18 12:01 UTC (permalink / raw
  To: gentoo-commits

commit:     1e44aa827280f7ba73de5d1c4d079bc07087c2c2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 12:01:24 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 12:01:24 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1e44aa82

portageq: fix visiblity filter with no atoms

---
 bin/portageq |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index a691a56..f76a967 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -903,6 +903,20 @@ def pquery(parser, pquery_option_groups, opts, args):
 	root_config = RootConfig(portdb.settings,
 		portage.db[portage.root], None)
 
+	def _pkg(cpv, repo_name):
+		try:
+			metadata = dict(zip(
+				Package.metadata_keys,
+				portdb.aux_get(cpv,
+				Package.metadata_keys,
+				myrepo=repo_name)))
+		except KeyError:
+			raise portage.exception.PackageNotFound(cpv)
+		return Package(built=False, cpv=cpv,
+			installed=False, metadata=metadata,
+			root_config=root_config,
+			type_name="ebuild")
+
 	need_metadata = False
 	atoms = []
 	for arg in args:
@@ -1020,17 +1034,9 @@ def pquery(parser, pquery_option_groups, opts, args):
 							if need_metadata:
 								if pkg is None:
 									try:
-										metadata = dict(zip(
-											Package.metadata_keys,
-											portdb.aux_get(cpv,
-											Package.metadata_keys,
-											myrepo=repo.name)))
-									except KeyError:
+										pkg = _pkg(cpv, repo.name)
+									except portage.exception.PackageNotFound:
 										continue
-									pkg = Package(built=False, cpv=cpv,
-										installed=False, metadata=metadata,
-										root_config=root_config,
-										type_name="ebuild")
 
 								if not (opts.no_filters or pkg.visible):
 									continue
@@ -1038,8 +1044,17 @@ def pquery(parser, pquery_option_groups, opts, args):
 									continue
 							matches.append(cpv)
 							break
-				else:
+				elif opts.no_filters:
 					matches.extend(cpv_list)
+				else:
+					for cpv in cpv_list:
+						try:
+							pkg = _pkg(cpv, repo.name)
+						except portage.exception.PackageNotFound:
+							continue
+						else:
+							if pkg.visible:
+								matches.append(cpv)
 
 			if not matches:
 				continue


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-18 19:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-18 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     0fa5cbb1e1eb0da33ba6bb7bc21285c0e5ff489c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 19:39:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 19:39:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0fa5cbb1

portageq: optimize pquery --no-version

---
 bin/portageq |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index f76a967..b3c872d 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -996,6 +996,7 @@ def pquery(parser, pquery_option_groups, opts, args):
 		else:
 			names = sorted(set(names))
 
+	no_version = opts.no_version
 	categories.sort()
 
 	for category in categories:
@@ -1044,6 +1045,8 @@ def pquery(parser, pquery_option_groups, opts, args):
 									continue
 							matches.append(cpv)
 							break
+						if no_version and matches:
+							break
 				elif opts.no_filters:
 					matches.extend(cpv_list)
 				else:
@@ -1055,15 +1058,20 @@ def pquery(parser, pquery_option_groups, opts, args):
 						else:
 							if pkg.visible:
 								matches.append(cpv)
+								if no_version:
+									break
+
+				if no_version and matches:
+					break
 
 			if not matches:
 				continue
 
-			if opts.no_version:
+			if no_version:
 				writemsg_stdout("%s\n" % (cp,), noiselevel=-1)
 			else:
-				matches = sorted(set(matches),
-					key=portage.versions.cpv_sort_key())
+				matches = list(set(matches))
+				portdb._cpv_sort_ascending(matches)
 				for cpv in matches:
 					writemsg_stdout("%s\n" % (cpv,), noiselevel=-1)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-19 19:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-19 19:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e9ba030a67ca69af791af8370837dfddf2f2f7b1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 19:55:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 19:57:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9ba030a

repoman: export GNUPGHOME to git, bug #462362

---
 bin/repoman |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 8c49c06..a2be380 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -595,6 +595,7 @@ repodir = os.path.realpath(portdir_overlay)
 repo_config = repoman_settings.repositories.get_repo_for_location(repodir)
 portdb.porttrees = list(repo_config.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
+commit_env = os.environ.copy()
 
 if repo_config.allow_provide_virtual:
 	qawarnings.add("virtual.oldstyle")
@@ -605,6 +606,9 @@ if repo_config.sign_commit:
 		# the commit arguments. If key_id is unspecified, then it must be
 		# configured by `git config user.signingkey key_id`.
 		vcs_local_opts.append("--gpg-sign")
+		if repoman_settings.get("PORTAGE_GPG_DIR"):
+			# Pass GNUPGHOME to git for bug #462362.
+			commit_env["GNUPGHOME"] = repoman_settings["PORTAGE_GPG_DIR"]
 
 # In order to disable manifest signatures, repos may set
 # "sign-manifests = false" in metadata/layout.conf. This
@@ -2855,7 +2859,7 @@ else:
 			if options.pretend:
 				print("(%s)" % (" ".join(commit_cmd),))
 			else:
-				retval = spawn(commit_cmd, env=os.environ)
+				retval = spawn(commit_cmd, env=commit_env)
 				if retval != os.EX_OK:
 					writemsg_level(("!!! Exiting on %s (shell) " + \
 						"error code: %s\n") % (vcs, retval),
@@ -3026,7 +3030,7 @@ else:
 			if options.pretend:
 				print("(%s)" % (" ".join(commit_cmd),))
 			else:
-				retval = spawn(commit_cmd, env=os.environ)
+				retval = spawn(commit_cmd, env=commit_env)
 				if retval != os.EX_OK:
 					if repo_config.sign_commit and vcs == 'git' and \
 						not git_supports_gpg_sign():


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-20  3:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-03-20  3:30 UTC (permalink / raw
  To: gentoo-commits

commit:     d77dbe6ff72924e1934df63bf774e1c69b6e3b61
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 20 03:30:32 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 03:30:32 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d77dbe6f

portageq: fix envvar -v, bug #462412

---
 bin/portageq |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index b3c872d..c88ee88 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1156,6 +1156,10 @@ def main(argv):
 		portage.output.nocolor()
 
 	parser = optparse.OptionParser(add_help_option=False)
+
+	# used by envvar
+	parser.add_option("-v", dest="verbose", action="store_true")
+
 	actions = optparse.OptionGroup(parser, 'Actions')
 	actions.add_option("-h", "--help", action="store_true")
 	actions.add_option("--version", action="store_true")
@@ -1210,6 +1214,10 @@ def main(argv):
 	if cmd is None:
 		return pquery(parser, pquery_option_groups, opts, args)
 
+	if opts.verbose:
+		# used by envvar
+		args.append("-v")
+
 	argv = argv[:1] + args
 
 	if len(argv) < 2:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-03-27 19:11 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-03-27 19:11 UTC (permalink / raw
  To: gentoo-commits

commit:     37f33e94d7bb3049414c093f6c483041d2c17dc3
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 27 19:14:22 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Mar 27 19:15:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=37f33e94

ebuild: standardize error output a bit

A bunch of the messages are written to stdout instead of stderr, and
lack any sort of general context.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/ebuild |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 1ce4c9c..876aaf7 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -77,6 +77,10 @@ from portage.const import VDB_PATH
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
+def err(txt):
+	portage.writemsg('ebuild: %s\n' % (txt,), noiselevel=-1)
+	sys.exit(1)
+
 if opts.version:
 	print("Portage", portage.VERSION)
 	sys.exit(os.EX_OK)
@@ -115,9 +119,7 @@ if ebuild.endswith(".ebuild"):
 	pf = os.path.basename(ebuild)[:-7]
 
 if pf is None:
-	portage.writemsg("'%s' does not end with '.ebuild'.\n" % \
-		(ebuild,), noiselevel=-1)
-	sys.exit(1)
+	err("%s: does not end with '.ebuild'" % (ebuild,))
 
 if not os.path.isabs(ebuild):
 	mycwd = os.getcwd()
@@ -163,8 +165,7 @@ if ebuild_portdir != vdb_path:
 	myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
 
 if not os.path.exists(ebuild):
-	print("'%s' does not exist." % ebuild)
-	sys.exit(1)
+	err('%s: does not exist' % (ebuild,))
 
 ebuild_split = ebuild.split("/")
 cpv = "%s/%s" % (ebuild_split[-3], pf)
@@ -175,8 +176,7 @@ with io.open(_unicode_encode(ebuild, encoding=_encodings['fs'], errors='strict')
 if eapi is None:
 	eapi = "0"
 if not portage.catpkgsplit(cpv, eapi=eapi):
-	print("!!! %s does not follow correct package syntax." % (cpv))
-	sys.exit(1)
+	err('%s: %s: does not follow correct package syntax' % (ebuild, cpv))
 
 if ebuild.startswith(vdb_path):
 	mytree = "vartree"
@@ -185,8 +185,7 @@ if ebuild.startswith(vdb_path):
 	portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
 
 	if os.path.realpath(portage_ebuild) != ebuild:
-		print("!!! Portage seems to think that %s is at %s" % (cpv, portage_ebuild))
-		sys.exit(1)
+		err('Portage seems to think that %s is at %s' % (cpv, portage_ebuild))
 
 else:
 	mytree = "porttree"
@@ -195,12 +194,10 @@ else:
 	portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
 
 	if not portage_ebuild or portage_ebuild != ebuild:
-		print("!!! %s does not seem to have a valid PORTDIR structure." % ebuild)
-		sys.exit(1)
+		err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,))
 
 if len(pargs) > 1 and "config" in pargs:
-	print("config must be called on it's own, not combined with any other phase")
-	sys.exit(1)
+	err('"config" must not be called with any other phase')
 
 def discard_digests(myebuild, mysettings, mydbapi):
 	"""Discard all distfiles digests for the given ebuild.  This is useful when


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-11 17:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-11 17:51 UTC (permalink / raw
  To: gentoo-commits

commit:     8dd1f89c91dac45c7db4984a93249ed494fa2323
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 11 17:51:08 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 11 17:51:08 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8dd1f89c

Revert "Add a QA check for systemd unit file install."

This reverts commit dd2d661078771a41d4fd554c2bc3b1188ce7b53e.
Forcing use of a specific eclass is too restrictive. It would be better
to use a variable to control a warning like this. See bug #465562.

---
 bin/misc-functions.sh |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ce3d681..c83d21f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -841,16 +841,6 @@ install_qa_check() {
 
 		[[ ${abort} == yes ]] && die "multilib-strict check failed!"
 	fi
-
-	# ensure packages don't install systemd units automagically
-	if ! has systemd ${INHERITED} && \
-		[[ -d "${ED}"/lib/systemd/system ]]
-	then
-		eqawarn "QA Notice: package installs systemd unit files (/lib/systemd/system)"
-		eqawarn "           but does not inherit systemd.eclass."
-		has stricter ${FEATURES} \
-			&& die "install aborted due to missing inherit of systemd.eclass"
-	fi
 }
 
 install_qa_check_prefix() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-12  7:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-12  7:20 UTC (permalink / raw
  To: gentoo-commits

commit:     4c150f56c762cde82abd62754c9d48686a5c74be
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 12 07:20:35 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 12 07:20:35 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c150f56

repoman: fix random package.use.stable.* failure

It failed to work randomly, since setcpv did not always use the correct
value for the effective ACCEPT_KEYWORDS of the current profile.

---
 bin/repoman |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c55fb04..b948631 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2265,8 +2265,7 @@ for x in effective_scanlist:
 				trees[root]["porttree"].settings = dep_settings
 				portdb.settings = dep_settings
 				portdb.xcache = xcache
-				# for package.use.mask support inside dep_check
-				dep_settings.setcpv(pkg)
+
 				dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
 				# just in case, prevent config.reset() from nuking these.
 				dep_settings.backup_changes("ACCEPT_KEYWORDS")
@@ -2279,6 +2278,13 @@ for x in effective_scanlist:
 				# dependencies may conflict (see bug #456342).
 				dep_settings._parent_stable = dep_settings._isStable(pkg)
 
+				# Handle package.use*.{force,mask) calculation, for use
+				# in dep_check.
+				dep_settings.useforce = dep_settings._use_manager.getUseForce(
+					pkg, stable=dep_settings._parent_stable)
+				dep_settings.usemask = dep_settings._use_manager.getUseMask(
+					pkg, stable=dep_settings._parent_stable)
+
 				if not baddepsyntax:
 					ismasked = not ebuild_archs or \
 						pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-16 18:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-16 18:16 UTC (permalink / raw
  To: gentoo-commits

commit:     3c5c21232a89b262f18bab261c37664a19eb74b7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 16 18:15:56 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 16 18:15:56 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3c5c2123

bin/ebuild: only digest once for FEATURES=digest

---
 bin/ebuild |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 876aaf7..ba9d84c 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -312,8 +312,9 @@ from portage.exception import PermissionDenied, \
 	PortagePackageException, UnsupportedAPIException
 
 if 'digest' in tmpsettings.features and \
-	not set(["digest", "manifest"]).intersection(pargs):
+	pargs and pargs[0] not in ("digest", "manifest"):
 	pargs = ['digest'] + pargs
+	tmpsettings.features.discard('digest')
 
 checked_for_stale_env = False
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-16 18:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-16 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     8c67a81cdb17096fe2e64ad6fd0d9386da30cb85
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 16 18:15:56 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 16 18:18:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8c67a81c

bin/ebuild: only digest once for FEATURES=digest

---
 bin/ebuild |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 876aaf7..aa7c18a 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -312,8 +312,10 @@ from portage.exception import PermissionDenied, \
 	PortagePackageException, UnsupportedAPIException
 
 if 'digest' in tmpsettings.features and \
-	not set(["digest", "manifest"]).intersection(pargs):
+	pargs and pargs[0] not in ("digest", "manifest"):
 	pargs = ['digest'] + pargs
+	# We only need to build digests on the first pass.
+	tmpsettings.features.discard('digest')
 
 checked_for_stale_env = False
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-16 19:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-16 19:26 UTC (permalink / raw
  To: gentoo-commits

commit:     238302521adfe222c037f690f20c4cd245a1b4f4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 16 19:26:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 16 19:26:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=23830252

bin/ebuild: tweak FEATURES=digest logic

---
 bin/ebuild |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index aa7c18a..5538600 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -311,9 +311,9 @@ def stale_env_warning():
 from portage.exception import PermissionDenied, \
 	PortagePackageException, UnsupportedAPIException
 
-if 'digest' in tmpsettings.features and \
-	pargs and pargs[0] not in ("digest", "manifest"):
-	pargs = ['digest'] + pargs
+if 'digest' in tmpsettings.features:
+	if pargs and pargs[0] not in ("digest", "manifest"):
+		pargs = ['digest'] + pargs
 	# We only need to build digests on the first pass.
 	tmpsettings.features.discard('digest')
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-22 21:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-22 21:02 UTC (permalink / raw
  To: gentoo-commits

commit:     29a1ac5ae9b36722269e3a72326680656a918040
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 22 21:02:13 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 22 21:02:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=29a1ac5a

Don't filter SHELL from bash env, bug #466844.

---
 bin/phase-functions.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 5a40fcf..76c97ac 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -89,7 +89,7 @@ __filter_readonly_variables() {
 	local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
 		HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
 		OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-		SECONDS SHELL SHLVL _"
+		SECONDS SHLVL _"
 	local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC
 		SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
 		SANDBOX_LOG SANDBOX_ON"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-23  3:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-23  3:20 UTC (permalink / raw
  To: gentoo-commits

commit:     154729f2ede470f454a3f58ef2a26250e28a4e18
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 22 23:08:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 23 02:49:24 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=154729f2

Refactor PORTAGE_GPG_KEY.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

---
 bin/repoman |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index b948631..c419c6f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2658,6 +2658,7 @@ else:
 	commitmessage = commitmessage.rstrip()
 	changelog_msg = commitmessage
 	portage_version = getattr(portage, "VERSION", None)
+	gpg_key = repoman_settings.get("PORTAGE_GPG_KEY", "")
 	if portage_version is None:
 		sys.stderr.write("Failed to insert portage version in message!\n")
 		sys.stderr.flush()
@@ -2669,8 +2670,7 @@ else:
 		if options.force:
 			commit_footer += "\nRepoMan-Options: --force"
 		if sign_manifests:
-			commit_footer += "\nManifest-Sign-Key: %s" % \
-				repoman_settings.get("PORTAGE_GPG_KEY", "")
+			commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
 	else:
 		unameout = platform.system() + " "
 		if platform.system() in ["Darwin", "SunOS"]:
@@ -2683,7 +2683,7 @@ else:
 			commit_footer += ", RepoMan options: --force"
 		if sign_manifests:
 			commit_footer += ", signed Manifest commit with key %s" % \
-				repoman_settings.get("PORTAGE_GPG_KEY", "")
+				(gpg_key, )
 		else:
 			commit_footer += ", unsigned Manifest commit"
 		commit_footer += ")"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-29  4:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-29  4:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2bdc5c1230c8684e602f889e8b434a48b9c1701a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 29 04:26:45 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 29 04:26:45 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2bdc5c12

repoman: report --ignore/include-arches commits

---
 bin/repoman |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index ca4fb53..a829334 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2680,11 +2680,20 @@ else:
 		sys.stderr.flush()
 		portage_version = "Unknown"
 
+	report_options = []
+	if options.force:
+		report_options.append("--force")
+	if options.ignore_arches:
+		report_options.append("--ignore-arches")
+	if include_arches is not None:
+		report_options.append("--include-arches=\"%s\"" %
+			" ".join(sorted(include_arches)))
+
 	if vcs == "git":
 		# Use new footer only for git (see bug #438364).
 		commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
-		if options.force:
-			commit_footer += "\nRepoMan-Options: --force"
+		if report_options:
+			commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
 		if sign_manifests:
 			commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
 		if dco_sob:
@@ -2700,8 +2709,8 @@ else:
 			commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
 		commit_footer += "(Portage version: %s/%s/%s" % \
 			(portage_version, vcs, unameout)
-		if options.force:
-			commit_footer += ", RepoMan options: --force"
+		if report_options:
+			commit_footer += ", RepoMan options: " + " ".join(report_options)
 		if sign_manifests:
 			commit_footer += ", signed Manifest commit with key %s" % \
 				(gpg_key, )


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-30  4:54 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-30  4:54 UTC (permalink / raw
  To: gentoo-commits

commit:     c9911e5eb70a194a35dfddceb816f720bf7ae579
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 30 04:53:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 04:53:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c9911e5e

bin/misc-functions.sh: normalize ${D%/}${D} slash

This will fix bug #467886.

---
 bin/misc-functions.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c83d21f..17dea4e 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -536,13 +536,13 @@ install_qa_check() {
 		die "Unsafe files found in \${D}.  Portage will not install them."
 	fi
 
-	if [[ -d ${D}/${D} ]] ; then
+	if [[ -d ${D%/}${D} ]] ; then
 		declare -i INSTALLTOD=0
-		for i in $(find "${D}/${D}/"); do
-			eqawarn "QA Notice: /${i##${D}/${D}} installed in \${D}/\${D}"
+		for i in $(find "${D%/}${D}"); do
+			eqawarn "QA Notice: /${i##${D%/}${D}} installed in \${D}/\${D}"
 			((INSTALLTOD++))
 		done
-		die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${D}/${D}"
+		die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${D%/}${D}"
 		unset INSTALLTOD
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-04-30  5:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-04-30  5:07 UTC (permalink / raw
  To: gentoo-commits

commit:     2d5e38b495776e5bb2266848a3365667f3ca7233
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 30 05:06:40 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 05:06:40 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2d5e38b4

bin/misc-functions.sh: use pipe for find ${D}${D}

---
 bin/misc-functions.sh |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 17dea4e..725ba55 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -537,13 +537,12 @@ install_qa_check() {
 	fi
 
 	if [[ -d ${D%/}${D} ]] ; then
-		declare -i INSTALLTOD=0
-		for i in $(find "${D%/}${D}"); do
+		local -i INSTALLTOD=0
+		while read -r -d $'\0' i ; do
 			eqawarn "QA Notice: /${i##${D%/}${D}} installed in \${D}/\${D}"
 			((INSTALLTOD++))
-		done
+		done < <(find "${D%/}${D}" -print0)
 		die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${D%/}${D}"
-		unset INSTALLTOD
 	fi
 
 	# Sanity check syntax errors in init.d scripts


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-12 19:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-12 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     ac42c83d7779ead2ac11ee075d078881095b3d32
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 12 19:47:46 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 12 19:47:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ac42c83d

ebuild.sh: use PORTAGE_PYM_PATH as default cwd

---
 bin/ebuild.sh |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2293938..cb5fca7 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -145,11 +145,9 @@ export SANDBOX_ON=0
 
 # Ensure that $PWD is sane whenever possible, to protect against
 # exploitation of insecure search path for python -c in ebuilds.
-# See bug #239560.
-if ! has "$EBUILD_PHASE" clean cleanrm depend help ; then
-	cd "$PORTAGE_BUILDDIR" || \
-		die "PORTAGE_BUILDDIR does not exist: '$PORTAGE_BUILDDIR'"
-fi
+# See bug #239560 and bug #469338.
+cd "${PORTAGE_PYM_PATH}" || \
+	die "PORTAGE_PYM_PATH does not exist: '${PORTAGE_PYM_PATH}'"
 
 #if no perms are specified, dirs/files will have decent defaults
 #(not secretive, but not stupid)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-12 20:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-12 20:12 UTC (permalink / raw
  To: gentoo-commits

commit:     14d0196a227c0c648cf09d924c9a6bc61fa8704b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 12 20:11:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 12 20:11:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=14d0196a

filter_readonly_variables: safe cwd, bug #469338

---
 bin/phase-functions.sh |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 76c97ac..ea717fe 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -582,9 +582,13 @@ __dyn_install() {
 	# local variables can leak into the saved environment.
 	unset f
 
+	# Use safe cwd, avoiding unsafe import for bug #469338.
+	cd "${PORTAGE_PYM_PATH}"
 	__save_ebuild_env --exclude-init-phases | __filter_readonly_variables \
-		--filter-path --filter-sandbox --allow-extra-vars > environment
+		--filter-path --filter-sandbox --allow-extra-vars > \
+		"${PORTAGE_BUILDDIR}"/build-info/environment
 	assert "__save_ebuild_env failed"
+	cd "${PORTAGE_BUILDDIR}"/build-info || die
 
 	${PORTAGE_BZIP2_COMMAND} -f9 environment
 
@@ -874,6 +878,8 @@ __ebuild_main() {
 		if [[ -n $PORTAGE_UPDATE_ENV ]] ; then
 			# Update environment.bz2 in case installation phases
 			# need to pass some variables to uninstallation phases.
+			# Use safe cwd, avoiding unsafe import for bug #469338.
+			cd "${PORTAGE_PYM_PATH}"
 			__save_ebuild_env --exclude-init-phases | \
 				__filter_readonly_variables --filter-path \
 				--filter-sandbox --allow-extra-vars \
@@ -974,6 +980,8 @@ __ebuild_main() {
 	# Save the env only for relevant phases.
 	if ! has "${1}" clean help info nofetch ; then
 		umask 002
+		# Use safe cwd, avoiding unsafe import for bug #469338.
+		cd "${PORTAGE_PYM_PATH}"
 		__save_ebuild_env | __filter_readonly_variables \
 			--filter-features > "$T/environment"
 		assert "__save_ebuild_env failed"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-12 20:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-12 20:21 UTC (permalink / raw
  To: gentoo-commits

commit:     5448570c89693c89356e1e3d7ad4190c47281eb0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 12 20:21:38 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 12 20:21:38 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5448570c

check-implicit-pointer-usage: safe cwd bug 469338

---
 bin/misc-functions.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 725ba55..cebc67f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -747,7 +747,8 @@ install_qa_check() {
 		local cat_cmd=cat
 		[[ $PORTAGE_LOG_FILE = *.gz ]] && cat_cmd=zcat
 		[[ $reset_debug = 1 ]] && set -x
-		f=$($cat_cmd "${PORTAGE_LOG_FILE}" | \
+		# Use safe cwd, avoiding unsafe import for bug #469338.
+		f=$(cd "${PORTAGE_PYM_PATH}" ; $cat_cmd "${PORTAGE_LOG_FILE}" | \
 			"${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
 		if [[ -n ${f} ]] ; then
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-15 18:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-15 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     d3a690580b62d9002080da833283bd35e683cc52
Author:     Vladimir Romanov <blueboar2 <AT> gmail <DOT> com>
AuthorDate: Wed May 15 18:01:05 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 15 18:01:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3a69058

Remove unused imports, bug #469022

---
 bin/clean_locks   |    2 --
 bin/dispatch-conf |    6 ++----
 bin/emerge        |    1 -
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/bin/clean_locks b/bin/clean_locks
index 0a97918..184e80c 100755
--- a/bin/clean_locks
+++ b/bin/clean_locks
@@ -10,10 +10,8 @@ pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
 portage._internal_caller = True
-from portage import os
 
 if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:
-	import portage
 	print()
 	print("You must specify directories with hardlink-locks to clean.")
 	print("You may optionally specify --force, which will remove all")

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index e44c0ea..90b407a 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -22,10 +22,9 @@ sys.path.insert(0, pym_path)
 import portage
 portage._internal_caller = True
 from portage import os
-from portage import dispatch_conf
 from portage import _unicode_decode
 from portage.dispatch_conf import diffstatusoutput
-from portage.process import find_binary
+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'"
@@ -428,7 +427,7 @@ class dispatch:
 def getch ():
     # from ASPN - Danny Yoo
     #
-    import sys, tty, termios
+    import tty, termios
 
     fd = sys.stdin.fileno()
     old_settings = termios.tcgetattr(fd)
@@ -453,7 +452,6 @@ def clear_screen():
         pass
     os.system("clear 2>/dev/null")
 
-from portage.process import find_binary, spawn
 shell = os.environ.get("SHELL")
 if not shell or not os.access(shell, os.EX_OK):
     shell = find_binary("sh")

diff --git a/bin/emerge b/bin/emerge
index fc85d58..a7654bb 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -45,7 +45,6 @@ try:
 	from _emerge.main import emerge_main
 
 	if __name__ == "__main__":
-		import sys
 		from portage.exception import ParseError, PermissionDenied
 		try:
 			retval = emerge_main()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-15 20:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-15 20:16 UTC (permalink / raw
  To: gentoo-commits

commit:     a4c5982a60761d68418fc518ad2f8d0695ea6e35
Author:     Vladimir Romanov <blueboar2 <AT> gmail <DOT> com>
AuthorDate: Wed May 15 20:16:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 15 20:16:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a4c5982a

archive-conf: rename vars to avoid builtin names

---
 bin/archive-conf |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index 42b6274..f8efcb9 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -19,8 +19,8 @@ sys.path.insert(0, pym_path)
 import portage
 portage._internal_caller = True
 
+import portage.dispatch_conf
 from portage import os
-from portage import dispatch_conf
 
 FIND_EXTANT_CONTENTS  = "find %s -name CONTENTS"
 
@@ -42,12 +42,12 @@ except ImportError:
         blocksize=32768
         data = f.read(blocksize)
         size = 0
-        sum = md5.new()
+        checksum = md5.new()
         while data:
-            sum.update(data)
+            checksum.update(data)
             size = size + len(data)
             data = f.read(blocksize)
-        return (md5_to_hex(sum.digest()),size)
+        return (md5_to_hex(checksum.digest()), size)
 
 def archive_conf():
     args = []
@@ -70,12 +70,12 @@ def archive_conf():
     # and see if the current file is unmodified or not.
     try:
         todo_cnt = len(args)
-        for file in content_files:
-            file = file.rstrip()
+        for filename in content_files:
+            filename = filename.rstrip()
             try:
-                contents = open(file, "r")
+                contents = open(filename, "r")
             except IOError as e:
-                print('archive-conf: Unable to open %s: %s' % (file, e), file=sys.stderr)
+                print('archive-conf: Unable to open %s: %s' % (filename, e), file=sys.stderr)
                 sys.exit(1)
             lines = contents.readlines()
             for line in lines:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-15 20:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-15 20:21 UTC (permalink / raw
  To: gentoo-commits

commit:     11f956411c3d79bb4d81911531738fdabc31dc5d
Author:     Vladimir Romanov <blueboar2 <AT> gmail <DOT> com>
AuthorDate: Wed May 15 20:21:16 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 15 20:21:16 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11f95641

dispatch-conf: fix python2-style print call

---
 bin/dispatch-conf |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 90b407a..a41464f 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -407,7 +407,8 @@ class dispatch:
 
 
     def do_help (self):
-        print(); print
+        print()
+        print()
 
         print('  u -- update current config with new config and continue')
         print('  z -- zap (delete) new config and continue')


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-15 22:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-15 22:27 UTC (permalink / raw
  To: gentoo-commits

commit:     155b31eb91da4e6007a3a72c8027d66caf9fadb8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 15 22:27:38 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 15 22:27:38 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=155b31eb

repoman: use FETCHCOMMAND for metadata.dtd

---
 bin/repoman |  104 ++++++++++++++++++++---------------------------------------
 1 files changed, 35 insertions(+), 69 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index a7bcbe1..5243e61 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -8,7 +8,6 @@
 
 from __future__ import print_function, unicode_literals
 
-import calendar
 import codecs
 import copy
 import errno
@@ -25,14 +24,13 @@ import tempfile
 import textwrap
 import time
 import platform
+from itertools import chain
+from stat import S_ISDIR
 
 try:
-	from urllib.request import urlopen as urllib_request_urlopen
+	from urllib.parse import urlparse
 except ImportError:
-	from urllib import urlopen as urllib_request_urlopen
-
-from itertools import chain
-from stat import S_ISDIR
+	from urlparse import urlparse
 
 from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
@@ -1072,33 +1070,6 @@ for x in qacats:
 xmllint_capable = False
 metadata_dtd = os.path.join(repoman_settings["DISTDIR"], 'metadata.dtd')
 
-def parsedate(s):
-	"""Parse a RFC 822 date and time string.
-	This is required for python3 compatibility, since the
-	rfc822.parsedate() function is not available."""
-
-	s_split = []
-	for x in s.upper().split():
-		for y in x.split(','):
-			if y:
-				s_split.append(y)
-
-	if len(s_split) != 6:
-		return None
-
-	# %a, %d %b %Y %H:%M:%S %Z
-	a, d, b, Y, H_M_S, Z = s_split
-
-	# Convert month to integer, since strptime %w is locale-dependent.
-	month_map = {'JAN':1, 'FEB':2, 'MAR':3, 'APR':4, 'MAY':5, 'JUN':6,
-		'JUL':7, 'AUG':8, 'SEP':9, 'OCT':10, 'NOV':11, 'DEC':12}
-	m = month_map.get(b)
-	if m is None:
-		return None
-	m = "%02d" % m
-
-	return time.strptime(':'.join((Y, m, d, H_M_S)), '%Y:%m:%d:%H:%M:%S')
-
 def fetch_metadata_dtd():
 	"""
 	Fetch metadata.dtd if it doesn't exist or the ctime is older than
@@ -1127,45 +1098,40 @@ def fetch_metadata_dtd():
 		print(green("***") + " the local copy of metadata.dtd " + \
 			"needs to be refetched, doing that now")
 		print()
+		parsed_url = urlparse(metadata_dtd_uri)
+		setting = 'FETCHCOMMAND_' + parsed_url.scheme.upper()
+		fcmd = repoman_settings.get(setting)
+		if not fcmd:
+			fcmd = repoman_settings.get('FETCHCOMMAND')
+			if not fcmd:
+				logging.error("FETCHCOMMAND is unset")
+				return False
+
+		destdir = repoman_settings["DISTDIR"]
+		fd, metadata_dtd_tmp = tempfile.mkstemp(
+			prefix='metadata.dtd.', dir=destdir)
+		os.close(fd)
+
 		try:
-			url_f = urllib_request_urlopen(metadata_dtd_uri)
-			msg_info = url_f.info()
-			last_modified = msg_info.get('last-modified')
-			if last_modified is not None:
-				last_modified = parsedate(last_modified)
-				if last_modified is not None:
-					last_modified = calendar.timegm(last_modified)
-
-			metadata_dtd_tmp = "%s.%s" % (metadata_dtd, os.getpid())
-			try:
-				local_f = open(metadata_dtd_tmp, mode='wb')
-				local_f.write(url_f.read())
-				local_f.close()
-				if last_modified is not None:
-					try:
-						os.utime(metadata_dtd_tmp,
-							(int(last_modified), int(last_modified)))
-					except OSError:
-						# This fails on some odd non-unix-like filesystems.
-						# We don't really need the mtime to be preserved
-						# anyway here (currently we use ctime to trigger
-						# fetch), so just ignore it.
-						pass
-				os.rename(metadata_dtd_tmp, metadata_dtd)
-			finally:
-				try:
-					os.unlink(metadata_dtd_tmp)
-				except OSError:
-					pass
+			if not portage.getbinpkg.file_get(metadata_dtd_uri,
+				destdir, fcmd=fcmd,
+				filename=os.path.basename(metadata_dtd_tmp)):
+				logging.error("failed to fetch metadata.dtd from '%s'" %
+					metadata_dtd_uri)
+				return False
 
-			url_f.close()
+			try:
+				portage.util.apply_secpass_permissions(metadata_dtd_tmp,
+					gid=portage.data.portage_gid, mode=0o664, mask=0o2)
+			except portage.exception.PortageException:
+				pass
 
-		except EnvironmentError as e:
-			print()
-			print(red("!!!")+" attempting to fetch '%s', caught" % metadata_dtd_uri)
-			print(red("!!!")+" exception '%s' though." % (e,))
-			print(red("!!!")+" fetching new metadata.dtd failed, aborting")
-			return False
+			os.rename(metadata_dtd_tmp, metadata_dtd)
+		finally:
+			try:
+				os.unlink(metadata_dtd_tmp)
+			except OSError:
+				pass
 
 	return True
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-18 18:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-18 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     160b22ef09edf8b81f68d41b26360fb2525790ba
Author:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 18:57:28 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 18 18:57:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=160b22ef

Flag  -Wsizeof-pointer-memaccess warnings.

This will fix bug #470224.

---
 bin/misc-functions.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index cebc67f..ad99d8a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -698,6 +698,7 @@ install_qa_check() {
 			": warning: reference to local variable .* returned"
 			": warning: returning reference to temporary"
 			": warning: function returns address of local variable"
+			": warning: .*\\[-Wsizeof-pointer-memaccess\\]"
 			# this may be valid code :/
 			#": warning: multi-character character constant"
 			# need to check these two ...


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-18 23:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-18 23:25 UTC (permalink / raw
  To: gentoo-commits

commit:     41de10c78419006249c73e8eb52df1aab86f6d9f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 23:24:58 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 18 23:24:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=41de10c7

Fix RESTRICT=test message for bug #469332.

---
 bin/phase-functions.sh |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ea717fe..6d75ef1 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -461,12 +461,6 @@ __dyn_test() {
 		return
 	fi
 
-	if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ $PORTAGE_IUSE ]]; then
-		# If USE came from ${T}/environment then it might not have USE=test
-		# like it's supposed to here.
-		! has test ${USE} && export USE="${USE} test"
-	fi
-
 	trap "__abort_test" SIGINT SIGQUIT
 	if [ -d "${S}" ]; then
 		cd "${S}"
@@ -474,12 +468,22 @@ __dyn_test() {
 		cd "${WORKDIR}"
 	fi
 
-	if ! has test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
-		__vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
-	elif has test $RESTRICT; then
+	if has test ${RESTRICT} ; then
 		einfo "Skipping make test/check due to ebuild restriction."
-		__vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
+		__vecho ">>> Test phase [disabled because of RESTRICT=test]: ${CATEGORY}/${PF}"
+
+	# If ${EBUILD_FORCE_TEST} == 1 and FEATURES came from ${T}/environment
+	# then it might not have FEATURES=test like it's supposed to here.
+	elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test ${FEATURES} ; then
+		__vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
 	else
+		# If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
+		# then it might not have USE=test like it's supposed to here.
+		if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ ${PORTAGE_IUSE} ]] && \
+			! has test ${USE} ; then
+			export USE="${USE} test"
+		fi
+
 		local save_sp=${SANDBOX_PREDICT}
 		addpredict /
 		__ebuild_phase pre_src_test


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-05-20 15:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-05-20 15:30 UTC (permalink / raw
  To: gentoo-commits

commit:     eb4bff6276f7511d21ac6bb04d4d56a39b844593
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 20 15:30:13 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 20 15:30:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb4bff62

*_DEFAULT_OPTS: shlex for embedded quotes

---
 bin/ebuild    |    3 ++-
 bin/egencache |    3 ++-
 bin/quickpkg  |    3 ++-
 bin/repoman   |    3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 5538600..4fdc762 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -89,7 +89,8 @@ if len(pargs) < 2:
 	parser.error("missing required args")
 
 if not opts.ignore_default_opts:
-	default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split()
+	default_opts = portage.util.shlex_split(
+		portage.settings.get("EBUILD_DEFAULT_OPTS", ""))
 	opts, pargs = parser.parse_args(default_opts + sys.argv[1:])
 
 debug = opts.debug

diff --git a/bin/egencache b/bin/egencache
index 133903d..71f012a 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -873,7 +873,8 @@ def egencache_main(args):
 
 	default_opts = None
 	if not options.ignore_default_opts:
-		default_opts = settings.get('EGENCACHE_DEFAULT_OPTS', '').split()
+		default_opts = portage.util.shlex_split(
+			settings.get('EGENCACHE_DEFAULT_OPTS', ''))
 
 	if default_opts:
 		parser, options, args = parse_args(default_opts + args)

diff --git a/bin/quickpkg b/bin/quickpkg
index 19d90b0..16118ab 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -310,7 +310,8 @@ if __name__ == "__main__":
 		help="include files protected by CONFIG_PROTECT that have not been modified since installation (as a security precaution, default is 'n')")
 	options, args = parser.parse_args(sys.argv[1:])
 	if not options.ignore_default_opts:
-		default_opts = portage.settings.get("QUICKPKG_DEFAULT_OPTS","").split()
+		default_opts = shlex_split(
+			portage.settings.get("QUICKPKG_DEFAULT_OPTS", ""))
 		options, args = parser.parse_args(default_opts + sys.argv[1:])
 	if not args:
 		parser.error("no packages atoms given")

diff --git a/bin/repoman b/bin/repoman
index 5243e61..20832ec 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -265,7 +265,8 @@ def ParseArgs(argv, qahelp):
 	opts, args = parser.parse_args(argv[1:])
 
 	if not opts.ignore_default_opts:
-		default_opts = repoman_settings.get("REPOMAN_DEFAULT_OPTS", "").split()
+		default_opts = portage.util.shlex_split(
+			repoman_settings.get("REPOMAN_DEFAULT_OPTS", ""))
 		if default_opts:
 			opts, args = parser.parse_args(default_opts + sys.argv[1:])
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-20  7:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-20  7:05 UTC (permalink / raw
  To: gentoo-commits

commit:     2a6b69cf6ac36c262e253ce701dd9db5a24d0f25
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 20 07:05:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 20 07:05:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a6b69cf

chpathtool: fix mime_type TypeError, bug #473892

---
 bin/chpathtool.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 85e608e..a040bab 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2011-2012 Gentoo Foundation
+# Copyright 2011-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import io
@@ -41,6 +41,8 @@ class IsTextFile(object):
 
 	def _is_text_magic(self, filename):
 		mime_type = self._m.file(filename)
+		if isinstance(mime_type, bytes):
+			mime_type = mime_type.decode('ascii', 'replace')
 		return mime_type.startswith("text/")
 
 	def _is_text_encoding(self, filename):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-21 20:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-21 20:41 UTC (permalink / raw
  To: gentoo-commits

commit:     0ca18b45ca14e94ba18a29c8cf897d82ee9eabfd
Author:     Anthony Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 21 20:41:17 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 21 20:41:17 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0ca18b45

install.py wrapper for xattrs, bug #465000

---
 bin/install.py | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 210 insertions(+)

diff --git a/bin/install.py b/bin/install.py
new file mode 100755
index 0000000..6be3900
--- /dev/null
+++ b/bin/install.py
@@ -0,0 +1,210 @@
+#!/usr/bin/python
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import os
+import sys
+import argparse
+import subprocess
+import traceback
+
+from portage.util.movefile import _copyxattr
+from portage.exception import OperationNotSupported
+
+
+def parse_args(args):
+	"""
+	Parse the command line arguments using optparse for python 2.6 compatibility
+	Args:
+	  args: a list of the white space delimited command line
+	Returns:
+	  tuple of the Namespace of parsed options, and a list of order parameters
+	"""
+	parser = argparse.ArgumentParser(add_help=False)
+
+	parser.add_argument(
+		"-b",
+		action="store_true",
+		dest="shortopt_b"
+	)
+	parser.add_argument(
+		"--backup",
+		action="store",
+		dest="backup"
+		)
+	parser.add_argument(
+		"-c",
+		action="store_true",
+		dest="shortopt_c"
+	)
+	parser.add_argument(
+		"--compare",
+		"-C",
+		action="store_true",
+		dest="compare"
+	)
+	parser.add_argument(
+		"--directory",
+			"-d",
+		action="store_true",
+		dest="directory"
+	)
+	parser.add_argument(
+		"-D",
+		action="store_true",
+		dest="shortopt_D"
+	)
+	parser.add_argument(
+		"--owner",
+		"-o",
+		action="store", 
+		dest="owner"
+	)
+	parser.add_argument(
+		"--group",
+		"-g",
+		action="store",
+		dest="group"
+	)
+	parser.add_argument(
+		"--mode",
+		"-m",
+		action="store",
+		dest="mode"
+	)
+	parser.add_argument(
+		"--preserve-timestamps",
+		"-p",
+		action="store_true",
+		dest="preserve_timestamps"
+	)
+	parser.add_argument(
+		"--strip",
+		"-s",
+		action="store_true",
+		dest="strip"
+	)
+	parser.add_argument(
+		"--strip-program",
+		action="store",
+		dest="strip_program"
+	)
+	parser.add_argument(
+		"--suffix",
+		"-S",
+		action="store",
+		dest="suffix"
+	)
+	parser.add_argument(
+		"--target-directory",
+		"-t",
+		action="store",
+		dest="target_directory"
+	)
+	parser.add_argument(
+		"--no-target-directory",
+		"-T",
+		action="store_true",
+		dest="no_target_directory"
+	)
+	parser.add_argument(
+		"--context",
+		"-Z",
+		action="store",
+		dest="context"
+	)
+	parser.add_argument(
+		"--verbose",
+		"-v",
+		action="store_true",
+		dest="verbose"
+	)
+	parser.add_argument(
+		"--help",
+		action="store_true",
+		dest="help"
+	)
+	parser.add_argument(
+		"--version",
+		action="store_true",
+		dest="version"
+	)
+	parsed_args = parser.parse_known_args()
+
+	opts  = parsed_args[0]
+	files = parsed_args[1]
+	files = [f for f in files if f != "--"]	# filter out "--"
+
+	return (opts, files)
+
+
+def copy_xattrs(opts, files):
+	"""
+	Copy the extended attributes using portage.util.movefile._copyxattr
+	Args:
+	  opts:  Namespace of the parsed command line otions
+	  files: list of ordered command line parameters which should be files/directories
+	Returns:
+	  system exit code
+	"""
+	if opts.directory:
+		return os.EX_OK
+
+	if opts.target_directory is None:
+		source, target = files[:-1], files[-1]
+		target_is_directory = os.path.isdir(target)
+	else:
+		source, target = files, opts.target_directory
+		target_is_directory = True
+
+	try:
+		if target_is_directory:
+			for s in source:
+				abs_path = os.path.join(target, os.path.basename(s))
+				_copyxattr(s, abs_path)
+		else:
+			_copyxattr(source[0], target)
+		return os.EX_OK
+
+	except OperationNotSupported:
+		traceback.print_exc()
+		return os.EX_OSERR
+
+
+def Which(filename, path=None, all=False):
+	"""
+	Find the absolute path of 'filename' in a given search 'path'
+	Args:
+	  filename: basename of the file
+	  path: colon delimited search path
+	  all: return a list of all intances if true, else return just the first
+	"""
+	if path is None:
+		path = os.environ.get('PATH', '')
+	ret = []
+	for p in path.split(':'):
+		p = os.path.join(p, filename)
+		if os.access(p, os.X_OK):
+			if all:
+				ret.append(p)
+			else:
+				return p
+	if all:
+		return ret
+	else:
+		return None
+
+
+def main(args):
+	opts, files = parse_args(args)
+	path_installs = Which('install', all=True)
+	cmdline = path_installs[0:1]
+	cmdline += args
+	returncode = subprocess.call(cmdline)
+	if returncode == os.EX_OK:
+		returncode = copy_xattrs(opts, files)
+	return returncode
+
+
+if __name__ == "__main__":
+	sys.exit(main(sys.argv[1:]))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-21 21:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-21 21:24 UTC (permalink / raw
  To: gentoo-commits

commit:     1c47d7ae856e8dea4e0d8bd9244331d752d49c44
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 21 21:24:36 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 21 21:24:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1c47d7ae

install.py: Python 2.6 and 3.1 optparse compat

---
 bin/install.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/bin/install.py b/bin/install.py
index 6be3900..3fdd5be 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -4,13 +4,26 @@
 
 import os
 import sys
-import argparse
 import subprocess
 import traceback
 
 from portage.util.movefile import _copyxattr
 from portage.exception import OperationNotSupported
 
+try:
+	from argparse import ArgumentParser
+except ImportError:
+	# Compatibility with Python 2.6 and 3.1
+	from optparse import OptionParser
+
+	class ArgumentParser(object):
+		def __init__(self, **kwargs):
+			add_help = kwargs.pop("add_help", None)
+			if add_help is not None:
+				kwargs["add_help_option"] = add_help
+			parser = OptionParser(**kwargs)
+			self.add_argument = parser.add_option
+			self.parse_known_args = parser.parse_args
 
 def parse_args(args):
 	"""
@@ -20,7 +33,7 @@ def parse_args(args):
 	Returns:
 	  tuple of the Namespace of parsed options, and a list of order parameters
 	"""
-	parser = argparse.ArgumentParser(add_help=False)
+	parser = ArgumentParser(add_help=False)
 
 	parser.add_argument(
 		"-b",


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-21 22:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-21 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     411f7649364b728bc5836416bc9b9564dbcd291f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 21 22:09:52 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 21 22:09:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=411f7649

install.py: add note about parse_known_args

---
 bin/install.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bin/install.py b/bin/install.py
index 3fdd5be..2ca62f2 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -142,6 +142,16 @@ def parse_args(args):
 		action="store_true",
 		dest="version"
 	)
+
+	# Use parse_known_args for maximum compatibility with
+	# getopt handling of non-option file arguments. Note
+	# that parser.add_argument("files", nargs='+') would
+	# be subtly incompatible because it requires that all
+	# of the file arguments be grouped sequentially. Also
+	# note that we have to explicitly call add_argument
+	# for known options in order for argparse to correctly
+	# separate option arguments from file arguments in all
+	# cases (it also allows for optparse compatibility).
 	parsed_args = parser.parse_known_args()
 
 	opts  = parsed_args[0]


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-21 23:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-21 23:07 UTC (permalink / raw
  To: gentoo-commits

commit:     d31b8be0806815b1c01f36ec4b83126b1483c8b6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 21 23:07:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 21 23:07:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d31b8be0

install.py: use surrogateescape for Python >=3.2

We can't trust that the filesystem encoding (locale dependent)
correctly matches the arguments, so use surrogateescape to
pass through the original argv bytes for Python 3.
Since Python <3.2 does not support bytes in Popen args, trust
the locale in that case.

---
 bin/install.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/bin/install.py b/bin/install.py
index 2ca62f2..f7118a6 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -223,6 +223,20 @@ def main(args):
 	path_installs = Which('install', all=True)
 	cmdline = path_installs[0:1]
 	cmdline += args
+
+	if sys.hexversion >= 0x3020000:
+		# We can't trust that the filesystem encoding (locale dependent)
+		# correctly matches the arguments, so use surrogateescape to
+		# pass through the original argv bytes for Python 3.
+		# Since Python <3.2 does not support bytes in Popen args, trust
+		# the locale in that case.
+		fs_encoding = sys.getfilesystemencoding()
+		cmdline = [x.encode(fs_encoding, 'surrogateescape') for x in cmdline]
+		files = [x.encode(fs_encoding, 'surrogateescape') for x in files]
+		if opts.target_directory is not None:
+			opts.target_directory = \
+				opts.target_directory.encode(fs_encoding, 'surrogateescape')
+
 	returncode = subprocess.call(cmdline)
 	if returncode == os.EX_OK:
 		returncode = copy_xattrs(opts, files)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-24 21:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-24 21:21 UTC (permalink / raw
  To: gentoo-commits

commit:     824a889f79f6a685f7c05b0d2e812905a27d2fa9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 21:21:18 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 21:21:18 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=824a889f

repoman: re-use repoman_settings.repositories

This avoids constructing a separate instance for each profile.

---
 bin/repoman | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 457da09..e5e6c8f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2255,7 +2255,7 @@ for x in effective_scanlist:
 						config_root=config_root,
 						local_config=False,
 						_unmatched_removal=options.unmatched_removal,
-						env=env)
+						env=env, repositories=repoman_settings.repositories)
 					dep_settings.categories = repoman_settings.categories
 					if options.without_mask:
 						dep_settings._mask_manager_obj = \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-25  2:23 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-25  2:23 UTC (permalink / raw
  To: gentoo-commits

commit:     eab5b86c2d45765ea718e1e9488dde43c9bbac7e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jun 25 02:21:07 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Tue Jun 25 02:21:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eab5b86c

Stop setting PORTDIR / PORTDIR_OVERLAY in repoman.

---
 bin/repoman | 41 +++++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index e5e6c8f..5de554c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -65,6 +65,7 @@ from _emerge.RootConfig import RootConfig
 from _emerge.userquery import userquery
 import portage.checksum
 import portage.const
+import portage.repository.config
 from portage import cvstree, normalize_path
 from portage import util
 from portage.exception import (FileNotFound, InvalidAtom, MissingParameter,
@@ -580,14 +581,23 @@ if options.mode == 'commit' and not options.pretend and not vcs:
 	logging.info("Not in a version controlled repository; enabling pretend mode.")
 	options.pretend = True
 
-# Ensure that PORTDIR_OVERLAY contains the repository corresponding to $PWD.
-repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
-	(repoman_settings.get('PORTDIR_OVERLAY', ''),
-	portage._shell_quote(portdir_overlay))
-# We have to call the config constructor again so
-# that config.repositories is initialized correctly.
-repoman_settings = portage.config(config_root=config_root, local_config=False,
-	env=dict(os.environ, PORTDIR_OVERLAY=repoman_settings['PORTDIR_OVERLAY']))
+# Ensure that current repository is in the list of enabled repositories.
+try:
+	repoman_settings.repositories.get_repo_for_location(portdir_overlay)
+except KeyError:
+	repo_name = portage.repository.config.RepoConfig._read_valid_repo_name(portdir_overlay)[0]
+	layout_conf_data = portage.repository.config.parse_layout_conf(portdir_overlay)[0]
+	if layout_conf_data['repo-name']:
+		repo_name = layout_conf_data['repo-name']
+	repos_conf_file = os.path.join(repoman_settings["PORTAGE_CONFIGROOT"], portage.const.USER_CONFIG_PATH, "repos.conf")
+	tmp_conf_file = io.StringIO("""
+		[%s]
+		location = %s
+		""" % (repo_name, portdir_overlay))
+	repositories = portage.repository.config.RepoConfigLoader([repos_conf_file, tmp_conf_file], repoman_settings)
+	# We have to call the config constructor again so that attributes
+	# dependent on config.repositories are initialized correctly.
+	repoman_settings = portage.config(config_root=config_root, local_config=False, repositories=repositories)
 
 root = repoman_settings['EROOT']
 trees = {
@@ -602,6 +612,10 @@ repo_config = repoman_settings.repositories.get_repo_for_location(repodir)
 portdb.porttrees = list(repo_config.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 commit_env = os.environ.copy()
+# list() is for iteration on a copy.
+for repo in list(repoman_settings.repositories):
+	if repo.location not in [portdir_overlay] + [x.location for x in repo_config.masters]:
+		del repoman_settings.repositories[repo.name]
 
 if repo_config.allow_provide_virtual:
 	qawarnings.add("virtual.oldstyle")
@@ -695,18 +709,9 @@ logging.debug("vcs: %s" % (vcs,))
 logging.debug("repo config: %s" % (repo_config,))
 logging.debug("options: %s" % (options,))
 
-# Generate an appropriate PORTDIR_OVERLAY value for passing into the
-# profile-specific config constructor calls.
-env = os.environ.copy()
-env['PORTDIR'] = portdir
-env['PORTDIR_OVERLAY'] = ' '.join(portdb.porttrees[1:])
-
-logging.info('Setting paths:')
-logging.info('PORTDIR = "' + portdir + '"')
-logging.info('PORTDIR_OVERLAY = "%s"' % env['PORTDIR_OVERLAY'])
-
 # It's confusing if these warnings are displayed without the user
 # being told which profile they come from, so disable them.
+env = os.environ.copy()
 env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
 
 categories = []


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-25  3:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-25  3:26 UTC (permalink / raw
  To: gentoo-commits

commit:     258c9c1bd9d6213013c0fd6a0cdd61b6840b0bb1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 25 03:26:15 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 25 03:26:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=258c9c1b

repoman: samefile for repo location comparison

This ensures correct behavior with symlinks.

---
 bin/repoman | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 5de554c..6107449 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -614,7 +614,15 @@ portdir = portdb.porttrees[0]
 commit_env = os.environ.copy()
 # list() is for iteration on a copy.
 for repo in list(repoman_settings.repositories):
-	if repo.location not in [portdir_overlay] + [x.location for x in repo_config.masters]:
+	found = False
+	for location in [portdir_overlay] + [x.location for x in repo_config.masters]:
+		try:
+			if os.path.samefile(location, repo.location):
+				found = True
+				break
+		except OSError:
+			pass
+	if not found:
 		del repoman_settings.repositories[repo.name]
 
 if repo_config.allow_provide_virtual:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-25  3:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-25  3:29 UTC (permalink / raw
  To: gentoo-commits

commit:     589ba5a84f6cdd7a71c94e378c61a4d5f39932be
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 25 03:29:10 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 25 03:29:10 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=589ba5a8

repoman: dedent generated repos.conf

This fixes a "File contains no section headers" error raised by
configparser with Python 2.

---
 bin/repoman | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 6107449..2a3b4f3 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -590,10 +590,10 @@ except KeyError:
 	if layout_conf_data['repo-name']:
 		repo_name = layout_conf_data['repo-name']
 	repos_conf_file = os.path.join(repoman_settings["PORTAGE_CONFIGROOT"], portage.const.USER_CONFIG_PATH, "repos.conf")
-	tmp_conf_file = io.StringIO("""
+	tmp_conf_file = io.StringIO(textwrap.dedent("""
 		[%s]
 		location = %s
-		""" % (repo_name, portdir_overlay))
+		""") % (repo_name, portdir_overlay))
 	repositories = portage.repository.config.RepoConfigLoader([repos_conf_file, tmp_conf_file], repoman_settings)
 	# We have to call the config constructor again so that attributes
 	# dependent on config.repositories are initialized correctly.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-25 18:50 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-25 18:50 UTC (permalink / raw
  To: gentoo-commits

commit:     8403b5434c3b7c9e383a16f3d4f6619efacda385
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 25 18:50:01 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 25 18:50:01 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8403b543

repoman: canonical path for repo location compare

---
 bin/repoman | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 2a3b4f3..60286db 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -582,8 +582,9 @@ if options.mode == 'commit' and not options.pretend and not vcs:
 	options.pretend = True
 
 # Ensure that current repository is in the list of enabled repositories.
+repodir = os.path.realpath(portdir_overlay)
 try:
-	repoman_settings.repositories.get_repo_for_location(portdir_overlay)
+	repoman_settings.repositories.get_repo_for_location(repodir)
 except KeyError:
 	repo_name = portage.repository.config.RepoConfig._read_valid_repo_name(portdir_overlay)[0]
 	layout_conf_data = portage.repository.config.parse_layout_conf(portdir_overlay)[0]
@@ -607,22 +608,14 @@ portdb = trees[root]['porttree'].dbapi
 
 # Constrain dependency resolution to the master(s)
 # that are specified in layout.conf.
-repodir = os.path.realpath(portdir_overlay)
 repo_config = repoman_settings.repositories.get_repo_for_location(repodir)
 portdb.porttrees = list(repo_config.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 commit_env = os.environ.copy()
 # list() is for iteration on a copy.
 for repo in list(repoman_settings.repositories):
-	found = False
-	for location in [portdir_overlay] + [x.location for x in repo_config.masters]:
-		try:
-			if os.path.samefile(location, repo.location):
-				found = True
-				break
-		except OSError:
-			pass
-	if not found:
+	# all paths are canonical
+	if repo.location not in [repodir] + [x.location for x in repo_config.masters]:
 		del repoman_settings.repositories[repo.name]
 
 if repo_config.allow_provide_virtual:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-25 19:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-25 19:24 UTC (permalink / raw
  To: gentoo-commits

commit:     fae27fe900e0c93d9ffff2b17f8fa309c0099439
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 25 19:24:40 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 25 19:24:40 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fae27fe9

repoman: simplify repo location comparison

---
 bin/repoman | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 60286db..faf0232 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -615,7 +615,7 @@ commit_env = os.environ.copy()
 # list() is for iteration on a copy.
 for repo in list(repoman_settings.repositories):
 	# all paths are canonical
-	if repo.location not in [repodir] + [x.location for x in repo_config.masters]:
+	if repo.location not in repo_config.eclass_db.porttrees:
 		del repoman_settings.repositories[repo.name]
 
 if repo_config.allow_provide_virtual:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-06-29  4:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-06-29  4:21 UTC (permalink / raw
  To: gentoo-commits

commit:     1b4a808ebcb93fe559cced7b270263bbfd4c6594
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 29 04:21:38 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 29 04:21:38 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1b4a808e

repoman: fix PORTDIR{,_OVERLAY} interference

Ensure that the repository corresponding to $PWD overrides a
repository of the same name referenced by the existing PORTDIR
or PORTDIR_OVERLAY settings (broken since commit
eab5b86c2d45765ea718e1e9488dde43c9bbac7e).

---
 bin/repoman | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index faf0232..e31f699 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -595,6 +595,12 @@ except KeyError:
 		[%s]
 		location = %s
 		""") % (repo_name, portdir_overlay))
+	# Ensure that the repository corresponding to $PWD overrides a
+	# repository of the same name referenced by the existing PORTDIR
+	# or PORTDIR_OVERLAY settings.
+	repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
+		(repoman_settings.get('PORTDIR_OVERLAY', ''),
+		portage._shell_quote(portdir_overlay))
 	repositories = portage.repository.config.RepoConfigLoader([repos_conf_file, tmp_conf_file], repoman_settings)
 	# We have to call the config constructor again so that attributes
 	# dependent on config.repositories are initialized correctly.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-13 18:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-13 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     36106c00b650dab8b482ebc7a56b77b872bd5f40
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 13 18:19:27 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 13 18:19:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=36106c00

portageq: avoid portdbapi instantiation

The portdbapi takes time to instantiate, and for some commands we
really only need the  RepoConfig instance.

---
 bin/portageq | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 4be9f88..0e1cb64 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -725,7 +725,7 @@ def get_repos(argv):
 	if len(argv) < 1:
 		print("ERROR: insufficient parameters!")
 		return 2
-	print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories()))
+	print(" ".join(reversed(portage.db[argv[0]]["vartree"].settings.repositories.prepos_order)))
 
 get_repos.uses_eroot = True
 
@@ -741,7 +741,7 @@ def master_repositories(argv):
 			print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
 			return 2
 		try:
-			repo = portage.db[argv[0]]["porttree"].dbapi.repositories[arg]
+			repo = portage.db[argv[0]]["vartree"].settings.repositories[arg]
 		except KeyError:
 			print("")
 			return 1
@@ -761,7 +761,7 @@ def get_repo_path(argv):
 		if portage.dep._repo_name_re.match(arg) is None:
 			print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
 			return 2
-		path = portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(arg)
+		path = portage.db[argv[0]]["vartree"].settings.repositories.treemap.get(arg)
 		if path is None:
 			print("")
 			return 1
@@ -781,7 +781,7 @@ def available_eclasses(argv):
 			print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
 			return 2
 		try:
-			repo = portage.db[argv[0]]["porttree"].dbapi.repositories[arg]
+			repo = portage.db[argv[0]]["vartree"].settings.repositories[arg]
 		except KeyError:
 			print("")
 			return 1
@@ -801,7 +801,7 @@ def eclass_path(argv):
 		print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr)
 		return 2
 	try:
-		repo = portage.db[argv[0]]["porttree"].dbapi.repositories[argv[1]]
+		repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]]
 	except KeyError:
 		print("")
 		return 1
@@ -830,7 +830,7 @@ def license_path(argv):
 		print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr)
 		return 2
 	try:
-		repo = portage.db[argv[0]]["porttree"].dbapi.repositories[argv[1]]
+		repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]]
 	except KeyError:
 		print("")
 		return 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-14  8:39 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-14  8:39 UTC (permalink / raw
  To: gentoo-commits

commit:     11a14b42b129a21f6f34122666219085475e4851
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jul 14 08:38:25 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Jul 14 08:38:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11a14b42

portageq: Support repositories_configuration command.

---
 bin/portageq | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/portageq b/bin/portageq
index 0e1cb64..4c2f464 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -650,6 +650,14 @@ def gentoo_mirrors(argv):
 	print(portage.settings["GENTOO_MIRRORS"])
 
 
+def repositories_configuration(argv):
+	"""
+	Returns the configuration of repositories.
+	"""
+	sys.stdout.write(portage.settings.repositories.config_string())
+	sys.stdout.flush()
+
+
 def portdir(argv):
 	"""
 	Returns the PORTDIR path.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-14 18:02 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-14 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     e71f4a5061005fe02787ed58c53330eb8b07d2d2
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jul 14 18:01:52 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Jul 14 18:01:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e71f4a50

portageq repositories_configuration: Require EROOT argument.

---
 bin/portageq | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 4c2f464..c5c37d9 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -651,11 +651,15 @@ def gentoo_mirrors(argv):
 
 
 def repositories_configuration(argv):
-	"""
+	"""<eroot>
 	Returns the configuration of repositories.
 	"""
-	sys.stdout.write(portage.settings.repositories.config_string())
+	if len(argv) < 1:
+		print("ERROR: insufficient parameters!", file=sys.stderr)
+		return 3
+	sys.stdout.write(portage.db[argv[0]]["vartree"].settings.repositories.config_string())
 	sys.stdout.flush()
+repositories_configuration.uses_eroot = True
 
 
 def portdir(argv):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-14 18:40 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-14 18:40 UTC (permalink / raw
  To: gentoo-commits

commit:     7e1e2fc9709fd30a460b9bc83c1f612d79378cca
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jul 14 18:39:14 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Jul 14 18:39:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7e1e2fc9

portageq: Use uses_eroot decorator.

---
 bin/portageq | 56 +++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index c5c37d9..990d1bf 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -58,6 +58,10 @@ def eval_atom_use(atom):
 		atom = atom.evaluate_conditionals(use)
 	return atom
 
+def uses_eroot(function):
+	function.uses_eroot = True
+	return function
+
 #-----------------------------------------------------------------------------
 #
 # To add functionality to this tool, add a function below.
@@ -79,6 +83,7 @@ def eval_atom_use(atom):
 # and will automaticly add a command by the same name as the function!
 #
 
+@uses_eroot
 def has_version(argv):
 	"""<eroot> <category/package>
 	Return code 0 if it's available, 1 otherwise.
@@ -122,9 +127,9 @@ def has_version(argv):
 		portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
 			noiselevel=-1)
 		return 2
-has_version.uses_eroot = True
 
 
+@uses_eroot
 def best_version(argv):
 	"""<eroot> <category/package>
 	Returns category/package-version (without .ebuild).
@@ -161,9 +166,9 @@ def best_version(argv):
 		print(portage.best(mylist))
 	except KeyError:
 		return 1
-best_version.uses_eroot = True
 
 
+@uses_eroot
 def mass_best_version(argv):
 	"""<eroot> [<category/package>]+
 	Returns category/package-version (without .ebuild).
@@ -177,8 +182,9 @@ def mass_best_version(argv):
 			print(pack+":"+portage.best(mylist))
 	except KeyError:
 		return 1
-mass_best_version.uses_eroot = True
 
+
+@uses_eroot
 def metadata(argv):
 	if (len(argv) < 4):
 		print("ERROR: insufficient parameters!", file=sys.stderr)
@@ -211,8 +217,8 @@ Available keys: %s
 """  % ','.join(sorted(x for x in portage.auxdbkeys \
 if not x.startswith('UNUSED_')))
 
-metadata.uses_eroot = True
 
+@uses_eroot
 def contents(argv):
 	"""<eroot> <category/package>
 	List the files that are installed for a given package, with
@@ -233,8 +239,9 @@ def contents(argv):
 		treetype="vartree", vartree=vartree)
 	writemsg_stdout(''.join('%s\n' % x for x in sorted(db.getcontents())),
 		noiselevel=-1)
-contents.uses_eroot = True
 
+
+@uses_eroot
 def owners(argv):
 	"""<eroot> [<filename>]+
 	Given a list of files, print the packages that own the files and which
@@ -313,8 +320,8 @@ def owners(argv):
 		return 0
 	return 1
 
-owners.uses_eroot = True
 
+@uses_eroot
 def is_protected(argv):
 	"""<eroot> <filename>
 	Given a single filename, return code 0 if it's protected, 1 otherwise.
@@ -360,8 +367,8 @@ def is_protected(argv):
 		return 0
 	return 1
 
-is_protected.uses_eroot = True
 
+@uses_eroot
 def filter_protected(argv):
 	"""<eroot>
 	Read filenames from stdin and write them to stdout if they are protected.
@@ -420,8 +427,8 @@ def filter_protected(argv):
 
 	return 0
 
-filter_protected.uses_eroot = True
 
+@uses_eroot
 def best_visible(argv):
 	"""<eroot> [pkgtype] <atom>
 	Returns category/package-version (without .ebuild).
@@ -502,9 +509,9 @@ def best_visible(argv):
 	writemsg_stdout("\n", noiselevel=-1)
 
 	return 1
-best_visible.uses_eroot = True
 
 
+@uses_eroot
 def mass_best_visible(argv):
 	"""<eroot> [<type>] [<category/package>]+
 	Returns category/package-version (without .ebuild).
@@ -529,9 +536,9 @@ def mass_best_visible(argv):
 			best_visible([root, pkgtype, pack])
 	except KeyError:
 		return 1
-mass_best_visible.uses_eroot = True
 
 
+@uses_eroot
 def all_best_visible(argv):
 	"""<eroot>
 	Returns all best_visible packages (without .ebuild).
@@ -546,9 +553,9 @@ def all_best_visible(argv):
 		mybest=portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg))
 		if mybest:
 			print(mybest)
-all_best_visible.uses_eroot = True
 
 
+@uses_eroot
 def match(argv):
 	"""<eroot> <atom>
 	Returns a \\n separated list of category/package-version.
@@ -595,8 +602,9 @@ def match(argv):
 		results = vardb.match(atom)
 	for cpv in results:
 		print(cpv)
-match.uses_eroot = True
 
+
+@uses_eroot
 def expand_virtual(argv):
 	"""<eroot> <atom>
 	Returns a \\n separated list of atoms expanded from a
@@ -631,7 +639,6 @@ def expand_virtual(argv):
 
 	return os.EX_OK
 
-expand_virtual.uses_eroot = True
 
 def vdb_path(argv):
 	"""
@@ -650,6 +657,7 @@ def gentoo_mirrors(argv):
 	print(portage.settings["GENTOO_MIRRORS"])
 
 
+@uses_eroot
 def repositories_configuration(argv):
 	"""<eroot>
 	Returns the configuration of repositories.
@@ -659,7 +667,6 @@ def repositories_configuration(argv):
 		return 3
 	sys.stdout.write(portage.db[argv[0]]["vartree"].settings.repositories.config_string())
 	sys.stdout.flush()
-repositories_configuration.uses_eroot = True
 
 
 def portdir(argv):
@@ -730,6 +737,8 @@ def envvar(argv):
 		else:
 			print(portage.settings[arg])
 
+
+@uses_eroot
 def get_repos(argv):
 	"""<eroot>
 	Returns all repos with names (repo_name file) argv[0] = $EROOT
@@ -739,8 +748,8 @@ def get_repos(argv):
 		return 2
 	print(" ".join(reversed(portage.db[argv[0]]["vartree"].settings.repositories.prepos_order)))
 
-get_repos.uses_eroot = True
 
+@uses_eroot
 def master_repositories(argv):
 	"""<eroot> <repo_id>+
 	Returns space-separated list of master repositories for specified repository.
@@ -760,8 +769,8 @@ def master_repositories(argv):
 		else:
 			print(" ".join(x.name for x in repo.masters))
 
-master_repositories.uses_eroot = True
 
+@uses_eroot
 def get_repo_path(argv):
 	"""<eroot> <repo_id>+
 	Returns the path to the repo named argv[1], argv[0] = $EROOT
@@ -779,8 +788,8 @@ def get_repo_path(argv):
 			return 1
 		print(path)
 
-get_repo_path.uses_eroot = True
 
+@uses_eroot
 def available_eclasses(argv):
 	"""<eroot> <repo_id>+
 	Returns space-separated list of available eclasses for specified repository.
@@ -800,8 +809,8 @@ def available_eclasses(argv):
 		else:
 			print(" ".join(sorted(repo.eclass_db.eclasses)))
 
-available_eclasses.uses_eroot = True
 
+@uses_eroot
 def eclass_path(argv):
 	"""<eroot> <repo_id> <eclass>+
 	Returns the path to specified eclass for specified repository.
@@ -829,8 +838,8 @@ def eclass_path(argv):
 				print(eclass.location)
 		return retval
 
-eclass_path.uses_eroot = True
 
+@uses_eroot
 def license_path(argv):
 	"""<eroot> <repo_id> <license>+
 	Returns the path to specified license for specified repository.
@@ -860,8 +869,8 @@ def license_path(argv):
 			print(eclass_path)
 		return retval
 
-license_path.uses_eroot = True
 
+@uses_eroot
 def list_preserved_libs(argv):
 	"""<eroot>
 	Print a list of libraries preserved during a package update in the form
@@ -883,7 +892,7 @@ def list_preserved_libs(argv):
 		msg.append('\n')
 	writemsg_stdout(''.join(msg), noiselevel=-1)
 	return rValue
-list_preserved_libs.uses_eroot = True
+
 
 class MaintainerEmailMatcher(object):
 	def __init__(self, maintainer_emails):
@@ -906,6 +915,8 @@ class HerdMatcher(object):
 		herds = self._herds
 		return any(x in herds for x in metadata_xml.herds())
 
+
+@uses_eroot
 def pquery(parser, pquery_option_groups, opts, args):
 	"""[options] [atom]+
 	Emulates a subset of Pkgcore's pquery tool.
@@ -1089,14 +1100,13 @@ def pquery(parser, pquery_option_groups, opts, args):
 
 	return os.EX_OK
 
-pquery.uses_eroot = False
 
 #-----------------------------------------------------------------------------
 #
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage', 'uses_eroot'])
 commands = sorted(k for k, v in globals().items() \
 	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-14 18:56 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-14 18:56 UTC (permalink / raw
  To: gentoo-commits

commit:     c0bc5eb192e6cdd65838a2c4cce403ffb17087a9
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jul 14 18:55:26 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Jul 14 18:55:26 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0bc5eb1

portageq: Delete incorrect usage of uses_eroot decorator for pquery.

---
 bin/portageq | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bin/portageq b/bin/portageq
index 990d1bf..0d9c278 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -916,7 +916,6 @@ class HerdMatcher(object):
 		return any(x in herds for x in metadata_xml.herds())
 
 
-@uses_eroot
 def pquery(parser, pquery_option_groups, opts, args):
 	"""[options] [atom]+
 	Emulates a subset of Pkgcore's pquery tool.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-16 18:57 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-16 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     abf350dfb580436efe51162e668d07567ab124bc
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jul 16 18:56:37 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Tue Jul 16 18:56:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=abf350df

die(): Stop using PORTDIR and clean output.

---
 bin/isolated-functions.sh | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 61ed8b7..4b5ed8b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -141,7 +141,7 @@ die() {
 	# get a stack trace, so at least report the phase that failed.
 	local phase_str=
 	[[ -n $EBUILD_PHASE ]] && phase_str=" ($EBUILD_PHASE phase)"
-	eerror "ERROR: $CATEGORY/$PF failed${phase_str}:"
+	eerror "ERROR: ${CATEGORY}/${PF}::${PORTAGE_REPO_NAME} failed${phase_str}:"
 	eerror "  ${*:-(no error message)}"
 	eerror
 	# __dump_trace is useless when the main script is a helper binary
@@ -174,28 +174,8 @@ die() {
 		| while read -r n ; do eerror "  ${n#RETAIN-LEADING-SPACE}" ; done
 	eerror
 	fi
-	eerror "If you need support, post the output of \`emerge --info '=$CATEGORY/$PF'\`,"
-	eerror "the complete build log and the output of \`emerge -pqv '=$CATEGORY/$PF'\`."
-	if [ "${EMERGE_FROM}" != "binary" ] && \
-		! has ${EBUILD_PHASE} prerm postrm && \
-		[ "${EBUILD#${PORTDIR}/}" == "${EBUILD}" ] ; then
-		local overlay=${EBUILD%/*}
-		overlay=${overlay%/*}
-		overlay=${overlay%/*}
-		if [[ -n $PORTAGE_REPO_NAME ]] ; then
-			eerror "This ebuild is from an overlay named" \
-				"'$PORTAGE_REPO_NAME': '${overlay}/'"
-		else
-			eerror "This ebuild is from an overlay: '${overlay}/'"
-		fi
-	elif [[ -n $PORTAGE_REPO_NAME && -f "$PORTDIR"/profiles/repo_name ]] ; then
-		local portdir_repo_name=$(<"$PORTDIR"/profiles/repo_name)
-		if [[ -n $portdir_repo_name && \
-			$portdir_repo_name != $PORTAGE_REPO_NAME ]] ; then
-			eerror "This ebuild is from a repository" \
-				"named '$PORTAGE_REPO_NAME'"
-		fi
-	fi
+	eerror "If you need support, post the output of \`emerge --info '=${CATEGORY}/${PF}::${PORTAGE_REPO_NAME}'\`,"
+	eerror "the complete build log and the output of \`emerge -pqv '=${CATEGORY}/${PF}::${PORTAGE_REPO_NAME}'\`."
 
 	# Only call die hooks here if we are executed via ebuild.sh or
 	# misc-functions.sh, since those are the only cases where the environment


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-21 16:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-21 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     d2dbcec42a554c3aab1ef1631a4100292e33c5d3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 21 16:53:32 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 16:53:32 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2dbcec4

rpmbuild: use --nodeps option

---
 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ad99d8a..9375734 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1231,7 +1231,7 @@ __dyn_rpm() {
 	addwrite "${RPMDIR}"
 	__dyn_spec
 	HOME=${T} \
-	rpmbuild -bb --clean --rmsource "${PF}.spec" --buildroot "${D}" --target "${CHOST}" || die "Failed to integrate rpm spec file"
+	rpmbuild -bb --clean --nodeps --rmsource "${PF}.spec" --buildroot "${D}" --target "${CHOST}" || die "Failed to integrate rpm spec file"
 	install -D "${dest_dir}/${PN}-${PV}-${PR}.${machine_name}.rpm" \
 		"${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
 		die "Failed to move rpm"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-22  1:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-22  1:59 UTC (permalink / raw
  To: gentoo-commits

commit:     658bffea09b4acf291ddc02a810d14d5a966b911
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 22 01:58:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 22 01:58:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=658bffea

portageq: add aliases for bug #476830

---
 bin/portageq | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/bin/portageq b/bin/portageq
index 0d9c278..d31ae34 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -668,6 +668,13 @@ def repositories_configuration(argv):
 	sys.stdout.write(portage.db[argv[0]]["vartree"].settings.repositories.config_string())
 	sys.stdout.flush()
 
+@uses_eroot
+def repos_config(argv):
+	"""
+	<eroot>
+	This is an alias for the repositories_configuration command.
+	"""
+	return repositories_configuration(argv)
 
 def portdir(argv):
 	"""
@@ -769,6 +776,12 @@ def master_repositories(argv):
 		else:
 			print(" ".join(x.name for x in repo.masters))
 
+@uses_eroot
+def master_repos(argv):
+	"""<eroot> <repo_id>+
+	This is an alias for the master_repositories command.
+	"""
+	return master_repositories(argv)
 
 @uses_eroot
 def get_repo_path(argv):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-22  3:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-22  3:21 UTC (permalink / raw
  To: gentoo-commits

commit:     17a114403d01b3aea226d5d9f1ff7b479df79e97
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 22 03:20:43 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 22 03:20:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=17a11440

__save_ebuild_env: filter __repo_key

---
 bin/save-ebuild-env.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 5b68b07..72055c9 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -70,7 +70,7 @@ __save_ebuild_env() {
 		__hasg __hasgq \
 		__save_ebuild_env __set_colors __filter_readonly_variables \
 		__preprocess_ebuild_env \
-		__source_all_bashrcs \
+		__repo_key __source_all_bashrcs \
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-22 20:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-22 20:48 UTC (permalink / raw
  To: gentoo-commits

commit:     d7cc898957c39d58e66558136f4f7fd556411420
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 22 20:47:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 22 20:47:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7cc8989

Quote ${PORTAGE_ECLASS_LOCATIONS[@]}

---
 bin/ebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 7ef8a76..18703bb 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -245,7 +245,7 @@ inherit() {
 			fi
 		fi
 
-		for repo_location in ${PORTAGE_ECLASS_LOCATIONS[@]}; do
+		for repo_location in "${PORTAGE_ECLASS_LOCATIONS[@]}"; do
 			potential_location="${repo_location}/eclass/${1}.eclass"
 			if [[ -f ${potential_location} ]]; then
 				location="${potential_location}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-23 22:18 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-23 22:18 UTC (permalink / raw
  To: gentoo-commits

commit:     92fa6a1e1fcc92f2ad8ce8896c4ce3ec39477485
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jul 23 22:18:13 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Tue Jul 23 22:18:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=92fa6a1e

egencache: Print warnings for deprecated options.

---
 bin/egencache | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/egencache b/bin/egencache
index 921c461..e3a3f13 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -108,7 +108,7 @@ def parse_args(args):
 		help="override the PORTAGE_GPG_KEY variable",
 		dest="gpg_key")
 	common.add_option("--portdir",
-		help="override the portage tree location (deprecated in favor of --repositories-configuration)",
+		help="override the PORTDIR variable (deprecated in favor of --repositories-configuration)",
 		dest="portdir")
 	common.add_option("--portdir-overlay",
 		help="override the PORTDIR_OVERLAY variable (deprecated in favor of --repositories-configuration)",
@@ -215,6 +215,13 @@ def parse_args(args):
 	if options.repo is None:
 		parser.error("--repo option is required")
 
+	if options.portdir is not None:
+		writemsg_level("egencache: warning: --portdir option is deprecated in favor of --repositories-configuration option\n",
+			level=logging.WARNING, noiselevel=-1)
+	if options.portdir_overlay is not None:
+		writemsg_level("egencache: warning: --portdir-overlay option is deprecated in favor of --repositories-configuration option\n",
+			level=logging.WARNING, noiselevel=-1)
+
 	for atom in args:
 		try:
 			atom = portage.dep.Atom(atom)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-25 18:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-25 18:00 UTC (permalink / raw
  To: gentoo-commits

commit:     c9a73d5f8d52803a703e8827c42ab3274ad3ec84
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 18:00:20 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 18:00:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c9a73d5f

repoman: auto disable bad commit opts, bug 478156

---
 bin/repoman | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index f21dacc..bbade95 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -287,12 +287,6 @@ def ParseArgs(argv, qahelp):
 	if opts.mode == 'ci':
 		opts.mode = 'commit'  # backwards compat shortcut
 
-	if opts.mode == 'commit' and not (opts.force or opts.pretend):
-		if opts.ignore_masked:
-			parser.error('Commit mode and --ignore-masked are not compatible')
-		if opts.without_mask:
-			parser.error('Commit mode and --without-mask are not compatible')
-
 	# Use the verbosity and quiet options to fiddle with the loglevel appropriately
 	for val in range(opts.verbosity):
 		logger = logging.getLogger()
@@ -302,6 +296,14 @@ def ParseArgs(argv, qahelp):
 		logger = logging.getLogger()
 		logger.setLevel(logger.getEffectiveLevel() + 10)
 
+	if opts.mode == 'commit' and not (opts.force or opts.pretend):
+		if opts.ignore_masked:
+			opts.ignore_masked = False
+			logging.warn('Commit mode automatically disables --ignore-masked')
+		if opts.without_mask:
+			opts.without_mask = False
+			logging.warn('Commit mode automatically disables --without-mask')
+
 	return (opts, args)
 
 qahelp = {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-27 22:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-27 22:29 UTC (permalink / raw
  To: gentoo-commits

commit:     af76565d011464a6da418478655848182099e117
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 27 22:28:40 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 27 22:28:40 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af76565d

repoman: export GPG_TTY for bug #477728

---
 bin/repoman | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index bbade95..5223439 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -638,6 +638,12 @@ if repo_config.sign_commit:
 			# Pass GNUPGHOME to git for bug #462362.
 			commit_env["GNUPGHOME"] = repoman_settings["PORTAGE_GPG_DIR"]
 
+		# Pass GPG_TTY to git for bug #477728.
+		try:
+			commit_env["GPG_TTY"] = os.ttyname(sys.stdin.fileno())
+		except OSError:
+			pass
+
 # In order to disable manifest signatures, repos may set
 # "sign-manifests = false" in metadata/layout.conf. This
 # can be used to prevent merge conflicts like those that


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-07-30 22:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-07-30 22:26 UTC (permalink / raw
  To: gentoo-commits

commit:     6df1eac93a0dc6f460bb2b38070184e355b35ea0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 30 22:25:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 22:25:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6df1eac9

install.py: handle zero file arguments (--help)

---
 bin/install.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/install.py b/bin/install.py
index b194941..1f56212 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -160,7 +160,7 @@ def copy_xattrs(opts, files):
 	Returns:
 	  system exit code
 	"""
-	if opts.directory:
+	if opts.directory or not files:
 		return os.EX_OK
 
 	if opts.target_directory is None:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-02 18:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-02 18:06 UTC (permalink / raw
  To: gentoo-commits

commit:     3b5023b646455cce1d7ba43c0dd065fb0b99717c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 18:05:51 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 18:05:51 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3b5023b6

xattr-helper.py: portage.util._argparse

---
 bin/xattr-helper.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index e63f2cb..a85309f 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -1,13 +1,14 @@
 #!/usr/bin/python
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import array
-import optparse
 import os
 import re
 import sys
 
+from portage.util._argparse import ArgumentParser
+
 if hasattr(os, "getxattr"):
 
 	class xattr(object):
@@ -128,21 +129,20 @@ def main(argv):
 	usage = "usage: %s [--dump | --restore]\n" % \
 		os.path.basename(argv[0])
 
-	parser = optparse.OptionParser(description=description, usage=usage)
+	parser = ArgumentParser(description=description, usage=usage)
 
-	actions = optparse.OptionGroup(parser, 'Actions')
-	actions.add_option("--dump",
+	actions = parser.add_argument_group('Actions')
+	actions.add_argument("--dump",
 		action="store_true",
 		help="Dump the values of all extended "
 			"attributes associated with null-separated"
 			" paths read from stdin.")
-	actions.add_option("--restore",
+	actions.add_argument("--restore",
 		action="store_true",
 		help="Restore extended attributes using"
 			" a dump read from stdin.")
-	parser.add_option_group(actions)
 
-	options, args = parser.parse_args(argv[1:])
+	options, args = parser.parse_known_args(argv[1:])
 
 	if len(args) != 0:
 		parser.error("expected zero arguments, "


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-02 22:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-02 22:37 UTC (permalink / raw
  To: gentoo-commits

commit:     a5823c2118325d01566efbafa947f323f0b925b2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 22:36:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 22:36:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a5823c21

repoman: simplify help output

This will simplify conversion to argparse.

---
 bin/repoman | 47 +++--------------------------------------------
 1 file changed, 3 insertions(+), 44 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 5223439..7d84daa 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -121,33 +121,6 @@ def exithandler(signum=None, frame=None):
 
 signal.signal(signal.SIGINT, exithandler)
 
-class RepomanHelpFormatter(optparse.IndentedHelpFormatter):
-	"""Repoman needs its own HelpFormatter for now, because the default ones
-	murder the help text."""
-
-	def __init__(self, indent_increment=1, max_help_position=24, width=150, short_first=1):
-		optparse.HelpFormatter.__init__(self, indent_increment, max_help_position, width, short_first)
-
-	def format_description(self, description):
-		return description
-
-class RepomanOptionParser(optparse.OptionParser):
-	"""Add the on_tail function, ruby has it, optionParser should too
-	"""
-
-	def __init__(self, *args, **kwargs):
-		optparse.OptionParser.__init__(self, *args, **kwargs)
-		self.tail = ""
-
-	def on_tail(self, description):
-		self.tail += description
-
-	def format_help(self, formatter=None):
-		result = optparse.OptionParser.format_help(self, formatter)
-		result += self.tail
-		return result
-
-
 def ParseArgs(argv, qahelp):
 	"""This function uses a customized optionParser to parse command line arguments for repoman
 	Args:
@@ -173,11 +146,9 @@ def ParseArgs(argv, qahelp):
 	mode_keys = list(modes)
 	mode_keys.sort()
 
-	parser = RepomanOptionParser(formatter=RepomanHelpFormatter(), usage="%prog [options] [mode]")
-	parser.description = green(" ".join((os.path.basename(argv[0]), "1.2")))
-	parser.description += "\nCopyright 1999-2007 Gentoo Foundation"
-	parser.description += "\nDistributed under the terms of the GNU General Public License v2"
-	parser.description += "\nmodes: " + " | ".join(map(green, mode_keys))
+	parser = optparse.OptionParser(usage="%prog [options] [mode]",
+		description="Modes: %s" % " | ".join(mode_keys),
+		epilog="For more help consult the man page.")
 
 	parser.add_option('-a', '--ask', dest='ask', action='store_true', default=False,
 		help='Request a confirmation before commiting')
@@ -250,18 +221,6 @@ def ParseArgs(argv, qahelp):
 	parser.add_option('--mode', type='choice', dest='mode', choices=list(modes),
 		help='specify which mode repoman will run in (default=full)')
 
-	parser.on_tail("\n " + green("Modes".ljust(20) + " Description\n"))
-
-	for k in mode_keys:
-		parser.on_tail(" %s %s\n" % (k.ljust(20), modes[k]))
-
-	parser.on_tail("\n " + green("QA keyword".ljust(20) + " Description\n"))
-
-	sorted_qa = list(qahelp)
-	sorted_qa.sort()
-	for k in sorted_qa:
-		parser.on_tail(" %s %s\n" % (k.ljust(20), qahelp[k]))
-
 	opts, args = parser.parse_args(argv[1:])
 
 	if not opts.ignore_default_opts:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-02 22:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-02 22:49 UTC (permalink / raw
  To: gentoo-commits

commit:     59f65bd7a03861d53608b298398246682505b31b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 22:49:37 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 22:49:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=59f65bd7

repoman: portage.util._argparse

---
 bin/repoman | 54 +++++++++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 7d84daa..638bd37 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -14,7 +14,6 @@ import errno
 import formatter
 import io
 import logging
-import optparse
 import re
 import signal
 import stat
@@ -76,6 +75,7 @@ from portage.output import bold, create_color_func, \
 	green, nocolor, red
 from portage.output import ConsoleStyleFile, StyleWriter
 from portage.util import writemsg_level
+from portage.util._argparse import ArgumentParser
 from portage.package.ebuild.digestgen import digestgen
 from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
 
@@ -146,82 +146,82 @@ def ParseArgs(argv, qahelp):
 	mode_keys = list(modes)
 	mode_keys.sort()
 
-	parser = optparse.OptionParser(usage="%prog [options] [mode]",
+	parser = ArgumentParser(usage="repoman [options] [mode]",
 		description="Modes: %s" % " | ".join(mode_keys),
 		epilog="For more help consult the man page.")
 
-	parser.add_option('-a', '--ask', dest='ask', action='store_true', default=False,
+	parser.add_argument('-a', '--ask', dest='ask', action='store_true', default=False,
 		help='Request a confirmation before commiting')
 
-	parser.add_option('-m', '--commitmsg', dest='commitmsg',
+	parser.add_argument('-m', '--commitmsg', dest='commitmsg',
 		help='specify a commit message on the command line')
 
-	parser.add_option('-M', '--commitmsgfile', dest='commitmsgfile',
+	parser.add_argument('-M', '--commitmsgfile', dest='commitmsgfile',
 		help='specify a path to a file that contains a commit message')
 
-	parser.add_option('--digest',
-		type='choice', choices=('y', 'n'), metavar='<y|n>',
+	parser.add_argument('--digest',
+		choices=('y', 'n'), metavar='<y|n>',
 		help='Automatically update Manifest digests for modified files')
 
-	parser.add_option('-p', '--pretend', dest='pretend', default=False,
+	parser.add_argument('-p', '--pretend', dest='pretend', default=False,
 		action='store_true', help='don\'t commit or fix anything; just show what would be done')
 
-	parser.add_option('-q', '--quiet', dest="quiet", action="count", default=0,
+	parser.add_argument('-q', '--quiet', dest="quiet", action="count", default=0,
 		help='do not print unnecessary messages')
 
-	parser.add_option(
-		'--echangelog', type='choice', choices=('y', 'n', 'force'), metavar="<y|n|force>",
+	parser.add_argument(
+		'--echangelog', choices=('y', 'n', 'force'), metavar="<y|n|force>",
 		help='for commit mode, call echangelog if ChangeLog is unmodified (or '
 		'regardless of modification if \'force\' is specified)')
 
-	parser.add_option('-f', '--force', dest='force', default=False, action='store_true',
+	parser.add_argument('-f', '--force', dest='force', default=False, action='store_true',
 		help='Commit with QA violations')
 
-	parser.add_option('--vcs', dest='vcs',
+	parser.add_argument('--vcs', dest='vcs',
 		help='Force using specific VCS instead of autodetection')
 
-	parser.add_option('-v', '--verbose', dest="verbosity", action='count',
+	parser.add_argument('-v', '--verbose', dest="verbosity", action='count',
 		help='be very verbose in output', default=0)
 
-	parser.add_option('-V', '--version', dest='version', action='store_true',
+	parser.add_argument('-V', '--version', dest='version', action='store_true',
 		help='show version info')
 
-	parser.add_option('-x', '--xmlparse', dest='xml_parse', action='store_true',
+	parser.add_argument('-x', '--xmlparse', dest='xml_parse', action='store_true',
 		default=False, help='forces the metadata.xml parse check to be carried out')
 
-	parser.add_option(
-		'--if-modified', type='choice', choices=('y', 'n'), default='n',
+	parser.add_argument(
+		'--if-modified', choices=('y', 'n'), default='n',
 		metavar="<y|n>",
 		help='only check packages that have uncommitted modifications')
 
-	parser.add_option('-i', '--ignore-arches', dest='ignore_arches', action='store_true',
+	parser.add_argument('-i', '--ignore-arches', dest='ignore_arches', action='store_true',
 		default=False, help='ignore arch-specific failures (where arch != host)')
 
-	parser.add_option("--ignore-default-opts",
+	parser.add_argument("--ignore-default-opts",
 		action="store_true",
 		help="do not use the REPOMAN_DEFAULT_OPTS environment variable")
 
-	parser.add_option('-I', '--ignore-masked', dest='ignore_masked', action='store_true',
+	parser.add_argument('-I', '--ignore-masked', dest='ignore_masked', action='store_true',
 		default=False, help='ignore masked packages (not allowed with commit mode)')
 
-	parser.add_option('--include-arches', dest='include_arches',
+	parser.add_argument('--include-arches', dest='include_arches',
 		metavar='ARCHES', action='append',
 		help='A space separated list of arches used to '
 		'filter the selection of profiles for dependency checks')
 
-	parser.add_option('-d', '--include-dev', dest='include_dev', action='store_true',
+	parser.add_argument('-d', '--include-dev', dest='include_dev', action='store_true',
 		default=False, help='include dev profiles in dependency checks')
 
-	parser.add_option('--unmatched-removal', dest='unmatched_removal', action='store_true',
+	parser.add_argument('--unmatched-removal', dest='unmatched_removal', action='store_true',
 		default=False, help='enable strict checking of package.mask and package.unmask files for unmatched removal atoms')
 
-	parser.add_option('--without-mask', dest='without_mask', action='store_true',
+	parser.add_argument('--without-mask', dest='without_mask', action='store_true',
 		default=False, help='behave as if no package.mask entries exist (not allowed with commit mode)')
 
-	parser.add_option('--mode', type='choice', dest='mode', choices=list(modes),
+	parser.add_argument('--mode', dest='mode', choices=mode_keys,
 		help='specify which mode repoman will run in (default=full)')
 
-	opts, args = parser.parse_args(argv[1:])
+	opts, args = parser.parse_known_args(argv[1:])
 
 	if not opts.ignore_default_opts:
 		default_opts = portage.util.shlex_split(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-02 23:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-02 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     506c757ef1f3b6c59f381b9a63bf4b03497be075
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 23:03:53 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 23:03:53 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=506c757e

egencache: portage.util._argparse

---
 bin/egencache | 67 +++++++++++++++++++++++++++--------------------------------
 1 file changed, 31 insertions(+), 36 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index e3a3f13..45d4fbd 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -35,7 +35,6 @@ signal.signal(debug_signum, debug_signal)
 
 import io
 import logging
-import optparse
 import subprocess
 import time
 import textwrap
@@ -52,6 +51,7 @@ from portage.cache.cache_errors import CacheError, StatCollision
 from portage.manifest import guessManifestFileType
 from portage.package.ebuild._parallel_manifest.ManifestScheduler import ManifestScheduler
 from portage.util import cmp_sort_key, writemsg_level
+from portage.util._argparse import ArgumentParser
 from portage.util._async.run_main_scheduler import run_main_scheduler
 from portage.util._eventloop.global_event_loop import global_event_loop
 from portage import cpv_getkey
@@ -77,95 +77,90 @@ if sys.hexversion >= 0x3000000:
 
 def parse_args(args):
 	usage = "egencache [options] <action> ... [atom] ..."
-	parser = optparse.OptionParser(usage=usage)
+	parser = ArgumentParser(usage=usage)
 
-	actions = optparse.OptionGroup(parser, 'Actions')
-	actions.add_option("--update",
+	actions = parser.add_argument_group('Actions')
+	actions.add_argument("--update",
 		action="store_true",
 		help="update metadata/md5-cache/ (generate as necessary)")
-	actions.add_option("--update-use-local-desc",
+	actions.add_argument("--update-use-local-desc",
 		action="store_true",
 		help="update the use.local.desc file from metadata.xml")
-	actions.add_option("--update-changelogs",
+	actions.add_argument("--update-changelogs",
 		action="store_true",
 		help="update the ChangeLog files from SCM logs")
-	actions.add_option("--update-manifests",
+	actions.add_argument("--update-manifests",
 		action="store_true",
 		help="update manifests")
-	parser.add_option_group(actions)
 
-	common = optparse.OptionGroup(parser, 'Common options')
-	common.add_option("--repo",
+	common = parser.add_argument_group('Common options')
+	common.add_argument("--repo",
 		action="store",
 		help="name of repo to operate on")
-	common.add_option("--config-root",
+	common.add_argument("--config-root",
 		help="location of portage config files",
 		dest="portage_configroot")
-	common.add_option("--gpg-dir",
+	common.add_argument("--gpg-dir",
 		help="override the PORTAGE_GPG_DIR variable",
 		dest="gpg_dir")
-	common.add_option("--gpg-key",
+	common.add_argument("--gpg-key",
 		help="override the PORTAGE_GPG_KEY variable",
 		dest="gpg_key")
-	common.add_option("--portdir",
+	common.add_argument("--portdir",
 		help="override the PORTDIR variable (deprecated in favor of --repositories-configuration)",
 		dest="portdir")
-	common.add_option("--portdir-overlay",
+	common.add_argument("--portdir-overlay",
 		help="override the PORTDIR_OVERLAY variable (deprecated in favor of --repositories-configuration)",
 		dest="portdir_overlay")
-	common.add_option("--repositories-configuration",
+	common.add_argument("--repositories-configuration",
 		help="override configuration of repositories (in format of repos.conf)",
 		dest="repositories_configuration")
-	common.add_option("--sign-manifests",
-		type="choice",
+	common.add_argument("--sign-manifests",
 		choices=('y', 'n'),
 		metavar="<y|n>",
 		help="manually override layout.conf sign-manifests setting")
-	common.add_option("--strict-manifests",
-		type="choice",
+	common.add_argument("--strict-manifests",
 		choices=('y', 'n'),
 		metavar="<y|n>",
 		help="manually override \"strict\" FEATURES setting")
-	common.add_option("--thin-manifests",
-		type="choice",
+	common.add_argument("--thin-manifests",
 		choices=('y', 'n'),
 		metavar="<y|n>",
 		help="manually override layout.conf thin-manifests setting")
-	common.add_option("--tolerant",
+	common.add_argument("--tolerant",
 		action="store_true",
 		help="exit successfully if only minor errors occurred")
-	common.add_option("--ignore-default-opts",
+	common.add_argument("--ignore-default-opts",
 		action="store_true",
 		help="do not use the EGENCACHE_DEFAULT_OPTS environment variable")
-	parser.add_option_group(common)
 
-	update = optparse.OptionGroup(parser, '--update options')
-	update.add_option("--cache-dir",
+	update = parser.add_argument_group('--update options')
+	update.add_argument("--cache-dir",
 		help="location of the metadata cache",
 		dest="cache_dir")
-	update.add_option("-j", "--jobs",
+	update.add_argument("-j", "--jobs",
+		type=int,
 		action="store",
 		help="max ebuild processes to spawn")
-	update.add_option("--load-average",
+	update.add_argument("--load-average",
+		type=float,
 		action="store",
 		help="max load allowed when spawning multiple jobs",
 		dest="load_average")
-	update.add_option("--rsync",
+	update.add_argument("--rsync",
 		action="store_true",
 		help="enable rsync stat collision workaround " + \
 			"for bug 139134 (use with --update)")
-	parser.add_option_group(update)
 
-	uld = optparse.OptionGroup(parser, '--update-use-local-desc options')
-	uld.add_option("--preserve-comments",
+	uld = parser.add_argument_group('--update-use-local-desc options')
+	uld.add_argument("--preserve-comments",
 		action="store_true",
 		help="preserve the comments from the existing use.local.desc file")
-	uld.add_option("--use-local-desc-output",
+	uld.add_argument("--use-local-desc-output",
 		help="output file for use.local.desc data (or '-' for stdout)",
 		dest="uld_output")
-	parser.add_option_group(uld)
 
-	options, args = parser.parse_args(args)
+	options, args = parser.parse_known_args(args)
 
 	if options.jobs:
 		jobs = None


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  0:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  0:49 UTC (permalink / raw
  To: gentoo-commits

commit:     3e12410b8c7a6ea5416f24a6e15cd377917ab775
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 00:48:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 00:48:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3e12410b

binhost-snapshot: portage.util._argparse

---
 bin/binhost-snapshot | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index e9bd45a..376080c 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -3,7 +3,6 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import io
-import optparse
 import os
 import sys
 import textwrap
@@ -18,6 +17,7 @@ pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
 portage._internal_caller = True
+from portage.util._argparse import ArgumentParser
 
 def parse_args(argv):
 	prog_name = os.path.basename(argv[0])
@@ -45,11 +45,12 @@ def parse_args(argv):
 		"write Packages index with\n" + \
 		"                 snapshot_uri"
 
-	parser = optparse.OptionParser(usage=usage)
-	parser.add_option('--hardlinks', help='create hardlinks (y or n, default is y)',
-		choices=('y', 'n'))
-	parser.set_defaults(hardlinks='y')
-	options, args = parser.parse_args(argv[1:])
+	parser = ArgumentParser(usage=usage)
+	parser.add_argument('--hardlinks',
+		help='create hardlinks (y or n, default is y)',
+		choices=('y', 'n'),
+		default='y')
+	options, args = parser.parse_known_args(argv[1:])
 
 	if len(args) != 4:
 		parser.error("Required 4 arguments, got %d" % (len(args),))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  0:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  0:49 UTC (permalink / raw
  To: gentoo-commits

commit:     aa4d093eb3fb1bcfc9fe3bad0ed6a6d88bc9417a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 00:48:55 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 00:48:55 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aa4d093e

ebuild: portage.util._argparse

---
 bin/ebuild | 51 +++++++++++++++++++++++++--------------------------
 1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 4fdc762..8221c29 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -36,33 +36,7 @@ else:
 signal.signal(debug_signum, debug_signal)
 
 import io
-import optparse
 import os
-
-description = "See the ebuild(1) man page for more info"
-usage = "Usage: ebuild <ebuild file> <command> [command] ..."
-parser = optparse.OptionParser(description=description, usage=usage)
-
-force_help = "When used together with the digest or manifest " + \
-	"command, this option forces regeneration of digests for all " + \
-	"distfiles associated with the current ebuild. Any distfiles " + \
-	"that do not already exist in ${DISTDIR} will be automatically fetched."
-
-parser.add_option("--force", help=force_help, action="store_true", dest="force")
-parser.add_option("--color", help="enable or disable color output",
-	type="choice", choices=("y", "n"))
-parser.add_option("--debug", help="show debug output",
-	action="store_true", dest="debug")
-parser.add_option("--version", help="show version and exit",
-	action="store_true", dest="version")
-parser.add_option("--ignore-default-opts",
-	action="store_true",
-	help="do not use the EBUILD_DEFAULT_OPTS environment variable")
-parser.add_option("--skip-manifest", help="skip all manifest checks",
-	action="store_true", dest="skip_manifest")
-
-opts, pargs = parser.parse_args(args=sys.argv[1:])
-
 from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
@@ -74,9 +48,34 @@ from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
 from portage.const import VDB_PATH
+from portage.util._argparse import ArgumentParser
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
+description = "See the ebuild(1) man page for more info"
+usage = "Usage: ebuild <ebuild file> <command> [command] ..."
+parser = ArgumentParser(description=description, usage=usage)
+
+force_help = "When used together with the digest or manifest " + \
+	"command, this option forces regeneration of digests for all " + \
+	"distfiles associated with the current ebuild. Any distfiles " + \
+	"that do not already exist in ${DISTDIR} will be automatically fetched."
+
+parser.add_argument("--force", help=force_help, action="store_true")
+parser.add_argument("--color", help="enable or disable color output",
+	choices=("y", "n"))
+parser.add_argument("--debug", help="show debug output",
+	action="store_true")
+parser.add_argument("--version", help="show version and exit",
+	action="store_true")
+parser.add_argument("--ignore-default-opts",
+	action="store_true",
+	help="do not use the EBUILD_DEFAULT_OPTS environment variable")
+parser.add_argument("--skip-manifest", help="skip all manifest checks",
+	action="store_true")
+
+opts, pargs = parser.parse_known_args(args=sys.argv[1:])
+
 def err(txt):
 	portage.writemsg('ebuild: %s\n' % (txt,), noiselevel=-1)
 	sys.exit(1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  0:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  0:59 UTC (permalink / raw
  To: gentoo-commits

commit:     42b76667b04bb87ac9a16469a24f8bc57c61abcd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 00:48:55 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 00:59:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=42b76667

ebuild: portage.util._argparse

---
 bin/ebuild | 53 ++++++++++++++++++++++++++---------------------------
 1 file changed, 26 insertions(+), 27 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 4fdc762..a100657 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -36,33 +36,7 @@ else:
 signal.signal(debug_signum, debug_signal)
 
 import io
-import optparse
 import os
-
-description = "See the ebuild(1) man page for more info"
-usage = "Usage: ebuild <ebuild file> <command> [command] ..."
-parser = optparse.OptionParser(description=description, usage=usage)
-
-force_help = "When used together with the digest or manifest " + \
-	"command, this option forces regeneration of digests for all " + \
-	"distfiles associated with the current ebuild. Any distfiles " + \
-	"that do not already exist in ${DISTDIR} will be automatically fetched."
-
-parser.add_option("--force", help=force_help, action="store_true", dest="force")
-parser.add_option("--color", help="enable or disable color output",
-	type="choice", choices=("y", "n"))
-parser.add_option("--debug", help="show debug output",
-	action="store_true", dest="debug")
-parser.add_option("--version", help="show version and exit",
-	action="store_true", dest="version")
-parser.add_option("--ignore-default-opts",
-	action="store_true",
-	help="do not use the EBUILD_DEFAULT_OPTS environment variable")
-parser.add_option("--skip-manifest", help="skip all manifest checks",
-	action="store_true", dest="skip_manifest")
-
-opts, pargs = parser.parse_args(args=sys.argv[1:])
-
 from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
@@ -74,9 +48,34 @@ from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
 from portage.const import VDB_PATH
+from portage.util._argparse import ArgumentParser
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
+description = "See the ebuild(1) man page for more info"
+usage = "Usage: ebuild <ebuild file> <command> [command] ..."
+parser = ArgumentParser(description=description, usage=usage)
+
+force_help = "When used together with the digest or manifest " + \
+	"command, this option forces regeneration of digests for all " + \
+	"distfiles associated with the current ebuild. Any distfiles " + \
+	"that do not already exist in ${DISTDIR} will be automatically fetched."
+
+parser.add_argument("--force", help=force_help, action="store_true")
+parser.add_argument("--color", help="enable or disable color output",
+	choices=("y", "n"))
+parser.add_argument("--debug", help="show debug output",
+	action="store_true")
+parser.add_argument("--version", help="show version and exit",
+	action="store_true")
+parser.add_argument("--ignore-default-opts",
+	action="store_true",
+	help="do not use the EBUILD_DEFAULT_OPTS environment variable")
+parser.add_argument("--skip-manifest", help="skip all manifest checks",
+	action="store_true")
+
+opts, pargs = parser.parse_known_args(args=sys.argv[1:])
+
 def err(txt):
 	portage.writemsg('ebuild: %s\n' % (txt,), noiselevel=-1)
 	sys.exit(1)
@@ -91,7 +90,7 @@ if len(pargs) < 2:
 if not opts.ignore_default_opts:
 	default_opts = portage.util.shlex_split(
 		portage.settings.get("EBUILD_DEFAULT_OPTS", ""))
-	opts, pargs = parser.parse_args(default_opts + sys.argv[1:])
+	opts, pargs = parser.parse_known_args(default_opts + sys.argv[1:])
 
 debug = opts.debug
 force = opts.force


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  1:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  1:02 UTC (permalink / raw
  To: gentoo-commits

commit:     b919259cc54830e6d4ffbfa3aa878f16f4c3c016
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 01:02:19 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 01:02:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b919259c

filter-bash-environment.py: don't use optparse

---
 bin/filter-bash-environment.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
index b9aec96..3d4b3ec 100755
--- a/bin/filter-bash-environment.py
+++ b/bin/filter-bash-environment.py
@@ -1,10 +1,9 @@
 #!/usr/bin/python
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import codecs
 import io
-import optparse
 import os
 import re
 import sys
@@ -126,10 +125,19 @@ if __name__ == "__main__":
 		"intact. The PATTERN is a space separated list of variable names" + \
 		" and it supports python regular expression syntax."
 	usage = "usage: %s PATTERN" % os.path.basename(sys.argv[0])
-	parser = optparse.OptionParser(description=description, usage=usage)
-	options, args = parser.parse_args(sys.argv[1:])
+	args = sys.argv[1:]
+
+	if '-h' in args or '--help' in args:
+		sys.stdout.write(usage + "\n")
+		sys.stdout.flush()
+		sys.exit(os.EX_OK)
+
 	if len(args) != 1:
-		parser.error("Missing required PATTERN argument.")
+		sys.stderr.write(usage + "\n")
+		sys.stderr.write("Exactly one PATTERN argument required.\n")
+		sys.stderr.flush()
+		sys.exit(2)
+
 	file_in = sys.stdin
 	file_out = sys.stdout
 	if sys.hexversion >= 0x3000000:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  1:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  1:21 UTC (permalink / raw
  To: gentoo-commits

commit:     9aac9539294a607d9968a0cbfa46cd5a963ce309
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 01:21:37 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 01:21:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9aac9539

glsa-check: portage.util._argparse

---
 bin/glsa-check | 61 +++++++++++++++++++++++++++++-----------------------------
 1 file changed, 30 insertions(+), 31 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index f1aef04..7fa3688 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -14,67 +14,66 @@ import portage
 portage._internal_caller = True
 from portage import os
 from portage.output import green, red, nocolor, white
-
-from optparse import OptionGroup, OptionParser
+from portage.util._argparse import ArgumentParser
 
 __program__ = "glsa-check"
 __author__ = "Marius Mauch <genone@gentoo.org>"
 __version__ = "1.0"
 
-def cb_version(*args, **kwargs):
-	"""Callback for --version"""
-	sys.stderr.write("\n"+ __program__ + ", version " + __version__ + "\n")
-	sys.stderr.write("Author: " + __author__ + "\n")
-	sys.stderr.write("This program is licensed under the GPL, version 2\n\n")
-	sys.exit(0)
-
 # option parsing
-parser = OptionParser(usage="%prog <option> [glsa-list]",
-		version="%prog "+ __version__)
-parser.epilog = "glsa-list can contain an arbitrary number of GLSA ids," \
+epilog = "glsa-list can contain an arbitrary number of GLSA ids," \
 		" filenames containing GLSAs or the special identifiers" \
 		" 'all', 'new' and 'affected'"
+parser = ArgumentParser(usage=__program__ + " <option> [glsa-list]",
+	epilog=epilog)
 
-modes = OptionGroup(parser, "Modes")
-modes.add_option("-l", "--list", action="store_const",
+modes = parser.add_argument_group("Modes")
+modes.add_argument("-l", "--list", action="store_const",
 		const="list", dest="mode",
 		help="List all unapplied GLSA")
-modes.add_option("-d", "--dump", action="store_const",
+modes.add_argument("-d", "--dump", action="store_const",
 		const="dump", dest="mode",
 		help="Show all information about the given GLSA")
-modes.add_option("", "--print", action="store_const",
+modes.add_argument("--print", action="store_const",
 		const="dump", dest="mode",
 		help="Alias for --dump")
-modes.add_option("-t", "--test", action="store_const",
+modes.add_argument("-t", "--test", action="store_const",
 		const="test", dest="mode",
 		help="Test if this system is affected by the given GLSA")
-modes.add_option("-p", "--pretend", action="store_const",
+modes.add_argument("-p", "--pretend", action="store_const",
 		const="pretend", dest="mode",
 		help="Show the necessary commands to apply this GLSA")
-modes.add_option("-f", "--fix", action="store_const",
+modes.add_argument("-f", "--fix", action="store_const",
 		const="fix", dest="mode",
 		help="Try to auto-apply this GLSA (experimental)")
-modes.add_option("-i", "--inject", action="store_const", dest="mode",
+modes.add_argument("-i", "--inject", action="store_const",
+		const="inject", dest="mode",
 		help="inject the given GLSA into the glsa_injected file")
-modes.add_option("-m", "--mail", action="store_const",
+modes.add_argument("-m", "--mail", action="store_const",
 		const="mail", dest="mode",
 		help="Send a mail with the given GLSAs to the administrator")
-parser.add_option_group(modes)
 
-parser.remove_option("--version")
-parser.add_option("-V", "--version", action="callback",
-		callback=cb_version, help="Some information about this tool")
-parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
+parser.add_argument("-V", "--version", action="store_true",
+		help="Some information about this tool")
+parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
 		help="Print more information")
-parser.add_option("-n", "--nocolor", action="callback",
-		callback=lambda *args, **kwargs: nocolor(),
+parser.add_argument("-n", "--nocolor", action="store_true",
 		help="Disable colors")
-parser.add_option("-e", "--emergelike", action="store_false", dest="least_change",
+parser.add_argument("-e", "--emergelike", action="store_false", dest="least_change",
 		help="Do not use a least-change algorithm")
-parser.add_option("-c", "--cve", action="store_true", dest="list_cve",
+parser.add_argument("-c", "--cve", action="store_true", dest="list_cve",
 		help="Show CAN ids in listing mode")
 
-options, params = parser.parse_args()
+options, params = parser.parse_known_args()
+
+if options.nocolor:
+	nocolor()
+
+if options.version:
+	sys.stderr.write("\n"+ __program__ + ", version " + __version__ + "\n")
+	sys.stderr.write("Author: " + __author__ + "\n")
+	sys.stderr.write("This program is licensed under the GPL, version 2\n\n")
+	sys.exit(0)
 
 mode = options.mode
 least_change = options.least_change


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  1:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  1:27 UTC (permalink / raw
  To: gentoo-commits

commit:     651292d1b380e7e027a47cf5430a715d74f2799a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 01:27:20 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 01:27:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=651292d1

repoman: use parse_known_args

---
 bin/repoman | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 638bd37..452ca48 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -227,7 +227,7 @@ def ParseArgs(argv, qahelp):
 		default_opts = portage.util.shlex_split(
 			repoman_settings.get("REPOMAN_DEFAULT_OPTS", ""))
 		if default_opts:
-			opts, args = parser.parse_args(default_opts + sys.argv[1:])
+			opts, args = parser.parse_known_args(default_opts + sys.argv[1:])
 
 	if opts.mode == 'help':
 		parser.print_help(short=False)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  1:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  1:29 UTC (permalink / raw
  To: gentoo-commits

commit:     adf7be633dca8e5112d622b9f68f01c93f65f4f6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 01:29:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 01:29:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=adf7be63

quickpkg: portage.util._argparse

---
 bin/quickpkg | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 16118ab..cf5800c 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -6,7 +6,6 @@ from __future__ import print_function
 
 import errno
 import math
-import optparse
 import signal
 import sys
 import tarfile
@@ -26,6 +25,7 @@ from portage.util import ConfigProtect, ensure_dirs, shlex_split
 from portage.dbapi.vartree import dblink, tar_contents
 from portage.checksum import perform_md5
 from portage._sets import load_default_config, SETPREFIX
+from portage.util._argparse import ArgumentParser
 
 def quickpkg_atom(options, infos, arg, eout):
 	settings = portage.settings
@@ -289,30 +289,28 @@ def quickpkg_main(options, args, eout):
 
 if __name__ == "__main__":
 	usage = "quickpkg [options] <list of package atoms or package sets>"
-	parser = optparse.OptionParser(usage=usage)
-	parser.add_option("--umask",
+	parser = ArgumentParser(usage=usage)
+	parser.add_argument("--umask",
 		default="0077",
 		help="umask used during package creation (default is 0077)")
-	parser.add_option("--ignore-default-opts",
+	parser.add_argument("--ignore-default-opts",
 		action="store_true",
 		help="do not use the QUICKPKG_DEFAULT_OPTS environment variable")
-	parser.add_option("--include-config",
-		type="choice",
+	parser.add_argument("--include-config",
 		choices=["y","n"],
 		default="n",
 		metavar="<y|n>",
 		help="include all files protected by CONFIG_PROTECT (as a security precaution, default is 'n')")
-	parser.add_option("--include-unmodified-config",
-		type="choice",
+	parser.add_argument("--include-unmodified-config",
 		choices=["y","n"],
 		default="n",
 		metavar="<y|n>",
 		help="include files protected by CONFIG_PROTECT that have not been modified since installation (as a security precaution, default is 'n')")
-	options, args = parser.parse_args(sys.argv[1:])
+	options, args = parser.parse_known_args(sys.argv[1:])
 	if not options.ignore_default_opts:
 		default_opts = shlex_split(
 			portage.settings.get("QUICKPKG_DEFAULT_OPTS", ""))
-		options, args = parser.parse_args(default_opts + sys.argv[1:])
+		options, args = parser.parse_known_args(default_opts + sys.argv[1:])
 	if not args:
 		parser.error("no packages atoms given")
 	try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03  1:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03  1:32 UTC (permalink / raw
  To: gentoo-commits

commit:     80934d0c3631abfc2e4410fc68d8c12f8c6b1d02
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 01:32:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 01:32:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80934d0c

xpak-helper.py: portage.util._argparse

---
 bin/xpak-helper.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/xpak-helper.py b/bin/xpak-helper.py
index 7a3865c..d9d325d 100755
--- a/bin/xpak-helper.py
+++ b/bin/xpak-helper.py
@@ -2,11 +2,11 @@
 # Copyright 2009-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-import optparse
 import sys
 import portage
 portage._internal_caller = True
 from portage import os
+from portage.util._argparse import ArgumentParser
 
 def command_recompose(args):
 
@@ -46,8 +46,8 @@ def main(argv):
 	usage = "usage: %s COMMAND [args]" % \
 		os.path.basename(argv[0])
 
-	parser = optparse.OptionParser(description=description, usage=usage)
-	options, args = parser.parse_args(argv[1:])
+	parser = ArgumentParser(description=description, usage=usage)
+	options, args = parser.parse_known_args(argv[1:])
 
 	if not args:
 		parser.error("missing command argument")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03 11:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03 11:09 UTC (permalink / raw
  To: gentoo-commits

commit:     a907b6d292208002116105544cd48b20a66a35fe
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 11:08:53 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 11:08:53 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a907b6d2

__repo_key: fix for bash-3.2 compatibility

---
 bin/isolated-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 4b5ed8b..6ef8a91 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -461,7 +461,7 @@ __repo_key() {
 	while read line; do
 		[[ ${appropriate_section} == 0 && ${line} == "[$1]" ]] && appropriate_section=1 && continue
 		[[ ${appropriate_section} == 1 && ${line} == "["*"]" ]] && appropriate_section=0 && continue
-		if [[ ${appropriate_section} == 1 && ${line} == $2*( )=* ]]; then
+		if [[ ${appropriate_section} == 1 && ${line} =~ ^${2}[[:space:]]*= ]]; then
 			echo "${line##$2*( )=*( )}"
 			exit_status=0
 			break


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-03 22:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-03 22:14 UTC (permalink / raw
  To: gentoo-commits

commit:     c0c15070d120546af3e43654f71b8178b8ddb882
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 22:14:14 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 22:14:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0c15070

__repo_key: comment on bash-3.2 compatibility

---
 bin/isolated-functions.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 6ef8a91..42d9e70 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -461,6 +461,10 @@ __repo_key() {
 	while read line; do
 		[[ ${appropriate_section} == 0 && ${line} == "[$1]" ]] && appropriate_section=1 && continue
 		[[ ${appropriate_section} == 1 && ${line} == "["*"]" ]] && appropriate_section=0 && continue
+		# If a conditional expression like [[ ${line} == $2*( )=* ]] is used
+		# then bash-3.2 produces an error like the following when the file is
+		# sourced: syntax error in conditional expression: unexpected token `('
+		# Therefore, use a regular expression for compatibility.
 		if [[ ${appropriate_section} == 1 && ${line} =~ ^${2}[[:space:]]*= ]]; then
 			echo "${line##$2*( )=*( )}"
 			exit_status=0


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-05 17:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-05 17:57 UTC (permalink / raw
  To: gentoo-commits

commit:     7d5775778432458bde6298badf182b4db90487fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  5 17:56:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  5 17:56:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d577577

repoman: don't deprecate ruby_targets_rbx

It was mistakenly deprecated (see bug #469616).

---
 bin/repoman | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 4ffe10d..2f98a9f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -479,7 +479,6 @@ suspect_virtual = {
 }
 
 ruby_deprecated = {
-	"ruby_targets_rbx",
 	"ruby_targets_ree18",
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-06  4:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-06  4:30 UTC (permalink / raw
  To: gentoo-commits

commit:     4072d0563bb7a893a828a060a4360aca2eaf8b45
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  6 04:29:45 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug  6 04:29:45 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4072d056

repoman: remove set literal for python-2.6 compat

---
 bin/repoman | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 2f98a9f..2f48934 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -478,9 +478,9 @@ suspect_virtual = {
 	"dev-libs/libusb-compat":"virtual/libusb",
 }
 
-ruby_deprecated = {
+ruby_deprecated = frozenset([
 	"ruby_targets_ree18",
-}
+])
 
 metadata_xml_encoding = 'UTF-8'
 metadata_xml_declaration = '<?xml version="1.0" encoding="%s"?>' % \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-12 23:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-12 23:09 UTC (permalink / raw
  To: gentoo-commits

commit:     db095dbbbb7cf51b4a89e7b961dc84c1a2af2402
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 23:01:20 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 12 23:03:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=db095dbb

egencache: allow missing --repo if exactly 1 repo

---
 bin/egencache | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 45d4fbd..3859a06 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -207,9 +207,6 @@ def parse_args(args):
 			parser.error("Write access denied: --cache-dir='%s'" % \
 				(options.cache_dir,))
 
-	if options.repo is None:
-		parser.error("--repo option is required")
-
 	if options.portdir is not None:
 		writemsg_level("egencache: warning: --portdir option is deprecated in favor of --repositories-configuration option\n",
 			level=logging.WARNING, noiselevel=-1)
@@ -894,6 +891,16 @@ def egencache_main(args):
 		parser.error('No action specified')
 		return 1
 
+	if options.repo is None:
+		if len(settings.repositories.prepos) == 2:
+			for repo in settings.repositories:
+				if repo.name != "DEFAULT":
+					options.repo = repo.name
+					break
+
+		if options.repo is None:
+			parser.error("--repo option is required")
+
 	repo_path = settings.repositories.treemap.get(options.repo)
 	if repo_path is None:
 		parser.error("Unable to locate repository named '%s'" % (options.repo,))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-18  6:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-18  6:52 UTC (permalink / raw
  To: gentoo-commits

commit:     ddd1bc384629571d52d5c5f59a5446debaeae01a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 18 06:51:45 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug 18 06:51:45 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ddd1bc38

archive-conf: fix for python3, bug #481518

---
 bin/archive-conf | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index f8efcb9..2c34588 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -21,34 +21,12 @@ portage._internal_caller = True
 
 import portage.dispatch_conf
 from portage import os
+from portage.checksum import perform_md5
 
 FIND_EXTANT_CONTENTS  = "find %s -name CONTENTS"
 
 MANDATORY_OPTS  = [ 'archive-dir' ]
 
-try:
-    import fchksum
-    def perform_checksum(filename): return fchksum.fmd5t(filename)
-except ImportError:
-    import md5
-    def md5_to_hex(md5sum):
-        hexform = ""
-        for ix in range(len(md5sum)):
-            hexform = hexform + "%02x" % ord(md5sum[ix])
-        return hexform.lower()
-
-    def perform_checksum(filename):
-        f = open(filename, 'rb')
-        blocksize=32768
-        data = f.read(blocksize)
-        size = 0
-        checksum = md5.new()
-        while data:
-            checksum.update(data)
-            size = size + len(data)
-            data = f.read(blocksize)
-        return (md5_to_hex(checksum.digest()), size)
-
 def archive_conf():
     args = []
     content_files = []
@@ -84,7 +62,7 @@ def archive_conf():
                     for conf in args:
                         if items[1] == conf:
                             stored = items[2].lower()
-                            real = perform_checksum(conf)[0].lower()
+                            real = perform_md5(conf).lower()
                             if stored == real:
                                 md5_match_hash[conf] = conf
                             todo_cnt -= 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-22  2:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-22  2:19 UTC (permalink / raw
  To: gentoo-commits

commit:     94aed24784d5122c5bbd7afd6dd85ee83c10ab2e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 02:19:19 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 02:19:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=94aed247

repoman: fix manifest for --echangelog

---
 bin/repoman | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index 31ae747..5250af0 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2719,6 +2719,7 @@ else:
 
 	commitmessage += commit_footer
 
+	broken_changelog_manifests = []
 	if options.echangelog in ('y', 'force'):
 		logging.info("checking for unmodified ChangeLog files")
 		committer_name = utilities.get_committer_name(env=repoman_settings)
@@ -2774,6 +2775,8 @@ else:
 				# regenerate Manifest for modified ChangeLog (bug #420735)
 				repoman_settings["O"] = checkdir
 				digestgen(mysettings=repoman_settings, myportdb=portdb)
+			else:
+				broken_changelog_manifests.append(x)
 
 	if myautoadd:
 		print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
@@ -3003,6 +3006,11 @@ else:
 			repoman_settings["O"] = os.path.join(repodir, x)
 			digestgen(mysettings=repoman_settings, myportdb=portdb)
 
+	elif broken_changelog_manifests:
+		for x in broken_changelog_manifests:
+			repoman_settings["O"] = os.path.join(repodir, x)
+			digestgen(mysettings=repoman_settings, myportdb=portdb)
+
 	signed = False
 	if sign_manifests:
 		signed = True


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-24 18:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-24 18:24 UTC (permalink / raw
  To: gentoo-commits

commit:     3f67cb453ee1b74894c230459b43855db7fcc410
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 18:24:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 18:24:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f67cb45

dohtml: optimize for bug #482290

Use os.makedirs and shutil.copy instead of spawning install, since
spawning install is much slower (especially with FEATURES=xattr).

---
 bin/dohtml.py | 39 +++++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index 1b6ba89..ec9a80b 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -31,16 +31,25 @@
 from __future__ import print_function
 
 import os
+import shutil
 import sys
 
+from portage.util import normalize_path
+
 # Change back to original cwd _after_ all imports (bug #469338).
 os.chdir(os.environ["__PORTAGE_HELPER_CWD"])
 
 def dodir(path):
-	os.spawnlp(os.P_WAIT, "install", "install", "-d", path)
+	try:
+		os.makedirs(path, 0o755)
+	except OSError:
+		if not os.path.isdir(path):
+			raise
+		os.chmod(path, 0o755)
 
 def dofile(src,dst):
-	os.spawnlp(os.P_WAIT, "install", "install", "-m0644", src, dst)
+	shutil.copy(src, dst)
+	os.chmod(dst, 0o644)
 
 def eqawarn(lines):
 	cmd = "source '%s/isolated-functions.sh' ; " % \
@@ -58,14 +67,18 @@ unwarned_skipped_files = os.environ.get("PORTAGE_DOHTML_UNWARNED_SKIPPED_FILES",
 def install(basename, dirname, options, prefix=""):
 	fullpath = basename
 	if prefix:
-		fullpath = prefix + "/" + fullpath
+		fullpath = os.path.join(prefix, fullpath)
 	if dirname:
-		fullpath = dirname + "/" + fullpath
+		fullpath = os.path.join(dirname, fullpath)
 
 	if options.DOCDESTTREE:
-		destdir = options.ED + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
+		desttree = options.DOCDESTTREE
 	else:
-		destdir = options.ED + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
+		desttree = "html"
+
+	destdir = os.path.join(options.ED, "usr", "share", "doc",
+		options.PF.lstrip(os.sep), desttree,
+		options.doc_prefix.lstrip(os.sep), prefix).rstrip(os.sep)
 
 	if not os.path.exists(fullpath):
 		sys.stderr.write("!!! dohtml: %s does not exist\n" % fullpath)
@@ -74,14 +87,15 @@ def install(basename, dirname, options, prefix=""):
 		ext = os.path.splitext(basename)[1][1:]
 		if ext in options.allowed_exts or basename in options.allowed_files:
 			dodir(destdir)
-			dofile(fullpath, destdir + "/" + basename)
+			dofile(fullpath, os.path.join(destdir, basename))
 		elif warn_on_skipped_files and ext not in unwarned_skipped_extensions and basename not in unwarned_skipped_files:
 			skipped_files.append(fullpath)
 	elif options.recurse and os.path.isdir(fullpath) and \
 	     basename not in options.disallowed_dirs:
 		for i in os.listdir(fullpath):
 			pfx = basename
-			if prefix: pfx = prefix + "/" + pfx
+			if prefix:
+				pfx = os.path.join(prefix, pfx)
 			install(i, dirname, options, pfx)
 	elif not options.recurse and os.path.isdir(fullpath):
 		global skipped_directories
@@ -100,13 +114,19 @@ class OptionsClass:
 
 		if "PF" in os.environ:
 			self.PF = os.environ["PF"]
+			if self.PF:
+				self.PF = normalize_path(self.PF)
 		if "force-prefix" not in os.environ.get("FEATURES", "").split() and \
 			os.environ.get("EAPI", "0") in ("0", "1", "2"):
 			self.ED = os.environ.get("D", "")
 		else:
 			self.ED = os.environ.get("ED", "")
+		if self.ED:
+			self.ED = normalize_path(self.ED)
 		if "_E_DOCDESTTREE_" in os.environ:
 			self.DOCDESTTREE = os.environ["_E_DOCDESTTREE_"]
+			if self.DOCDESTTREE:
+				self.DOCDESTTREE = normalize_path(self.DOCDESTTREE)
 
 		self.allowed_exts = ['css', 'gif', 'htm', 'html', 'jpeg', 'jpg', 'js', 'png']
 		if os.environ.get("EAPI", "0") in ("4-python", "5-progress"):
@@ -156,6 +176,8 @@ def parse_args():
 				sys.exit(0)
 			elif arg == "-p":
 				options.doc_prefix = sys.argv[x]
+				if options.doc_prefix:
+					options.doc_prefix = normalize_path(options.doc_prefix)
 			else:
 				values = sys.argv[x].split(",")
 				if arg == "-A":
@@ -184,6 +206,7 @@ def main():
 	success = False
 
 	for x in args:
+		x = normalize_path(x)
 		basename = os.path.basename(x)
 		dirname  = os.path.dirname(x)
 		success |= install(basename, dirname, options)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-08-27  4:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-08-27  4:00 UTC (permalink / raw
  To: gentoo-commits

commit:     2110ec6ed42fc306d5c25cbf970d013ff2a226fd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 27 03:59:40 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 27 03:59:40 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2110ec6e

dohtml: restore behavior noted in bug #425214

A trailing slash cause os.path.basename() and os.path.dirname() to
behave differently, causing foo/ to behave similarly to the way that
foo/* behaves. This behavior was broken by normalization in commit
3f67cb453ee1b74894c230459b43855db7fcc410.

---
 bin/dohtml.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index ec9a80b..37d5b2e 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -206,7 +206,14 @@ def main():
 	success = False
 
 	for x in args:
+		trailing_slash = x[-1:] == os.sep
 		x = normalize_path(x)
+		if trailing_slash:
+			# Modify behavior of basename and dirname
+			# as noted in bug #425214, causing foo/ to
+			# behave similarly to the way that foo/*
+			# behaves.
+			x += os.sep
 		basename = os.path.basename(x)
 		dirname  = os.path.dirname(x)
 		success |= install(basename, dirname, options)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-01 18:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-01 18:16 UTC (permalink / raw
  To: gentoo-commits

commit:     71e00ea28ef86f083ed25a1de0c963970b0b5681
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  1 18:16:07 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  1 18:16:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71e00ea2

unpack: warn for unofficial sufffix, bug #476738

---
 bin/eapi.sh          |  4 +++
 bin/phase-helpers.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e63f145..5d5b36d 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -134,6 +134,10 @@ ___eapi_disallows_helpers_in_global_scope() {
 	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 }
 
+___eapi_unpack_is_case_sensitive() {
+	true
+}
+
 # OTHERS
 
 ___eapi_enables_globstar() {

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 91762bf..c6ca997 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -262,6 +262,7 @@ unpack() {
 	local x
 	local y
 	local suffix
+	local insensitive_suffix
 	local myfail
 	local eapi=${EAPI:-0}
 	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
@@ -269,7 +270,7 @@ unpack() {
 	for x in "$@"; do
 		__vecho ">>> Unpacking ${x} to ${PWD}"
 		suffix=${x##*.}
-		suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
+		insensitive_suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
 		y=${x%.*}
 		y=${y##*.}
 		y=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
@@ -297,27 +298,64 @@ unpack() {
 		}
 
 		myfail="failure unpacking ${x}"
-		case "${suffix}" in
+		case "${insensitive_suffix}" in
 			tar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tar != ${suffix} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tar'."
+				fi
 				tar xof "$srcdir$x" || die "$myfail"
 				;;
 			tgz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tgz != ${suffix} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tgz'."
+				fi
 				tar xozf "$srcdir$x" || die "$myfail"
 				;;
 			tbz|tbz2)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " tbz tbz2 " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
+				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
 				__assert_sigpipe_ok "$myfail"
 				;;
 			zip|jar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " ZIP zip jar " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'." \
+						"Instead use 'ZIP', 'zip', or 'jar'."
+				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
 				( set +x ; while true ; do echo n || break ; done ) | \
 				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
 			gz|z)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " gz z Z " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
+				fi
 				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " bz bz2 " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
+				fi
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
@@ -329,15 +367,40 @@ unpack() {
 				fi
 				;;
 			rar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " rar RAR " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
+				fi
 				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
 				;;
 			lha|lzh)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " LHA LHa lha lhz " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'." \
+						"Instead use 'LHA', 'LHa', 'lha', or 'lhz'."
+				fi
 				lha xfq "${srcdir}${x}" || die "$myfail"
 				;;
 			a)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " a " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'a'."
+				fi
 				ar x "${srcdir}${x}" || die "$myfail"
 				;;
 			deb)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " deb " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'deb'."
+				fi
 				# Unpacking .deb archives can not always be done with
 				# `ar`.  For instance on AIX this doesn't work out.  If
 				# we have `deb2targz` installed, prefer it over `ar` for
@@ -365,9 +428,21 @@ unpack() {
 				fi
 				;;
 			lzma)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " lzma " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'lzma'."
+				fi
 				__unpack_tar "lzma -d"
 				;;
 			xz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " xz " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'xz'."
+				fi
 				if ___eapi_unpack_supports_xz; then
 					__unpack_tar "xz -d"
 				else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-01 18:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-01 18:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9c4f16193cd07e1b11761592b4c79225bce32cee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  1 18:16:07 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  1 18:45:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c4f1619

unpack: warn for unofficial sufffix, bug #476738

---
 bin/eapi.sh          |  4 +++
 bin/phase-helpers.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e63f145..5d5b36d 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -134,6 +134,10 @@ ___eapi_disallows_helpers_in_global_scope() {
 	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 }
 
+___eapi_unpack_is_case_sensitive() {
+	true
+}
+
 # OTHERS
 
 ___eapi_enables_globstar() {

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 91762bf..ffb87aa 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -262,6 +262,7 @@ unpack() {
 	local x
 	local y
 	local suffix
+	local insensitive_suffix
 	local myfail
 	local eapi=${EAPI:-0}
 	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
@@ -269,7 +270,7 @@ unpack() {
 	for x in "$@"; do
 		__vecho ">>> Unpacking ${x} to ${PWD}"
 		suffix=${x##*.}
-		suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
+		insensitive_suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
 		y=${x%.*}
 		y=${y##*.}
 		y=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
@@ -297,27 +298,64 @@ unpack() {
 		}
 
 		myfail="failure unpacking ${x}"
-		case "${suffix}" in
+		case "${insensitive_suffix}" in
 			tar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tar != ${suffix} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tar'."
+				fi
 				tar xof "$srcdir$x" || die "$myfail"
 				;;
 			tgz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tgz != ${suffix} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tgz'."
+				fi
 				tar xozf "$srcdir$x" || die "$myfail"
 				;;
 			tbz|tbz2)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " tbz tbz2 " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
+				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
 				__assert_sigpipe_ok "$myfail"
 				;;
 			zip|jar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " ZIP zip jar " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'." \
+						"Instead use 'ZIP', 'zip', or 'jar'."
+				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
 				( set +x ; while true ; do echo n || break ; done ) | \
 				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
 			gz|z)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " gz z Z " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
+				fi
 				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " bz bz2 " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
+				fi
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
@@ -329,15 +367,40 @@ unpack() {
 				fi
 				;;
 			rar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " rar RAR " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
+				fi
 				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
 				;;
 			lha|lzh)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " LHA LHa lha lzh " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'." \
+						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
+				fi
 				lha xfq "${srcdir}${x}" || die "$myfail"
 				;;
 			a)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " a " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'a'."
+				fi
 				ar x "${srcdir}${x}" || die "$myfail"
 				;;
 			deb)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " deb " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'deb'."
+				fi
 				# Unpacking .deb archives can not always be done with
 				# `ar`.  For instance on AIX this doesn't work out.  If
 				# we have `deb2targz` installed, prefer it over `ar` for
@@ -365,9 +428,21 @@ unpack() {
 				fi
 				;;
 			lzma)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " lzma " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'lzma'."
+				fi
 				__unpack_tar "lzma -d"
 				;;
 			xz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " xz " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'xz'."
+				fi
 				if ___eapi_unpack_supports_xz; then
 					__unpack_tar "xz -d"
 				else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-01 19:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-01 19:04 UTC (permalink / raw
  To: gentoo-commits

commit:     71e22fb4dbccc41c93f4b05dc193a557769ba6bc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  1 18:16:07 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  1 19:02:57 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71e22fb4

unpack: warn for unofficial sufffix, bug #476738

---
 bin/eapi.sh          |  4 +++
 bin/phase-helpers.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 90 insertions(+), 6 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e63f145..5d5b36d 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -134,6 +134,10 @@ ___eapi_disallows_helpers_in_global_scope() {
 	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 }
 
+___eapi_unpack_is_case_sensitive() {
+	true
+}
+
 # OTHERS
 
 ___eapi_enables_globstar() {

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 91762bf..d03a4d7 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -260,8 +260,8 @@ use_enable() {
 unpack() {
 	local srcdir
 	local x
-	local y
-	local suffix
+	local y y_insensitive
+	local suffix suffix_insensitive
 	local myfail
 	local eapi=${EAPI:-0}
 	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
@@ -269,10 +269,10 @@ unpack() {
 	for x in "$@"; do
 		__vecho ">>> Unpacking ${x} to ${PWD}"
 		suffix=${x##*.}
-		suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
+		suffix_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
 		y=${x%.*}
 		y=${y##*.}
-		y=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
+		y_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
 
 		if [[ ${x} == "./"* ]] ; then
 			srcdir=""
@@ -286,7 +286,13 @@ unpack() {
 		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
 
 		__unpack_tar() {
-			if [ "${y}" == "tar" ]; then
+			if [[ ${y_insensitive} == tar ]] ; then
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tar != ${y} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"secondary suffix '${y}' which is unofficially" \
+						"supported with EAPI '${EAPI}'. Instead use 'tar'."
+				fi
 				$1 -c -- "$srcdir$x" | tar xof -
 				__assert_sigpipe_ok "$myfail"
 			else
@@ -297,27 +303,64 @@ unpack() {
 		}
 
 		myfail="failure unpacking ${x}"
-		case "${suffix}" in
+		case "${suffix_insensitive}" in
 			tar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tar != ${suffix} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tar'."
+				fi
 				tar xof "$srcdir$x" || die "$myfail"
 				;;
 			tgz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ tgz != ${suffix} ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tgz'."
+				fi
 				tar xozf "$srcdir$x" || die "$myfail"
 				;;
 			tbz|tbz2)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " tbz tbz2 " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
+				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
 				__assert_sigpipe_ok "$myfail"
 				;;
 			zip|jar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " ZIP zip jar " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'." \
+						"Instead use 'ZIP', 'zip', or 'jar'."
+				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
 				( set +x ; while true ; do echo n || break ; done ) | \
 				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
 			gz|z)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " gz z Z " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
+				fi
 				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " bz bz2 " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
+				fi
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
@@ -329,15 +372,40 @@ unpack() {
 				fi
 				;;
 			rar)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " rar RAR " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
+				fi
 				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
 				;;
 			lha|lzh)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " LHA LHa lha lzh " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'." \
+						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
+				fi
 				lha xfq "${srcdir}${x}" || die "$myfail"
 				;;
 			a)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " a " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'a'."
+				fi
 				ar x "${srcdir}${x}" || die "$myfail"
 				;;
 			deb)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " deb " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'deb'."
+				fi
 				# Unpacking .deb archives can not always be done with
 				# `ar`.  For instance on AIX this doesn't work out.  If
 				# we have `deb2targz` installed, prefer it over `ar` for
@@ -365,9 +433,21 @@ unpack() {
 				fi
 				;;
 			lzma)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " lzma " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'lzma'."
+				fi
 				__unpack_tar "lzma -d"
 				;;
 			xz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " xz " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'xz'."
+				fi
 				if ___eapi_unpack_supports_xz; then
 					__unpack_tar "xz -d"
 				else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-03 19:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-03 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     356abf4adb756362ef6f207cbaa47915eb12e494
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  3 19:43:12 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  3 19:43:12 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=356abf4a

install.py: show args if copy_xattrs fails

---
 bin/install.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/install.py b/bin/install.py
index 1f56212..2c6dfbe 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -8,6 +8,7 @@ import sys
 import subprocess
 import traceback
 
+import portage
 from portage.util._argparse import ArgumentParser
 from portage.util.movefile import _copyxattr
 from portage.exception import OperationNotSupported
@@ -241,6 +242,10 @@ def main(args):
 	returncode = subprocess.call(cmdline)
 	if returncode == os.EX_OK:
 		returncode = copy_xattrs(opts, files)
+		if returncode != os.EX_OK:
+			portage.util.writemsg("!!! install: copy_xattrs failed with the "
+				"following arguments: %s\n" %
+				" ".join(portage._shell_quote(x) for x in args), noiselevel=-1)
 	return returncode
 
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-11 20:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-11 20:47 UTC (permalink / raw
  To: gentoo-commits

commit:     45ee7b009ad50eafd227acfd7cc14adc8aa469ab
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 11 20:46:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 11 20:46:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=45ee7b00

dohtml: fix DOCDESTTREE path join

When DOCDESTTREE begins with a leading slash, it caused os.path.join()
to misbehave since commit 3f67cb453ee1b74894c230459b43855db7fcc410.

---
 bin/dohtml.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index 37d5b2e..500c523 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -77,7 +77,7 @@ def install(basename, dirname, options, prefix=""):
 		desttree = "html"
 
 	destdir = os.path.join(options.ED, "usr", "share", "doc",
-		options.PF.lstrip(os.sep), desttree,
+		options.PF.lstrip(os.sep), desttree.lstrip(os.sep),
 		options.doc_prefix.lstrip(os.sep), prefix).rstrip(os.sep)
 
 	if not os.path.exists(fullpath):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-13  3:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-13  3:07 UTC (permalink / raw
  To: gentoo-commits

commit:     5efeeb8fe8618e2ae8ecc6f774221746896774ee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 13 03:06:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 13 03:06:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5efeeb8f

dohtml: restore behavior noted in bug #425214

This goes along with commit 2110ec6ed42fc306d5c25cbf970d013ff2a226fd,
adding support for trailing /. as well, since it's used at least by
distutils-r1.eclass.

---
 bin/dohtml.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index 500c523..f98557f 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -204,9 +204,10 @@ def main():
 		print("Allowed files :", options.allowed_files)
 
 	success = False
+	endswith_slash = (os.sep, os.sep + ".")
 
 	for x in args:
-		trailing_slash = x[-1:] == os.sep
+		trailing_slash = x.endswith(endswith_slash)
 		x = normalize_path(x)
 		if trailing_slash:
 			# Modify behavior of basename and dirname


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-15  0:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-15  0:30 UTC (permalink / raw
  To: gentoo-commits

commit:     bb6f7fc22b59a8949dfd4bb362d4522b1cc6d048
Author:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 15 00:29:38 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 00:29:38 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bb6f7fc2

Flag  -Waggressive-loop-optimizations warnings.
This will fix bug #484840.

---
 bin/misc-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ee21444..771bd0a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -699,6 +699,7 @@ install_qa_check() {
 			": warning: returning reference to temporary"
 			": warning: function returns address of local variable"
 			": warning: .*\\[-Wsizeof-pointer-memaccess\\]"
+			": warning: .*\\[-Waggressive-loop-optimizations\\]"
 			# this may be valid code :/
 			#": warning: multi-character character constant"
 			# need to check these two ...


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-16  5:03 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-09-16  5:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d807ee1edaf06306a328c2af45f2daa96c965c49
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Sep 16 05:03:02 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Sep 16 05:03:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d807ee1e

Bug #485056: Fix portageq with Python <2.6.5.

---
 bin/portageq | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/portageq b/bin/portageq
index 0756cdb..82735f1 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1193,7 +1193,7 @@ def add_pquery_arguments(parser):
 				kwargs["help"] = opt_info["help"]
 			except KeyError:
 				pass
-			arg_group.add_argument(*pargs, **kwargs)
+			arg_group.add_argument(*pargs, **portage._native_kwargs(kwargs))
 
 
 def usage(argv):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-09-20 12:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2013-09-20 12:40 UTC (permalink / raw
  To: gentoo-commits

commit:     68034f61f3da0aff4fca4b764620abd2c87c16c6
Author:     Ruud Koolen <redlizard <AT> redlizard <DOT> nl>
AuthorDate: Fri Sep 20 12:39:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 20 12:39:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=68034f61

ebuild_main: prefix PKG_CONFIG_PATH, bug #485456

---
 bin/phase-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 37503bf..711b721 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -917,7 +917,7 @@ __ebuild_main() {
 
 			x=LIBDIR_$ABI
 			[ -z "$PKG_CONFIG_PATH" -a -n "$ABI" -a -n "${!x}" ] && \
-				export PKG_CONFIG_PATH=/usr/${!x}/pkgconfig
+				export PKG_CONFIG_PATH=${EPREFIX}/usr/${!x}/pkgconfig
 
 			if has noauto $FEATURES && \
 				[[ ! -f $PORTAGE_BUILDDIR/.unpacked ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-08 19:40 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-08 19:40 UTC (permalink / raw
  To: gentoo-commits

commit:     773bae7524d97ea5e6e431dfe34d7f49362688bc
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  8 19:39:30 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  8 19:39:30 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=773bae75

chpathtool: standardize quote style

---
 bin/chpathtool.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index c35acd1..471582b 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -9,8 +9,8 @@ import sys
 
 from portage.util._argparse import ArgumentParser
 
-CONTENT_ENCODING = "utf_8"
-FS_ENCODING = "utf_8"
+CONTENT_ENCODING = 'utf_8'
+FS_ENCODING = 'utf_8'
 
 try:
 	import magic
@@ -44,7 +44,7 @@ class IsTextFile(object):
 		mime_type = self._m.file(filename)
 		if isinstance(mime_type, bytes):
 			mime_type = mime_type.decode('ascii', 'replace')
-		return mime_type.startswith("text/")
+		return mime_type.startswith('text/')
 
 	def _is_text_encoding(self, filename):
 		try:
@@ -67,7 +67,7 @@ def chpath_inplace(filename, is_text_file, old, new):
 		try:
 			orig_mode = stat.S_IMODE(os.lstat(filename).st_mode)
 		except OSError as e:
-			sys.stderr.write("%s: %s\n" % (e, filename))
+			sys.stderr.write('%s: %s\n' % (e, filename))
 			return
 		temp_mode = 0o200 | orig_mode
 		os.chmod(filename, temp_mode)
@@ -142,12 +142,12 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-	usage = "%s [options] <location> <old> <new>" % (os.path.basename(argv[0],))
+	usage = '%s [options] <location> <old> <new>' % (os.path.basename(argv[0],))
 	parser = ArgumentParser(usage=usage)
 	options, args = parser.parse_known_args(argv[1:])
 
 	if len(args) != 3:
-		parser.error("3 args required, got %s" % (len(args),))
+		parser.error('3 args required, got %s' % (len(args),))
 
 	location, old, new = args
 
@@ -185,5 +185,5 @@ def main(argv):
 
 	return os.EX_OK
 
-if __name__ == "__main__":
+if __name__ == '__main__':
 	sys.exit(main(sys.argv))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-08 19:40 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-08 19:40 UTC (permalink / raw
  To: gentoo-commits

commit:     c3afc0c35143a362970c2e7ef0a700feb1ea15e5
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  8 19:39:53 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  8 19:39:53 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c3afc0c3

chpathtool: use built in %(prog)s for usage

---
 bin/chpathtool.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 471582b..b8c6fd5 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -142,9 +142,9 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-	usage = '%s [options] <location> <old> <new>' % (os.path.basename(argv[0],))
+	usage = '%(prog)s [options] <location> <old> <new>'
 	parser = ArgumentParser(usage=usage)
-	options, args = parser.parse_known_args(argv[1:])
+	options, args = parser.parse_known_args(argv)
 
 	if len(args) != 3:
 		parser.error('3 args required, got %s' % (len(args),))
@@ -186,4 +186,4 @@ def main(argv):
 	return os.EX_OK
 
 if __name__ == '__main__':
-	sys.exit(main(sys.argv))
+	sys.exit(main(sys.argv[1:]))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-08 20:00 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-08 20:00 UTC (permalink / raw
  To: gentoo-commits

commit:     54df6c66ccebfa238126bad543b1af08524cedc6
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  8 19:58:58 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  8 20:00:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=54df6c66

chpathtool: clean up arg parsing to use proper argparse module

Also throw in some documentation for good measure since not everyone knows
what this thing does.

---
 bin/chpathtool.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index b8c6fd5..aa3b7d4 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -2,6 +2,10 @@
 # Copyright 2011-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+"""Helper tool for converting installed files to custom prefixes.
+
+In other words, eprefixy $D for Gentoo/Prefix."""
+
 import io
 import os
 import stat
@@ -142,14 +146,16 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-	usage = '%(prog)s [options] <location> <old> <new>'
-	parser = ArgumentParser(usage=usage)
-	options, args = parser.parse_known_args(argv)
-
-	if len(args) != 3:
-		parser.error('3 args required, got %s' % (len(args),))
+	parser = ArgumentParser(description=__doc__)
+	parser.add_argument('location', default=None,
+		help='root directory (e.g. $D)')
+	parser.add_argument('old', default=None,
+		help='original build prefix (e.g. /)')
+	parser.add_argument('new', default=None,
+		help='new install prefix (e.g. $EPREFIX)')
+	opts = parser.parse_args(argv)
 
-	location, old, new = args
+	location, old, new = opts.location, opts.old, opts.new
 
 	is_text_file = IsTextFile()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-11 10:33 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-11 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     80036cd01dd468d6b5e583b890db90e20c09a585
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 10:19:49 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 10:19:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80036cd0

xattr-helper: use upper caps for module constants

---
 bin/xattr-helper.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index a85309f..6d33017 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -19,8 +19,10 @@ if hasattr(os, "getxattr"):
 else:
 	import xattr
 
-_unquote_re = re.compile(br'\\[0-7]{3}')
-_fs_encoding = sys.getfilesystemencoding()
+
+_UNQUOTE_RE = re.compile(br'\\[0-7]{3}')
+_FS_ENCODING = sys.getfilesystemencoding()
+
 
 if sys.hexversion < 0x3000000:
 
@@ -29,7 +31,7 @@ if sys.hexversion < 0x3000000:
 
 	def unicode_encode(s):
 		if isinstance(s, unicode):
-			s = s.encode(_fs_encoding)
+			s = s.encode(_FS_ENCODING)
 		return s
 else:
 
@@ -38,7 +40,7 @@ else:
 
 	def unicode_encode(s):
 		if isinstance(s, str):
-			s = s.encode(_fs_encoding)
+			s = s.encode(_FS_ENCODING)
 		return s
 
 def quote(s, quote_chars):
@@ -68,7 +70,7 @@ def unquote(s):
 	s_len = len(s)
 
 	while pos < s_len:
-		m = _unquote_re.search(s, pos=pos)
+		m = _UNQUOTE_RE.search(s, pos=pos)
 		if m is None:
 			result.append(s[pos:])
 			pos = s_len


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-11 10:33 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-11 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     3416b283af77915e14fb11b499f9a165236934dd
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 10:29:35 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 10:29:35 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3416b283

xattr-helper: refactor dump_xattrs to make it a bit more readable

Pull the common qoute chars out into a var and use % with format
strings rather than mixing + in between.

---
 bin/xattr-helper.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index 249ea87..e84d23d 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -105,6 +105,9 @@ def unquote(s):
 
 def dump_xattrs(file_in, file_out):
 	"""Dump the xattr data for files in |file_in| to |file_out|"""
+	# NOTE: Always quote backslashes, in order to ensure that they are
+	# not interpreted as quotes when they are processed by unquote.
+	quote_chars = b'\n\r\\\\'
 
 	for pathname in file_in.read().split(b'\0'):
 		if not pathname:
@@ -114,13 +117,14 @@ def dump_xattrs(file_in, file_out):
 		if not attrs:
 			continue
 
-		# NOTE: Always quote backslashes, in order to ensure that they are
-		# not interpreted as quotes when they are processed by unquote.
-		file_out.write(b'# file: ' + quote(pathname, b'\n\r\\\\') + b'\n')
+		file_out.write(b'# file: %s\n' % quote(pathname, quote_chars))
 		for attr in attrs:
 			attr = unicode_encode(attr)
-			file_out.write(quote(attr, b'=\n\r\\\\') + b'="' +
-				quote(xattr.get(pathname, attr), b'\0\n\r"\\\\') + b'"\n')
+			value = xattr.get(pathname, attr)
+			file_out.write(b'%s="%s"\n' % (
+				quote(attr, b'=' + quote_chars),
+				quote(value, b'\0"' + quote_chars)))
+
 
 def restore_xattrs(file_in):
 	"""Read |file_in| and restore xattrs content from it


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-11 10:33 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-11 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     305f0c4c5fc91e85d0e30a24f9097344f8efe097
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 10:23:49 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 10:23:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=305f0c4c

xattr-helper: add docstrings to more places

---
 bin/xattr-helper.py | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index 6d33017..92bf1a2 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -2,6 +2,15 @@
 # Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+"""Dump and restore extended attributes.
+
+We use formats like that used by getfattr --dump.  This is meant for shell
+helpers to save/restore.  If you're looking for a python/portage API, see
+portage.util.movefile._copyxattr instead.
+
+https://en.wikipedia.org/wiki/Extended_file_attributes
+"""
+
 import array
 import os
 import re
@@ -43,8 +52,12 @@ else:
 			s = s.encode(_FS_ENCODING)
 		return s
 
+
 def quote(s, quote_chars):
+	"""Convert all |quote_chars| in |s| to escape sequences
 
+	This is normally used to escape any embedded quotation marks.
+	"""
 	quote_re = re.compile(b'[' + quote_chars + b']')
 	result = []
 	pos = 0
@@ -63,8 +76,9 @@ def quote(s, quote_chars):
 
 	return b"".join(result)
 
-def unquote(s):
 
+def unquote(s):
+	"""Process all escape sequences in |s|"""
 	result = []
 	pos = 0
 	s_len = len(s)
@@ -88,7 +102,9 @@ def unquote(s):
 
 	return b"".join(result)
 
+
 def dump_xattrs(file_in, file_out):
+	"""Dump the xattr data for files in |file_in| to |file_out|"""
 
 	for pathname in file_in.read().split(b'\0'):
 		if not pathname:
@@ -107,7 +123,10 @@ def dump_xattrs(file_in, file_out):
 				quote(xattr.get(pathname, attr), b'\0\n\r"\\\\') + b'"\n')
 
 def restore_xattrs(file_in):
+	"""Read |file_in| and restore xattrs content from it
 
+	This expects textual data in the format written by dump_xattrs.
+	"""
 	pathname = None
 	for i, line in enumerate(file_in):
 		if line.startswith(b'# file: '):
@@ -173,6 +192,7 @@ def main(argv):
 
 	return os.EX_OK
 
+
 if __name__ == "__main__":
 	rval = main(sys.argv[:])
 	sys.exit(rval)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-11 10:33 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-11 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     345c54de9e8c9daac190fbb07d33bf40e7bac5a9
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 10:30:37 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 10:30:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=345c54de

xattr-helper: clean up command line interface

This uses the standard argparse fields rather than open coding things
ourselves.  It also makes it a bit easier to test as you can now pass
paths on the command line in addition to stdin.

---
 bin/xattr-helper.py | 34 +++++++++++-----------------------
 1 file changed, 11 insertions(+), 23 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index e84d23d..6d99521 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -103,16 +103,13 @@ def unquote(s):
 	return b''.join(result)
 
 
-def dump_xattrs(file_in, file_out):
-	"""Dump the xattr data for files in |file_in| to |file_out|"""
+def dump_xattrs(pathnames, file_out):
+	"""Dump the xattr data for |pathnames| to |file_out|"""
 	# NOTE: Always quote backslashes, in order to ensure that they are
 	# not interpreted as quotes when they are processed by unquote.
 	quote_chars = b'\n\r\\\\'
 
-	for pathname in file_in.read().split(b'\0'):
-		if not pathname:
-			continue
-
+	for pathname in pathnames:
 		attrs = xattr.list(pathname)
 		if not attrs:
 			continue
@@ -147,14 +144,11 @@ def restore_xattrs(file_in):
 			elif line.strip():
 				raise ValueError('line %d: malformed entry' % (i + 1,))
 
-def main(argv):
 
-	description = "Dump and restore extended attributes," \
-		" using format like that used by getfattr --dump."
-	usage = "usage: %s [--dump | --restore]\n" % \
-		os.path.basename(argv[0])
+def main(argv):
 
-	parser = ArgumentParser(description=description, usage=usage)
+	parser = ArgumentParser(description=__doc__)
+	parser.add_argument('paths', nargs='*', default=[])
 
 	actions = parser.add_argument_group('Actions')
 	actions.add_argument('--dump',
@@ -167,28 +161,23 @@ def main(argv):
 		help='Restore extended attributes using'
 			' a dump read from stdin.')
 
-	options, args = parser.parse_known_args(argv[1:])
-
-	if len(args) != 0:
-		parser.error("expected zero arguments, "
-			"got %s" % len(args))
+	options = parser.parse_args(argv)
 
 	if sys.hexversion >= 0x3000000:
 		file_in = sys.stdin.buffer.raw
 	else:
 		file_in = sys.stdin
+	if not options.paths:
+		options.paths += [x for x in file_in.read().split(b'\0') if x]
 
 	if options.dump:
-
 		if sys.hexversion >= 0x3000000:
 			file_out = sys.stdout.buffer
 		else:
 			file_out = sys.stdout
-
-		dump_xattrs(file_in, file_out)
+		dump_xattrs(options.paths, file_out)
 
 	elif options.restore:
-
 		restore_xattrs(file_in)
 
 	else:
@@ -198,5 +187,4 @@ def main(argv):
 
 
 if __name__ == '__main__':
-	rval = main(sys.argv[:])
-	sys.exit(rval)
+	sys.exit(main(sys.argv[1:]))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-11 10:33 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-11 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     cbf5e8657b654e2538b31db945b315ce89eb72bc
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 10:27:15 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 10:27:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cbf5e865

xattr-helper: standardize quoting style a bit

---
 bin/xattr-helper.py | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index 83ee32c..249ea87 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -74,7 +74,7 @@ def quote(s, quote_chars):
 			result.append(octal_quote_byte(s[start:start+1]))
 			pos = start + 1
 
-	return b"".join(result)
+	return b''.join(result)
 
 
 def unquote(s):
@@ -100,7 +100,7 @@ def unquote(s):
 			except AttributeError:
 				result.append(a.tostring())
 
-	return b"".join(result)
+	return b''.join(result)
 
 
 def dump_xattrs(file_in, file_out):
@@ -153,15 +153,15 @@ def main(argv):
 	parser = ArgumentParser(description=description, usage=usage)
 
 	actions = parser.add_argument_group('Actions')
-	actions.add_argument("--dump",
-		action="store_true",
-		help="Dump the values of all extended "
-			"attributes associated with null-separated"
-			" paths read from stdin.")
-	actions.add_argument("--restore",
-		action="store_true",
-		help="Restore extended attributes using"
-			" a dump read from stdin.")
+	actions.add_argument('--dump',
+		action='store_true',
+		help='Dump the values of all extended '
+			'attributes associated with null-separated'
+			' paths read from stdin.')
+	actions.add_argument('--restore',
+		action='store_true',
+		help='Restore extended attributes using'
+			' a dump read from stdin.')
 
 	options, args = parser.parse_known_args(argv[1:])
 
@@ -188,11 +188,11 @@ def main(argv):
 		restore_xattrs(file_in)
 
 	else:
-		parser.error("available actions: --dump, --restore")
+		parser.error('missing action!')
 
 	return os.EX_OK
 
 
-if __name__ == "__main__":
+if __name__ == '__main__':
 	rval = main(sys.argv[:])
 	sys.exit(rval)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-11 10:33 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-11 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     90c4c7a8167b15431b65f1b99e97b9c4dc16839e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 10:24:22 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 10:24:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=90c4c7a8

xattr-helper: use ValueError when the input is wrong

This is the standard exception for when the input is incorrect.

---
 bin/xattr-helper.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index 92bf1a2..83ee32c 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -135,13 +135,13 @@ def restore_xattrs(file_in):
 			parts = line.split(b'=', 1)
 			if len(parts) == 2:
 				if pathname is None:
-					raise AssertionError('line %d: missing pathname' % (i + 1,))
+					raise ValueError('line %d: missing pathname' % (i + 1,))
 				attr = unquote(parts[0])
-				# strip trailing newline and quotes 
+				# strip trailing newline and quotes
 				value = unquote(parts[1].rstrip(b'\n')[1:-1])
 				xattr.set(pathname, attr, value)
 			elif line.strip():
-				raise AssertionError("line %d: malformed entry" % (i + 1,))
+				raise ValueError('line %d: malformed entry' % (i + 1,))
 
 def main(argv):
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-10-16  6:56 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-10-16  6:56 UTC (permalink / raw
  To: gentoo-commits

commit:     c651476c03a67e98054335b43e476c55bcab167f
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 16 06:51:24 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Oct 16 06:55:51 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c651476c

helper-functions.sh: sync with multiprocessing.eclass

This pulls in (among other thing) portability fixes.

URL: https://bugs.gentoo.org/487056

---
 bin/helper-functions.sh | 57 ++++++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
index ecd78c3..4a46278 100644
--- a/bin/helper-functions.sh
+++ b/bin/helper-functions.sh
@@ -10,7 +10,7 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 #
 # API functions for doing parallel processing
 #
-__numjobs() {
+makeopts_jobs() {
 	# Copied from eutils.eclass:makeopts_jobs()
 	local jobs=$(echo " ${MAKEOPTS} " | \
 		sed -r -n 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p')
@@ -19,25 +19,28 @@ __numjobs() {
 
 __multijob_init() {
 	# Setup a pipe for children to write their pids to when they finish.
-	mj_control_pipe=$(mktemp -t multijob.XXXXXX)
-	rm "${mj_control_pipe}"
-	mkfifo "${mj_control_pipe}"
-	__redirect_alloc_fd mj_control_fd "${mj_control_pipe}"
-	rm -f "${mj_control_pipe}"
+	# We have to allocate two fd's because POSIX has undefined behavior
+	# when you open a FIFO for simultaneous read/write. #487056
+	local pipe=$(mktemp -t multijob.XXXXXX)
+	rm -f "${pipe}"
+	mkfifo -m 600 "${pipe}"
+	__redirect_alloc_fd mj_write_fd "${pipe}"
+	__redirect_alloc_fd mj_read_fd "${pipe}"
+	rm -f "${pipe}"
 
 	# See how many children we can fork based on the user's settings.
-	mj_max_jobs=$(__numjobs)
+	mj_max_jobs=$(makeopts_jobs "$@")
 	mj_num_jobs=0
 }
 
 __multijob_child_init() {
-	trap 'echo ${BASHPID} $? >&'${mj_control_fd} EXIT
+	trap 'echo ${BASHPID} $? >&'${mj_write_fd} EXIT
 	trap 'exit 1' INT TERM
 }
 
 __multijob_finish_one() {
 	local pid ret
-	read -r -u ${mj_control_fd} pid ret
+	read -r -u ${mj_read_fd} pid ret
 	: $(( --mj_num_jobs ))
 	return ${ret}
 }
@@ -71,24 +74,24 @@ __redirect_alloc_fd() {
 	local var=$1 file=$2 redir=${3:-"<>"}
 
 	if [[ $(( (BASH_VERSINFO[0] << 8) + BASH_VERSINFO[1] )) -ge $(( (4 << 8) + 1 )) ]] ; then
-			# Newer bash provides this functionality.
-			eval "exec {${var}}${redir}'${file}'"
+		# Newer bash provides this functionality.
+		eval "exec {${var}}${redir}'${file}'"
 	else
-			# Need to provide the functionality ourselves.
-			local fd=10
-			local fddir=/dev/fd
-			# Prefer /proc/self/fd if available (/dev/fd
-			# doesn't work on solaris, see bug #474536).
-			[[ -d /proc/self/fd ]] && fddir=/proc/self/fd
-			while :; do
-					# Make sure the fd isn't open.  It could be a char device,
-					# or a symlink (possibly broken) to something else.
-					if [[ ! -e ${fddir}/${fd} ]] && [[ ! -L ${fddir}/${fd} ]] ; then
-							eval "exec ${fd}${redir}'${file}'" && break
-					fi
-					[[ ${fd} -gt 1024 ]] && die "__redirect_alloc_fd failed"
-					: $(( ++fd ))
-			done
-			: $(( ${var} = fd ))
+		# Need to provide the functionality ourselves.
+		local fd=10
+		local fddir=/dev/fd
+		# Prefer /proc/self/fd if available (/dev/fd
+		# doesn't work on solaris, see bug #474536).
+		[[ -d /proc/self/fd ]] && fddir=/proc/self/fd
+		while :; do
+			# Make sure the fd isn't open.  It could be a char device,
+			# or a symlink (possibly broken) to something else.
+			if [[ ! -e ${fddir}/${fd} ]] && [[ ! -L ${fddir}/${fd} ]] ; then
+				eval "exec ${fd}${redir}'${file}'" && break
+			fi
+			[[ ${fd} -gt 1024 ]] && die 'could not locate a free temp fd !?'
+			: $(( ++fd ))
+		done
+		: $(( ${var} = fd ))
 	fi
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-11-27  3:27 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-11-27  3:27 UTC (permalink / raw
  To: gentoo-commits

commit:     ff8b17301527f35079eec332a2884337f797f837
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Tue Nov 26 20:15:37 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Nov 27 03:25:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ff8b1730

portageq envvar: shell escape variable (bug 492314)

---
 bin/portageq | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/portageq b/bin/portageq
index 82735f1..f29c124 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -740,7 +740,7 @@ def envvar(argv):
 
 	for arg in argv:
 		if verbose:
-			print(arg +"='"+ portage.settings[arg] +"'")
+			print(arg + "=" + portage._shell_quote(portage.settings[arg]))
 		else:
 			print(portage.settings[arg])
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-11-30  4:22 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-11-30  4:22 UTC (permalink / raw
  To: gentoo-commits

commit:     b004f54da09febe1e77a03d1e9ec633aa80d4557
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 29 23:29:40 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 29 23:47:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b004f54d

fix random pylint errors

Shouldn't be any functional changes here.

---
 bin/ebuild    |   4 +-
 bin/egencache | 124 +++++++++++++--------------
 bin/emaint    |   4 +-
 bin/emerge    |   4 +-
 bin/portageq  |  48 +++++------
 bin/repoman   | 266 +++++++++++++++++++++++++++++-----------------------------
 6 files changed, 225 insertions(+), 225 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index a100657..f8ac5b8 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -10,7 +10,7 @@ import sys
 # This block ensures that ^C interrupts are handled quietly.
 try:
 
-	def exithandler(signum,frame):
+	def exithandler(signum, _frame):
 		signal.signal(signal.SIGINT, signal.SIG_IGN)
 		signal.signal(signal.SIGTERM, signal.SIG_IGN)
 		sys.exit(128 + signum)
@@ -24,7 +24,7 @@ try:
 except KeyboardInterrupt:
 	sys.exit(128 + signal.SIGINT)
 
-def debug_signal(signum, frame):
+def debug_signal(_signum, _frame):
 	import pdb
 	pdb.set_trace()
 

diff --git a/bin/egencache b/bin/egencache
index 915adc8..408aec8 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -11,7 +11,7 @@ import sys
 # This block ensures that ^C interrupts are handled quietly.
 try:
 
-	def exithandler(signum,frame):
+	def exithandler(signum, _frame):
 		signal.signal(signal.SIGINT, signal.SIG_IGN)
 		signal.signal(signal.SIGTERM, signal.SIG_IGN)
 		sys.exit(128 + signum)
@@ -22,7 +22,7 @@ try:
 except KeyboardInterrupt:
 	sys.exit(128 + signal.SIGINT)
 
-def debug_signal(signum, frame):
+def debug_signal(_signum, _frame):
 	import pdb
 	pdb.set_trace()
 
@@ -74,6 +74,7 @@ else:
 from repoman.utilities import FindVCS
 
 if sys.hexversion >= 0x3000000:
+	# pylint: disable=W0622
 	long = int
 
 def parse_args(args):
@@ -300,69 +301,69 @@ class GenCache(object):
 
 	def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
 
-			if not hasattr(trg_cache, 'raise_stat_collision'):
-				# This cache does not avoid redundant writes automatically,
-				# so check for an identical existing entry before writing.
-				# This prevents unnecessary disk writes and can also prevent
-				# unnecessary rsync transfers.
-				try:
-					dest = trg_cache[cpv]
-				except (KeyError, CacheError):
-					pass
-				else:
-					if trg_cache.validate_entry(dest,
-						ebuild_hash, self._eclass_db):
-						identical = True
-						for k in self._auxdbkeys:
-							if dest.get(k, '') != metadata.get(k, ''):
-								identical = False
-								break
-						if identical:
-							return
+		if not hasattr(trg_cache, 'raise_stat_collision'):
+			# This cache does not avoid redundant writes automatically,
+			# so check for an identical existing entry before writing.
+			# This prevents unnecessary disk writes and can also prevent
+			# unnecessary rsync transfers.
+			try:
+				dest = trg_cache[cpv]
+			except (KeyError, CacheError):
+				pass
+			else:
+				if trg_cache.validate_entry(dest,
+					ebuild_hash, self._eclass_db):
+					identical = True
+					for k in self._auxdbkeys:
+						if dest.get(k, '') != metadata.get(k, ''):
+							identical = False
+							break
+					if identical:
+						return
 
+		try:
+			chf = trg_cache.validation_chf
+			metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
 			try:
-				chf = trg_cache.validation_chf
-				metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
+				trg_cache[cpv] = metadata
+			except StatCollision as sc:
+				# If the content of a cache entry changes and neither the
+				# file mtime nor size changes, it will prevent rsync from
+				# detecting changes. Cache backends may raise this
+				# exception from _setitem() if they detect this type of stat
+				# collision. These exceptions are handled by bumping the
+				# mtime on the ebuild (and the corresponding cache entry).
+				# See bug #139134. It is convenient to include checks for
+				# redundant writes along with the internal StatCollision
+				# detection code, so for caches with the
+				# raise_stat_collision attribute, we do not need to
+				# explicitly check for redundant writes like we do for the
+				# other cache types above.
+				max_mtime = sc.mtime
+				for _ec, ec_hash in metadata['_eclasses_'].items():
+					if max_mtime < ec_hash.mtime:
+						max_mtime = ec_hash.mtime
+				if max_mtime == sc.mtime:
+					max_mtime += 1
+				max_mtime = long(max_mtime)
 				try:
+					os.utime(ebuild_hash.location, (max_mtime, max_mtime))
+				except OSError as e:
+					self.returncode |= 1
+					writemsg_level(
+						"%s writing target: %s\n" % (cpv, e),
+						level=logging.ERROR, noiselevel=-1)
+				else:
+					ebuild_hash.mtime = max_mtime
+					metadata['_mtime_'] = max_mtime
 					trg_cache[cpv] = metadata
-				except StatCollision as sc:
-					# If the content of a cache entry changes and neither the
-					# file mtime nor size changes, it will prevent rsync from
-					# detecting changes. Cache backends may raise this
-					# exception from _setitem() if they detect this type of stat
-					# collision. These exceptions are handled by bumping the
-					# mtime on the ebuild (and the corresponding cache entry).
-					# See bug #139134. It is convenient to include checks for
-					# redundant writes along with the internal StatCollision
-					# detection code, so for caches with the
-					# raise_stat_collision attribute, we do not need to
-					# explicitly check for redundant writes like we do for the
-					# other cache types above.
-					max_mtime = sc.mtime
-					for ec, ec_hash in metadata['_eclasses_'].items():
-						if max_mtime < ec_hash.mtime:
-							max_mtime = ec_hash.mtime
-					if max_mtime == sc.mtime:
-						max_mtime += 1
-					max_mtime = long(max_mtime)
-					try:
-						os.utime(ebuild_hash.location, (max_mtime, max_mtime))
-					except OSError as e:
-						self.returncode |= 1
-						writemsg_level(
-							"%s writing target: %s\n" % (cpv, e),
-							level=logging.ERROR, noiselevel=-1)
-					else:
-						ebuild_hash.mtime = max_mtime
-						metadata['_mtime_'] = max_mtime
-						trg_cache[cpv] = metadata
-						self._portdb.auxdb[repo_path][cpv] = metadata
+					self._portdb.auxdb[repo_path][cpv] = metadata
 
-			except CacheError as ce:
-				self.returncode |= 1
-				writemsg_level(
-					"%s writing target: %s\n" % (cpv, ce),
-					level=logging.ERROR, noiselevel=-1)
+		except CacheError as ce:
+			self.returncode |= 1
+			writemsg_level(
+				"%s writing target: %s\n" % (cpv, ce),
+				level=logging.ERROR, noiselevel=-1)
 
 	def run(self):
 		signum = run_main_scheduler(self._regen)
@@ -644,7 +645,8 @@ class _special_filename(_filename_base):
 		self.file_name = file_name
 		self.file_type = guessManifestFileType(file_name)
 
-	def file_type_lt(self, a, b):
+	@staticmethod
+	def file_type_lt(a, b):
 		"""
 		Defines an ordering between file types.
 		"""

diff --git a/bin/emaint b/bin/emaint
index f0e4978..adf44d0 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -13,10 +13,10 @@ import errno
 try:
 	import signal
 
-	def exithandler(signum,frame):
+	def exithandler(signum, _frame):
 		signal.signal(signal.SIGINT, signal.SIG_IGN)
 		signal.signal(signal.SIGTERM, signal.SIG_IGN)
-		sys.exit(1)
+		sys.exit(128 + signum)
 
 	signal.signal(signal.SIGINT, exithandler)
 	signal.signal(signal.SIGTERM, exithandler)

diff --git a/bin/emerge b/bin/emerge
index a7654bb..4d9ea5a 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -15,7 +15,7 @@ import sys
 # Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
 try:
 
-	def exithandler(signum,frame):
+	def exithandler(signum, _frame):
 		signal.signal(signal.SIGTERM, signal.SIG_IGN)
 		sys.exit(128 + signum)
 
@@ -24,7 +24,7 @@ try:
 	# writing to a pipe.
 	signal.signal(signal.SIGPIPE, signal.SIG_DFL)
 
-	def debug_signal(signum, frame):
+	def debug_signal(_signum, _frame):
 		import pdb
 		pdb.set_trace()
 

diff --git a/bin/portageq b/bin/portageq
index f29c124..3dc5c28 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -9,7 +9,7 @@ import sys
 # This block ensures that ^C interrupts are handled quietly.
 try:
 
-	def exithandler(signum, frame):
+	def exithandler(signum, _frame):
 		signal.signal(signal.SIGINT, signal.SIG_IGN)
 		signal.signal(signal.SIGTERM, signal.SIG_IGN)
 		sys.exit(128 + signum)
@@ -178,8 +178,8 @@ def mass_best_version(argv):
 		return 2
 	try:
 		for pack in argv[1:]:
-			mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack)
-			print(pack+":"+portage.best(mylist))
+			mylist = portage.db[argv[0]]['vartree'].dbapi.match(pack)
+			print('%s:%s' % (pack, portage.best(mylist)))
 	except KeyError:
 		return 1
 
@@ -187,15 +187,16 @@ def mass_best_version(argv):
 @uses_eroot
 def metadata(argv):
 	if (len(argv) < 4):
-		print("ERROR: insufficient parameters!", file=sys.stderr)
+		print('ERROR: insufficient parameters!', file=sys.stderr)
 		return 2
 
 	eroot, pkgtype, pkgspec = argv[0:3]
 	metakeys = argv[3:]
 	type_map = {
-		"ebuild":"porttree",
-		"binary":"bintree",
-		"installed":"vartree"}
+		'ebuild': 'porttree',
+		'binary': 'bintree',
+		'installed': 'vartree'
+	}
 	if pkgtype not in type_map:
 		print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
 		return 1
@@ -203,9 +204,9 @@ def metadata(argv):
 	repo = portage.dep.dep_getrepo(pkgspec)
 	pkgspec = portage.dep.remove_slot(pkgspec)
 	try:
-			values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
-				pkgspec, metakeys, myrepo=repo)
-			writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
+		values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
+			pkgspec, metakeys, myrepo=repo)
+		writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
 	except KeyError:
 		print("Package not found: '%s'" % pkgspec, file=sys.stderr)
 		return 1
@@ -396,7 +397,6 @@ def filter_protected(argv):
 		settings.get("CONFIG_PROTECT_MASK", ""))
 	protect_obj = ConfigProtect(root, protect, protect_mask)
 
-	protected = 0
 	errors = 0
 
 	for line in sys.stdin:
@@ -418,7 +418,6 @@ def filter_protected(argv):
 			continue
 
 		if protect_obj.isprotected(f):
-			protected += 1
 			out.write("%s\n" % filename)
 	out.flush()
 
@@ -466,8 +465,7 @@ def best_visible(argv):
 			noiselevel=-1)
 		return 2
 
-	root_config = RootConfig(portage.settings,
-		portage.db[eroot], None)
+	root_config = RootConfig(portage.settings, portage.db[eroot], None)
 
 	if hasattr(db, "xmatch"):
 		cpv_list = db.xmatch("match-all-cpv-only", atom)
@@ -640,7 +638,7 @@ def expand_virtual(argv):
 	return os.EX_OK
 
 
-def vdb_path(argv):
+def vdb_path(_argv):
 	"""
 	Returns the path used for the var(installed) package database for the
 	set environment/configuration options.
@@ -650,7 +648,7 @@ def vdb_path(argv):
 	out.flush()
 	return os.EX_OK
 
-def gentoo_mirrors(argv):
+def gentoo_mirrors(_argv):
 	"""
 	Returns the mirrors set to use in the portage configuration.
 	"""
@@ -676,49 +674,49 @@ def repos_config(argv):
 	"""
 	return repositories_configuration(argv)
 
-def portdir(argv):
+def portdir(_argv):
 	"""
 	Returns the PORTDIR path.
 	"""
 	print(portage.settings["PORTDIR"])
 
 
-def config_protect(argv):
+def config_protect(_argv):
 	"""
 	Returns the CONFIG_PROTECT paths.
 	"""
 	print(portage.settings["CONFIG_PROTECT"])
 
 
-def config_protect_mask(argv):
+def config_protect_mask(_argv):
 	"""
 	Returns the CONFIG_PROTECT_MASK paths.
 	"""
 	print(portage.settings["CONFIG_PROTECT_MASK"])
 
 
-def portdir_overlay(argv):
+def portdir_overlay(_argv):
 	"""
 	Returns the PORTDIR_OVERLAY path.
 	"""
 	print(portage.settings["PORTDIR_OVERLAY"])
 
 
-def pkgdir(argv):
+def pkgdir(_argv):
 	"""
 	Returns the PKGDIR path.
 	"""
 	print(portage.settings["PKGDIR"])
 
 
-def distdir(argv):
+def distdir(_argv):
 	"""
 	Returns the DISTDIR path.
 	"""
 	print(portage.settings["DISTDIR"])
 
 
-def colormap(argv):
+def colormap(_argv):
 	"""
 	Display the color.map as environment variables.
 	"""
@@ -1319,10 +1317,10 @@ def main(argv):
 				sys.stderr.write("ERROR: This version of portageq"
 						 " only supports <eroot>s ending in"
 						 " '%s'. The provided <eroot>, '%s',"
-						 " doesn't.\n" % (eprefix, eroot));
+						 " doesn't.\n" % (eprefix, eroot))
 				sys.stderr.flush()
 				sys.exit(os.EX_USAGE)
-			root = eroot[:1-len(eprefix)]
+			root = eroot[:1 - len(eprefix)]
 		else:
 			root = eroot
 

diff --git a/bin/repoman b/bin/repoman
index 1a02050..63558fa 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -113,7 +113,7 @@ def err(txt):
 	warn(txt)
 	sys.exit(1)
 
-def exithandler(signum=None, frame=None):
+def exithandler(signum=None, _frame=None):
 	logging.fatal("Interrupted; exiting...")
 	if signum is None:
 		sys.exit(1)
@@ -1319,7 +1319,7 @@ if options.if_modified == "y":
 		chain(mychanged, mynew, myremoved)))
 
 for x in effective_scanlist:
-	#ebuilds and digests added to cvs respectively.
+	# ebuilds and digests added to cvs respectively.
 	logging.info("checking package %s" % x)
 	# save memory by discarding xmatch caches from previous package(s)
 	arch_xmatch_caches.clear()
@@ -1413,9 +1413,9 @@ for x in effective_scanlist:
 	allvalid = True
 	for y in checkdirlist:
 		if (y in no_exec or y.endswith(".ebuild")) and \
-			stat.S_IMODE(os.stat(os.path.join(checkdir, y)).st_mode) & 0o111:
-				stats["file.executable"] += 1
-				fails["file.executable"].append(os.path.join(checkdir, y))
+				stat.S_IMODE(os.stat(os.path.join(checkdir, y)).st_mode) & 0o111:
+			stats["file.executable"] += 1
+			fails["file.executable"].append(os.path.join(checkdir, y))
 		if y.endswith(".ebuild"):
 			pf = y[:-7]
 			ebuildlist.append(pf)
@@ -1758,7 +1758,7 @@ for x in effective_scanlist:
 				fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
 				del e
 
-		#Only carry out if in package directory or check forced
+		# Only carry out if in package directory or check forced
 		if xmllint_capable and not metadata_bad:
 			# xmlint can produce garbage output even on success, so only dump
 			# the ouput when it fails.
@@ -1797,7 +1797,7 @@ for x in effective_scanlist:
 			fails['changelog.ebuildadded'].append(relative_path)
 
 		if vcs in ("cvs", "svn", "bzr") and check_ebuild_notadded and y not in eadded:
-			#ebuild not added to vcs
+			# ebuild not added to vcs
 			stats["ebuild.notadded"] += 1
 			fails["ebuild.notadded"].append(x + "/" + y + ".ebuild")
 		myesplit = portage.pkgsplit(y)
@@ -2122,7 +2122,7 @@ for x in effective_scanlist:
 		for mypos in range(len(myuse)):
 			stats["IUSE.invalid"] += 1
 			fails["IUSE.invalid"].append(x + "/" + y + ".ebuild: %s" % myuse[mypos])
-		
+
 		# Check for outdated RUBY targets
 		if "ruby-ng" in inherited or "ruby-fakegem" in inherited or "ruby" in inherited:
 			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
@@ -2149,7 +2149,7 @@ for x in effective_scanlist:
 					stats["LICENSE.deprecated"] += 1
 					fails["LICENSE.deprecated"].append("%s: %s" % (relative_path, lic))
 
-		#keyword checks
+		# keyword checks
 		myuse = myaux["KEYWORDS"].split()
 		for mykey in myuse:
 			if mykey not in ("-*", "*", "~*"):
@@ -2165,7 +2165,7 @@ for x in effective_scanlist:
 					stats["KEYWORDS.invalid"] += 1
 					fails["KEYWORDS.invalid"].append(x + "/" + y + ".ebuild: %s (profile invalid)" % mykey)
 
-		#restrict checks
+		# restrict checks
 		myrestrict = None
 		try:
 			myrestrict = portage.dep.use_reduce(myaux["RESTRICT"], matchall=1, flat=True)
@@ -2181,7 +2181,7 @@ for x in effective_scanlist:
 				stats["RESTRICT.invalid"] += len(mybadrestrict)
 				for mybad in mybadrestrict:
 					fails["RESTRICT.invalid"].append(x + "/" + y + ".ebuild: %s" % mybad)
-		#REQUIRED_USE check
+		# REQUIRED_USE check
 		required_use = myaux["REQUIRED_USE"]
 		if required_use:
 			if not eapi_has_required_use(eapi):
@@ -2247,133 +2247,133 @@ for x in effective_scanlist:
 
 		for keyword, groups, prof in relevant_profiles:
 
-				if not (prof.status == "stable" or \
-					(prof.status == "dev" and options.include_dev) or \
-					(prof.status == "exp" and options.include_exp_profiles == 'y')):
-					continue
+			if not (prof.status == "stable" or \
+				(prof.status == "dev" and options.include_dev) or \
+				(prof.status == "exp" and options.include_exp_profiles == 'y')):
+				continue
 
-				dep_settings = arch_caches.get(prof.sub_path)
-				if dep_settings is None:
-					dep_settings = portage.config(
-						config_profile_path=prof.abs_path,
-						config_incrementals=repoman_incrementals,
-						config_root=config_root,
-						local_config=False,
-						_unmatched_removal=options.unmatched_removal,
-						env=env, repositories=repoman_settings.repositories)
-					dep_settings.categories = repoman_settings.categories
-					if options.without_mask:
-						dep_settings._mask_manager_obj = \
-							copy.deepcopy(dep_settings._mask_manager)
-						dep_settings._mask_manager._pmaskdict.clear()
-					arch_caches[prof.sub_path] = dep_settings
-
-				xmatch_cache_key = (prof.sub_path, tuple(groups))
-				xcache = arch_xmatch_caches.get(xmatch_cache_key)
-				if xcache is None:
-					portdb.melt()
-					portdb.freeze()
-					xcache = portdb.xcache
-					xcache.update(shared_xmatch_caches)
-					arch_xmatch_caches[xmatch_cache_key] = xcache
-
-				trees[root]["porttree"].settings = dep_settings
-				portdb.settings = dep_settings
-				portdb.xcache = xcache
-
-				dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
-				# just in case, prevent config.reset() from nuking these.
-				dep_settings.backup_changes("ACCEPT_KEYWORDS")
-
-				# This attribute is used in dbapi._match_use() to apply
-				# use.stable.{mask,force} settings based on the stable
-				# status of the parent package. This is required in order
-				# for USE deps of unstable packages to be resolved correctly,
-				# since otherwise use.stable.{mask,force} settings of
-				# dependencies may conflict (see bug #456342).
-				dep_settings._parent_stable = dep_settings._isStable(pkg)
-
-				# Handle package.use*.{force,mask) calculation, for use
-				# in dep_check.
-				dep_settings.useforce = dep_settings._use_manager.getUseForce(
-					pkg, stable=dep_settings._parent_stable)
-				dep_settings.usemask = dep_settings._use_manager.getUseMask(
-					pkg, stable=dep_settings._parent_stable)
-
-				if not baddepsyntax:
-					ismasked = not ebuild_archs or \
-						pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)
-					if ismasked:
-						if not have_pmasked:
-							have_pmasked = bool(dep_settings._getMaskAtom(
-								pkg.cpv, pkg._metadata))
-						if options.ignore_masked:
-							continue
-						#we are testing deps for a masked package; give it some lee-way
-						suffix = "masked"
-						matchmode = "minimum-all"
-					else:
-						suffix = ""
-						matchmode = "minimum-visible"
-
-					if not have_dev_keywords:
-						have_dev_keywords = \
-							bool(dev_keywords.intersection(keywords))
-
-					if prof.status == "dev":
-						suffix = suffix + "indev"
-
-					for mytype in Package._dep_keys:
-
-						mykey = "dependency.bad" + suffix
-						myvalue = myaux[mytype]
-						if not myvalue:
-							continue
-
-						success, atoms = portage.dep_check(myvalue, portdb,
-							dep_settings, use="all", mode=matchmode,
-							trees=trees)
-
-						if success:
-							if atoms:
-
-								# Don't bother with dependency.unknown for
-								# cases in which *DEPEND.bad is triggered.
-								for atom in atoms:
-									# dep_check returns all blockers and they
-									# aren't counted for *DEPEND.bad, so we
-									# ignore them here.
-									if not atom.blocker:
-										unknown_pkgs.discard(
-											(mytype, atom.unevaluated_atom))
-
-								if not prof.sub_path:
-									# old-style virtuals currently aren't
-									# resolvable with empty profile, since
-									# 'virtuals' mappings are unavailable
-									# (it would be expensive to search
-									# for PROVIDE in all ebuilds)
-									atoms = [atom for atom in atoms if not \
-										(atom.cp.startswith('virtual/') and \
-										not portdb.cp_list(atom.cp))]
-
-								#we have some unsolvable deps
-								#remove ! deps, which always show up as unsatisfiable
-								atoms = [str(atom.unevaluated_atom) \
-									for atom in atoms if not atom.blocker]
-
-								#if we emptied out our list, continue:
-								if not atoms:
-									continue
-								stats[mykey] += 1
-								fails[mykey].append("%s: %s: %s(%s) %s" % \
-									(relative_path, mytype, keyword,
-									prof, repr(atoms)))
-						else:
+			dep_settings = arch_caches.get(prof.sub_path)
+			if dep_settings is None:
+				dep_settings = portage.config(
+					config_profile_path=prof.abs_path,
+					config_incrementals=repoman_incrementals,
+					config_root=config_root,
+					local_config=False,
+					_unmatched_removal=options.unmatched_removal,
+					env=env, repositories=repoman_settings.repositories)
+				dep_settings.categories = repoman_settings.categories
+				if options.without_mask:
+					dep_settings._mask_manager_obj = \
+						copy.deepcopy(dep_settings._mask_manager)
+					dep_settings._mask_manager._pmaskdict.clear()
+				arch_caches[prof.sub_path] = dep_settings
+
+			xmatch_cache_key = (prof.sub_path, tuple(groups))
+			xcache = arch_xmatch_caches.get(xmatch_cache_key)
+			if xcache is None:
+				portdb.melt()
+				portdb.freeze()
+				xcache = portdb.xcache
+				xcache.update(shared_xmatch_caches)
+				arch_xmatch_caches[xmatch_cache_key] = xcache
+
+			trees[root]["porttree"].settings = dep_settings
+			portdb.settings = dep_settings
+			portdb.xcache = xcache
+
+			dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
+			# just in case, prevent config.reset() from nuking these.
+			dep_settings.backup_changes("ACCEPT_KEYWORDS")
+
+			# This attribute is used in dbapi._match_use() to apply
+			# use.stable.{mask,force} settings based on the stable
+			# status of the parent package. This is required in order
+			# for USE deps of unstable packages to be resolved correctly,
+			# since otherwise use.stable.{mask,force} settings of
+			# dependencies may conflict (see bug #456342).
+			dep_settings._parent_stable = dep_settings._isStable(pkg)
+
+			# Handle package.use*.{force,mask) calculation, for use
+			# in dep_check.
+			dep_settings.useforce = dep_settings._use_manager.getUseForce(
+				pkg, stable=dep_settings._parent_stable)
+			dep_settings.usemask = dep_settings._use_manager.getUseMask(
+				pkg, stable=dep_settings._parent_stable)
+
+			if not baddepsyntax:
+				ismasked = not ebuild_archs or \
+					pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)
+				if ismasked:
+					if not have_pmasked:
+						have_pmasked = bool(dep_settings._getMaskAtom(
+							pkg.cpv, pkg._metadata))
+					if options.ignore_masked:
+						continue
+					# we are testing deps for a masked package; give it some lee-way
+					suffix = "masked"
+					matchmode = "minimum-all"
+				else:
+					suffix = ""
+					matchmode = "minimum-visible"
+
+				if not have_dev_keywords:
+					have_dev_keywords = \
+						bool(dev_keywords.intersection(keywords))
+
+				if prof.status == "dev":
+					suffix = suffix + "indev"
+
+				for mytype in Package._dep_keys:
+
+					mykey = "dependency.bad" + suffix
+					myvalue = myaux[mytype]
+					if not myvalue:
+						continue
+
+					success, atoms = portage.dep_check(myvalue, portdb,
+						dep_settings, use="all", mode=matchmode,
+						trees=trees)
+
+					if success:
+						if atoms:
+
+							# Don't bother with dependency.unknown for
+							# cases in which *DEPEND.bad is triggered.
+							for atom in atoms:
+								# dep_check returns all blockers and they
+								# aren't counted for *DEPEND.bad, so we
+								# ignore them here.
+								if not atom.blocker:
+									unknown_pkgs.discard(
+										(mytype, atom.unevaluated_atom))
+
+							if not prof.sub_path:
+								# old-style virtuals currently aren't
+								# resolvable with empty profile, since
+								# 'virtuals' mappings are unavailable
+								# (it would be expensive to search
+								# for PROVIDE in all ebuilds)
+								atoms = [atom for atom in atoms if not \
+									(atom.cp.startswith('virtual/') and \
+									not portdb.cp_list(atom.cp))]
+
+							# we have some unsolvable deps
+							# remove ! deps, which always show up as unsatisfiable
+							atoms = [str(atom.unevaluated_atom) \
+								for atom in atoms if not atom.blocker]
+
+							# if we emptied out our list, continue:
+							if not atoms:
+								continue
 							stats[mykey] += 1
 							fails[mykey].append("%s: %s: %s(%s) %s" % \
 								(relative_path, mytype, keyword,
 								prof, repr(atoms)))
+					else:
+						stats[mykey] += 1
+						fails[mykey].append("%s: %s: %s(%s) %s" % \
+							(relative_path, mytype, keyword,
+							prof, repr(atoms)))
 
 		if not baddepsyntax and unknown_pkgs:
 			type_map = {}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-12-01  7:22 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-12-01  7:22 UTC (permalink / raw
  To: gentoo-commits

commit:     e365ea81ad835ef2853e29925047d8ecb2754941
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  1 07:21:00 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 07:21:00 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e365ea81

docompress: add --limit support with newer EAPIs

We added support for not compressing files below a certain size (since the
speed/size/etc... tradeoffs didn't make sense), but it was only for man
pages and old EAPI's.

Add the logic to the newer EAPIs and apply to all compressed paths.

URL: http://bugs.gentoo.org/169260

---
 bin/misc-functions.sh  | 2 +-
 bin/phase-helpers.sh   | 2 ++
 bin/save-ebuild-env.sh | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 771bd0a..bd99def 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -156,7 +156,7 @@ prepcompress() {
 
 	# Queue up for compression.
 	# ecompress{,dir} doesn't like to be called with empty argument lists.
-	[[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --queue "${incl_d[@]}"
+	[[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --limit ${PORTAGE_DOCOMPRESS_SIZE_LIMIT:-0} --queue "${incl_d[@]}"
 	[[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ED}}"
 	[[ ${#exclude[@]} -gt 0 ]] && ecompressdir --ignore "${exclude[@]}"
 	return 0

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index d03a4d7..ec48c94 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -11,6 +11,8 @@ export EXEOPTIONS="-m0755"
 export LIBOPTIONS="-m0644"
 export DIROPTIONS="-m0755"
 export MOPREFIX=${PN}
+# Do not compress files which are smaller than this (in bytes). #169260
+export PORTAGE_DOCOMPRESS_SIZE_LIMIT="128"
 declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
 declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
 

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 2a3d5ea..7a31b89 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -14,7 +14,8 @@ __save_ebuild_env() {
 	(
 	if has --exclude-init-phases $* ; then
 		unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ \
-			PORTAGE_DOCOMPRESS PORTAGE_DOCOMPRESS_SKIP
+			PORTAGE_DOCOMPRESS_SIZE_LIMIT PORTAGE_DOCOMPRESS \
+			PORTAGE_DOCOMPRESS_SKIP
 		if [[ -n $PYTHONPATH &&
 			${PYTHONPATH%%:*} -ef $PORTAGE_PYM_PATH ]] ; then
 			if [[ $PYTHONPATH == *:* ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-12-02 15:18 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-12-02 15:18 UTC (permalink / raw
  To: gentoo-commits

commit:     5b8962b55cfe4a529861cf5400266daa25e8f4e6
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec  2 15:17:54 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Mon Dec  2 15:17:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5b8962b5

portageq: Print deprecation warnings for deprecated commands.

---
 bin/portageq | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/portageq b/bin/portageq
index 3dc5c28..a50b805 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -677,7 +677,9 @@ def repos_config(argv):
 def portdir(_argv):
 	"""
 	Returns the PORTDIR path.
+	Deprecated in favor of repositories_configuration command.
 	"""
+	print("WARNING: 'portageq portdir' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
 	print(portage.settings["PORTDIR"])
 
 
@@ -698,7 +700,9 @@ def config_protect_mask(_argv):
 def portdir_overlay(_argv):
 	"""
 	Returns the PORTDIR_OVERLAY path.
+	Deprecated in favor of repositories_configuration command.
 	"""
+	print("WARNING: 'portageq portdir_overlay' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
 	print(portage.settings["PORTDIR_OVERLAY"])
 
 
@@ -737,6 +741,8 @@ def envvar(argv):
 		return 2
 
 	for arg in argv:
+		if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
+			print("WARNING: 'portageq envvar %s' is deprecated. Use 'portageq repositories_configuration' instead." % arg, file=sys.stderr)
 		if verbose:
 			print(arg + "=" + portage._shell_quote(portage.settings[arg]))
 		else:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-12-12 19:39 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-12-12 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     167d1f23a54861055dce756ae39c012533a5e7f0
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Thu Dec  5 20:57:17 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Dec 11 07:57:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=167d1f23

QA warning for files in /var/{cache,lock,run}/ or /run/

No warning will be issued if the directories are created, but are
left empty.

URL: https://bugs.gentoo.org/493154

---
 bin/misc-functions.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index bd99def..2c4d248 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -241,13 +241,30 @@ install_qa_check() {
 	for x in etc/app-defaults usr/man usr/info usr/X11R6 usr/doc usr/locale ; do
 		[[ -d ${ED}/$x ]] && f+="  $x\n"
 	done
-
 	if [[ -n $f ]] ; then
 		eqawarn "QA Notice: This ebuild installs into the following deprecated directories:"
 		eqawarn
 		eqawarn "$f"
 	fi
 
+	# It's ok create these directories, but not to install into them. #493154
+	# TODO: We should add var/lib to this list.
+	f=
+	for x in var/cache var/lock var/run run ; do
+		if [[ ! -L ${ED}/${x} && -d ${ED}/${x} ]] ; then
+			if [[ -z $(find "${ED}/${x}" -prune -empty) ]] ; then
+				f+=$(cd "${ED}"; find "${x}" -printf '  %p\n')
+			fi
+		fi
+	done
+	if [[ -n ${f} ]] ; then
+		eqawarn "QA Notice: This ebuild installs into paths that should be created at runtime."
+		eqawarn " To fix, simply do not install into these directories.  Instead, your package"
+		eqawarn " should create dirs on the fly at runtime as needed via init scripts/etc..."
+		eqawarn
+		eqawarn "${f}"
+	fi
+
 	set +f
 	f=
 	for x in "${ED}etc/udev/rules.d/"* "${ED}lib"*"/udev/rules.d/"* ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-12-18  2:50 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2013-12-18  2:50 UTC (permalink / raw
  To: gentoo-commits

commit:     8d4d077d5775c4f1dac724d5e6fbb7cf14db1920
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 17 23:23:12 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Dec 17 23:27:04 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8d4d077d

econf: update configure/config.{sub,guess} atomically to avoid races

Use $BASHPID which will be unique even in subshells.

URL: https://bugs.gentoo.org/487478

---
 bin/phase-helpers.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ec48c94..1a7ae03 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -469,6 +469,7 @@ unpack() {
 
 econf() {
 	local x
+	local pid=${BASHPID}
 
 	if ! ___eapi_has_prefix_variables; then
 		local EPREFIX=
@@ -501,18 +502,22 @@ 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_.$$" || die
-			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
-				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
-			touch -r "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
-			rm -f "$ECONF_SOURCE/configure._portage_tmp_.$$"
+			touch -r "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die
+			sed -i \
+				-e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \
+				"${ECONF_SOURCE}/configure" \
+				|| 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}"
 		fi
 		if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
 			find "${WORKDIR}" -type f '(' \
 			-name config.guess -o -name config.sub ')' -print0 | \
 			while read -r -d $'\0' x ; do
 				__vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
-				cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}"
+				# Make sure we do this atomically incase we're run in parallel. #487478
+				cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}.${pid}"
+				mv -f "${x}.${pid}" "${x}"
 			done
 		fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2013-12-24  8:28 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-12-24  8:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d2db1ad5a51d405f38b2158896f274b0bf08bd47
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec 24 08:27:58 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Tue Dec 24 08:27:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2db1ad5

Fix ResourceWarning.

---
 bin/ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild b/bin/ebuild
index f8ac5b8..262dab6 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -306,7 +306,7 @@ def stale_env_warning():
 
 			if ebuild_changed:
 				open(os.path.join(tmpsettings['PORTAGE_BUILDDIR'],
-					'.ebuild_changed'), 'w')
+					'.ebuild_changed'), 'w').close()
 
 from portage.exception import PermissionDenied, \
 	PortagePackageException, UnsupportedAPIException


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-01-05 17:56 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-01-05 17:56 UTC (permalink / raw
  To: gentoo-commits

commit:     d217db2bc76e4c1a2e75685b4a00e25f7d8142a8
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 29 02:21:48 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Jan  5 16:18:35 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d217db2b

Make use of optparse to fix argument parsing for Python 2.6 in bin/chpathtool.py.

---
 bin/chpathtool.py | 45 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 36 insertions(+), 9 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index aa3b7d4..0cb5d64 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -13,6 +13,12 @@ import sys
 
 from portage.util._argparse import ArgumentParser
 
+# Argument parsing compatibility for Python 2.6 using optparse.
+if sys.hexversion < 0x2070000:
+	from optparse import OptionParser
+
+from optparse import OptionError
+
 CONTENT_ENCODING = 'utf_8'
 FS_ENCODING = 'utf_8'
 
@@ -147,15 +153,36 @@ def chpath_inplace_symlink(filename, st, old, new):
 def main(argv):
 
 	parser = ArgumentParser(description=__doc__)
-	parser.add_argument('location', default=None,
-		help='root directory (e.g. $D)')
-	parser.add_argument('old', default=None,
-		help='original build prefix (e.g. /)')
-	parser.add_argument('new', default=None,
-		help='new install prefix (e.g. $EPREFIX)')
-	opts = parser.parse_args(argv)
-
-	location, old, new = opts.location, opts.old, opts.new
+	try:
+		parser.add_argument('location', default=None,
+			help='root directory (e.g. $D)')
+		parser.add_argument('old', default=None,
+			help='original build prefix (e.g. /)')
+		parser.add_argument('new', default=None,
+			help='new install prefix (e.g. $EPREFIX)')
+		opts = parser.parse_args(argv)
+
+		location, old, new = opts.location, opts.old, opts.new
+	except OptionError:
+		# Argument parsing compatibility for Python 2.6 using optparse.
+		if sys.hexversion < 0x2070000:
+			parser = OptionParser(description=__doc__,
+				usage="usage: %prog [-h] location old new\n\n" + \
+				"  location: root directory (e.g. $D)\n" + \
+				"  old:      original build prefix (e.g. /)\n" + \
+				"  new:      new install prefix (e.g. $EPREFIX)")
+
+			(opts, args) = parser.parse_args()
+
+			if len(args) != 3:
+				parser.print_usage()
+				print("%s: error: expected 3 arguments, got %i"
+					% (__file__, len(args)))
+				return
+
+			location, old, new = args[0:3]
+		else:
+			raise
 
 	is_text_file = IsTextFile()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-02-19 17:52 Chris Reffett
  0 siblings, 0 replies; 881+ messages in thread
From: Chris Reffett @ 2014-02-19 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     b45ebd914ca5d454db1e615dc4461ae8b59a30b8
Author:     Chris Reffett <creffett <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 17:49:06 2014 +0000
Commit:     Chris Reffett <creffett <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 17:49:06 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b45ebd91

Use function pointer when choosing qa output function

Replace the chain of if/else statements deciding which output formatting
function to use with a function pointer wrt comments by vapier

---
 bin/repoman | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index c7a1c4c..888892b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2432,10 +2432,14 @@ console_writer.style_listener = style_file.new_styles
 
 f = formatter.AbstractFormatter(console_writer)
 
-if options.output_style == 'column':
-	utilities.format_qa_output_column(f, stats, fails, dofull, dofail, options, qawarnings)
-else:
-	utilities.format_qa_output(f, stats, fails, dofull, dofail, options, qawarnings)
+format_outputs = {
+	'column': utilities.format_qa_output_column,
+	'default': utilities.format_qa_output
+}
+
+format_output = format_outputs.get(options.output_style,
+	format_outputs['default'])
+format_output(f, stats, fails, dofull, dofail, options, qawarnings)
 
 style_file.flush()
 del console_writer, f, style_file


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-04-19  5:26 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-04-19  5:26 UTC (permalink / raw
  To: gentoo-commits

commit:     06637c4215d55c57517739214c6e0fd6f8f53914
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 19 04:55:56 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Apr 19 04:55:56 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06637c42

repoman: Add DESCRIPTION.puntuation check (bug #438976)

Basic patch supplied by Michael Orlitzky.
Modified to be easier to add/remove puntuation to the check.

---
 bin/repoman | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index 888892b..17a4ef0 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -318,6 +318,7 @@ qahelp = {
 	"LICENSE.missing": "Ebuilds that have a missing or empty LICENSE variable",
 	"LICENSE.virtual": "Virtuals that have a non-empty LICENSE variable",
 	"DESCRIPTION.missing": "Ebuilds that have a missing or empty DESCRIPTION variable",
+	"DESCRIPTION.punctuation": "DESCRIPTION ends with a period character",
 	"DESCRIPTION.toolong": "DESCRIPTION is over %d characters" % max_desc_len,
 	"EAPI.definition": "EAPI definition does not conform to PMS section 7.3.1 (first non-comment, non-blank line)",
 	"EAPI.deprecated": "Ebuilds that use features that are deprecated in the current EAPI",
@@ -385,6 +386,7 @@ qawarnings = set((
 "dependency.badindev",
 "dependency.badmaskedindev",
 "dependency.badtilde",
+"DESCRIPTION.punctuation",
 "DESCRIPTION.toolong",
 "EAPI.deprecated",
 "HOMEPAGE.virtual",
@@ -1890,6 +1892,12 @@ for x in effective_scanlist:
 					stats[myqakey] += 1
 					fails[myqakey].append(relative_path)
 
+		if myaux['DESCRIPTION'][-1:] in ['.']:
+			stats['DESCRIPTION.punctuation'] += 1
+			fails['DESCRIPTION.punctuation'].append(
+				"%s: DESCRIPTION ends with a '%s' character"
+				% (relative_path, myaux['DESCRIPTION'][-1:])
+
 		# 14 is the length of DESCRIPTION=""
 		if len(myaux['DESCRIPTION']) > max_desc_len:
 			stats['DESCRIPTION.toolong'] += 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-04-19  5:26 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-04-19  5:26 UTC (permalink / raw
  To: gentoo-commits

commit:     1970d866b67ddbcdbd4eb5d20a5762f9efbd17aa
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 19 05:01:59 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Apr 19 05:13:22 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1970d866

repoman: Add ruby18 warning for deprecated ruby target

---
 bin/repoman | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/repoman b/bin/repoman
index 17a4ef0..feaec5c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -489,6 +489,7 @@ suspect_virtual = {
 
 ruby_deprecated = frozenset([
 	"ruby_targets_ree18",
+	"ruby_targets_ruby18",
 ])
 
 metadata_xml_encoding = 'UTF-8'


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-04-19  7:59 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-04-19  7:59 UTC (permalink / raw
  To: gentoo-commits

commit:     0a2dab393f2ecf0476262620aa2e9a68d1f88a95
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 19 06:05:02 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Apr 19 06:05:02 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0a2dab39

repoman: Add accidently deleted closing bracket ')'

Fixes commit: repoman: Add DESCRIPTION.puntuation check (bug #438976)
SHA: 06637c4215d55c57517739214c6e0fd6f8f53914
Date: (Fri Apr 18 21:55:56 2014)

---
 bin/repoman | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index feaec5c..a632246 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1897,7 +1897,7 @@ for x in effective_scanlist:
 			stats['DESCRIPTION.punctuation'] += 1
 			fails['DESCRIPTION.punctuation'].append(
 				"%s: DESCRIPTION ends with a '%s' character"
-				% (relative_path, myaux['DESCRIPTION'][-1:])
+				% (relative_path, myaux['DESCRIPTION'][-1:]))
 
 		# 14 is the length of DESCRIPTION=""
 		if len(myaux['DESCRIPTION']) > max_desc_len:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-06-16  5:16 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-06-16  5:16 UTC (permalink / raw
  To: gentoo-commits

commit:     2a3dc328bfbfd4e0e777f05c1da57bf9c4305e2c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 16 05:15:28 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 05:15:28 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a3dc328

repoman: Fix broken userquery import

Commit: 15433c52866e09967142fd2352bd7aad9ad5026f
Author: Alexander Berntsen <bernalex <AT> gentoo.org> (Thu 08 May 2014 08:47:58 AM PDT)
Subject: emerge: Implement "--alert"

---
 bin/repoman | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index a632246..c36ace1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -62,7 +62,7 @@ from repoman import utilities
 from repoman.herdbase import make_herd_base
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
-from _emerge.userquery import userquery
+from _emerge.UserQuery import UserQuery
 import portage.checksum
 import portage.const
 import portage.repository.config
@@ -2880,7 +2880,8 @@ else:
 	logging.info("myupdates: %s", myupdates)
 	logging.info("myheaders: %s", myheaders)
 
-	if options.ask and userquery('Commit changes?', True) != 'Yes':
+	uq = UserQuery(options)
+	if options.ask and uq.query('Commit changes?', True) != 'Yes':
 		print("* aborting commit.")
 		sys.exit(128 + signal.SIGINT)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-07-25 16:15 Alexander Berntsen
  0 siblings, 0 replies; 881+ messages in thread
From: Alexander Berntsen @ 2014-07-25 16:15 UTC (permalink / raw
  To: gentoo-commits

commit:     ea2d9c5a7da408437d36c3f14112088f905d57f1
Author:     Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 21 20:22:36 2014 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Fri Jul 25 16:11:24 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ea2d9c5a

repoman: Warn if virtuals depend on perl-core, bug 516428

Reported-by:   Andreas K. Hüttel  <dilfridge <AT> gentoo.org>
Authored-by:   Andreas K. Hüttel  <dilfridge <AT> gentoo.org>
Reviewed-by:   Alexander Berntsen <bernalex <AT> gentoo.org>
Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/repoman | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index c36ace1..9c5d720 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -299,6 +299,7 @@ qahelp = {
 	"dependency.badindev": "User-visible ebuilds with unsatisfied dependencies (matched against *visible* ebuilds) in developing arch",
 	"dependency.badmaskedindev": "Masked ebuilds with unsatisfied dependencies (matched against *all* ebuilds) in developing arch",
 	"dependency.badtilde": "Uses the ~ dep operator with a non-zero revision part, which is useless (the revision is ignored)",
+	"dependency.perlcore": "This ebuild directly depends on a package in perl-core; it should use the corresponding virtual instead.",
 	"dependency.syntax": "Syntax error in dependency string (usually an extra/missing space/parenthesis)",
 	"dependency.unknown": "Ebuild has a dependency that refers to an unknown package (which may be valid if it is a blocker for a renamed/removed package, or is an alternative choice provided by an overlay)",
 	"file.executable": "Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the executable bit",
@@ -386,6 +387,7 @@ qawarnings = set((
 "dependency.badindev",
 "dependency.badmaskedindev",
 "dependency.badtilde",
+"dependency.perlcore",
 "DESCRIPTION.punctuation",
 "DESCRIPTION.toolong",
 "EAPI.deprecated",
@@ -2058,6 +2060,13 @@ for x in effective_scanlist:
 								relative_path +
 								": %s: consider using '%s' instead of '%s'" %
 								(mytype, suspect_virtual[atom.cp], atom))
+						if not is_blocker and \
+							atom.cp.startswith("perl-core/"):
+							stats['dependency.perlcore'] += 1
+							fails['dependency.perlcore'].append(
+								relative_path +
+								": %s: please use '%s' instead of '%s'" %
+								(mytype, atom.replace("perl-core/","virtual/perl-"), atom))
 
 					if buildtime and \
 						not is_blocker and \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
  2014-08-03 15:24 [gentoo-commits] proj/portage:v2.2.11 " Brian Dolbec
@ 2014-08-03 15:22 ` Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-08-03 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     9351edad48523bb38b1bf651506786bdc8814f62
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  3 15:08:18 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Aug  3 15:19:25 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9351edad

bin/chpathtool.py: fix py3.2 &py3.3 test failure

The magic module for those 2 python versions do not handle byte strings correctly.
forcing the filename to str() fixes it for all pythons tested.

---
 bin/chpathtool.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 6460662..6ddf329 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -51,9 +51,12 @@ class IsTextFile(object):
 		return self._call(filename)
 
 	def _is_text_magic(self, filename):
-		mime_type = self._m.file(filename)
-		if isinstance(mime_type, bytes):
-			mime_type = mime_type.decode('ascii', 'replace')
+		# regression in sys-apps/file causes
+		# py 3.2 & 3.3 magic module to not handle bytes properly
+		if isinstance(filename, bytes):
+			mime_type = self._m.file(str(filename))
+		else:
+			mime_type = self._m.file(filename)
 		return mime_type.startswith('text/')
 
 	def _is_text_encoding(self, filename):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-04 12:16 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-08-04 12:16 UTC (permalink / raw
  To: gentoo-commits

commit:     213335d85286cd7a188d9f83b59ce0d6c2da7146
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Aug  4 12:11:24 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Mon Aug  4 12:11:24 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=213335d8

Revert incorrect commit 9351edad48523bb38b1bf651506786bdc8814f62, which broke file type detection
in chpathtool.py with Python 3 and magic module present.

>>> import magic
>>> m = magic.open(magic.MIME_TYPE)
>>> m.load()
0
>>> m.file(b"/etc/fstab")
'text/plain'
>>> m.file(str(b"/etc/fstab"))
"cannot open `b'/etc/fstab'' (No such file or directory)"

---
 bin/chpathtool.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 6ddf329..6460662 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -51,12 +51,9 @@ class IsTextFile(object):
 		return self._call(filename)
 
 	def _is_text_magic(self, filename):
-		# regression in sys-apps/file causes
-		# py 3.2 & 3.3 magic module to not handle bytes properly
-		if isinstance(filename, bytes):
-			mime_type = self._m.file(str(filename))
-		else:
-			mime_type = self._m.file(filename)
+		mime_type = self._m.file(filename)
+		if isinstance(mime_type, bytes):
+			mime_type = mime_type.decode('ascii', 'replace')
 		return mime_type.startswith('text/')
 
 	def _is_text_encoding(self, filename):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
  2014-08-19  7:01 Michał Górny
@ 2014-08-06 21:11 ` Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-06 21:11 UTC (permalink / raw
  To: gentoo-commits

commit:     72a1f979342d89f41594f40fc6074fcd3ede9086
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  4 08:57:07 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  6 21:11:38 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72a1f979

repoman: fix atom.blocker checks.

The original checks assume that no-blocker is denoted as 'None'.
However, currently atom.blocker returns just 'False'.

---
 bin/repoman | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 9c5d720..71fc7f0 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2042,16 +2042,16 @@ for x in effective_scanlist:
 					if atom == "||":
 						continue
 
+					is_blocker = atom.blocker
+
 					# Skip dependency.unknown for blockers, so that we
 					# don't encourage people to remove necessary blockers,
 					# as discussed in bug #382407.
-					if atom.blocker is None and \
+					if not is_blocker and \
 						not portdb.xmatch("match-all", atom) and \
 						not atom.cp.startswith("virtual/"):
 						unknown_pkgs.add((mytype, atom.unevaluated_atom))
 
-					is_blocker = atom.blocker
-
 					if catdir != "virtual":
 						if not is_blocker and \
 							atom.cp in suspect_virtual:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-10 10:32 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-08-10 10:32 UTC (permalink / raw
  To: gentoo-commits

commit:     bbb34efebd0bfc0b231073d00b863b3e3ebd918a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Aug 10 10:31:29 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun Aug 10 10:31:29 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbb34efe

repoman: Do not report DESCRIPTION.punctuation warning for "etc.".

---
 bin/repoman | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 71fc7f0..bd9ad15 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1895,7 +1895,11 @@ for x in effective_scanlist:
 					stats[myqakey] += 1
 					fails[myqakey].append(relative_path)
 
-		if myaux['DESCRIPTION'][-1:] in ['.']:
+		# Abbreviations usable at the end of sentence.
+		abbreviations = (
+			'etc.',
+		)
+		if myaux['DESCRIPTION'][-1:] == '.' and not myaux['DESCRIPTION'].split()[-1] in abbreviations:
 			stats['DESCRIPTION.punctuation'] += 1
 			fails['DESCRIPTION.punctuation'].append(
 				"%s: DESCRIPTION ends with a '%s' character"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-11 20:52 Michał Górny
  2014-08-19  7:01 ` Michał Górny
  0 siblings, 1 reply; 881+ messages in thread
From: Michał Górny @ 2014-08-11 20:52 UTC (permalink / raw
  To: gentoo-commits

commit:     852f5b5d7f2dd138a1d1b5dfa92b12bba51cf0a4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 24 08:03:52 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 11 20:44:10 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=852f5b5d

QA: Warn when systemd units use /etc/conf.d

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
Reviewed-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 bin/misc-functions.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 4e0f1fc..961738f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -595,6 +595,21 @@ install_qa_check() {
 		done
 	fi
 
+	# Common mistakes in systemd service files.
+	if type -P pkg-config >/dev/null && pkg-config --exists systemd; then
+		systemddir=$(pkg-config --variable=systemdsystemunitdir systemd)
+	else
+		systemddir=/usr/lib/systemd/system
+	fi
+	if [[ -d ${ED%/}${systemddir} ]]; then
+		f=$(grep -sH '^EnvironmentFile.*=.*/etc/conf\.d' "${ED%/}${systemddir}"/*.service)
+		if [[ -n ${f} ]] ; then
+			eqawarn "QA Notice: systemd units using /etc/conf.d detected:"
+			eqawarn "${f//${D}}"
+			eqawarn "See: https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files"
+		fi
+	fi
+
 	# Look for leaking LDFLAGS into pkg-config files
 	f=$(egrep -sH '^Libs.*-Wl,(-O[012]|--hash-style)' "${ED}"/usr/*/pkgconfig/*.pc)
 	if [[ -n ${f} ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-11 20:52 Michał Górny
  2014-08-19  7:01 ` Michał Górny
  0 siblings, 1 reply; 881+ messages in thread
From: Michał Górny @ 2014-08-11 20:52 UTC (permalink / raw
  To: gentoo-commits

commit:     98e84ba7b3939f314f61a2e1f4ce756e5cdb4009
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  9 11:54:35 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 11 20:33:28 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=98e84ba7

QA: Use pngfix to find broken PNG files

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
Reviewed-by: Justin Lecher <jlec <AT> gentoo.org>
Reviewed-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

---
 bin/misc-functions.sh | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 5ccf7c2..4e0f1fc 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -860,6 +860,33 @@ install_qa_check() {
 
 		[[ ${abort} == yes ]] && die "multilib-strict check failed!"
 	fi
+
+	local pngfix=$(type -P pngfix)
+	if [[ -n ${pngfix} ]] ; then
+		local pngout=()
+		local next
+
+		while read -r -a pngout ; do
+			local error
+
+			case "${pngout[1]}" in
+				CHK)
+					error='invalid checksum'
+					;;
+				TFB)
+					error='broken IDAT window length'
+					;;
+			esac
+
+			if [[ -n ${error} ]] ; then
+				if [[ -z ${next} ]] ; then
+					eqawarn "QA Notice: broken .png files found:"
+					next=1
+				fi
+				eqawarn "   ${pngout[@]:7}: ${error}"
+			fi
+		done < <(find "${ED}" -type f -name '*.png' -exec "${pngfix}" {} +)
+	fi
 }
 
 install_qa_check_prefix() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     9351edad48523bb38b1bf651506786bdc8814f62
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  3 15:08:18 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  3 15:19:25 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9351edad

bin/chpathtool.py: fix py3.2 &py3.3 test failure

The magic module for those 2 python versions do not handle byte strings correctly.
forcing the filename to str() fixes it for all pythons tested.

---
 bin/chpathtool.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 6460662..6ddf329 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -51,9 +51,12 @@ class IsTextFile(object):
 		return self._call(filename)
 
 	def _is_text_magic(self, filename):
-		mime_type = self._m.file(filename)
-		if isinstance(mime_type, bytes):
-			mime_type = mime_type.decode('ascii', 'replace')
+		# regression in sys-apps/file causes
+		# py 3.2 & 3.3 magic module to not handle bytes properly
+		if isinstance(filename, bytes):
+			mime_type = self._m.file(str(filename))
+		else:
+			mime_type = self._m.file(filename)
 		return mime_type.startswith('text/')
 
 	def _is_text_encoding(self, filename):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     ea2d9c5a7da408437d36c3f14112088f905d57f1
Author:     Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 21 20:22:36 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 25 16:11:24 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ea2d9c5a

repoman: Warn if virtuals depend on perl-core, bug 516428

Reported-by:   Andreas K. Hüttel  <dilfridge <AT> gentoo.org>
Authored-by:   Andreas K. Hüttel  <dilfridge <AT> gentoo.org>
Reviewed-by:   Alexander Berntsen <bernalex <AT> gentoo.org>
Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/repoman | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index c36ace1..9c5d720 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -299,6 +299,7 @@ qahelp = {
 	"dependency.badindev": "User-visible ebuilds with unsatisfied dependencies (matched against *visible* ebuilds) in developing arch",
 	"dependency.badmaskedindev": "Masked ebuilds with unsatisfied dependencies (matched against *all* ebuilds) in developing arch",
 	"dependency.badtilde": "Uses the ~ dep operator with a non-zero revision part, which is useless (the revision is ignored)",
+	"dependency.perlcore": "This ebuild directly depends on a package in perl-core; it should use the corresponding virtual instead.",
 	"dependency.syntax": "Syntax error in dependency string (usually an extra/missing space/parenthesis)",
 	"dependency.unknown": "Ebuild has a dependency that refers to an unknown package (which may be valid if it is a blocker for a renamed/removed package, or is an alternative choice provided by an overlay)",
 	"file.executable": "Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the executable bit",
@@ -386,6 +387,7 @@ qawarnings = set((
 "dependency.badindev",
 "dependency.badmaskedindev",
 "dependency.badtilde",
+"dependency.perlcore",
 "DESCRIPTION.punctuation",
 "DESCRIPTION.toolong",
 "EAPI.deprecated",
@@ -2058,6 +2060,13 @@ for x in effective_scanlist:
 								relative_path +
 								": %s: consider using '%s' instead of '%s'" %
 								(mytype, suspect_virtual[atom.cp], atom))
+						if not is_blocker and \
+							atom.cp.startswith("perl-core/"):
+							stats['dependency.perlcore'] += 1
+							fails['dependency.perlcore'].append(
+								relative_path +
+								": %s: please use '%s' instead of '%s'" %
+								(mytype, atom.replace("perl-core/","virtual/perl-"), atom))
 
 					if buildtime and \
 						not is_blocker and \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     bbb34efebd0bfc0b231073d00b863b3e3ebd918a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Aug 10 10:31:29 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 10 10:31:29 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbb34efe

repoman: Do not report DESCRIPTION.punctuation warning for "etc.".

---
 bin/repoman | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 71fc7f0..bd9ad15 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1895,7 +1895,11 @@ for x in effective_scanlist:
 					stats[myqakey] += 1
 					fails[myqakey].append(relative_path)
 
-		if myaux['DESCRIPTION'][-1:] in ['.']:
+		# Abbreviations usable at the end of sentence.
+		abbreviations = (
+			'etc.',
+		)
+		if myaux['DESCRIPTION'][-1:] == '.' and not myaux['DESCRIPTION'].split()[-1] in abbreviations:
 			stats['DESCRIPTION.punctuation'] += 1
 			fails['DESCRIPTION.punctuation'].append(
 				"%s: DESCRIPTION ends with a '%s' character"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     213335d85286cd7a188d9f83b59ce0d6c2da7146
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Aug  4 12:11:24 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug  4 12:11:24 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=213335d8

Revert incorrect commit 9351edad48523bb38b1bf651506786bdc8814f62, which broke file type detection
in chpathtool.py with Python 3 and magic module present.

>>> import magic
>>> m = magic.open(magic.MIME_TYPE)
>>> m.load()
0
>>> m.file(b"/etc/fstab")
'text/plain'
>>> m.file(str(b"/etc/fstab"))
"cannot open `b'/etc/fstab'' (No such file or directory)"

---
 bin/chpathtool.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 6ddf329..6460662 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -51,12 +51,9 @@ class IsTextFile(object):
 		return self._call(filename)
 
 	def _is_text_magic(self, filename):
-		# regression in sys-apps/file causes
-		# py 3.2 & 3.3 magic module to not handle bytes properly
-		if isinstance(filename, bytes):
-			mime_type = self._m.file(str(filename))
-		else:
-			mime_type = self._m.file(filename)
+		mime_type = self._m.file(filename)
+		if isinstance(mime_type, bytes):
+			mime_type = mime_type.decode('ascii', 'replace')
 		return mime_type.startswith('text/')
 
 	def _is_text_encoding(self, filename):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-19  7:01 Michał Górny
  2014-08-06 21:11 ` Michał Górny
  0 siblings, 1 reply; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     72a1f979342d89f41594f40fc6074fcd3ede9086
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  4 08:57:07 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  6 21:11:38 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72a1f979

repoman: fix atom.blocker checks.

The original checks assume that no-blocker is denoted as 'None'.
However, currently atom.blocker returns just 'False'.

---
 bin/repoman | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 9c5d720..71fc7f0 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2042,16 +2042,16 @@ for x in effective_scanlist:
 					if atom == "||":
 						continue
 
+					is_blocker = atom.blocker
+
 					# Skip dependency.unknown for blockers, so that we
 					# don't encourage people to remove necessary blockers,
 					# as discussed in bug #382407.
-					if atom.blocker is None and \
+					if not is_blocker and \
 						not portdb.xmatch("match-all", atom) and \
 						not atom.cp.startswith("virtual/"):
 						unknown_pkgs.add((mytype, atom.unevaluated_atom))
 
-					is_blocker = atom.blocker
-
 					if catdir != "virtual":
 						if not is_blocker and \
 							atom.cp in suspect_virtual:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
  2014-08-11 20:52 Michał Górny
@ 2014-08-19  7:01 ` Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     98e84ba7b3939f314f61a2e1f4ce756e5cdb4009
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  9 11:54:35 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 11 20:33:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=98e84ba7

QA: Use pngfix to find broken PNG files

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
Reviewed-by: Justin Lecher <jlec <AT> gentoo.org>
Reviewed-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

---
 bin/misc-functions.sh | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 5ccf7c2..4e0f1fc 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -860,6 +860,33 @@ install_qa_check() {
 
 		[[ ${abort} == yes ]] && die "multilib-strict check failed!"
 	fi
+
+	local pngfix=$(type -P pngfix)
+	if [[ -n ${pngfix} ]] ; then
+		local pngout=()
+		local next
+
+		while read -r -a pngout ; do
+			local error
+
+			case "${pngout[1]}" in
+				CHK)
+					error='invalid checksum'
+					;;
+				TFB)
+					error='broken IDAT window length'
+					;;
+			esac
+
+			if [[ -n ${error} ]] ; then
+				if [[ -z ${next} ]] ; then
+					eqawarn "QA Notice: broken .png files found:"
+					next=1
+				fi
+				eqawarn "   ${pngout[@]:7}: ${error}"
+			fi
+		done < <(find "${ED}" -type f -name '*.png' -exec "${pngfix}" {} +)
+	fi
 }
 
 install_qa_check_prefix() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
  2014-08-11 20:52 Michał Górny
@ 2014-08-19  7:01 ` Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     852f5b5d7f2dd138a1d1b5dfa92b12bba51cf0a4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 24 08:03:52 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 11 20:44:10 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=852f5b5d

QA: Warn when systemd units use /etc/conf.d

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
Reviewed-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 bin/misc-functions.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 4e0f1fc..961738f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -595,6 +595,21 @@ install_qa_check() {
 		done
 	fi
 
+	# Common mistakes in systemd service files.
+	if type -P pkg-config >/dev/null && pkg-config --exists systemd; then
+		systemddir=$(pkg-config --variable=systemdsystemunitdir systemd)
+	else
+		systemddir=/usr/lib/systemd/system
+	fi
+	if [[ -d ${ED%/}${systemddir} ]]; then
+		f=$(grep -sH '^EnvironmentFile.*=.*/etc/conf\.d' "${ED%/}${systemddir}"/*.service)
+		if [[ -n ${f} ]] ; then
+			eqawarn "QA Notice: systemd units using /etc/conf.d detected:"
+			eqawarn "${f//${D}}"
+			eqawarn "See: https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files"
+		fi
+	fi
+
 	# Look for leaking LDFLAGS into pkg-config files
 	f=$(egrep -sH '^Libs.*-Wl,(-O[012]|--hash-style)' "${ED}"/usr/*/pkgconfig/*.pc)
 	if [[ -n ${f} ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-08-26 19:38 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-08-26 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     9d27952965cec81bbdfe66d94391fc6ea506bbbb
Author:     eroen <eroen <AT> occam <DOT> eroen <DOT> eu>
AuthorDate: Tue Aug 26 19:04:44 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 26 19:38:12 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9d279529

bin/misc-functions.sh: Empty flag variable 'error' before (re-)use

Prevent subsequent .png files from inheriting error status from earlier
file.

Reviewed-By: Michał Górny <mgorny <AT> gentoo.org>
Acked-By: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 961738f..e45d810 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -882,7 +882,7 @@ install_qa_check() {
 		local next
 
 		while read -r -a pngout ; do
-			local error
+			local error=""
 
 			case "${pngout[1]}" in
 				CHK)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-03 20:22 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-09-03 20:22 UTC (permalink / raw
  To: gentoo-commits

commit:     582cb806f88ba3d405c305a4feeded3776f8d264
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 30 07:53:35 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep  3 20:21:21 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=582cb806

QA: Add a set of checks for bash-completion files

Add checks for common mistakes when installing bash completion files:
legacy directory, incorrect naming, missing aliases, deprecated 'have'
function.

Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/misc-functions.sh | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index e45d810..f6c3c1c 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -610,6 +610,130 @@ install_qa_check() {
 		fi
 	fi
 
+	# Check for correct bash-completion install path.
+	local syscompdir=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null)
+	: ${syscompdir:=${EPREFIX}/usr/share/bash-completion/completions}
+
+	local instcompdir
+	if [[ -d ${ED}/usr/share/bash-completion/completions ]]; then
+		instcompdir=${ED}/usr/share/bash-completion/completions
+	elif [[ -d ${ED}/usr/share/bash-completion ]]; then
+		if [[ ${syscompdir} != ${EPREFIX}/usr/share/bash-completion ]]; then
+			eqawarn "Bash completions were installed in legacy location. Please update"
+			eqawarn "the ebuild to get the install paths using bash-completion-r1.eclass."
+			eqawarn
+		fi
+
+		instcompdir=${ED}/usr/share/bash-completion
+	fi
+
+	# Do a few QA tests on bash completions.
+	if [[ -n ${instcompdir} && -f ${EROOT}/usr/share/bash-completion/bash_completion ]]; then
+		(
+			_get_completions() {
+				# source the file
+				source "${1}" &>/dev/null
+
+				[[ ${USED_HAVE} == yes ]] && echo '__HAVE_USED__'
+
+				# print the completed commands
+				while read -a args; do
+					[[ ${args[0]} == complete ]] || continue
+					# command always comes last, one per line
+					echo "${args[$(( ${#args[@]} - 1))]}"
+				done < <(complete -p)
+			}
+
+			# load the global helpers
+			source "${EROOT}"/usr/share/bash-completion/bash_completion
+
+			# clean up predefined completions
+			complete -r
+
+			# force all completions on
+			_have() {
+				return 0
+			}
+
+			local USED_HAVE=no
+			# add a replacement for have()
+			have() {
+				USED_HAVE=yes
+
+				unset -v have
+				_have ${1} && have=yes
+			}
+
+			local f c completions
+			local all_compls=()
+			local all_files=()
+			local qa_warnings=()
+
+			for f in "${instcompdir}"/*; do
+				# ignore directories and other non-files
+				[[ ! -f ${f} ]] && continue
+
+				# skip the common code file
+				# (in case we're run in /usr/share/bash-completion)
+				[[ ${f##*/} == bash_completion ]] && continue
+
+				completions=( $(_get_completions "${f}") )
+
+				if [[ ${completions[0]} == __HAVE_USED__ ]]; then
+					qa_warnings+=(
+						"${f##*/}: 'have' command is deprecated and must not be used."
+					)
+					unset 'completions[0]'
+				fi
+
+				if [[ -z ${completions[@]} ]]; then
+					qa_warnings+=(
+						"${f##*/}: does not define any completions (failed to source?)."
+					)
+					continue
+				fi
+
+				for c in "${completions[@]}"; do
+					if [[ ${c} == /* ]]; then
+						qa_warnings+=(
+							"${f##*/}: absolute paths can not be used for completions (on '${c}')."
+						)
+					else
+						all_compls+=( "${c}" )
+					fi
+				done
+
+				if ! has "${f##*/}" "${all_compls[@]}"; then
+					qa_warnings+=(
+						"${f##*/}: incorrect name, no completions for '${f##*/}' command defined."
+					)
+				fi
+
+				all_files+=( "${f##*/}" )
+			done
+
+			for c in "${all_compls[@]}"; do
+				if ! has "${c}" "${all_files[@]}"; then
+					qa_warnings+=(
+						"${c}: missing alias (symlink) for completed command."
+					)
+				fi
+			done
+
+			if [[ -n ${qa_warnings[@]} ]]; then
+				eqawarn "Problems with installed bash completions were found:"
+				eqawarn
+				for c in "${qa_warnings[@]}"; do
+					eqawarn "	${c}"
+				done
+				eqawarn
+				eqawarn "For more details on installing bash-completions, please see:"
+				eqawarn "https://wiki.gentoo.org/wiki/Bash/Installing_completion_files"
+				eqawarn
+			fi
+		)
+	fi
+
 	# Look for leaking LDFLAGS into pkg-config files
 	f=$(egrep -sH '^Libs.*-Wl,(-O[012]|--hash-style)' "${ED}"/usr/*/pkgconfig/*.pc)
 	if [[ -n ${f} ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-10  6:51 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-09-10  6:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b7f0bcda782aee3451833ac1bc70c72ef669b19d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  7 09:02:08 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 10 06:50:55 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b7f0bcda

Run distcc-pump server throughout src_configure() to src_install()

Start distcc-pump server in all phases throughout src_configure() to
src_install() rather than in src_compile() alone. Since each of those
phases may involve some compilations, we should try to take full
advantage of distcc in all of them. Moreover, this silences distcc
warnings about being unable to connect to the server when compiling.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=507482

---
 bin/phase-functions.sh | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index f39a024..e80f16e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -382,6 +382,19 @@ __dyn_prepare() {
 	trap - SIGINT SIGQUIT
 }
 
+# @FUNCTION: __start_distcc
+# @DESCRIPTION:
+# Start distcc-pump if necessary.
+__start_distcc() {
+	if has distcc $FEATURES && has distcc-pump $FEATURES ; then
+		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
+			# adding distcc to PATH repeatedly results in fatal distcc recursion :)
+			eval $(pump --startup | grep -v PATH)
+			trap "pump --shutdown >/dev/null" EXIT
+		fi
+	fi
+}
+
 __dyn_configure() {
 
 	if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
@@ -401,6 +414,7 @@ __dyn_configure() {
 	fi
 
 	trap __abort_configure SIGINT SIGQUIT
+	__start_distcc
 
 	__ebuild_phase pre_src_configure
 
@@ -434,13 +448,7 @@ __dyn_compile() {
 	fi
 
 	trap __abort_compile SIGINT SIGQUIT
-
-	if has distcc $FEATURES && has distcc-pump $FEATURES ; then
-		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
-			eval $(pump --startup)
-			trap "pump --shutdown" EXIT
-		fi
-	fi
+	__start_distcc
 
 	__ebuild_phase pre_src_compile
 
@@ -464,6 +472,8 @@ __dyn_test() {
 	fi
 
 	trap "__abort_test" SIGINT SIGQUIT
+	__start_distcc
+
 	if [ -d "${S}" ]; then
 		cd "${S}"
 	else
@@ -509,6 +519,8 @@ __dyn_install() {
 		return 0
 	fi
 	trap "__abort_install" SIGINT SIGQUIT
+	__start_distcc
+
 	__ebuild_phase pre_src_install
 
 	if ___eapi_has_prefix_variables; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-11 23:45 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-11 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     25e90d01d1021f7056ed3492a9fe44ed68d459d6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 17:42:49 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 23:44:25 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25e90d01

econf: Replace unnecessary 'case' statements with 'if's

Replace the 'case' statements used to match 'configure' output with
simpler pattern-matching 'if's.

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/phase-helpers.sh | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 02fcf3e..f0e298f 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -525,19 +525,15 @@ econf() {
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
-				case "${conf_help}" in
-					*--disable-dependency-tracking*)
-						set -- --disable-dependency-tracking "$@"
-						;;
-				esac
+				if [[ ${conf_help} == *--disable-dependency-tracking* ]]; then
+					set -- --disable-dependency-tracking "$@"
+				fi
 			fi
 
 			if ___eapi_econf_passes_--disable-silent-rules; then
-				case "${conf_help}" in
-					*--disable-silent-rules*)
-						set -- --disable-silent-rules "$@"
-						;;
-				esac
+				if [[ ${conf_help} == *--disable-silent-rules* ]]; then
+					set -- --disable-silent-rules "$@"
+				fi
 			fi
 		fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-11 23:45 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-11 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     f219582624a2b0d32a235fa438c26ec492cceb80
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 16 21:55:19 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 23:44:25 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f2195826

Output uniform status message before and after src_test()

Output the status messages before and after running src_test()
unconditionally, alike it is done for other src_* phase functions,
rather than in EAPI-default src_test() function. This fixes the issue of
test phase output lacking delimitation whenever a custom src_test()
function was used.

---
 bin/phase-functions.sh | 4 ++++
 bin/phase-helpers.sh   | 6 ++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index e80f16e..df385b8 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -499,7 +499,11 @@ __dyn_test() {
 		local save_sp=${SANDBOX_PREDICT}
 		addpredict /
 		__ebuild_phase pre_src_test
+
+		__vecho ">>> Test phase: ${CATEGORY}/${PF}"
 		__ebuild_phase src_test
+		__vecho ">>> Completed testing ${CATEGORY}/${PF}"
+
 		>> "$PORTAGE_BUILDDIR/.tested" || \
 			die "Failed to create $PORTAGE_BUILDDIR/.tested"
 		__ebuild_phase post_src_test

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 47bd843..02fcf3e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -667,15 +667,13 @@ __eapi0_src_test() {
 		internal_opts+=" -j1"
 	fi
 	if $emake_cmd ${internal_opts} check -n &> /dev/null; then
-		__vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
+		__vecho "${emake_cmd} ${internal_opts} check" >&2
 		$emake_cmd ${internal_opts} check || \
 			die "Make check failed. See above for details."
 	elif $emake_cmd ${internal_opts} test -n &> /dev/null; then
-		__vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
+		__vecho "${emake_cmd} ${internal_opts} test" >&2
 		$emake_cmd ${internal_opts} test || \
 			die "Make test failed. See above for details."
-	else
-		__vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-11 23:45 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-11 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     c48d5cbb505936d6b93e6f6c40589d1ac6f6c635
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 17:48:41 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 23:44:25 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c48d5cbb

econf: Add EAPI-conditional arguments via array

Use a dedicated array variable to add EAPI-conditional arguments to
the configure script instead of prepending them to the command
parameters.

---
 bin/phase-helpers.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f0e298f..ca28ce9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -521,18 +521,19 @@ econf() {
 			done
 		fi
 
+		local conf_args=()
 		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules; then
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
 				if [[ ${conf_help} == *--disable-dependency-tracking* ]]; then
-					set -- --disable-dependency-tracking "$@"
+					conf_args+=( --disable-dependency-tracking )
 				fi
 			fi
 
 			if ___eapi_econf_passes_--disable-silent-rules; then
 				if [[ ${conf_help} == *--disable-silent-rules* ]]; then
-					set -- --disable-silent-rules "$@"
+					conf_args+=( --disable-silent-rules )
 				fi
 			fi
 		fi
@@ -550,7 +551,9 @@ econf() {
 			CONF_PREFIX=${CONF_PREFIX#*=}
 			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
 			[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
-			set -- --libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")" "$@"
+			conf_args+=(
+				--libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")"
+			)
 		fi
 
 		# Handle arguments containing quoted whitespace (see bug #457136).
@@ -566,6 +569,7 @@ econf() {
 			--datadir="${EPREFIX}"/usr/share \
 			--sysconfdir="${EPREFIX}"/etc \
 			--localstatedir="${EPREFIX}"/var/lib \
+			"${conf_args[@]}" \
 			"$@" \
 			"${EXTRA_ECONF[@]}"
 		__vecho "${ECONF_SOURCE}/configure" "$@"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-11 23:45 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-11 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     772ed29fd9e7cf722aed943adbe33a27f250e1ff
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 11:54:15 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 23:44:25 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=772ed29f

Rewrite default ebuild phase setting code

Replace the ebuild phase setting code for EAPI 2 and newer with a
simpler approach; first set proper default_* functions, and call them
within the phase. Disallow calling default_* for other phase functions
than the one being run.

---
 bin/phase-functions.sh | 117 ++++++++++++++++++++++---------------------------
 bin/save-ebuild-env.sh |   2 +-
 2 files changed, 53 insertions(+), 66 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index df385b8..9bc3eb5 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -750,91 +750,78 @@ __ebuild_phase_funcs() {
 	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
 	local eapi=$1
 	local phase_func=$2
-	local default_phases="pkg_nofetch src_unpack src_prepare src_configure
-		src_compile src_install src_test"
-	local x y default_func=""
-
-	for x in pkg_nofetch src_unpack src_test ; do
-		declare -F $x >/dev/null || \
-			eval "$x() { __eapi0_$x \"\$@\" ; }"
+	local all_phases="src_compile pkg_config src_configure pkg_info
+		src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
+		src_prepare pkg_prerm pkg_pretend pkg_setup src_test src_unpack"
+	local x
+
+	# First, set up the error handlers for default*
+	for x in ${all_phases} ; do
+		eval "default_${x}() {
+			die \"default_${x}() is not supported in EAPI='${eapi}' in phase ${phase_func}\"
+		}"
 	done
 
+	# We can just call the specific handler -- it will either error out
+	# on invalid phase or run it.
+	eval "default() {
+		default_${phase_func}
+	}"
+
 	case "$eapi" in
+		0|1) # EAPIs not supporting 'default'
 
-		0|1)
+			for x in pkg_nofetch src_unpack src_test ; do
+				declare -F $x >/dev/null || \
+					eval "$x() { __eapi0_$x; }"
+			done
 
 			if ! declare -F src_compile >/dev/null ; then
 				case "$eapi" in
 					0)
-						src_compile() { __eapi0_src_compile "$@" ; }
+						src_compile() { __eapi0_src_compile; }
 						;;
 					*)
-						src_compile() { __eapi1_src_compile "$@" ; }
+						src_compile() { __eapi1_src_compile; }
 						;;
 				esac
 			fi
-
-			for x in $default_phases ; do
-				eval "default_$x() {
-					die \"default_$x() is not supported with EAPI='$eapi' during phase $phase_func\"
-				}"
-			done
-
-			eval "default() {
-				die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
-			}"
-
 			;;
 
-		*)
-
+		*) # EAPIs supporting 'default'
+
+			# defaults starting with EAPI 0
+			[[ ${phase_func} == pkg_nofetch ]] && \
+				default_pkg_nofetch() { __eapi0_pkg_nofetch; }
+			[[ ${phase_func} == src_unpack ]] && \
+				default_src_unpack() { __eapi0_src_unpack; }
+			[[ ${phase_func} == src_test ]] && \
+				default_src_test() { __eapi0_src_test; }
+
+			# defaults starting with EAPI 2
+			[[ ${phase_func} == src_configure ]] && \
+				default_src_configure() { __eapi2_src_configure; }
+			[[ ${phase_func} == src_compile ]] && \
+				default_src_compile() { __eapi2_src_compile; }
+
+			# bind supported phases to the defaults
+			declare -F src_unpack >/dev/null || \
+				src_unpack() { default; }
 			declare -F src_configure >/dev/null || \
-				src_configure() { __eapi2_src_configure "$@" ; }
-
+				src_configure() { default; }
 			declare -F src_compile >/dev/null || \
-				src_compile() { __eapi2_src_compile "$@" ; }
-
-			has $eapi 2 3 || declare -F src_install >/dev/null || \
-				src_install() { __eapi4_src_install "$@" ; }
+				src_compile() { default; }
+			declare -F src_test >/dev/null || \
+				src_test() { default; }
 
-			if has $phase_func $default_phases ; then
-
-				__eapi2_pkg_nofetch   () { __eapi0_pkg_nofetch          "$@" ; }
-				__eapi2_src_unpack    () { __eapi0_src_unpack           "$@" ; }
-				__eapi2_src_prepare   () { true                             ; }
-				__eapi2_src_test      () { __eapi0_src_test             "$@" ; }
-				__eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
-
-				for x in $default_phases ; do
-					eval "default_$x() { __eapi2_$x \"\$@\" ; }"
-				done
-
-				eval "default() { __eapi2_$phase_func \"\$@\" ; }"
-
-				case "$eapi" in
-					2|3)
-						;;
-					*)
-						eval "default_src_install() { __eapi4_src_install \"\$@\" ; }"
-						[[ $phase_func = src_install ]] && \
-							eval "default() { __eapi4_$phase_func \"\$@\" ; }"
-						;;
-				esac
-
-			else
-
-				for x in $default_phases ; do
-					eval "default_$x() {
-						die \"default_$x() is not supported in phase $default_func\"
-					}"
-				done
-
-				eval "default() {
-					die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
-				}"
+			# defaults starting with EAPI 4
+			if ! has ${eapi} 2 3; then
+				[[ ${phase_func} == src_install ]] && \
+					default_src_install() { __eapi4_src_install; }
 
+				declare -F src_install >/dev/null || \
+					src_install() { default; }
 			fi
-
 			;;
 	esac
 }

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 98cff83..de0c499 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -42,7 +42,7 @@ __save_ebuild_env() {
 
 	for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
 		src_compile src_test src_install pkg_preinst pkg_postinst \
-		pkg_prerm pkg_postrm ; do
+		pkg_prerm pkg_postrm pkg_config pkg_info pkg_pretend ; do
 		unset -f default_$x __eapi{0,1,2,3,4}_$x
 	done
 	unset x


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-20  3:56 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-09-20  3:56 UTC (permalink / raw
  To: gentoo-commits

commit:     5e3e84b4fc4dc75d520b8e0e894811e3e2c88f56
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Sep 20 03:48:23 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sat Sep 20 03:48:23 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e3e84b4

Update sys.path in scripts only when using not installed instance of Portage.

Modules of installed instance of Portage are now placed in standard location,
which is included in default sys.path.

---
 bin/archive-conf     |  4 ++--
 bin/binhost-snapshot |  4 ++--
 bin/clean_locks      |  4 ++--
 bin/dispatch-conf    |  4 ++--
 bin/ebuild           |  4 ++--
 bin/ebuild-ipc.py    | 20 +++++++++++++-------
 bin/egencache        |  4 ++--
 bin/emaint           |  4 ++--
 bin/emerge           |  5 ++---
 bin/env-update       |  4 ++--
 bin/fixpackages      |  4 ++--
 bin/glsa-check       |  4 ++--
 bin/portageq         | 22 +++++++++++++---------
 bin/quickpkg         |  4 ++--
 bin/regenworld       |  4 ++--
 bin/repoman          |  4 ++--
 16 files changed, 54 insertions(+), 45 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index f73ca42..59350a0 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -14,8 +14,8 @@ from __future__ import print_function
 import sys
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 

diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index c2204f0..3a34643 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -13,8 +13,8 @@ except ImportError:
 	from urlparse import urlparse
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage.util._argparse import ArgumentParser

diff --git a/bin/clean_locks b/bin/clean_locks
index 3e969f2..13af061 100755
--- a/bin/clean_locks
+++ b/bin/clean_locks
@@ -6,8 +6,8 @@ from __future__ import print_function
 
 import sys, errno
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 4b0c0ac..fb0a8af 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -17,8 +17,8 @@ from stat import ST_GID, ST_MODE, ST_UID
 from random import random
 import atexit, re, shutil, stat, sys
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/ebuild b/bin/ebuild
index 8f4b103..02ee022 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -38,8 +38,8 @@ signal.signal(debug_signum, debug_signal)
 import io
 import os
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 00337ee..3e6d90c 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -24,15 +24,21 @@ else:
 
 signal.signal(debug_signum, debug_signal)
 
-# Avoid sandbox violations after python upgrade.
-pym_path = os.path.join(os.path.dirname(
-	os.path.dirname(os.path.realpath(__file__))), "pym")
+if os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), ".portage_not_installed")):
+	pym_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym")]
+	sys.path.insert(0, pym_paths[0])
+else:
+	import distutils.sysconfig
+	pym_paths = [os.path.join(distutils.sysconfig.get_python_lib(), x) for x in ("_emerge", "portage")]
+# Avoid sandbox violations after Python upgrade.
 if os.environ.get("SANDBOX_ON") == "1":
 	sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
-	if pym_path not in sandbox_write:
-		sandbox_write.append(pym_path)
-		os.environ["SANDBOX_WRITE"] = \
-			":".join(filter(None, sandbox_write))
+	for pym_path in pym_paths:
+		if pym_path not in sandbox_write:
+			sandbox_write.append(pym_path)
+			os.environ["SANDBOX_WRITE"] = ":".join(filter(None, sandbox_write))
+	del pym_path, sandbox_write
+del pym_paths
 
 import portage
 portage._internal_caller = True

diff --git a/bin/egencache b/bin/egencache
index c14be93..e366058 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -41,8 +41,8 @@ import textwrap
 import re
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os, _encodings, _unicode_encode, _unicode_decode

diff --git a/bin/emaint b/bin/emaint
index aeeb183..a634c0e 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -26,8 +26,8 @@ except KeyboardInterrupt:
 	sys.exit(1)
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage.emaint.main import emaint_main

diff --git a/bin/emerge b/bin/emerge
index 7773f7f..43cfdcd 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -36,9 +36,8 @@ try:
 	signal.signal(debug_signum, debug_signal)
 
 	from os import path as osp
-	pym_path = osp.join(osp.dirname(osp.dirname(
-		osp.realpath(__file__))), "pym")
-	sys.path.insert(0, pym_path)
+	if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+		sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 	import portage
 	portage._internal_caller = True
 	portage._disable_legacy_globals()

diff --git a/bin/env-update b/bin/env-update
index 7651ef9..c43459b 100755
--- a/bin/env-update
+++ b/bin/env-update
@@ -26,8 +26,8 @@ if len(sys.argv) > 1:
 	usage(1)
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 

diff --git a/bin/fixpackages b/bin/fixpackages
index cec0030..8a0c444 100755
--- a/bin/fixpackages
+++ b/bin/fixpackages
@@ -8,8 +8,8 @@ import os
 import sys
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/glsa-check b/bin/glsa-check
index 972679a..94dea73 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -8,8 +8,8 @@ import sys
 import codecs
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/portageq b/bin/portageq
index 79818f6..4d5cc19 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -23,18 +23,22 @@ except KeyboardInterrupt:
 import os
 import types
 
-# Avoid sandbox violations after python upgrade.
-pym_path = os.path.join(os.path.dirname(
-	os.path.dirname(os.path.realpath(__file__))), "pym")
+if os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), ".portage_not_installed")):
+	pym_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym")]
+	sys.path.insert(0, pym_paths[0])
+else:
+	import distutils.sysconfig
+	pym_paths = [os.path.join(distutils.sysconfig.get_python_lib(), x) for x in ("_emerge", "portage")]
+# Avoid sandbox violations after Python upgrade.
 if os.environ.get("SANDBOX_ON") == "1":
 	sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
-	if pym_path not in sandbox_write:
-		sandbox_write.append(pym_path)
-		os.environ["SANDBOX_WRITE"] = \
-			":".join(filter(None, sandbox_write))
-	del sandbox_write
+	for pym_path in pym_paths:
+		if pym_path not in sandbox_write:
+			sandbox_write.append(pym_path)
+			os.environ["SANDBOX_WRITE"] = ":".join(filter(None, sandbox_write))
+	del pym_path, sandbox_write
+del pym_paths
 
-sys.path.insert(0, pym_path)
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/quickpkg b/bin/quickpkg
index 035131e..cf75791 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -11,8 +11,8 @@ import sys
 import tarfile
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/regenworld b/bin/regenworld
index 32e8e5c..e07424d 100755
--- a/bin/regenworld
+++ b/bin/regenworld
@@ -6,8 +6,8 @@ from __future__ import print_function
 
 import sys
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 from portage import os

diff --git a/bin/repoman b/bin/repoman
index 5a6ee5b..ddd2e92 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -32,8 +32,8 @@ except ImportError:
 	from urlparse import urlparse
 
 from os import path as osp
-pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
-sys.path.insert(0, pym_path)
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
 portage._disable_legacy_globals()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-20  4:52 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-20  4:52 UTC (permalink / raw
  To: gentoo-commits

commit:     8acbe7d7e28769dea0445df81106ef6dbf7b55ec
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 19 18:55:32 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 20 04:49:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8acbe7d7

xattr-helper: Migrate docstrings to a variable

Due to python optimizations, __doc__ are removed.
Reviewed by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>

---
 bin/xattr-helper.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index ea83a5e..3e9b81e 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -2,7 +2,7 @@
 # Copyright 2012-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-"""Dump and restore extended attributes.
+doc = """Dump and restore extended attributes.
 
 We use formats like that used by getfattr --dump.  This is meant for shell
 helpers to save/restore.  If you're looking for a python/portage API, see
@@ -10,6 +10,8 @@ portage.util.movefile._copyxattr instead.
 
 https://en.wikipedia.org/wiki/Extended_file_attributes
 """
+__doc__ = doc
+
 
 import array
 import os
@@ -147,7 +149,7 @@ def restore_xattrs(file_in):
 
 def main(argv):
 
-	parser = ArgumentParser(description=__doc__)
+	parser = ArgumentParser(description=doc)
 	parser.add_argument('paths', nargs='*', default=[])
 
 	actions = parser.add_argument_group('Actions')


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-20  4:52 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-20  4:52 UTC (permalink / raw
  To: gentoo-commits

commit:     4b3031b3b9bdb39f33bb95b628a9101cf29728e4
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 19 18:54:46 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 20 04:47:24 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b3031b3

chpathtool: migrate docstrings to a variable

Due to python optimizations, __doc__ are removed.
Reviewed by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>

---
 bin/chpathtool.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 6460662..9b26086 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -2,9 +2,11 @@
 # Copyright 2011-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-"""Helper tool for converting installed files to custom prefixes.
+doc = """Helper tool for converting installed files to custom prefixes.
 
 In other words, eprefixy $D for Gentoo/Prefix."""
+__doc__ = doc
+
 
 import io
 import os
@@ -152,7 +154,7 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-	parser = ArgumentParser(description=__doc__)
+	parser = ArgumentParser(description=doc)
 	try:
 		parser.add_argument('location', default=None,
 			help='root directory (e.g. $D)')
@@ -166,7 +168,7 @@ def main(argv):
 	except OptionError:
 		# Argument parsing compatibility for Python 2.6 using optparse.
 		if sys.hexversion < 0x2070000:
-			parser = OptionParser(description=__doc__,
+			parser = OptionParser(description=doc,
 				usage="usage: %prog [-h] location old new\n\n" + \
 				"  location: root directory (e.g. $D)\n" + \
 				"  old:      original build prefix (e.g. /)\n" + \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-20  4:52 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-20  4:52 UTC (permalink / raw
  To: gentoo-commits

commit:     c267fb5ec42185cbd980dfe4e63dab46492257b3
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 19 18:58:37 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 20 04:49:45 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c267fb5e

portageq: Migrate docstrings to a dictionary

Due to python optimizations, __doc__ are removed.
Reviewed by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>

---
 bin/portageq | 325 ++++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 199 insertions(+), 126 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 4d5cc19..009f116 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -66,6 +66,10 @@ def uses_eroot(function):
 	function.uses_eroot = True
 	return function
 
+# global to hold all function docstrings to be used for argparse help.
+# Avoids python compilation level 2 optimization troubles.
+docstrings = {}
+
 #-----------------------------------------------------------------------------
 #
 # To add functionality to this tool, add a function below.
@@ -73,10 +77,12 @@ def uses_eroot(function):
 # The format for functions is:
 #
 #   def function(argv):
-#       """<list of options for this function>
+#       <code>
+#
+#   docstrings['function'] = """<list of options for this function>
 #       <description of the function>
 #       """
-#       <code>
+#   function.__doc__ = docstrings['function']
 #
 # "argv" is an array of the command line parameters provided after the command.
 #
@@ -89,9 +95,6 @@ def uses_eroot(function):
 
 @uses_eroot
 def has_version(argv):
-	"""<eroot> <category/package>
-	Return code 0 if it's available, 1 otherwise.
-	"""
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
 		return 3
@@ -132,12 +135,14 @@ def has_version(argv):
 			noiselevel=-1)
 		return 2
 
+docstrings['has_version'] = """<eroot> <category/package>
+	Return code 0 if it's available, 1 otherwise.
+	"""
+has_version.__doc__ = docstrings['has_version']
+
 
 @uses_eroot
 def best_version(argv):
-	"""<eroot> <category/package>
-	Returns category/package-version (without .ebuild).
-	"""
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
 		return 3
@@ -171,12 +176,14 @@ def best_version(argv):
 	except KeyError:
 		return 1
 
+docstrings['best_version'] = """<eroot> <category/package>
+	Returns category/package-version (without .ebuild).
+	"""
+best_version.__doc__ = docstrings['best_version']
+
 
 @uses_eroot
 def mass_best_version(argv):
-	"""<eroot> [<category/package>]+
-	Returns category/package-version (without .ebuild).
-	"""
 	if (len(argv) < 2):
 		print("ERROR: insufficient parameters!")
 		return 2
@@ -187,6 +194,11 @@ def mass_best_version(argv):
 	except KeyError:
 		return 1
 
+docstrings['mass_best_version'] = """<eroot> [<category/package>]+
+	Returns category/package-version (without .ebuild).
+	"""
+mass_best_version.__doc__ = docstrings['mass_best_version']
+
 
 @uses_eroot
 def metadata(argv):
@@ -215,21 +227,17 @@ def metadata(argv):
 		print("Package not found: '%s'" % pkgspec, file=sys.stderr)
 		return 1
 
-metadata.__doc__ = """
+docstrings['metadata'] = """
 <eroot> <pkgtype> <category/package> [<key>]+
 Returns metadata values for the specified package.
 Available keys: %s
 """  % ','.join(sorted(x for x in portage.auxdbkeys \
 if not x.startswith('UNUSED_')))
+metadata.__doc__ = docstrings['metadata']
 
 
 @uses_eroot
 def contents(argv):
-	"""<eroot> <category/package>
-	List the files that are installed for a given package, with
-	one file listed on each line. All file names will begin with
-	<eroot>.
-	"""
 	if len(argv) != 2:
 		print("ERROR: expected 2 parameters, got %d!" % len(argv))
 		return 2
@@ -245,16 +253,16 @@ def contents(argv):
 	writemsg_stdout(''.join('%s\n' % x for x in sorted(db.getcontents())),
 		noiselevel=-1)
 
+docstrings['contents'] = """<eroot> <category/package>
+	List the files that are installed for a given package, with
+	one file listed on each line. All file names will begin with
+	<eroot>.
+	"""
+contents.__doc__ = docstrings['contents']
+
 
 @uses_eroot
 def owners(argv):
-	"""<eroot> [<filename>]+
-	Given a list of files, print the packages that own the files and which
-	files belong to each package. Files owned by a package are listed on
-	the lines below it, indented by a single tab character (\\t). All file
-	paths must either start with <eroot> or be a basename alone.
-	Returns 1 if no owners could be found, and 0 otherwise.
-	"""
 	if len(argv) < 2:
 		sys.stderr.write("ERROR: insufficient parameters!\n")
 		sys.stderr.flush()
@@ -325,13 +333,18 @@ def owners(argv):
 		return 0
 	return 1
 
+docstrings['owners'] = """<eroot> [<filename>]+
+	Given a list of files, print the packages that own the files and which
+	files belong to each package. Files owned by a package are listed on
+	the lines below it, indented by a single tab character (\\t). All file
+	paths must either start with <eroot> or be a basename alone.
+	Returns 1 if no owners could be found, and 0 otherwise.
+	"""
+owners.__doc__ = docstrings['owners']
+
 
 @uses_eroot
 def is_protected(argv):
-	"""<eroot> <filename>
-	Given a single filename, return code 0 if it's protected, 1 otherwise.
-	The filename must begin with <eroot>.
-	"""
 	if len(argv) != 2:
 		sys.stderr.write("ERROR: expected 2 parameters, got %d!\n" % len(argv))
 		sys.stderr.flush()
@@ -372,13 +385,15 @@ def is_protected(argv):
 		return 0
 	return 1
 
+docstrings['is_protected'] = """<eroot> <filename>
+	Given a single filename, return code 0 if it's protected, 1 otherwise.
+	The filename must begin with <eroot>.
+	"""
+is_protected.__doc__ = docstrings['is_protected']
+
 
 @uses_eroot
 def filter_protected(argv):
-	"""<eroot>
-	Read filenames from stdin and write them to stdout if they are protected.
-	All filenames are delimited by \\n and must begin with <eroot>.
-	"""
 	if len(argv) != 1:
 		sys.stderr.write("ERROR: expected 1 parameter, got %d!\n" % len(argv))
 		sys.stderr.flush()
@@ -430,14 +445,15 @@ def filter_protected(argv):
 
 	return 0
 
+docstrings['filter_protected'] = """<eroot>
+	Read filenames from stdin and write them to stdout if they are protected.
+	All filenames are delimited by \\n and must begin with <eroot>.
+	"""
+filter_protected.__doc__ = docstrings['filter_protected']
+
 
 @uses_eroot
 def best_visible(argv):
-	"""<eroot> [pkgtype] <atom>
-	Returns category/package-version (without .ebuild).
-	The pkgtype argument defaults to "ebuild" if unspecified,
-	otherwise it must be one of ebuild, binary, or installed.
-	"""
 	if (len(argv) < 2):
 		writemsg("ERROR: insufficient parameters!\n", noiselevel=-1)
 		return 2
@@ -512,14 +528,16 @@ def best_visible(argv):
 
 	return 1
 
-
-@uses_eroot
-def mass_best_visible(argv):
-	"""<eroot> [<type>] [<category/package>]+
+docstrings['best_visible'] = """<eroot> [pkgtype] <atom>
 	Returns category/package-version (without .ebuild).
 	The pkgtype argument defaults to "ebuild" if unspecified,
 	otherwise it must be one of ebuild, binary, or installed.
 	"""
+best_visible.__doc__ = docstrings['best_visible']
+
+
+@uses_eroot
+def mass_best_visible(argv):
 	type_map = {
 		"ebuild":"porttree",
 		"binary":"bintree",
@@ -539,12 +557,16 @@ def mass_best_visible(argv):
 	except KeyError:
 		return 1
 
+docstrings['mass_best_visible'] = """<eroot> [<type>] [<category/package>]+
+	Returns category/package-version (without .ebuild).
+	The pkgtype argument defaults to "ebuild" if unspecified,
+	otherwise it must be one of ebuild, binary, or installed.
+	"""
+mass_best_visible.__doc__ = docstrings['mass_best_visible']
+
 
 @uses_eroot
 def all_best_visible(argv):
-	"""<eroot>
-	Returns all best_visible packages (without .ebuild).
-	"""
 	if len(argv) < 1:
 		sys.stderr.write("ERROR: insufficient parameters!\n")
 		sys.stderr.flush()
@@ -556,14 +578,14 @@ def all_best_visible(argv):
 		if mybest:
 			print(mybest)
 
+docstrings['all_best_visible'] = """<eroot>
+	Returns all best_visible packages (without .ebuild).
+	"""
+all_best_visible.__doc__ = docstrings['all_best_visible']
+
 
 @uses_eroot
 def match(argv):
-	"""<eroot> <atom>
-	Returns a \\n separated list of category/package-version.
-	When given an empty string, all installed packages will
-	be listed.
-	"""
 	if len(argv) != 2:
 		print("ERROR: expected 2 parameters, got %d!" % len(argv))
 		return 2
@@ -605,20 +627,16 @@ def match(argv):
 	for cpv in results:
 		print(cpv)
 
+docstrings['match'] = """<eroot> <atom>
+	Returns a \\n separated list of category/package-version.
+	When given an empty string, all installed packages will
+	be listed.
+	"""
+match.__doc__ = docstrings['match']
+
 
 @uses_eroot
 def expand_virtual(argv):
-	"""<eroot> <atom>
-	Returns a \\n separated list of atoms expanded from a
-	given virtual atom (GLEP 37 virtuals only),
-	excluding blocker atoms. Satisfied
-	virtual atoms are not included in the output, since
-	they are expanded to real atoms which are displayed.
-	Unsatisfied virtual atoms are displayed without
-	any expansion. The "match" command can be used to
-	resolve the returned atoms to specific installed
-	packages.
-	"""
 	if len(argv) != 2:
 		writemsg("ERROR: expected 2 parameters, got %d!\n" % len(argv),
 			noiselevel=-1)
@@ -641,101 +659,134 @@ def expand_virtual(argv):
 
 	return os.EX_OK
 
+docstrings['expand_virtual'] = """<eroot> <atom>
+	Returns a \\n separated list of atoms expanded from a
+	given virtual atom (GLEP 37 virtuals only),
+	excluding blocker atoms. Satisfied
+	virtual atoms are not included in the output, since
+	they are expanded to real atoms which are displayed.
+	Unsatisfied virtual atoms are displayed without
+	any expansion. The "match" command can be used to
+	resolve the returned atoms to specific installed
+	packages.
+	"""
+expand_virtual.__doc__ = docstrings['expand_virtual']
+
 
 def vdb_path(_argv):
-	"""
-	Returns the path used for the var(installed) package database for the
-	set environment/configuration options.
-	"""
 	out = sys.stdout
 	out.write(os.path.join(portage.settings["EROOT"], portage.VDB_PATH) + "\n")
 	out.flush()
 	return os.EX_OK
 
-def gentoo_mirrors(_argv):
+docstrings['vdb_path'] = """
+	Returns the path used for the var(installed) package database for the
+	set environment/configuration options.
 	"""
+vdb_path.__doc__ = docstrings['vdb_path']
+
+
+def gentoo_mirrors(_argv):
+	print(portage.settings["GENTOO_MIRRORS"])
+
+docstrings['gentoo_mirrors'] = """
 	Returns the mirrors set to use in the portage configuration.
 	"""
-	print(portage.settings["GENTOO_MIRRORS"])
+gentoo_mirrors.__doc__ = docstrings['gentoo_mirrors']
 
 
 @uses_eroot
 def repositories_configuration(argv):
-	"""<eroot>
-	Returns the configuration of repositories.
-	"""
 	if len(argv) < 1:
 		print("ERROR: insufficient parameters!", file=sys.stderr)
 		return 3
 	sys.stdout.write(portage.db[argv[0]]["vartree"].settings.repositories.config_string())
 	sys.stdout.flush()
 
+docstrings['repositories_configuration'] = """<eroot>
+	Returns the configuration of repositories.
+	"""
+repositories_configuration.__doc__ = docstrings['repositories_configuration']
+
+
 @uses_eroot
 def repos_config(argv):
-	"""
+	return repositories_configuration(argv)
+
+docstrings['repos_config'] = """
 	<eroot>
 	This is an alias for the repositories_configuration command.
 	"""
-	return repositories_configuration(argv)
+repos_config.__doc__ = docstrings['repos_config']
+
 
 def portdir(_argv):
-	"""
+	print("WARNING: 'portageq portdir' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
+	print(portage.settings["PORTDIR"])
+
+docstrings['portdir'] = """
 	Returns the PORTDIR path.
 	Deprecated in favor of repositories_configuration command.
 	"""
-	print("WARNING: 'portageq portdir' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
-	print(portage.settings["PORTDIR"])
+portdir.__doc__ = docstrings['portdir']
 
 
 def config_protect(_argv):
-	"""
+	print(portage.settings["CONFIG_PROTECT"])
+
+docstrings['config_protect'] = """
 	Returns the CONFIG_PROTECT paths.
 	"""
-	print(portage.settings["CONFIG_PROTECT"])
+config_protect.__doc__ = docstrings['config_protect']
 
 
 def config_protect_mask(_argv):
-	"""
-	Returns the CONFIG_PROTECT_MASK paths.
-	"""
 	print(portage.settings["CONFIG_PROTECT_MASK"])
 
+docstrings['config_protect_mask'] = """
+	Returns the CONFIG_PROTECT_MASK paths.
+	"""
+config_protect_mask.__doc__ = docstrings['config_protect_mask']
 
 def portdir_overlay(_argv):
-	"""
+	print("WARNING: 'portageq portdir_overlay' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
+	print(portage.settings["PORTDIR_OVERLAY"])
+
+docstrings['portdir_overlay'] = """
 	Returns the PORTDIR_OVERLAY path.
 	Deprecated in favor of repositories_configuration command.
 	"""
-	print("WARNING: 'portageq portdir_overlay' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
-	print(portage.settings["PORTDIR_OVERLAY"])
+portdir_overlay.__doc__ = docstrings['portdir_overlay']
 
 
 def pkgdir(_argv):
-	"""
+	print(portage.settings["PKGDIR"])
+
+docstrings['pkgdir'] = """
 	Returns the PKGDIR path.
 	"""
-	print(portage.settings["PKGDIR"])
+pkgdir.__doc__ = docstrings['pkgdir']
 
 
 def distdir(_argv):
-	"""
+	print(portage.settings["DISTDIR"])
+
+docstrings['distdir'] = """
 	Returns the DISTDIR path.
 	"""
-	print(portage.settings["DISTDIR"])
+distdir.__doc__ = docstrings['distdir']
 
 
 def colormap(_argv):
-	"""
+	print(portage.output.colormap())
+
+docstrings['colormap'] = """
 	Display the color.map as environment variables.
 	"""
-	print(portage.output.colormap())
+colormap.__doc__ = docstrings['colormap']
 
 
 def envvar(argv):
-	"""<variable>+
-	Returns a specific environment variable as exists prior to ebuild.sh.
-	Similar to: emerge --verbose --info | egrep '^<variable>='
-	"""
 	verbose = "-v" in argv
 	if verbose:
 		argv.pop(argv.index("-v"))
@@ -752,23 +803,28 @@ def envvar(argv):
 		else:
 			print(portage.settings[arg])
 
+docstrings['envvar'] = """<variable>+
+	Returns a specific environment variable as exists prior to ebuild.sh.
+	Similar to: emerge --verbose --info | egrep '^<variable>='
+	"""
+envvar.__doc__ = docstrings['envvar']
+
 
 @uses_eroot
 def get_repos(argv):
-	"""<eroot>
-	Returns all repos with names (repo_name file) argv[0] = $EROOT
-	"""
 	if len(argv) < 1:
 		print("ERROR: insufficient parameters!")
 		return 2
 	print(" ".join(reversed(portage.db[argv[0]]["vartree"].settings.repositories.prepos_order)))
 
+docstrings['get_repos'] = """<eroot>
+	Returns all repos with names (repo_name file) argv[0] = $EROOT
+	"""
+get_repos.__doc__ = docstrings['get_repos']
+
 
 @uses_eroot
 def master_repositories(argv):
-	"""<eroot> <repo_id>+
-	Returns space-separated list of master repositories for specified repository.
-	"""
 	if len(argv) < 2:
 		print("ERROR: insufficient parameters!", file=sys.stderr)
 		return 3
@@ -784,18 +840,25 @@ def master_repositories(argv):
 		else:
 			print(" ".join(x.name for x in repo.masters))
 
+docstrings['master_repositories'] = """<eroot> <repo_id>+
+	Returns space-separated list of master repositories for specified repository.
+	"""
+master_repositories.__doc__ = docstrings['master_repositories']
+
+
 @uses_eroot
 def master_repos(argv):
-	"""<eroot> <repo_id>+
+	return master_repositories(argv)
+
+docstrings['master_repos'] = """<eroot> <repo_id>+
 	This is an alias for the master_repositories command.
 	"""
-	return master_repositories(argv)
+master_repos.__doc__ = docstrings['master_repos']
+
 
 @uses_eroot
 def get_repo_path(argv):
-	"""<eroot> <repo_id>+
-	Returns the path to the repo named argv[1], argv[0] = $EROOT
-	"""
+
 	if len(argv) < 2:
 		print("ERROR: insufficient parameters!", file=sys.stderr)
 		return 3
@@ -809,12 +872,14 @@ def get_repo_path(argv):
 			return 1
 		print(path)
 
+docstrings['get_repo_path'] = """<eroot> <repo_id>+
+	Returns the path to the repo named argv[1], argv[0] = $EROOT
+	"""
+get_repo_path.__doc__ = docstrings['get_repo_path']
+
 
 @uses_eroot
 def available_eclasses(argv):
-	"""<eroot> <repo_id>+
-	Returns space-separated list of available eclasses for specified repository.
-	"""
 	if len(argv) < 2:
 		print("ERROR: insufficient parameters!", file=sys.stderr)
 		return 3
@@ -830,12 +895,14 @@ def available_eclasses(argv):
 		else:
 			print(" ".join(sorted(repo.eclass_db.eclasses)))
 
+docstrings['available_eclasses'] = """<eroot> <repo_id>+
+	Returns space-separated list of available eclasses for specified repository.
+	"""
+available_eclasses.__doc__ = docstrings['available_eclasses']
+
 
 @uses_eroot
 def eclass_path(argv):
-	"""<eroot> <repo_id> <eclass>+
-	Returns the path to specified eclass for specified repository.
-	"""
 	if len(argv) < 3:
 		print("ERROR: insufficient parameters!", file=sys.stderr)
 		return 3
@@ -859,12 +926,14 @@ def eclass_path(argv):
 				print(eclass.location)
 		return retval
 
+docstrings['eclass_path'] = """<eroot> <repo_id> <eclass>+
+	Returns the path to specified eclass for specified repository.
+	"""
+eclass_path.__doc__ = docstrings['eclass_path']
+
 
 @uses_eroot
 def license_path(argv):
-	"""<eroot> <repo_id> <license>+
-	Returns the path to specified license for specified repository.
-	"""
 	if len(argv) < 3:
 		print("ERROR: insufficient parameters!", file=sys.stderr)
 		return 3
@@ -890,15 +959,14 @@ def license_path(argv):
 			print(eclass_path)
 		return retval
 
+docstrings['license_path'] = """<eroot> <repo_id> <license>+
+	Returns the path to specified license for specified repository.
+	"""
+license_path.__doc__ = docstrings['license_path']
+
 
 @uses_eroot
 def list_preserved_libs(argv):
-	"""<eroot>
-	Print a list of libraries preserved during a package update in the form
-	package: path. Returns 1 if no preserved libraries could be found,
-	0 otherwise.
-	"""
-
 	if len(argv) != 1:
 		print("ERROR: wrong number of arguments")
 		return 2
@@ -914,6 +982,13 @@ def list_preserved_libs(argv):
 	writemsg_stdout(''.join(msg), noiselevel=-1)
 	return rValue
 
+docstrings['list_preserved_libs'] = """<eroot>
+	Print a list of libraries preserved during a package update in the form
+	package: path. Returns 1 if no preserved libraries could be found,
+	0 otherwise.
+	"""
+list_preserved_libs.__doc__ = docstrings['list_preserved_libs']
+
 
 class MaintainerEmailMatcher(object):
 	def __init__(self, maintainer_emails):
@@ -938,10 +1013,6 @@ class HerdMatcher(object):
 
 
 def pquery(parser, opts, args):
-	"""[options] [atom]+
-	Emulates a subset of Pkgcore's pquery tool.
-	"""
-
 	portdb = portage.db[portage.root]['porttree'].dbapi
 	root_config = RootConfig(portdb.settings,
 		portage.db[portage.root], None)
@@ -1120,6 +1191,11 @@ def pquery(parser, opts, args):
 
 	return os.EX_OK
 
+docstrings['pquery'] = """[options] [atom]+
+	Emulates a subset of Pkgcore's pquery tool.
+	"""
+pquery.__doc__ = docstrings['pquery']
+
 
 #-----------------------------------------------------------------------------
 #
@@ -1217,10 +1293,7 @@ def usage(argv):
 	#
 	help_mode = '--help' in argv
 	for name in commands:
-		# Drop non-functions
-		obj = globals()[name]
-
-		doc = obj.__doc__
+		doc = docstrings.get(name)
 		if (doc == None):
 			print("   " + name)
 			print("      MISSING DOCUMENTATION!")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-20 15:09 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-20 15:09 UTC (permalink / raw
  To: gentoo-commits

commit:     c775565a9f0c2aa5872559f3927d6608e840cb1d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 20 05:04:47 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 20 05:04:47 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c775565a

Revert "Rewrite default ebuild phase setting code" (bug 523182)

This reverts commit 772ed29fd9e7cf722aed943adbe33a27f250e1ff.
X-Gentoo-Bug: 523182
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=523182

---
 bin/phase-functions.sh | 117 +++++++++++++++++++++++++++----------------------
 bin/save-ebuild-env.sh |   2 +-
 2 files changed, 66 insertions(+), 53 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 9bc3eb5..df385b8 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -750,78 +750,91 @@ __ebuild_phase_funcs() {
 	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
 	local eapi=$1
 	local phase_func=$2
-	local all_phases="src_compile pkg_config src_configure pkg_info
-		src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
-		src_prepare pkg_prerm pkg_pretend pkg_setup src_test src_unpack"
-	local x
-
-	# First, set up the error handlers for default*
-	for x in ${all_phases} ; do
-		eval "default_${x}() {
-			die \"default_${x}() is not supported in EAPI='${eapi}' in phase ${phase_func}\"
-		}"
-	done
+	local default_phases="pkg_nofetch src_unpack src_prepare src_configure
+		src_compile src_install src_test"
+	local x y default_func=""
 
-	# We can just call the specific handler -- it will either error out
-	# on invalid phase or run it.
-	eval "default() {
-		default_${phase_func}
-	}"
+	for x in pkg_nofetch src_unpack src_test ; do
+		declare -F $x >/dev/null || \
+			eval "$x() { __eapi0_$x \"\$@\" ; }"
+	done
 
 	case "$eapi" in
-		0|1) # EAPIs not supporting 'default'
 
-			for x in pkg_nofetch src_unpack src_test ; do
-				declare -F $x >/dev/null || \
-					eval "$x() { __eapi0_$x; }"
-			done
+		0|1)
 
 			if ! declare -F src_compile >/dev/null ; then
 				case "$eapi" in
 					0)
-						src_compile() { __eapi0_src_compile; }
+						src_compile() { __eapi0_src_compile "$@" ; }
 						;;
 					*)
-						src_compile() { __eapi1_src_compile; }
+						src_compile() { __eapi1_src_compile "$@" ; }
 						;;
 				esac
 			fi
+
+			for x in $default_phases ; do
+				eval "default_$x() {
+					die \"default_$x() is not supported with EAPI='$eapi' during phase $phase_func\"
+				}"
+			done
+
+			eval "default() {
+				die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
+			}"
+
 			;;
 
-		*) # EAPIs supporting 'default'
-
-			# defaults starting with EAPI 0
-			[[ ${phase_func} == pkg_nofetch ]] && \
-				default_pkg_nofetch() { __eapi0_pkg_nofetch; }
-			[[ ${phase_func} == src_unpack ]] && \
-				default_src_unpack() { __eapi0_src_unpack; }
-			[[ ${phase_func} == src_test ]] && \
-				default_src_test() { __eapi0_src_test; }
-
-			# defaults starting with EAPI 2
-			[[ ${phase_func} == src_configure ]] && \
-				default_src_configure() { __eapi2_src_configure; }
-			[[ ${phase_func} == src_compile ]] && \
-				default_src_compile() { __eapi2_src_compile; }
-
-			# bind supported phases to the defaults
-			declare -F src_unpack >/dev/null || \
-				src_unpack() { default; }
+		*)
+
 			declare -F src_configure >/dev/null || \
-				src_configure() { default; }
+				src_configure() { __eapi2_src_configure "$@" ; }
+
 			declare -F src_compile >/dev/null || \
-				src_compile() { default; }
-			declare -F src_test >/dev/null || \
-				src_test() { default; }
+				src_compile() { __eapi2_src_compile "$@" ; }
+
+			has $eapi 2 3 || declare -F src_install >/dev/null || \
+				src_install() { __eapi4_src_install "$@" ; }
 
-			# defaults starting with EAPI 4
-			if ! has ${eapi} 2 3; then
-				[[ ${phase_func} == src_install ]] && \
-					default_src_install() { __eapi4_src_install; }
+			if has $phase_func $default_phases ; then
+
+				__eapi2_pkg_nofetch   () { __eapi0_pkg_nofetch          "$@" ; }
+				__eapi2_src_unpack    () { __eapi0_src_unpack           "$@" ; }
+				__eapi2_src_prepare   () { true                             ; }
+				__eapi2_src_test      () { __eapi0_src_test             "$@" ; }
+				__eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
+
+				for x in $default_phases ; do
+					eval "default_$x() { __eapi2_$x \"\$@\" ; }"
+				done
+
+				eval "default() { __eapi2_$phase_func \"\$@\" ; }"
+
+				case "$eapi" in
+					2|3)
+						;;
+					*)
+						eval "default_src_install() { __eapi4_src_install \"\$@\" ; }"
+						[[ $phase_func = src_install ]] && \
+							eval "default() { __eapi4_$phase_func \"\$@\" ; }"
+						;;
+				esac
+
+			else
+
+				for x in $default_phases ; do
+					eval "default_$x() {
+						die \"default_$x() is not supported in phase $default_func\"
+					}"
+				done
+
+				eval "default() {
+					die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
+				}"
 
-				declare -F src_install >/dev/null || \
-					src_install() { default; }
 			fi
+
 			;;
 	esac
 }

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index de0c499..98cff83 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -42,7 +42,7 @@ __save_ebuild_env() {
 
 	for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
 		src_compile src_test src_install pkg_preinst pkg_postinst \
-		pkg_prerm pkg_postrm pkg_config pkg_info pkg_pretend ; do
+		pkg_prerm pkg_postrm ; do
 		unset -f default_$x __eapi{0,1,2,3,4}_$x
 	done
 	unset x


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-24 22:23 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-24 22:23 UTC (permalink / raw
  To: gentoo-commits

commit:     1cadae82d2a03b2ed7ba31cd08dd3911055ed924
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 24 22:18:21 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Sep 24 22:22:32 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1cadae82

Initial creation of a deprecated-path script

This script is for installed portage bin/ scripts that have been moved from their original installed path.
It will search the PATH for the script called and run it from there.

---
 bin/deprecated-path | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/bin/deprecated-path b/bin/deprecated-path
new file mode 100755
index 0000000..b8aaadb
--- /dev/null
+++ b/bin/deprecated-path
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Author:
+#
+
+source /lib/gentoo/functions.sh
+
+scriptpath=${BASH_SOURCE[0]}
+scriptname=${scriptpath##*/}
+
+IFS=':'
+
+for path in ${PATH}; do
+	[[ -x ${path}/${scriptname} ]] || continue
+	[[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue
+
+	unset IFS
+	eerror "Deprecation warning: Calling ${scriptname} from wrong path: '${scriptpath}'"
+	eerror "Correct path should be '${path}/${scriptname}', Please correct your scripts or file a bug with the maintainer..."
+	exec "${path}/${scriptname}" "$@"
+done
+
+unset IFS
+
+eerror "ERROR: portage file: deprecated-path: Failed to locate ${scriptname} in PATH"
+eerror "PATH: ${PATH}"
+exit 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-26  2:17 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-26  2:17 UTC (permalink / raw
  To: gentoo-commits

commit:     042e1e0695255470e3194b6d343c74a1f2ec7f4b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 25 18:33:44 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Sep 26 01:22:13 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=042e1e06

Re-apply "Rewrite default ebuild phase setting code" (bug 523182)"

Add empty default src_prepare() as required by PMS
Add missing bind for pkg_nofetch. Spotted-by: Zac Medico <zmedico <AT> gentoo.org>

X-Gento-Bug: 523182
X-Gentoo-URL: https://bugs.gentoo.org/show_bug.cgi?id=523182
Merged 3 pathces by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/phase-functions.sh | 123 +++++++++++++++++++++++--------------------------
 bin/phase-helpers.sh   |   4 ++
 bin/save-ebuild-env.sh |   2 +-
 3 files changed, 63 insertions(+), 66 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index df385b8..d292ad3 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -750,91 +750,84 @@ __ebuild_phase_funcs() {
 	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
 	local eapi=$1
 	local phase_func=$2
-	local default_phases="pkg_nofetch src_unpack src_prepare src_configure
-		src_compile src_install src_test"
-	local x y default_func=""
-
-	for x in pkg_nofetch src_unpack src_test ; do
-		declare -F $x >/dev/null || \
-			eval "$x() { __eapi0_$x \"\$@\" ; }"
+	local all_phases="src_compile pkg_config src_configure pkg_info
+		src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
+		src_prepare pkg_prerm pkg_pretend pkg_setup src_test src_unpack"
+	local x
+
+	# First, set up the error handlers for default*
+	for x in ${all_phases} ; do
+		eval "default_${x}() {
+			die \"default_${x}() is not supported in EAPI='${eapi}' in phase ${phase_func}\"
+		}"
 	done
 
+	# We can just call the specific handler -- it will either error out
+	# on invalid phase or run it.
+	eval "default() {
+		default_${phase_func}
+	}"
+
 	case "$eapi" in
+		0|1) # EAPIs not supporting 'default'
 
-		0|1)
+			for x in pkg_nofetch src_unpack src_test ; do
+				declare -F $x >/dev/null || \
+					eval "$x() { __eapi0_$x; }"
+			done
 
 			if ! declare -F src_compile >/dev/null ; then
 				case "$eapi" in
 					0)
-						src_compile() { __eapi0_src_compile "$@" ; }
+						src_compile() { __eapi0_src_compile; }
 						;;
 					*)
-						src_compile() { __eapi1_src_compile "$@" ; }
+						src_compile() { __eapi1_src_compile; }
 						;;
 				esac
 			fi
-
-			for x in $default_phases ; do
-				eval "default_$x() {
-					die \"default_$x() is not supported with EAPI='$eapi' during phase $phase_func\"
-				}"
-			done
-
-			eval "default() {
-				die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
-			}"
-
 			;;
 
-		*)
-
+		*) # EAPIs supporting 'default'
+
+			# defaults starting with EAPI 0
+			[[ ${phase_func} == pkg_nofetch ]] && \
+				default_pkg_nofetch() { __eapi0_pkg_nofetch; }
+			[[ ${phase_func} == src_unpack ]] && \
+				default_src_unpack() { __eapi0_src_unpack; }
+			[[ ${phase_func} == src_test ]] && \
+				default_src_test() { __eapi0_src_test; }
+
+			# defaults starting with EAPI 2
+			[[ ${phase_func} == src_prepare ]] && \
+				default_src_prepare() { __eapi2_src_prepare; }
+			[[ ${phase_func} == src_configure ]] && \
+				default_src_configure() { __eapi2_src_configure; }
+			[[ ${phase_func} == src_compile ]] && \
+				default_src_compile() { __eapi2_src_compile; }
+
+			# bind supported phases to the defaults
+			declare -F pkg_nofetch >/dev/null || \
+				pkg_nofetch() { default; }
+			declare -F src_unpack >/dev/null || \
+				src_unpack() { default; }
+			declare -F src_prepare >/dev/null || \
+				src_prepare() { default; }
 			declare -F src_configure >/dev/null || \
-				src_configure() { __eapi2_src_configure "$@" ; }
-
+				src_configure() { default; }
 			declare -F src_compile >/dev/null || \
-				src_compile() { __eapi2_src_compile "$@" ; }
-
-			has $eapi 2 3 || declare -F src_install >/dev/null || \
-				src_install() { __eapi4_src_install "$@" ; }
+				src_compile() { default; }
+			declare -F src_test >/dev/null || \
+				src_test() { default; }
 
-			if has $phase_func $default_phases ; then
-
-				__eapi2_pkg_nofetch   () { __eapi0_pkg_nofetch          "$@" ; }
-				__eapi2_src_unpack    () { __eapi0_src_unpack           "$@" ; }
-				__eapi2_src_prepare   () { true                             ; }
-				__eapi2_src_test      () { __eapi0_src_test             "$@" ; }
-				__eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
-
-				for x in $default_phases ; do
-					eval "default_$x() { __eapi2_$x \"\$@\" ; }"
-				done
-
-				eval "default() { __eapi2_$phase_func \"\$@\" ; }"
-
-				case "$eapi" in
-					2|3)
-						;;
-					*)
-						eval "default_src_install() { __eapi4_src_install \"\$@\" ; }"
-						[[ $phase_func = src_install ]] && \
-							eval "default() { __eapi4_$phase_func \"\$@\" ; }"
-						;;
-				esac
-
-			else
-
-				for x in $default_phases ; do
-					eval "default_$x() {
-						die \"default_$x() is not supported in phase $default_func\"
-					}"
-				done
-
-				eval "default() {
-					die \"default() is not supported with EAPI='$eapi' during phase $phase_func\"
-				}"
+			# defaults starting with EAPI 4
+			if ! has ${eapi} 2 3; then
+				[[ ${phase_func} == src_install ]] && \
+					default_src_install() { __eapi4_src_install; }
 
+				declare -F src_install >/dev/null || \
+					src_install() { default; }
 			fi
-
 			;;
 	esac
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ca28ce9..5f7c809 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -682,6 +682,10 @@ __eapi1_src_compile() {
 	__eapi2_src_compile
 }
 
+__eapi2_src_prepare() {
+	:
+}
+
 __eapi2_src_configure() {
 	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
 		econf

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 98cff83..de0c499 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -42,7 +42,7 @@ __save_ebuild_env() {
 
 	for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
 		src_compile src_test src_install pkg_preinst pkg_postinst \
-		pkg_prerm pkg_postrm ; do
+		pkg_prerm pkg_postrm pkg_config pkg_info pkg_pretend ; do
 		unset -f default_$x __eapi{0,1,2,3,4}_$x
 	done
 	unset x


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-26  2:17 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-26  2:17 UTC (permalink / raw
  To: gentoo-commits

commit:     a45a9a05f80e157f6d4af8904a4c72e465e9a9d9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 11 16:56:18 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Sep 26 01:22:13 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a45a9a05

Run install-qa-check.d scripts from repositories

---
(following the remaster of install_qa_check())

---
 bin/misc-functions.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index d701ba6..bd43360 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -182,6 +182,19 @@ install_qa_check() {
 		)
 	done
 
+	# Run QA checks from repositories
+	# (yes, PORTAGE_ECLASS_LOCATIONS contains repo paths...)
+	local repo_location
+	for repo_location in "${PORTAGE_ECLASS_LOCATIONS[@]}"; do
+		for f in "${repo_location}"/metadata/install-qa-check.d/*; do
+			if [[ -f ${f} ]]; then
+				(
+					source "${f}" || eerror "Post-install QA check ${f##*/} failed to run"
+				)
+			fi
+		done
+	done
+
 	export STRIP_MASK
 	prepall
 	___eapi_has_docompress && prepcompress


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-09-26  2:17 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-09-26  2:17 UTC (permalink / raw
  To: gentoo-commits

commit:     d8bcaa6564d33928d7dbdd7f186ef635d23b1fb7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 11 17:23:13 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Sep 26 01:22:13 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d8bcaa65

Allow inheriting utility eclasses in QA checks

Allow inheriting utility eclasses for use in QA checks. The eclasses can
be used e.g. to obtain paths or other data needed for the check.
However, the eclasses must not export phases or set ebuild metadata.

---
 bin/ebuild.sh         | 131 ++++++++++++++++++++++++++------------------------
 bin/misc-functions.sh |   2 +
 2 files changed, 70 insertions(+), 63 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index be044e0..b980caa 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -230,10 +230,10 @@ inherit() {
 		__export_funcs_var=__export_functions_$ECLASS_DEPTH
 		unset $__export_funcs_var
 
-		if [ "${EBUILD_PHASE}" != "depend" ] && \
-			[ "${EBUILD_PHASE}" != "nofetch" ] && \
-			[[ ${EBUILD_PHASE} != *rm ]] && \
-			[[ ${EMERGE_FROM} != "binary" ]] ; then
+		if [[ ${EBUILD_PHASE} != depend && ${EBUILD_PHASE} != nofetch && \
+			${EBUILD_PHASE} != *rm && ${EMERGE_FROM} != "binary" && \
+			-z ${_IN_INSTALL_QA_CHECK} ]]
+		then
 			# This is disabled in the *rm phases because they frequently give
 			# false alarms due to INHERITED in /var/db/pkg being outdated
 			# in comparison the the eclasses from the portage tree. It's
@@ -256,70 +256,75 @@ inherit() {
 		debug-print "inherit: $1 -> $location"
 		[[ -z ${location} ]] && die "${1}.eclass could not be found by inherit()"
 
-		#We need to back up the values of *DEPEND to B_*DEPEND
-		#(if set).. and then restore them after the inherit call.
-
-		#turn off glob expansion
-		set -f
-
-		# Retain the old data and restore it later.
-		unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND B_HDEPEND
-		[ "${IUSE+set}"       = set ] && B_IUSE="${IUSE}"
-		[ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
-		[ "${DEPEND+set}"     = set ] && B_DEPEND="${DEPEND}"
-		[ "${RDEPEND+set}"    = set ] && B_RDEPEND="${RDEPEND}"
-		[ "${PDEPEND+set}"    = set ] && B_PDEPEND="${PDEPEND}"
-		[ "${HDEPEND+set}"    = set ] && B_HDEPEND="${HDEPEND}"
-		unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND HDEPEND
-		#turn on glob expansion
-		set +f
+		# inherits in QA checks can't handle metadata assignments
+		if [[ -z ${_IN_INSTALL_QA_CHECK} ]]; then
+			#We need to back up the values of *DEPEND to B_*DEPEND
+			#(if set).. and then restore them after the inherit call.
+
+			#turn off glob expansion
+			set -f
+
+			# Retain the old data and restore it later.
+			unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND B_HDEPEND
+			[ "${IUSE+set}"       = set ] && B_IUSE="${IUSE}"
+			[ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
+			[ "${DEPEND+set}"     = set ] && B_DEPEND="${DEPEND}"
+			[ "${RDEPEND+set}"    = set ] && B_RDEPEND="${RDEPEND}"
+			[ "${PDEPEND+set}"    = set ] && B_PDEPEND="${PDEPEND}"
+			[ "${HDEPEND+set}"    = set ] && B_HDEPEND="${HDEPEND}"
+			unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND HDEPEND
+			#turn on glob expansion
+			set +f
+		fi
 
 		__qa_source "$location" || die "died sourcing $location in inherit()"
 		
-		#turn off glob expansion
-		set -f
-
-		# If each var has a value, append it to the global variable E_* to
-		# be applied after everything is finished. New incremental behavior.
-		[ "${IUSE+set}"         = set ] && E_IUSE+="${E_IUSE:+ }${IUSE}"
-		[ "${REQUIRED_USE+set}" = set ] && E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
-		[ "${DEPEND+set}"       = set ] && E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
-		[ "${RDEPEND+set}"      = set ] && E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
-		[ "${PDEPEND+set}"      = set ] && E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
-		[ "${HDEPEND+set}"      = set ] && E_HDEPEND+="${E_HDEPEND:+ }${HDEPEND}"
-
-		[ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
-		[ "${B_IUSE+set}"     = set ] || unset IUSE
-		
-		[ "${B_REQUIRED_USE+set}"     = set ] && REQUIRED_USE="${B_REQUIRED_USE}"
-		[ "${B_REQUIRED_USE+set}"     = set ] || unset REQUIRED_USE
-
-		[ "${B_DEPEND+set}"   = set ] && DEPEND="${B_DEPEND}"
-		[ "${B_DEPEND+set}"   = set ] || unset DEPEND
-
-		[ "${B_RDEPEND+set}"  = set ] && RDEPEND="${B_RDEPEND}"
-		[ "${B_RDEPEND+set}"  = set ] || unset RDEPEND
-
-		[ "${B_PDEPEND+set}"  = set ] && PDEPEND="${B_PDEPEND}"
-		[ "${B_PDEPEND+set}"  = set ] || unset PDEPEND
-
-		[ "${B_HDEPEND+set}"  = set ] && HDEPEND="${B_HDEPEND}"
-		[ "${B_HDEPEND+set}"  = set ] || unset HDEPEND
-
-		#turn on glob expansion
-		set +f
+		if [[ -z ${_IN_INSTALL_QA_CHECK} ]]; then
+			#turn off glob expansion
+			set -f
+
+			# If each var has a value, append it to the global variable E_* to
+			# be applied after everything is finished. New incremental behavior.
+			[ "${IUSE+set}"         = set ] && E_IUSE+="${E_IUSE:+ }${IUSE}"
+			[ "${REQUIRED_USE+set}" = set ] && E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
+			[ "${DEPEND+set}"       = set ] && E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
+			[ "${RDEPEND+set}"      = set ] && E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
+			[ "${PDEPEND+set}"      = set ] && E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
+			[ "${HDEPEND+set}"      = set ] && E_HDEPEND+="${E_HDEPEND:+ }${HDEPEND}"
+
+			[ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
+			[ "${B_IUSE+set}"     = set ] || unset IUSE
+			
+			[ "${B_REQUIRED_USE+set}"     = set ] && REQUIRED_USE="${B_REQUIRED_USE}"
+			[ "${B_REQUIRED_USE+set}"     = set ] || unset REQUIRED_USE
+
+			[ "${B_DEPEND+set}"   = set ] && DEPEND="${B_DEPEND}"
+			[ "${B_DEPEND+set}"   = set ] || unset DEPEND
+
+			[ "${B_RDEPEND+set}"  = set ] && RDEPEND="${B_RDEPEND}"
+			[ "${B_RDEPEND+set}"  = set ] || unset RDEPEND
+
+			[ "${B_PDEPEND+set}"  = set ] && PDEPEND="${B_PDEPEND}"
+			[ "${B_PDEPEND+set}"  = set ] || unset PDEPEND
+
+			[ "${B_HDEPEND+set}"  = set ] && HDEPEND="${B_HDEPEND}"
+			[ "${B_HDEPEND+set}"  = set ] || unset HDEPEND
+
+			#turn on glob expansion
+			set +f
+
+			if [[ -n ${!__export_funcs_var} ]] ; then
+				for x in ${!__export_funcs_var} ; do
+					debug-print "EXPORT_FUNCTIONS: $x -> ${ECLASS}_$x"
+					declare -F "${ECLASS}_$x" >/dev/null || \
+						die "EXPORT_FUNCTIONS: ${ECLASS}_$x is not defined"
+					eval "$x() { ${ECLASS}_$x \"\$@\" ; }" > /dev/null
+				done
+			fi
+			unset $__export_funcs_var
 
-		if [[ -n ${!__export_funcs_var} ]] ; then
-			for x in ${!__export_funcs_var} ; do
-				debug-print "EXPORT_FUNCTIONS: $x -> ${ECLASS}_$x"
-				declare -F "${ECLASS}_$x" >/dev/null || \
-					die "EXPORT_FUNCTIONS: ${ECLASS}_$x is not defined"
-				eval "$x() { ${ECLASS}_$x \"\$@\" ; }" > /dev/null
-			done
+			has $1 $INHERITED || export INHERITED="$INHERITED $1"
 		fi
-		unset $__export_funcs_var
-
-		has $1 $INHERITED || export INHERITED="$INHERITED $1"
 
 		shift
 	done

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index bd43360..cc652a9 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -189,6 +189,8 @@ install_qa_check() {
 		for f in "${repo_location}"/metadata/install-qa-check.d/*; do
 			if [[ -f ${f} ]]; then
 				(
+					# allow inheriting eclasses
+					_IN_INSTALL_QA_CHECK=1
 					source "${f}" || eerror "Post-install QA check ${f##*/} failed to run"
 				)
 			fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-10-19 17:31 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-10-19 17:31 UTC (permalink / raw
  To: gentoo-commits

commit:     0903a300c9d79900389e59eab6fcfe9f12dbab51
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  8 04:52:08 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 19 17:29:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0903a300

bin/ebuild-ipc.py: nonblocking fifo write

Use nonblocking write instead of a fork for writing to the fifo.
This has the advantage of avoiding a possible python futex deadlock
following fork as reported in bug #524328.

X-Gentoo-Bug: 524328
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524328

---
 bin/ebuild-ipc.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 56 insertions(+), 8 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 3e6d90c..b47ee23 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -5,6 +5,7 @@
 # This is a helper which ebuild processes can use
 # to communicate with portage's main python process.
 
+import errno
 import logging
 import os
 import pickle
@@ -44,19 +45,66 @@ import portage
 portage._internal_caller = True
 portage._disable_legacy_globals()
 
-from portage.util._async.ForkProcess import ForkProcess
 from portage.util._eventloop.global_event_loop import global_event_loop
+from _emerge.AbstractPollTask import AbstractPollTask
 from _emerge.PipeReader import PipeReader
 
-class FifoWriter(ForkProcess):
+RETURNCODE_WRITE_FAILED = 2
 
-	__slots__ = ('buf', 'fifo',)
+class FifoWriter(AbstractPollTask):
 
-	def _run(self):
-		# Atomically write the whole buffer into the fifo.
-		with open(self.fifo, 'wb', 0) as f:
-			f.write(self.buf)
-		return os.EX_OK
+	__slots__ = ('buf', 'fifo', '_fd', '_reg_id',)
+
+	def _start(self):
+		try:
+			self._fd = os.open(self.fifo, os.O_WRONLY|os.O_NONBLOCK)
+		except OSError as e:
+			if e.errno == errno.ENXIO:
+				# This happens if the daemon has been killed.
+				self.returncode = RETURNCODE_WRITE_FAILED
+				self._unregister()
+				self._async_wait()
+				return
+			else:
+				raise
+		self._reg_id = self.scheduler.io_add_watch(
+			self._fd,
+			self.scheduler.IO_OUT | self.scheduler.IO_HUP | \
+			self._exceptional_events, self._output_handler)
+		self._registered = True
+
+	def _output_handler(self, fd, event):
+		if event & self.scheduler.IO_OUT:
+			# The whole buf should be able to fit in the fifo with
+			# a single write call, so there's no valid reason for
+			# os.write to raise EAGAIN here.
+			buf = self.buf
+			while buf:
+				buf = buf[os.write(fd, buf):]
+			self.returncode = os.EX_OK
+			self._unregister()
+			self.wait()
+			return False
+		else:
+			self._unregister_if_appropriate(event)
+			if not self._registered:
+				self.returncode = RETURNCODE_WRITE_FAILED
+				self.wait()
+				return False
+		return True
+
+	def _cancel(self):
+		self.returncode = self._cancelled_returncode
+		self._unregister()
+
+	def _unregister(self):
+		self._registered = False
+		if self._reg_id is not None:
+			self.scheduler.source_remove(self._reg_id)
+			self._reg_id = None
+		if self._fd is not None:
+			os.close(self._fd)
+			self._fd = None
 
 class EbuildIpc(object):
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-10-24 20:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-10-24 20:39 UTC (permalink / raw
  To: gentoo-commits

commit:     60ee4deefb701d532fdd279caa989e7a6f4b8400
Author:     Bertrand SIMONNET <bsimonnet <AT> chromium <DOT> org>
AuthorDate: Tue Sep 30 00:12:35 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 24 20:07:10 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60ee4dee

Refactor bashrc scripts sourcing

Creates two new helper functions __try_source and __source_env_files to simplify
__source_all_bashrcs.

---
 bin/ebuild.sh          | 75 +++++++++++++++++++++++++++++++++-----------------
 bin/save-ebuild-env.sh |  1 +
 2 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b980caa..10119ae 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -380,39 +380,64 @@ __source_all_bashrcs() {
 		done
 	fi
 
-	if [ -r "${PORTAGE_BASHRC}" ] ; then
-		if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
-			source "${PORTAGE_BASHRC}"
-		else
-			set -x
-			source "${PORTAGE_BASHRC}"
-			set +x
-		fi
-	fi
+	# The user's bashrc is the ONLY non-portage bit of code
+	# that can change shopts without a QA violation.
+	__try_source --no-qa "${PORTAGE_BASHRC}"
 
 	if [[ $EBUILD_PHASE != depend ]] ; then
-		# The user's bashrc is the ONLY non-portage bit of code that can
-		# change shopts without a QA violation.
-		for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT%/*},${P},${PF}}; do
-			if [ -r "${x}" ]; then
-				# If $- contains x, then tracing has already been enabled
-				# elsewhere for some reason. We preserve it's state so as
-				# not to interfere.
-				if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
-					source "${x}"
-				else
-					set -x
-					source "${x}"
-					set +x
-				fi
-			fi
-		done
+		__source_env_files --no-qa "${PM_EBUILD_HOOK_DIR}"
 	fi
 
 	[ ! -z "${OCC}" ] && export CC="${OCC}"
 	[ ! -z "${OCXX}" ] && export CXX="${OCXX}"
 }
 
+# @FUNCTION: __source_env_files
+# @USAGE: [--no-qa] <ENV_DIRECTORY>
+# @DESCRIPTION:
+# Source the files relevant to the current package from the given path.
+# If --no-qa is specified, use source instead of __qa_source to source the
+# files.
+__source_env_files() {
+	local argument=()
+	if [[ $1 == --no-qa ]]; then
+		argument=( --no-qa )
+	shift
+	fi
+	for x in "${1}"/${CATEGORY}/{${PN},${PN}:${SLOT%/*},${P},${PF}}; do
+		__try_source "${argument[@]}" "${x}"
+	done
+}
+
+# @FUNCTION: __try_source
+# @USAGE: [--no-qa] <FILE>
+# @DESCRIPTION:
+# If the path given as argument exists, source the file while preserving
+# $-.
+# If --no-qa is specified, source the file with source instead of __qa_source.
+__try_source() {
+	local qa=true
+	if [[ $1 == --no-qa ]]; then
+		qa=false
+		shift
+	fi
+	if [[ -r "$1" ]]; then
+		local debug_on=false
+		if [[ "$PORTAGE_DEBUG" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then
+			debug_on=true
+		fi
+		$debug_on && set -x
+		# If $- contains x, then tracing has already been enabled
+		# elsewhere for some reason. We preserve it's state so as
+		# not to interfere.
+		if [[ ${qa} ]]; then
+			source "${1}"
+		else
+			__qa_source "${1}"
+		fi
+		$debug_on && set +x
+	fi
+}
 # === === === === === === === === === === === === === === === === === ===
 # === === === === === functions end, main part begins === === === === ===
 # === === === === === === === === === === === === === === === === === ===

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index de0c499..3930089 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -75,6 +75,7 @@ __save_ebuild_env() {
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \
+		__source_env_files __try_source \
 		${QA_INTERCEPTORS}
 
 	___eapi_has_usex && unset -f usex


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-10-24 22:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-10-24 22:55 UTC (permalink / raw
  To: gentoo-commits

commit:     3c1366520d6ac404994d1d2c75d8750b16a4331c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 24 21:46:30 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 24 22:53:57 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3c136652

bin/ebuild: allow useful phases with pkg_config

It makes sense to run pkg_config by itself, but special phases like
"clean", "digest", and "manifest" can be useful. For example, if the
developer modifies the ebuild, then it's useful to regenerate the
manifest and use "clean" to discard the stale environment.

Fixes: bfa98d7a5b7a ("fixed ebuild so")
Reported-by: Vlastimil Babka <caster <AT> gentoo.org>
Reviewed-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/ebuild | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild b/bin/ebuild
index 02ee022..a62aa20 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -197,7 +197,11 @@ else:
 		err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,))
 
 if len(pargs) > 1 and "config" in pargs:
-	err('"config" must not be called with any other phase')
+	other_phases = set(pargs)
+	other_phases.difference_update(
+		("clean", "config", "digest", "manifest"))
+	if other_phases:
+		err('"config" must not be called with any other phase')
 
 def discard_digests(myebuild, mysettings, mydbapi):
 	"""Discard all distfiles digests for the given ebuild.  This is useful when


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-10-27  9:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-10-27  9:46 UTC (permalink / raw
  To: gentoo-commits

commit:     836cebe78e74d5d826b1eb889c1728386df1a2d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 26 01:25:20 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 27 09:45:05 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=836cebe7

bin/bashrc-functions.sh: remove portageq function

Since commit 0cc4c1ac21a2ea94cfb1f6ff4b461a9e349d47df,
$PORTAGE_BIN_PATH/portageq no longer exists, which breaks the portageq
shell function inside bashrc-functions.sh. Note that
$PORTAGE_BIN_PATH/ebuild-helpers/portageq is in $PATH, so we can simply
remove the redundant function.

Fixes: 0cc4c1a ("Install Portage using setup.py")
X-Gento-Bug: 524964
X-Gentoo-URL: https://bugs.gentoo.org/show_bug.cgi?id=524964
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/bashrc-functions.sh | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
index 503b172..cc02546 100644
--- a/bin/bashrc-functions.sh
+++ b/bin/bashrc-functions.sh
@@ -1,12 +1,7 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-portageq() {
-	PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}}\
-	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
-}
-
 register_die_hook() {
 	local x
 	for x in $* ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-10-27  9:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-10-27  9:47 UTC (permalink / raw
  To: gentoo-commits

commit:     61c34d8f4681860e6b45b8f63627bd0173d020df
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 26 01:25:20 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 27 09:46:37 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=61c34d8f

bin/bashrc-functions.sh: remove portageq function

Since commit 0cc4c1ac21a2ea94cfb1f6ff4b461a9e349d47df,
$PORTAGE_BIN_PATH/portageq no longer exists, which breaks the portageq
shell function inside bashrc-functions.sh. Note that
$PORTAGE_BIN_PATH/ebuild-helpers/portageq is in $PATH, so we can simply
remove the redundant function.

Fixes: 0cc4c1a ("Install Portage using setup.py")
X-Gentoo-Bug: 524964
X-Gentoo-URL: https://bugs.gentoo.org/show_bug.cgi?id=524964
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/bashrc-functions.sh | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/bin/bashrc-functions.sh b/bin/bashrc-functions.sh
index 503b172..cc02546 100644
--- a/bin/bashrc-functions.sh
+++ b/bin/bashrc-functions.sh
@@ -1,12 +1,7 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-portageq() {
-	PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}}\
-	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
-}
-
 register_die_hook() {
 	local x
 	for x in $* ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-10-27 19:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-10-27 19:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ab43c1944f0cb6bf43d5b40cceb2e8186645d347
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 26 15:12:08 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 27 19:21:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab43c194

Introduce eqalog and eqawarnlog functions.

These functions are to be used for creating a log of QA violations in a
machine-readable format.

Stored in ${T]/qa.log, the log consists of one entry per line in the
following format: violation-tag data

For example:
deprecated-directory /usr/man
deprecated-directory /usr/info
world-writable /var/db/foo/bar

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/isolated-functions.sh | 23 +++++++++++++++++++++++
 bin/save-ebuild-env.sh    |  1 +
 2 files changed, 24 insertions(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index a22af57..4992d77 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -256,6 +256,29 @@ __elog_base() {
 	return 0
 }
 
+__eqalog() {
+	local tag=$1 x
+	shift
+	for x in "$@" ; do
+		echo "${tag}" "${x}"| (
+			escape=""
+			while read -r ; do
+				echo -n "${escape}${REPLY}"
+				escape="\\n"
+			done
+			echo
+		) >> "${T}"/qa.log
+	done
+}
+
+__eqawarnlog() {
+	__eqalog "$@"
+	shift
+	for x in "$@" ; do
+		eqawarn "  ${x}"
+	done
+}
+
 eqawarn() {
 	__elog_base QA "$*"
 	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 775c02c..dd233a9 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -76,6 +76,7 @@ __save_ebuild_env() {
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \
 		__source_env_files __try_source \
+		__eqalog __eqawarnlog \
 		${QA_INTERCEPTORS}
 
 	___eapi_has_usex && unset -f usex


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-03  4:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-11-03  4:42 UTC (permalink / raw
  To: gentoo-commits

commit:     6659c00a580254f68460608b4cdc5df8e057d17c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 26 09:41:09 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov  2 23:15:38 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6659c00a

etc-update: symlink support for bug #485598

This includes numerous logic adjustments that are needed to support
protected symlinks. The show_diff function now supports arbitrary
file types. For example, a diff between two symlinks looks like this:

-SYM: /foo/bar -> baz
+SYM: /foo/bar -> blah

X-Gentoo-Bug: 485598
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=485598

---
 bin/etc-update | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 87 insertions(+), 8 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 7ac6f0b..1d78e96 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -51,11 +51,15 @@ do_mv_ln() {
 	local src=${@:$(( $# - 1 )):1}
 	local dst=${@:$(( $# - 0 )):1}
 
-	if [[ -L ${dst} ]] ; then #330221
+	if [[ ! -L ${src} && -L ${dst} ]] ; then #330221
 		local lfile=$(readlink "${dst}")
 		[[ ${lfile} == /* ]] || lfile="${dst%/*}/${lfile}"
 		echo " Target is a symlink; replacing ${lfile}"
 		dst=${lfile}
+	elif [[ -d ${dst} && ! -L ${dst} ]] ; then
+		# If ${dst} is a directory, do not move the file
+		# inside of it if this fails.
+		rmdir "${dst}" || return
 	fi
 
 	mv "${opts[@]}" "${src}" "${dst}"
@@ -115,6 +119,24 @@ scan() {
 					continue 2
 				fi
 			done
+			if [[ -L ${file} ]] ; then
+				if [[ -L ${live_file} && \
+					$(readlink "${live_file}") == $(readlink "${file}") ]]
+				then
+					rm -f "${file}"
+					continue
+				fi
+				if [[ "${ofile:10}" != "${rfile:10}" ]] ||
+				   [[ ${opath} != ${rpath} ]]
+				then
+					: $(( ++count ))
+					echo "${live_file}" > "${TMP}"/files/${count}
+				fi
+				echo "${cfg_file}" >> "${TMP}"/files/${count}
+				ofile="${rfile}"
+				opath="${rpath}"
+				continue
+			fi
 			if [[ ! -f ${file} ]] ; then
 				${QUIET} || echo "Skipping non-file ${file} ..."
 				continue
@@ -124,7 +146,9 @@ scan() {
 			   [[ ${opath} != ${rpath} ]]
 			then
 				MATCHES=0
-				if [[ ${eu_automerge} == "yes" ]] ; then
+				if ! [[ -f ${cfg_file} && -f ${live_file} ]] ; then
+					MATCHES=0
+				elif [[ ${eu_automerge} == "yes" ]] ; then
 					if [[ ! -e ${cfg_file} || ! -e ${live_file} ]] ; then
 						MATCHES=0
 					else
@@ -377,17 +401,50 @@ do_file() {
 
 show_diff() {
 	clear
-	local file1=$1 file2=$2
+	local file1=$1 file2=$2 files=("$1" "$2") \
+		diff_files=() file i tmpdir
+
+	if [[ -L ${file1} && ! -L ${file2} &&
+		-f ${file1} && -f ${file2} ]] ; then
+		# If a regular file replaces a symlink to a regular file, then
+		# show the diff between the regular files (bug #330221).
+		diff_files=("${file1}" "${file2}")
+	else
+		for i in 0 1 ; do
+			if [[ ! -L ${files[$i]} && -f ${files[$i]} ]] ; then
+				diff_files[$i]=${files[$i]}
+				continue
+			fi
+			[[ -n ${tmpdir} ]] || \
+				tmpdir=$(mktemp -d "${TMP}/symdiff-XXX")
+			diff_files[$i]=${tmpdir}/${i}
+			if [[ ! -L ${files[$i]} && ! -e ${files[$i]} ]] ; then
+				echo "/dev/null" > "${diff_files[$i]}"
+			elif [[ -L ${files[$i]} ]] ; then
+				echo "SYM: ${file1} -> $(readlink "${files[$i]}")" > \
+					"${diff_files[$i]}"
+			elif [[ -d ${files[$i]} ]] ; then
+				echo "DIR: ${file1}" > "${diff_files[$i]}"
+			elif [[ -p ${files[$i]} ]] ; then
+				echo "FIF: ${file1}" > "${diff_files[$i]}"
+			else
+				echo "DEV: ${file1}" > "${diff_files[$i]}"
+			fi
+		done
+	fi
+
 	if [[ ${using_editor} == 0 ]] ; then
 		(
 			echo "Showing differences between ${file1} and ${file2}"
-			diff_command "${file1}" "${file2}"
+			diff_command "${diff_files[0]}" "${diff_files[1]}"
 		) | ${pager}
 	else
 		echo "Beginning of differences between ${file1} and ${file2}"
-		diff_command "${file1}" "${file2}"
+		diff_command "${diff_files[0]}" "${diff_files[1]}"
 		echo "End of differences between ${file1} and ${file2}"
 	fi
+
+	[[ -n ${tmpdir} ]] && rm -rf "${tmpdir}"
 }
 
 do_cfg() {
@@ -395,14 +452,14 @@ do_cfg() {
 	local ofile=$2
 	local -i my_input=0
 
-	until (( my_input == -1 )) || [ ! -f "${file}" ] ; do
+	until (( my_input == -1 )) || [[ ! -f ${file} && ! -L ${file} ]] ; do
 		if [[ "${OVERWRITE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
 			my_input=1
 		elif [[ "${DELETE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
 			my_input=2
 		else
 			show_diff "${ofile}" "${file}"
-			if [[ -L ${file} ]] ; then
+			if [[ -L ${file} && ! -L ${ofile} ]] ; then
 				cat <<-EOF
 
 					-------------------------------------------------------------
@@ -461,6 +518,19 @@ do_merge() {
 	local ofile="${2}"
 	local mfile="${TMP}/${2}.merged"
 	local -i my_input=0
+
+	if [[ -L ${file} && -L ${ofile} ]] ; then
+		echo "Both files are symlinks, so they will not be merged."
+		return 0
+	elif [[ ! -f ${file} ]] ; then
+		echo "Non-regular file cannot be merged: ${file}"
+		return 0
+	elif [[ ! -f ${ofile} ]] ; then
+		echo "Non-regular file cannot be merged: ${ofile}"
+		return 0
+	fi
+
+
 	echo "${file} ${ofile} ${mfile}"
 
 	if [[ -e ${mfile} ]] ; then
@@ -533,9 +603,18 @@ do_distconf() {
 	for (( count = 0; count <= 9999; ++count )) ; do
 		suffix=$(printf ".dist_%04i" ${count})
 		efile="${ofile}${suffix}"
-		if [[ ! -f ${efile} ]] ; then
+		if [[ ! -f ${efile} && ! -L ${efile} ]] ; then
 			mv ${mv_opts} "${file}" "${efile}"
 			break
+		elif [[ -L ${efile} && -L ${file} ]] ; then
+			if [[ $(readlink "${efile}") == $(readlink "${file}") ]] ; then
+				# replace identical copy
+				mv "${file}" "${efile}"
+				break
+			fi
+		elif [[ -L ${efile} || -L ${file} ]] ; then
+			# not the same file types
+			continue
 		elif diff_command "${file}" "${efile}" &> /dev/null; then
 			# replace identical copy
 			mv "${file}" "${efile}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-08 20:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-11-08 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     b30f0a8527485b3dacf9255bd03f471c20d97ef1
Author:     Theo Chatzimichos <tampakrap <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  8 16:36:51 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov  8 19:43:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b30f0a85

Add support for SUSE based distros in etc-update

Add support for reading/merging *.rpmnew files created in SUSE based distros.
Configuration from etc-update will be read:
- from portage config vars in Gentoo based distros
- from portage config vars in non Gentoo distros if portage is installed
- from /etc/sysconfig/etc-update in SUSE distros if portage is absent

Signed-off-by: Michal Hrušecký <miska <AT> gentoo.org>
X-Gentoo-Bug: 456128
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=456128

---
 bin/etc-update | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 51 insertions(+), 7 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 1d78e96..0307688 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -32,6 +32,35 @@ get_config() {
 		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
 }
 
+OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2)
+
+case $OS_RELEASE_ID in
+	suse|opensuse) OS_FAMILY='suse' ;;
+	*) OS_FAMILY='gentoo' ;;
+esac
+
+if [[ $OS_FAMILY == 'gentoo' ]]; then
+	get_basename_find_opt() {
+		echo "._cfg????_${1}"
+	}
+	get_scan_regexp() {
+		echo "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3$b\1$b\2$b\3:"
+	}
+	get_live_file() {
+		echo "${rpath}/${rfile:10}"
+	}
+elif [[ $OS_FAMILY == 'suse' ]]; then
+	get_basename_find_opt() {
+		echo "${1}.rpmnew"
+	}
+	get_scan_regexp() {
+		echo "s:\(^.*/\)\(.*\)\(\.rpmnew\):\1\2\3$b\1$b\3$b\2:"
+	}
+	get_live_file() {
+		echo "${cfg_file%.rpmnew}"
+	}
+fi
+
 cmd_var_is_valid() {
 	# return true if the first whitespace-separated token contained
 	# in "${1}" is an executable file, false otherwise
@@ -82,12 +111,13 @@ scan() {
 			# parent directory doesn't exist, we can safely skip it.
 			path=${path%/}
 			[[ -d ${path%/*} ]] || continue
-			local my_basename="${path##*/}"
+			local name_opt=$(get_basename_find_opt "${path##*/}")
 			path="${path%/*}"
-			find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+			find_opts=( -maxdepth 1 -name "$name_opt" )
 		else
 			# Do not traverse hidden directories such as .svn or .git.
-			find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
+			local name_opt=$(get_basename_find_opt '*')
+			find_opts=( -name '.*' -type d -prune -o -name "$name_opt" )
 		fi
 		find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
 
@@ -97,10 +127,11 @@ scan() {
 		fi
 
 		local file ofile b=$'\001'
+		local scan_regexp=$(get_scan_regexp)
 		for file in $(find "${path}"/ "${find_opts[@]}" |
 		              sed \
 						-e 's://*:/:g' \
-						-e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3$b\1$b\2$b\3:" |
+						-e "${scan_regexp}" |
 		              sort -t"$b" -k2,2 -k4,4 -k3,3 |
 		              LC_ALL=C cut -f1 -d"$b")
 		do
@@ -108,7 +139,7 @@ scan() {
 			rpath=${file%/*}
 			rfile=${file##*/}
 			cfg_file="${rpath}/${rfile}"
-			live_file="${rpath}/${rfile:10}"
+			live_file=$(get_live_file)
 
 			local mpath
 			for mpath in ${CONFIG_PROTECT_MASK}; do
@@ -702,7 +733,14 @@ while [[ -n $1 ]] ; do
 done
 ${SET_X} && set -x
 
-type -P portageq >/dev/null || die "missing portageq"
+if [[ $OS_FAMILY == 'suse' ]]; then
+	PORTAGE_CONFIGROOT='/'
+	PORTAGE_TMPDIR='/tmp'
+	CONFIG_PROTECT='/etc'
+	CONFIG_PROTECT_MASK=''
+	[[ -f /etc/sysconfig/etc-update ]] && . /etc/sysconfig/etc-update
+fi
+
 portage_vars=(
 	CONFIG_PROTECT{,_MASK}
 	PORTAGE_CONFIGROOT
@@ -712,7 +750,13 @@ portage_vars=(
 	USERLAND
 	NOCOLOR
 )
-eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
+
+if type -P portageq > /dev/null; then
+	eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
+else
+	[[ $OS_FAMILY == 'gentoo' ]] && die "missing portageq"
+fi
+
 export PORTAGE_TMPDIR
 SCAN_PATHS=${*:-${CONFIG_PROTECT}}
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-08 20:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-11-08 20:26 UTC (permalink / raw
  To: gentoo-commits

commit:     59471df7a8d05bd060f3b4eb0c25d806cc4883a4
Author:     Theo Chatzimichos <tampakrap <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  8 16:36:51 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov  8 20:26:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=59471df7

Add support for SUSE based distros in etc-update

Add support for reading/merging *.rpmnew files created in SUSE based distros.
Configuration from etc-update will be read:
- from portage config vars in Gentoo based distros
- from portage config vars in non Gentoo distros if portage is installed
- from /etc/sysconfig/etc-update in SUSE distros if portage is absent

Signed-off-by: Michal Hrušecký <miska <AT> gentoo.org>
X-Gentoo-Bug: 456128
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=456128
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
Acked-by: Zac Medico <zmedico <AT> gentoo.org>

---
 bin/etc-update | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 51 insertions(+), 7 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 1d78e96..0307688 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -32,6 +32,35 @@ get_config() {
 		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
 }
 
+OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2)
+
+case $OS_RELEASE_ID in
+	suse|opensuse) OS_FAMILY='suse' ;;
+	*) OS_FAMILY='gentoo' ;;
+esac
+
+if [[ $OS_FAMILY == 'gentoo' ]]; then
+	get_basename_find_opt() {
+		echo "._cfg????_${1}"
+	}
+	get_scan_regexp() {
+		echo "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3$b\1$b\2$b\3:"
+	}
+	get_live_file() {
+		echo "${rpath}/${rfile:10}"
+	}
+elif [[ $OS_FAMILY == 'suse' ]]; then
+	get_basename_find_opt() {
+		echo "${1}.rpmnew"
+	}
+	get_scan_regexp() {
+		echo "s:\(^.*/\)\(.*\)\(\.rpmnew\):\1\2\3$b\1$b\3$b\2:"
+	}
+	get_live_file() {
+		echo "${cfg_file%.rpmnew}"
+	}
+fi
+
 cmd_var_is_valid() {
 	# return true if the first whitespace-separated token contained
 	# in "${1}" is an executable file, false otherwise
@@ -82,12 +111,13 @@ scan() {
 			# parent directory doesn't exist, we can safely skip it.
 			path=${path%/}
 			[[ -d ${path%/*} ]] || continue
-			local my_basename="${path##*/}"
+			local name_opt=$(get_basename_find_opt "${path##*/}")
 			path="${path%/*}"
-			find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+			find_opts=( -maxdepth 1 -name "$name_opt" )
 		else
 			# Do not traverse hidden directories such as .svn or .git.
-			find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
+			local name_opt=$(get_basename_find_opt '*')
+			find_opts=( -name '.*' -type d -prune -o -name "$name_opt" )
 		fi
 		find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
 
@@ -97,10 +127,11 @@ scan() {
 		fi
 
 		local file ofile b=$'\001'
+		local scan_regexp=$(get_scan_regexp)
 		for file in $(find "${path}"/ "${find_opts[@]}" |
 		              sed \
 						-e 's://*:/:g' \
-						-e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3$b\1$b\2$b\3:" |
+						-e "${scan_regexp}" |
 		              sort -t"$b" -k2,2 -k4,4 -k3,3 |
 		              LC_ALL=C cut -f1 -d"$b")
 		do
@@ -108,7 +139,7 @@ scan() {
 			rpath=${file%/*}
 			rfile=${file##*/}
 			cfg_file="${rpath}/${rfile}"
-			live_file="${rpath}/${rfile:10}"
+			live_file=$(get_live_file)
 
 			local mpath
 			for mpath in ${CONFIG_PROTECT_MASK}; do
@@ -702,7 +733,14 @@ while [[ -n $1 ]] ; do
 done
 ${SET_X} && set -x
 
-type -P portageq >/dev/null || die "missing portageq"
+if [[ $OS_FAMILY == 'suse' ]]; then
+	PORTAGE_CONFIGROOT='/'
+	PORTAGE_TMPDIR='/tmp'
+	CONFIG_PROTECT='/etc'
+	CONFIG_PROTECT_MASK=''
+	[[ -f /etc/sysconfig/etc-update ]] && . /etc/sysconfig/etc-update
+fi
+
 portage_vars=(
 	CONFIG_PROTECT{,_MASK}
 	PORTAGE_CONFIGROOT
@@ -712,7 +750,13 @@ portage_vars=(
 	USERLAND
 	NOCOLOR
 )
-eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
+
+if type -P portageq > /dev/null; then
+	eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
+else
+	[[ $OS_FAMILY == 'gentoo' ]] && die "missing portageq"
+fi
+
 export PORTAGE_TMPDIR
 SCAN_PATHS=${*:-${CONFIG_PROTECT}}
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-19 23:26 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-11-19 23:26 UTC (permalink / raw
  To: gentoo-commits

commit:     6dafdc28897682f7b8c77b7863b5713634974647
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  2 19:16:04 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 19 23:26:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6dafdc28

Remove __eqalog & __eqawarnlog

Replaced by eqatag.

---
 bin/isolated-functions.sh | 23 -----------------------
 bin/save-ebuild-env.sh    |  2 +-
 2 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index f03503b..42bf05d 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -256,29 +256,6 @@ __elog_base() {
 	return 0
 }
 
-__eqalog() {
-	local tag=$1 x
-	shift
-	for x in "$@" ; do
-		echo "${tag}" "${x}"| (
-			escape=""
-			while read -r ; do
-				echo -n "${escape}${REPLY}"
-				escape="\\n"
-			done
-			echo
-		) >> "${T}"/qa.log
-	done
-}
-
-__eqawarnlog() {
-	__eqalog "$@"
-	shift
-	for x in "$@" ; do
-		eqawarn "  ${x}"
-	done
-}
-
 eqawarn() {
 	__elog_base QA "$*"
 	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index b483d40..c6bffb5 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -76,7 +76,7 @@ __save_ebuild_env() {
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \
 		__source_env_files __try_source \
-		__eqalog __eqawarnlog __eqaquote __eqatag \
+		__eqaquote __eqatag \
 		${QA_INTERCEPTORS}
 
 	___eapi_has_usex && unset -f usex


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-19 23:26 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-11-19 23:26 UTC (permalink / raw
  To: gentoo-commits

commit:     ad57b64a366f2d182f442035e0ba3f6f667c40bc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  2 18:49:40 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 19 23:26:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ad57b64a

Introduce eqatag to output proper machine-readable QA logs

The eqatag command syntax conforms to pre-GLEP describing
install-qa-check.d. The qa.log file format strictly conforms to YAML for
easy machine parsing.

---
 bin/isolated-functions.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++
 bin/misc-functions.sh     |  4 +++
 bin/save-ebuild-env.sh    |  2 +-
 3 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 4992d77..f03503b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -505,4 +505,72 @@ __repo_attr() {
 	return ${exit_status}
 }
 
+# eqaquote <string>
+#
+# outputs parameter escaped for quoting
+__eqaquote() {
+	local v=${1} esc=''
+
+	# quote backslashes
+	v=${v//\\/\\\\}
+	# quote the quotes
+	v=${v//\"/\\\"}
+	# quote newlines
+	while read -r; do
+		echo -n "${esc}${REPLY}"
+		esc='\n'
+	done <<<"${v}"
+}
+
+# eqatag <tag> [-v] [<key>=<value>...] [/<relative-path>...]
+#
+# output (to qa.log):
+# - tag: <tag>
+#   data:
+#     <key1>: "<value1>"
+#     <key2>: "<value2>"
+#   files:
+#     - "<path1>"
+#     - "<path2>"
+__eqatag() {
+	local tag i filenames=() data=() verbose=
+
+	if [[ ${1} == -v ]]; then
+		verbose=1
+		shift
+	fi
+
+	tag=${1}
+	shift
+	[[ -n ${tag} ]] || die "${FUNCNAME}: no tag specified"
+
+	# collect data & filenames
+	for i; do
+		if [[ ${i} == /* ]]; then
+			filenames+=( "${i}" )
+			[[ -n ${verbose} ]] && eqawarn "  ${i}"
+		elif [[ ${i} == *=* ]]; then
+			data+=( "${i}" )
+		else
+			die "${FUNCNAME}: invalid parameter: ${i}"
+		fi
+	done
+
+	(
+		echo "- tag: ${tag}"
+		if [[ ${data[@]} ]]; then
+			echo "  data:"
+			for i in "${data[@]}"; do
+				echo "    ${i%%=*}: \"$(__eqaquote "${i#*=}")\""
+			done
+		fi
+		if [[ ${filenames[@]} ]]; then
+			echo "  files:"
+			for i in "${filenames[@]}"; do
+				echo "    - \"$(__eqaquote "${i}")\""
+			done
+		fi
+	) >> "${T}"/qa.log
+}
+
 true

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index cc652a9..6e6fcb4 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -551,6 +551,10 @@ install_hooks() {
 	return $ret
 }
 
+eqatag() {
+	__eqatag "${@}"
+}
+
 if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
 	__source_all_bashrcs
 	[ "$PORTAGE_DEBUG" == "1" ] && set -x

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index dd233a9..b483d40 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -76,7 +76,7 @@ __save_ebuild_env() {
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \
 		__source_env_files __try_source \
-		__eqalog __eqawarnlog \
+		__eqalog __eqawarnlog __eqaquote __eqatag \
 		${QA_INTERCEPTORS}
 
 	___eapi_has_usex && unset -f usex


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-26  8:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-11-26  8:40 UTC (permalink / raw
  To: gentoo-commits

commit:     bcac54411c462aa59fe874325e4843f61dc71312
Author:     Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
AuthorDate: Sun Nov 23 16:10:50 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov 26 08:38:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcac5441

Force the SELinux user during relabel operation (530192)

When Portage relabels the files of the package, it currently calls
setfiles (which is correct) but does not use the -F option (force). As a
result, the files only get assigned the right SELinux type, but not the
right SELinux user and SELinux role.

By using "setfiles -F", the SELinux user (and role, but role almost
always remains "object_r") is set to the right one (system_u mostly).

Without this, a multi-user system with different SELinux users and with
User Based Access Control (UBAC) enabled (the local "ubac" USE flag)
might find that some software fails to work for different SELinux users
than the one used to install the software, until a full forced relabel
operation is done.

X-Gentoo-Bug: 530192
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=530192
Acked-by: Zac Medico <zmedico <AT> gentoo.org>

---
 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 6e6fcb4..8d5df78 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -392,7 +392,7 @@ preinst_selinux_labels() {
 				addwrite /selinux/context
 				addwrite /sys/fs/selinux/context
 
-				/usr/sbin/setfiles "${file_contexts_path}" -r "${D}" "${D}"
+				/usr/sbin/setfiles -F "${file_contexts_path}" -r "${D}" "${D}"
 			) || die "Failed to set SELinux security labels."
 		else
 			# nonfatal, since merging can happen outside a SE kernel


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-11-29 22:48 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-11-29 22:48 UTC (permalink / raw
  To: gentoo-commits

commit:     eff62fff0599e09f0dce5f3ef4527416044e4910
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 22 23:05:13 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 22:48:30 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eff62fff

Support all install-qa-check.d locations and overrides

Update the install-qa-check.d handling code to conform to GLEP 65.
Collect files from all defined locations, order them lexically by name
and run each uniquely named script once. Make scripts in higher priority
locations override lower priority locations properly.

---
 bin/misc-functions.sh | 65 ++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 22 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 8d5df78..e08c228 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -163,40 +163,61 @@ prepcompress() {
 }
 
 install_qa_check() {
-	local f i qa_var x
+	local d f i qa_var x paths qa_checks=() checks_run=()
 	if ! ___eapi_has_prefix_variables; then
 		local EPREFIX= ED=${D}
 	fi
 
 	cd "${ED}" || die "cd failed"
 
-	# Run QA checks from install-qa-check.d.
-	# Note: checks need to be run *before* stripping.
-	local f
-	# TODO: handle nullglob-like
-	for f in "${PORTAGE_BIN_PATH}"/install-qa-check.d/*; do
-		# Run in a subshell to treat it like external script,
-		# but use 'source' to pass all variables through.
-		(
-			source "${f}" || eerror "Post-install QA check ${f##*/} failed to run"
+	# Collect the paths for QA checks, highest prio first.
+	paths=(
+		# sysadmin overrides
+		"${PORTAGE_OVERRIDE_EPREFIX}"/usr/local/lib/install-qa-check.d
+		# system-wide package installs
+		"${PORTAGE_OVERRIDE_EPREFIX}"/usr/lib/install-qa-check.d
+	)
+
+	# Now repo-specific checks.
+	# (yes, PORTAGE_ECLASS_LOCATIONS contains repo paths...)
+	for d in "${PORTAGE_ECLASS_LOCATIONS[@]}"; do
+		paths+=(
+			"${d}"/metadata/install-qa-check.d
 		)
 	done
 
-	# Run QA checks from repositories
-	# (yes, PORTAGE_ECLASS_LOCATIONS contains repo paths...)
-	local repo_location
-	for repo_location in "${PORTAGE_ECLASS_LOCATIONS[@]}"; do
-		for f in "${repo_location}"/metadata/install-qa-check.d/*; do
-			if [[ -f ${f} ]]; then
-				(
-					# allow inheriting eclasses
-					_IN_INSTALL_QA_CHECK=1
-					source "${f}" || eerror "Post-install QA check ${f##*/} failed to run"
-				)
-			fi
+	paths+=(
+		# Portage built-in checks
+		"${PORTAGE_OVERRIDE_EPREFIX}"/usr/lib/portage/install-qa-check.d
+		"${PORTAGE_BIN_PATH}"/install-qa-check.d
+	)
+
+	# Collect file names of QA checks. We need them early to support
+	# overrides properly.
+	for d in "${paths[@]}"; do
+		for f in "${d}"/*; do
+			[[ -f ${f} ]] && qa_checks+=( "${f##*/}" )
 		done
 	done
 
+	# Now we need to sort the filenames lexically, and process
+	# them in order.
+	while read -r -d '' f; do
+		# Find highest priority file matching the basename.
+		for d in "${paths[@]}"; do
+			[[ -f ${d}/${f} ]] && break
+		done
+
+		# Run in a subshell to treat it like external script,
+		# but use 'source' to pass all variables through.
+		(
+			# Allow inheriting eclasses.
+			# XXX: we want this only in repository-wide checks.
+			_IN_INSTALL_QA_CHECK=1
+			source "${d}/${f}" || eerror "Post-install QA check ${f} failed to run"
+		)
+	done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
+
 	export STRIP_MASK
 	prepall
 	___eapi_has_docompress && prepcompress


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-02 23:06 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-02 23:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c3ebc643d5a04cdc34518e6b3b3b37c3238391fa
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 29 11:12:21 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec  2 23:05:39 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c3ebc643

Do not try to source stray directories in bashrc paths

Check whether a particular bashrc path is not a directory before trying
to source it. Avoids unnecessary 'is a directory' errors.

---
 bin/ebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2ed1335..9c60a41 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -421,7 +421,7 @@ __try_source() {
 		qa=false
 		shift
 	fi
-	if [[ -r "$1" ]]; then
+	if [[ -r $1 && -f $1 ]]; then
 		local debug_on=false
 		if [[ "$PORTAGE_DEBUG" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then
 			debug_on=true


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     cb48432a949ecf1bde200b729f3885e9957f90d2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 17:40:31 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb48432a

Add tentative support for EAPI6 --docdir and --htmldir

Pass --docdir and --htmldir to configure scripts that support it.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 623b89f..5f96c3b 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -110,6 +110,10 @@ ___eapi_econf_passes_--disable-silent-rules() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
+___eapi_econf_passes_--docdir_and_--htmldir() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_use_enable_and_use_with_support_empty_third_argument() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3e63b11..9738a3a 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -558,7 +558,7 @@ econf() {
 		fi
 
 		local conf_args=()
-		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules; then
+		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules || ___eapi_econf_passes_--docdir_and_--htmldir; then
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
@@ -572,6 +572,16 @@ econf() {
 					conf_args+=( --disable-silent-rules )
 				fi
 			fi
+
+			if ___eapi_econf_passes_--docdir_and_--htmldir; then
+				if [[ ${conf_help} == *--docdir* ]]; then
+					conf_args+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
+				fi
+
+				if [[ ${conf_help} == *--htmldir* ]]; then
+					conf_args+=( --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html )
+				fi
+			fi
 		fi
 
 		# if the profile defines a location to install libs to aside from default, pass it on.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     859ce0c18b826cf3e89cab76661723ef7b11b420
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 08:39:29 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=859ce0c1

Apply 'nonfatal' to helpers only

Make 'nonfatal' modifier affect helpers only rather than disabling 'die'
completely. This improves the PMS conformance.

---
 bin/isolated-functions.sh | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index ed96bd0..251d7ee 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -113,7 +113,7 @@ __bashpid() {
 }
 
 __helpers_die() {
-	if ___eapi_helpers_can_die; then
+	if ___eapi_helpers_can_die && [[ ${PORTAGE_NONFATAL} != 1 ]]; then
 		die "$@"
 	else
 		echo -e "$@" >&2
@@ -123,11 +123,6 @@ __helpers_die() {
 die() {
 	local IFS=$' \t\n'
 
-	if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
-		echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2
-		return 1
-	fi
-
 	set +e
 	if [ -n "${QA_INTERCEPTORS}" ] ; then
 		# die was called from inside inherit. We need to clean up


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     3e485f7c051955295dc4cc4792a984a9879b489d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 07:47:10 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3e485f7c

Enable tentative EAPI6 failglob in global scope

Enable failglob in global scope to catch unintended globbing attempts
including unescaped special uses of '*'.

---
 bin/eapi.sh   |  4 ++++
 bin/ebuild.sh | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6e78750..fa57999 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -160,6 +160,10 @@ ___eapi_unpack_is_case_sensitive() {
 
 # OTHERS
 
+___eapi_enables_failglob_in_global_scope() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_enables_globstar() {
 	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 }

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 9c60a41..e6f9cb9 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -565,6 +565,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		# we make a backup copy for QA checks.
 		__INHERITED_QA_CACHE=$INHERITED
 
+		# Catch failed globbing attempts in case ebuild writer forgot to
+		# escape '*' or likes.
+		# Note: this needs to be done before unsetting EAPI.
+		if ___eapi_enables_failglob_in_global_scope; then
+			shopt -s failglob
+		fi
+
 		# *DEPEND and IUSE will be set during the sourcing of the ebuild.
 		# In order to ensure correct interaction between ebuilds and
 		# eclasses, they need to be unset before this process of
@@ -581,6 +588,10 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 			set +x
 		fi
 
+		if ___eapi_enables_failglob_in_global_scope; then
+			shopt -u failglob
+		fi
+
 		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
 			RESTRICT=${PORTAGE_RESTRICT}
 			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     525e69351d45621c34a9326fcbc11ca592cb6539
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 30 12:12:58 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=525e6935

Respect nonfatal in unpack(), econf() and einstall()

---
 bin/isolated-functions.sh | 11 ++++--
 bin/phase-helpers.sh      | 87 ++++++++++++++++++++++++++++++++++-------------
 2 files changed, 73 insertions(+), 25 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 42bf05d..ed96bd0 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -36,11 +36,18 @@ __assert_sigpipe_ok() {
 	local x pipestatus=${PIPESTATUS[*]}
 	for x in $pipestatus ; do
 		# Allow SIGPIPE through (128 + 13)
-		[[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
+		if [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]]
+		then
+			__helpers_die "$@"
+			return 1
+		fi
 	done
 
 	# Require normal success for the last process (tar).
-	[[ $x -eq 0 ]] || die "$@"
+	if [[ $x -ne 0 ]]; then
+		__helpers_die "$@"
+		return 1
+	fi
 }
 
 shopt -s extdebug

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5f7c809..3e63b11 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -285,7 +285,10 @@ unpack() {
 		else
 			srcdir="${DISTDIR}/"
 		fi
-		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
+		if [[ ! -s ${srcdir}${x} ]]; then
+			__helpers_die "unpack: ${x} does not exist"
+			return 1
+		fi
 
 		__unpack_tar() {
 			if [[ ${y_insensitive} == tar ]] ; then
@@ -296,15 +299,18 @@ unpack() {
 						"supported with EAPI '${EAPI}'. Instead use 'tar'."
 				fi
 				$1 -c -- "$srcdir$x" | tar xof -
-				__assert_sigpipe_ok "$myfail"
+				__assert_sigpipe_ok "$myfail" || return 1
 			else
 				local cwd_dest=${x##*/}
 				cwd_dest=${cwd_dest%.*}
-				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
+				if ! $1 -c -- "${srcdir}${x}" > "${cwd_dest}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 			fi
 		}
 
-		myfail="failure unpacking ${x}"
+		myfail="unpack: failure unpacking ${x}"
 		case "${suffix_insensitive}" in
 			tar)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -313,7 +319,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'tar'."
 				fi
-				tar xof "$srcdir$x" || die "$myfail"
+				if ! tar xof "$srcdir$x"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			tgz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -322,7 +331,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'tgz'."
 				fi
-				tar xozf "$srcdir$x" || die "$myfail"
+				if ! tar xozf "$srcdir$x"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			tbz|tbz2)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -332,7 +344,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
 				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
-				__assert_sigpipe_ok "$myfail"
+				__assert_sigpipe_ok "$myfail" || return 1
 				;;
 			zip|jar)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -344,8 +356,10 @@ unpack() {
 				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
-				( set +x ; while true ; do echo n || break ; done ) | \
-				unzip -qo "${srcdir}${x}" || die "$myfail"
+				if ! unzip -qo "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi < <(set +x ; while true ; do echo n || break ; done)
 				;;
 			gz|z)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -354,7 +368,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
 				fi
-				__unpack_tar "gzip -d"
+				__unpack_tar "gzip -d" || return 1
 				;;
 			bz2|bz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -363,7 +377,8 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
 				fi
-				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
+				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}" \
+					|| return 1
 				;;
 			7z)
 				local my_output
@@ -380,7 +395,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
 				fi
-				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
+				if ! unrar x -idq -o+ "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			lha|lzh)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -390,7 +408,10 @@ unpack() {
 						"with EAPI '${EAPI}'." \
 						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
 				fi
-				lha xfq "${srcdir}${x}" || die "$myfail"
+				if ! lha xfq "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			a)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -399,7 +420,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'a'."
 				fi
-				ar x "${srcdir}${x}" || die "$myfail"
+				if ! ar x "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			deb)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -420,18 +444,30 @@ unpack() {
 						# deb2targz always extracts into the same directory as
 						# the source file, so create a symlink in the current
 						# working directory if necessary.
-						ln -sf "$srcdir$x" "$y" || die "$myfail"
+						if ! ln -sf "$srcdir$x" "$y"; then
+							__helpers_die "$myfail"
+							return 1
+						fi
 						created_symlink=1
 					fi
-					deb2targz "$y" || die "$myfail"
+					if ! deb2targz "$y"; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 					if [ $created_symlink = 1 ] ; then
 						# Clean up the symlink so the ebuild
 						# doesn't inadvertently install it.
 						rm -f "$y"
 					fi
-					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
+					if ! mv -f "${y%.deb}".tar.gz data.tar.gz; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 				else
-					ar x "$srcdir$x" || die "$myfail"
+					if ! ar x "$srcdir$x"; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 				fi
 				;;
 			lzma)
@@ -441,7 +477,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'lzma'."
 				fi
-				__unpack_tar "lzma -d"
+				__unpack_tar "lzma -d" || return 1
 				;;
 			xz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -451,7 +487,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'xz'."
 				fi
 				if ___eapi_unpack_supports_xz; then
-					__unpack_tar "xz -d"
+					__unpack_tar "xz -d" || return 1
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
@@ -581,7 +617,8 @@ econf() {
 				echo "!!! Please attach the following file when seeking support:"
 				echo "!!! ${PWD}/config.log"
 			fi
-			die "econf failed"
+			__helpers_die "econf failed"
+			return 1
 		fi
 	elif [ -f "${ECONF_SOURCE}/configure" ]; then
 		die "configure is not executable"
@@ -620,7 +657,7 @@ einstall() {
 				${MAKEOPTS} -j1 \
 				"$@" ${EXTRA_EMAKE} install
 		fi
-		${MAKE:-make} prefix="${ED}usr" \
+		if ! ${MAKE:-make} prefix="${ED}usr" \
 			datadir="${ED}usr/share" \
 			infodir="${ED}usr/share/info" \
 			localstatedir="${ED}var/lib" \
@@ -628,7 +665,11 @@ einstall() {
 			sysconfdir="${ED}etc" \
 			${LOCAL_EXTRA_EINSTALL} \
 			${MAKEOPTS} -j1 \
-			"$@" ${EXTRA_EMAKE} install || die "einstall failed"
+			"$@" ${EXTRA_EMAKE} install
+		then
+			__helpers_die "einstall failed"
+			return 1
+		fi
 	else
 		die "no Makefile found"
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     6bedf0ae0fdd59123a9b16cc195dfb22cb293fa9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 18:20:28 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6bedf0ae

Add tentative support for EAPI6 einstalldocs function

Add the einstalldocs function to conveniently install documentation
using the default patterns or DOCS and HTML_DOCS variables.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6ace20d..978a410 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -68,6 +68,10 @@ ___eapi_has_get_libdir() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_einstalldocs() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 764b968..e401676 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -896,6 +896,34 @@ if ___eapi_has_get_libdir; then
 	}
 fi
 
+if ___eapi_has_einstalldocs; then
+	einstalldocs() {
+		(
+			docinto .
+			if ! declare -p DOCS &>/dev/null ; then
+				local d
+				for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+						THANKS BUGS FAQ CREDITS CHANGELOG ; do
+					[[ -s ${d} ]] && dodoc "${d}"
+				done
+			elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
+				[[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
+			else
+				[[ ${DOCS} ]] && dodoc -r ${DOCS}
+			fi
+		)
+
+		(
+			docinto html
+			if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
+				[[ ${HTML_DOCS[@]} ]] && dodoc -r "${HTML_DOCS[@]}"
+			else
+				[[ ${HTML_DOCS} ]] && dodoc -r ${HTML_DOCS}
+			fi
+		)
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     f188c989317a58ffc54cc0c022c728c100de9000
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 21:52:42 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f188c989

Add tentative support for EAPI6 eapply_user function

Add support for the user patch applying function.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 8ffffbb..6e78750 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -76,6 +76,10 @@ ___eapi_has_eapply() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_eapply_user() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e9fbbb4..f4b64ee 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -986,6 +986,28 @@ if ___eapi_has_eapply; then
 	}
 fi
 
+if ___eapi_has_eapply_user; then
+	eapply_user() {
+		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
+
+		local d applied
+		# possibilities:
+		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
+		#    ${P} twice)
+		# 2. ${CATEGORY}/${P}
+		# 3. ${CATEGORY}/${PN}
+		# all of the above may be optionally followed by a slot
+		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
+			if [[ -d ${d} ]]; then
+				eapply "${d}"
+				applied=1
+			fi
+		done
+
+		[[ -n ${applied} ]] && ewarn "User patches applied."
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     eb192ed4f307517851214baf94a6bfd792338711
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 20:42:15 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb192ed4

Add tentative support for EAPI6 eapply function

Add the eapply patch applying function.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 978a410..8ffffbb 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -72,6 +72,10 @@ ___eapi_has_einstalldocs() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_eapply() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e401676..e9fbbb4 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -924,6 +924,68 @@ if ___eapi_has_einstalldocs; then
 	}
 fi
 
+if ___eapi_has_eapply; then
+	eapply() {
+		_eapply_patch() {
+			local f=${1}
+			local prefix=${2}
+
+			started_applying=1
+			ebegin "${prefix:-Applying }${f##*/}"
+			# -p1 as a sane default
+			# -f to avoid interactivity
+			# -s to silence progress output
+			patch -p1 -f -s "${patch_options[@]}" < "${f}"
+			if ! eend ${?}; then
+				__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"
+				failed=1
+			fi
+		}
+
+		local f patch_options=() failed started_applying options_terminated
+		for f; do
+			if [[ ${f} == -* && -z ${options_terminated} ]]; then
+				if [[ -n ${started_applying} ]]; then
+					die "eapply: options need to be specified before files"
+				fi
+				if [[ ${f} == -- ]]; then
+					options_terminated=1
+				else
+					patch_options+=( ${f} )
+				fi
+			elif [[ -d ${f} ]]; then
+				_eapply_get_files() {
+					local LC_ALL=POSIX
+					local prev_shopt=$(shopt -p nullglob)
+					shopt -s nullglob
+					files=( "${f}"/*.{patch,diff} )
+					${prev_shopt}
+				}
+
+				local files
+				_eapply_get_files
+				[[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}"
+
+				einfo "Applying patches from ${f} ..."
+				local f2
+				for f2 in "${files[@]}"; do
+					_eapply_patch "${f2}" '  '
+
+					# in case of nonfatal
+					[[ -n ${failed} ]] && return 1
+				done
+			else
+				_eapply_patch "${f}"
+
+				# in case of nonfatal
+				[[ -n ${failed} ]] && return 1
+			fi
+		done
+
+		return 0
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     00d20f0ee71c59a0cdd75aa79705ed739990ff85
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 18:13:48 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=00d20f0e

Add tentative support for EAPI6 get_libdir()

Add get_libdir() function to obtain the basename of libdir using
the same algorithm that econf uses.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 5f96c3b..6ace20d 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -64,6 +64,10 @@ ___eapi_has_usex() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
+___eapi_has_get_libdir() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 9738a3a..764b968 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -885,6 +885,17 @@ best_version() {
 	esac
 }
 
+if ___eapi_has_get_libdir; then
+	get_libdir() {
+		local libdir_var="LIBDIR_${ABI}"
+		local libdir="lib"
+
+		[[ -n ${ABI} && -n ${!libdir_var} ]] && libdir=${!libdir_var}
+
+		echo "${libdir}"
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     2e845dabd4b6f21381b4022ca57e064e2361ebf9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 08:32:57 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2e845dab

Add tentative EAPI6 absolute path support to unpack()

Add support for absolute paths in unpack(). Allow subdirectory-level
relative paths not to start with './'.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 29 ++++++++++++++++++++++-------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 878f8e7..6716b1c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -162,6 +162,10 @@ ___eapi_unpack_is_case_sensitive() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
+___eapi_unpack_supports_absolute_paths() {
+	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
+}
+
 # OTHERS
 
 ___eapi_enables_failglob_in_global_scope() {

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 182a872..a6e1cdb 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -276,14 +276,29 @@ unpack() {
 		y=${y##*.}
 		y_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
 
-		if [[ ${x} == "./"* ]] ; then
-			srcdir=""
-		elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
-			die "Arguments to unpack() cannot begin with \${DISTDIR}."
-		elif [[ ${x} == "/"* ]] ; then
-			die "Arguments to unpack() cannot be absolute"
+		# wrt PMS 11.3.3.13 Misc Commands
+		if [[ ${x} != */* ]]; then
+			# filename without path of any kind
+			srcdir=${DISTDIR}/
+		elif [[ ${x} == ./* ]]; then
+			# relative path starting with './'
+			srcdir=
 		else
-			srcdir="${DISTDIR}/"
+			# non-'./' filename with path of some kind
+			if ___eapi_unpack_supports_absolute_paths; then
+				# EAPI 6 allows absolute and deep relative paths
+				srcdir=
+
+				if [[ ${x} == ${DISTDIR%/}/* ]]; then
+					eqawarn "QA Notice: unpack called with redundant \${DISTDIR} in path"
+				fi
+			elif [[ ${x} == ${DISTDIR%/}/* ]]; then
+				die "Arguments to unpack() cannot begin with \${DISTDIR} in EAPI ${EAPI}"
+			elif [[ ${x} == /* ]] ; then
+				die "Arguments to unpack() cannot be absolute in EAPI ${EAPI}"
+			else
+				die "Relative paths to unpack() must be prefixed with './' in EAPI ${EAPI}"
+			fi
 		fi
 		if [[ ! -s ${srcdir}${x} ]]; then
 			__helpers_die "unpack: ${x} does not exist"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     65c1b97870b6689d5b065540d0e46fa7cb4de7bc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 10:04:46 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=65c1b978

Add tentative EAPI6 in_iuse() function

Add a function to query IUSE_EFFECTIVE for flags.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index c650a4c..e0ade02 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -80,6 +80,10 @@ ___eapi_has_eapply_user() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_in_iuse() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a6e1cdb..e2376bf 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1036,6 +1036,22 @@ if ___eapi_has_eapply_user; then
 	}
 fi
 
+if ___eapi_has_in_iuse; then
+	in_iuse() {
+		local use=${1}
+
+		if [[ -z "${use}" ]]; then
+			echo "!!! in_iuse() called without a parameter." >&2
+			echo "!!! in_iuse <USEFLAG>" >&2
+			die "in_iuse() called without a parameter"
+		fi
+
+		local liuse=( ${IUSE_EFFECTIVE} )
+
+		has "${use}" "${liuse[@]#[+-]}"
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     5e519e0676249133c0d65cb7f3cabefe2653513e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 11:57:36 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e519e06

Add tentative EAPI6 phase functions

---
 bin/phase-functions.sh | 11 +++++++++++
 bin/phase-helpers.sh   | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ee28c27..aec86fd 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -828,6 +828,17 @@ __ebuild_phase_funcs() {
 				declare -F src_install >/dev/null || \
 					src_install() { default; }
 			fi
+
+			# defaults starting with EAPI 6
+			if ! has ${eapi} 2 3 4 4-python 4-slot-abi 5 5-progress 5-hdepend; then
+				[[ ${phase_func} == src_prepare ]] && \
+					default_src_prepare() { __eapi6_src_prepare; }
+				[[ ${phase_func} == src_install ]] && \
+					default_src_install() { __eapi6_src_install; }
+
+				declare -F src_prepare >/dev/null || \
+					src_prepare() { default; }
+			fi
 			;;
 	esac
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e2376bf..5605efd 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -795,6 +795,24 @@ __eapi4_src_install() {
 	fi
 }
 
+__eapi6_src_prepare() {
+	if [[ $(declare -p PATCHES) == "declare -a"* ]]; then
+		eapply "${PATCHES[@]}"
+	elif [[ -n ${PATCHES} ]]; then
+		eapply ${PATCHES}
+	fi
+
+	eapply_user
+}
+
+__eapi6_src_install() {
+	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+		emake DESTDIR="${D}" install
+	fi
+
+	einstalldocs
+}
+
 # @FUNCTION: has_version
 # @USAGE: [--host-root] <DEPEND ATOM>
 # @DESCRIPTION:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     daa65a336102050396482f08c77524fe99e48c9f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 08:13:45 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=daa65a33

Add tentative EAPI6 .txz unpack support

Support unpacking .txz-suffixed archives.

---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index fa57999..878f8e7 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -118,6 +118,10 @@ ___eapi_unpack_supports_xz() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2)$ ]]
 }
 
+___eapi_unpack_supports_txz() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_econf_passes_--disable-dependency-tracking() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f4b64ee..182a872 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -492,6 +492,19 @@ unpack() {
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
+			txz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " txz " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'txz'."
+				fi
+				if ___eapi_supports_txz; then
+					__unpack_tar "xz -d" || return 1
+				else
+					__vecho "unpack ${x}: file format not recognized. Ignoring."
+				fi
+				;;
 			*)
 				__vecho "unpack ${x}: file format not recognized. Ignoring."
 				;;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     25b3a589c42d42d48e3c30b49a12a46afab00d8d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  1 19:51:42 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25b3a589

Ban einstall for EAPI 6

---
 bin/eapi.sh          | 4 ++++
 bin/phase-helpers.sh | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 5ab92f4..b27b57c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -48,6 +48,10 @@ ___eapi_has_dosed() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }
 
+___eapi_has_einstall() {
+	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_docompress() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5605efd..6e437da 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -666,6 +666,11 @@ econf() {
 }
 
 einstall() {
+	if ! ___eapi_has_einstall; then
+		die "'${FUNCNAME}' has been banned for EAPI '$EAPI'"
+		exit 1
+	fi
+
 	# CONF_PREFIX is only set if they didn't pass in libdir above.
 	local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
 	if ! ___eapi_has_prefix_variables; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     b830bbc3b10bf239611663d0572b2cd4ba3d656a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  1 20:16:46 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b830bbc3

Disallow helpers in global scope in EAPI 6

Disallow calling most of the ebuild helpers in global scope since they
are meaningless in that context. Most of them are also prohibited by PMS
for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
that restriction.

---
 bin/eapi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e0ade02..5ab92f4 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
 }
 
 ___eapi_disallows_helpers_in_global_scope() {
-	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_unpack_is_case_sensitive() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-04 14:01 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2014-12-04 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     1d210dcc05676df866a1d8455f97009b3d698a66
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 09:47:44 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1d210dcc

Add tentative EAPI6 nonfatal support to die()

Add support for die() to respect 'nonfatal' modifier if
'--respect-nonfatal' (or '-n') option is used. This allows eclasses
to create custom ebuild helpers that mimic built-in helper behavior.

---
 bin/eapi.sh               | 4 ++++
 bin/isolated-functions.sh | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6716b1c..c650a4c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -166,6 +166,10 @@ ___eapi_unpack_supports_absolute_paths() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
+___eapi_die_can_respect_nonfatal() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 # OTHERS
 
 ___eapi_enables_failglob_in_global_scope() {

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 251d7ee..8e789ec 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -123,6 +123,13 @@ __helpers_die() {
 die() {
 	local IFS=$' \t\n'
 
+	if ___eapi_die_can_respect_nonfatal; then
+		if [[ ${1} == -n ]]; then
+			[[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
+			shift
+		fi
+	fi
+
 	set +e
 	if [ -n "${QA_INTERCEPTORS}" ] ; then
 		# die was called from inside inherit. We need to clean up


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-07  6:02 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-12-07  6:02 UTC (permalink / raw
  To: gentoo-commits

commit:     12000781c8b8facdd487a188e6ebfdc5cd1a7b83
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  6 19:22:12 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  7 06:00:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12000781

bin/ebuild: fix --color=n for bug #531690

When the NOCOLOR variable is overridden in portage.settings, it's
necessary to call the config.backup_changes method in order for the
change to persist through config.reset calls.

X-Gentoo-Bug: 531690
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=531690
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/ebuild b/bin/ebuild
index a62aa20..ad52ed5 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -110,6 +110,7 @@ if not opts.color == 'y' and \
 	portage.output.nocolor()
 	portage.settings.unlock()
 	portage.settings['NOCOLOR'] = 'true'
+	portage.settings.backup_changes('NOCOLOR')
 	portage.settings.lock()
 
 ebuild = pargs.pop(0)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-07 18:51 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2014-12-07 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     c53e7057f94728d6e0c7d16c675702ca831b9a5a
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  7 18:33:52 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Dec  7 18:39:07 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c53e7057

Prefer GNU ar when unpacking .deb packages.

PMS reference:
deb packages (*.deb). Ebuilds must ensure that the deb2targz program
is installed on those platforms where the GNU binutils ar program is
not available and the installed ar program is incompatible with GNU
archives. Otherwise, ebuilds must ensure that GNU binutils is
installed.

---
 bin/phase-helpers.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6e437da..afad2e9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -448,11 +448,13 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'deb'."
 				fi
 				# Unpacking .deb archives can not always be done with
-				# `ar`.  For instance on AIX this doesn't work out.  If
-				# we have `deb2targz` installed, prefer it over `ar` for
-				# that reason.  We just make sure on AIX `deb2targz` is
+				# `ar`.  For instance on AIX this doesn't work out.
+				# If `ar` is not the GNU binutils version and we have
+				# `deb2targz` installed, prefer it over `ar` for that
+				# reason.  We just make sure on AIX `deb2targz` is
 				# installed.
-				if type -P deb2targz > /dev/null; then
+				if [[ $(ar --version 2>/dev/null) != "GNU ar"* ]] && \
+					type -P deb2targz > /dev/null; then
 					y=${x##*/}
 					local created_symlink=0
 					if [ ! "$srcdir$x" -ef "$y" ] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-07 23:23 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2014-12-07 23:23 UTC (permalink / raw
  To: gentoo-commits

commit:     05da38b2228bb1105e98d48412168f9ac0db87b6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  6 22:51:13 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Dec  7 23:21:21 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=05da38b2

bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

Issue reported by: mva in irc

>>> Unpacking source...
>>> Unpacking 2gis_4.14.11-0trusty1+shv139+r191_amd64.deb to /var/tmp/portage/app-misc/2gis-4.14.11.139.191/work
deb2targz: converting '2gis_4.14.11-0trusty1+shv139+r191_amd64.deb' ...
deb2targz: skipping section 'debian-binary'
deb2targz: skipping section 'control.tar.gz'
deb2targz: wrote '2gis_4.14.11-0trusty1+shv139+r191_amd64.tar.xz'
mv: cannot stat ‘2gis_4.14.11-0trusty1+shv139+r191_amd64.tar.gz’: No such file or directory

---
 bin/phase-helpers.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index afad2e9..aca9e64 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -477,8 +477,9 @@ unpack() {
 						rm -f "$y"
 					fi
 					if ! mv -f "${y%.deb}".tar.gz data.tar.gz; then
-						__helpers_die "$myfail"
-						return 1
+						if ! mv -f "${y%.deb}".tar.xz data.tar.xz; then
+							__helpers_die "$myfail"
+							return 1
 					fi
 				else
 					if ! ar x "$srcdir$x"; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-07 23:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2014-12-07 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     518aedae1b3aa06f796376390118dad89eee31ce
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  6 22:51:13 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  7 23:53:22 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=518aedae

bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

Issue reported by: mva in irc

>>> Unpacking source...
>>> Unpacking 2gis_4.14.11-0trusty1+shv139+r191_amd64.deb to /var/tmp/portage/app-misc/2gis-4.14.11.139.191/work
deb2targz: converting '2gis_4.14.11-0trusty1+shv139+r191_amd64.deb' ...
deb2targz: skipping section 'debian-binary'
deb2targz: skipping section 'control.tar.gz'
deb2targz: wrote '2gis_4.14.11-0trusty1+shv139+r191_amd64.tar.xz'
mv: cannot stat ‘2gis_4.14.11-0trusty1+shv139+r191_amd64.tar.gz’: No such file or directory

---
 bin/phase-helpers.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index afad2e9..47ca060 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -477,8 +477,10 @@ unpack() {
 						rm -f "$y"
 					fi
 					if ! mv -f "${y%.deb}".tar.gz data.tar.gz; then
-						__helpers_die "$myfail"
-						return 1
+						if ! mv -f "${y%.deb}".tar.xz data.tar.xz; then
+							__helpers_die "$myfail"
+							return 1
+						fi
 					fi
 				else
 					if ! ar x "$srcdir$x"; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2014-12-15 16:28 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-15 16:28 UTC (permalink / raw
  To: gentoo-commits

commit:     57bae253674a5e0ed215f94e10eb3cc0061ae53a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec 15 16:23:03 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Mon Dec 15 16:23:03 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=57bae253

portageq pquery: Search ebuilds in all repositories be default.

--all-repos option is no longer supported.
1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() function
has been deleted.

---
 bin/portageq | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 2c4f548..8deeb8a 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1075,14 +1075,10 @@ def pquery(parser, opts, args):
 			herds.extend(x.split(","))
 		xml_matchers.append(HerdMatcher(herds))
 
-	repos = []
-	if opts.all_repos:
-		repos.extend(portdb.repositories.get_repo_for_location(location)
-			for location in portdb.porttrees)
-	elif opts.repo is not None:
-		repos.append(portdb.repositories[opts.repo])
+	if opts.repo is not None:
+		repos = [portdb.repositories[opts.repo]]
 	else:
-		repos.append(portdb.repositories.mainRepo())
+		repos = list(portdb.repositories)
 
 	if not atoms:
 		names = None
@@ -1220,12 +1216,8 @@ def add_pquery_arguments(parser):
 				},
 				{
 					"longopt": "--repo",
-					"help": "repo to use (default is PORTDIR if omitted)"
+					"help": "repository to use (all repositories are used by default)"
 				},
-				{
-					"longopt": "--all-repos",
-					"help": "search all repos"
-				}
 			)
 		),
 		(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-01-18  5:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-01-18  5:06 UTC (permalink / raw
  To: gentoo-commits

commit:     a01d73c362fdbf9761835bd587345f5570276fbb
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 17 12:07:27 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 18 05:05:12 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a01d73c3

bin/eapi.sh: default to EAPI=0 when EAPI is unset

Observed as a breakage on binutils ebuilds:

> ERROR: sys-devel/binutils-2.24-r3::gentoo failed (depend phase):
>  use() calls are not allowed in global scope
>    Call stack:
>    ebuild.sh, line 584:  Called source 'binutils-2.24-r3.ebuild,
>    ebuild.sh, line   7:  Called inherit 'toolchain-binutils'
>    ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/toolchain-binutils.e
>    ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/toolchain-binutils.eclass
>  toolchain-binutils.eclass, line 106:  Called use 'multislot'
>                  ebuild.sh, line  47:  Called die
> The specific snippet of code:
>       # These functions die because calls to them during the "depend" phase

Zac confirms it's a safe thing to use ${EAPI-0} here:
> ebuild.sh unsets the EAPI just before it sources the ebuild,
> and then it does this after it sources the ebuild:
>
>   [ "${EAPI+set}" = set ] || EAPI=0
>
> So, for any code that is called while the ebuild is being sourced, using
> ${EAPI-0} would be correct.

For consistency and defense against future copy/paste errors
converted all uses of ${EAPI} for ${EAPI-0} in 'bin/eapi.sh'.

Fixes: b830bbc3b10b ("Disallow helpers in global scope in EAPI 6")
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

---
 bin/eapi.sh | 90 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 7e7b54b..f1c677e 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -5,189 +5,189 @@
 # PHASES
 
 ___eapi_has_pkg_pretend() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_has_src_prepare() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1)$ ]]
 }
 
 ___eapi_has_src_configure() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1)$ ]]
 }
 
 ___eapi_default_src_test_disables_parallel_jobs() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
 ___eapi_has_S_WORKDIR_fallback() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 # VARIABLES
 
 ___eapi_has_prefix_variables() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2)$ || " ${FEATURES} " == *" force-prefix "* ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2)$ || " ${FEATURES} " == *" force-prefix "* ]]
 }
 
 ___eapi_has_HDEPEND() {
-	[[ ${1-${EAPI}} =~ ^(5-hdepend)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-hdepend)$ ]]
 }
 
 ___eapi_has_RDEPEND_DEPEND_fallback() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 # HELPERS PRESENCE
 
 ___eapi_has_dohard() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_has_dosed() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_has_einstall() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_dohtml_deprecated() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_docompress() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_has_nonfatal() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_has_doheader() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
 ___eapi_has_usex() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
 ___eapi_has_get_libdir() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_einstalldocs() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_eapply() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_eapply_user() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_in_iuse() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_has_master_repositories() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 ___eapi_has_repository_path() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 ___eapi_has_available_eclasses() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 ___eapi_has_eclass_path() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 ___eapi_has_license_path() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 ___eapi_has_package_manager_build_user() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 ___eapi_has_package_manager_build_group() {
-	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }
 
 # HELPERS BEHAVIOR
 
 ___eapi_best_version_and_has_version_support_--host-root() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
 ___eapi_unpack_supports_xz() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2)$ ]]
 }
 
 ___eapi_unpack_supports_txz() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_econf_passes_--disable-dependency-tracking() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_econf_passes_--disable-silent-rules() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
 ___eapi_econf_passes_--docdir_and_--htmldir() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_use_enable_and_use_with_support_empty_third_argument() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_dodoc_supports_-r() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_doins_and_newins_preserve_symlinks() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_newins_supports_reading_from_standard_input() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
 ___eapi_helpers_can_die() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
 ___eapi_disallows_helpers_in_global_scope() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_unpack_is_case_sensitive() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_unpack_supports_absolute_paths() {
-	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_die_can_respect_nonfatal() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 # OTHERS
 
 ___eapi_enables_failglob_in_global_scope() {
-	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
 ___eapi_enables_globstar() {
-	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(4-python|5-progress)$ ]]
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-01-19 20:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-01-19 20:47 UTC (permalink / raw
  To: gentoo-commits

commit:     4e4c5d496933dfef7ef4a14d4c6372af8c036ef2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 19 09:06:32 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan 19 20:46:28 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4e4c5d49

chpathtool.py: avoid unnecessary optparse import

Since commit d217db2bc76e4c1a2e75685b4a00e25f7d8142a8, the optparse
module has been imported unconditionally, even when the argparse module
is available. Fix it to import optparse only if the argparse import
fails.

Fixes: d217db2bc76e ("Make use of optparse to fix argument parsing for Python 2.6 in bin/chpathtool.py.")
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/chpathtool.py | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 9b26086..842f1f4 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -13,14 +13,12 @@ import os
 import stat
 import sys
 
-from portage.util._argparse import ArgumentParser
-
-# Argument parsing compatibility for Python 2.6 using optparse.
-if sys.hexversion < 0x2070000:
+try:
+	from argparse import ArgumentParser
+except ImportError:
+	ArgumentParser = None
 	from optparse import OptionParser
 
-from optparse import OptionError
-
 CONTENT_ENCODING = 'utf_8'
 FS_ENCODING = 'utf_8'
 
@@ -154,8 +152,8 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-	parser = ArgumentParser(description=doc)
-	try:
+	if ArgumentParser is not None:
+		parser = ArgumentParser(description=doc)
 		parser.add_argument('location', default=None,
 			help='root directory (e.g. $D)')
 		parser.add_argument('old', default=None,
@@ -165,9 +163,8 @@ def main(argv):
 		opts = parser.parse_args(argv)
 
 		location, old, new = opts.location, opts.old, opts.new
-	except OptionError:
+	else:
 		# Argument parsing compatibility for Python 2.6 using optparse.
-		if sys.hexversion < 0x2070000:
 			parser = OptionParser(description=doc,
 				usage="usage: %prog [-h] location old new\n\n" + \
 				"  location: root directory (e.g. $D)\n" + \
@@ -178,13 +175,10 @@ def main(argv):
 
 			if len(args) != 3:
 				parser.print_usage()
-				print("%s: error: expected 3 arguments, got %i"
+				parser.error("%s: error: expected 3 arguments, got %i"
 					% (__file__, len(args)))
-				return
 
 			location, old, new = args[0:3]
-		else:
-			raise
 
 	is_text_file = IsTextFile()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-02-03 21:39 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-02-03 21:39 UTC (permalink / raw
  To: gentoo-commits

commit:     c96c0540abf25e14d865ab9fcfd22b3e5748c901
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  3 21:39:07 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Feb  3 21:39:07 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c96c0540

bin/emerge-webrsync: Fix my flawed logic for the rsync/websync check

Thanks to Zac for spotting my logic error.

---
 bin/emerge-webrsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index e2b4e00..a603280 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -501,7 +501,7 @@ main() {
 
 	# This is a sanity check to help prevent people like funtoo users
 	# from accidentally wiping out their git tree.
-	if [[ -n ${repo_sync_type} && ( ${repo_sync_type} != rsync || ${repo_sync_type} != websync ) ]] ; then
+	if [[ -n ${repo_sync_type} &&  ${repo_sync_type} != rsync && ${repo_sync_type} != websync ]] ; then
 		echo "The current sync-type attribute of repository 'gentoo' is not set to 'rsync' or 'websync':" >&2
 		echo >&2
 		echo "  sync-type=${repo_sync_type}" >&2


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-02-09  0:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-02-09  0:45 UTC (permalink / raw
  To: gentoo-commits

commit:     21b4db4b9db1ed79d0f62e9761c29acde490fbc1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  9 00:44:51 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  9 00:44:51 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=21b4db4b

repoman: fix overlay mask logic for bug #539402

In repoman, portdb.xmatch("match-visible", pkg.cp) was used to check the
list of visible ebuilds. However, instead of pkg.cp, when checking an
overlay it needs use an atom which restricts the match to the
appropriate repo. Otherwise, it risks matching ebuilds from the master
repo(s).

X-Gentoo-Bug: 539402
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=539402
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/repoman | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 5380146..0bf576f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2319,7 +2319,8 @@ for x in effective_scanlist:
 
 			if not baddepsyntax:
 				ismasked = not ebuild_archs or \
-					pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)
+					pkg.cpv not in portdb.xmatch("match-visible",
+					Atom("%s::%s" % (pkg.cp, repo_config.name)))
 				if ismasked:
 					if not have_pmasked:
 						have_pmasked = bool(dep_settings._getMaskAtom(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-02-09 20:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-02-09 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d43cc91db8ae54f48a91576c175a2a49f7b8b11c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  7 19:22:16 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  9 20:32:10 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d43cc91d

repoman: make SRC_URI.mirror test result non-fatal

Make the SRC_URI.mirror test result non-fatal. There is no technical
reason to treat it as a critical error since the SRC_URI is still
correct -- just suboptimal.

Those errors can appear throughout the repository once a new mirror is
added, resulting in unnecessary failures. Worse than that, they prevent
committing ebuilds with mirror:// URIs removed when aiming to remove
a mirror specification.

X-Gentoo-Bug: 513168
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=513168
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 bin/repoman | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/repoman b/bin/repoman
index 0bf576f..16ea055 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -419,6 +419,7 @@ qawarnings = set((
 "LIVEVCS.stable",
 "LIVEVCS.unmasked",
 "IUSE.rubydeprecated",
+"SRC_URI.mirror",
 ))
 
 non_ascii_re = re.compile(r'[^\x00-\x7f]')


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-02-16 18:54 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2015-02-16 18:54 UTC (permalink / raw
  To: gentoo-commits

commit:     a729d720be51c6f24a5c1610510bfa3f2b83c245
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 16 18:24:07 2015 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Feb 16 18:24:07 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a729d720

bin/eapi.sh: Invert condition in ___eapi_unpack_supports_absolute_paths().

This should return true starting with EAPI 6, and false for EAPI 5
and earlier.

---
 bin/eapi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index f1c677e..528e6f2 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -175,7 +175,7 @@ ___eapi_unpack_is_case_sensitive() {
 }
 
 ___eapi_unpack_supports_absolute_paths() {
-	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_die_can_respect_nonfatal() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-02-21 20:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-02-21 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     c1489985f64443c4fba0b9661eee60f61e470d37
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 21 19:12:21 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 20:23:13 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c1489985

repoman: skip vcs calls for manifest modes (bug 540882)

For manifest and manifest-check modes, there's no need to call the vcs
unless --if-modified=y is enabled.

X-Gentoo-Bug: 540882
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=540882
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 bin/repoman | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 16ea055..13c220d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1187,7 +1187,10 @@ mychanged = []
 mynew = []
 myremoved = []
 
-if vcs == "cvs":
+if (options.if_modified != "y" and
+	options.mode in ("manifest", "manifest-check")):
+	pass
+elif vcs == "cvs":
 	mycvstree = cvstree.getentries("./", recursive=1)
 	mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
 	mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-03-31 16:52 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-03-31 16:52 UTC (permalink / raw
  To: gentoo-commits

commit:     f0b974c4839d3713fdeecf11eda46a2aeee233c8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 24 09:00:04 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar 25 08:00:11 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0b974c4

repoman: add --straight-to-stable (-S) option

Add an option to safely allow committing ebuilds straight to stable.
Before, this required either round trips with multiple commits or
--force option that ignored valid QA concerns and (surprisingly to many
developers) skipped some expensive QA checks.

 bin/repoman | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 13c220d..7101a00 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -191,6 +191,9 @@ def ParseArgs(argv, qahelp):
 	parser.add_argument('-f', '--force', dest='force', default=False, action='store_true',
 		help='Commit with QA violations')
 
+	parser.add_argument('-S', '--straight-to-stable', dest='straight_to_stable', default=False,
+		action='store_true', help='Allow committing straight to stable')
+
 	parser.add_argument('--vcs', dest='vcs',
 		help='Force using specific VCS instead of autodetection')
 
@@ -1908,18 +1911,19 @@ for x in effective_scanlist:
 				(relative_path, len(myaux['DESCRIPTION']), max_desc_len))
 
 		keywords = myaux["KEYWORDS"].split()
-		stable_keywords = []
-		for keyword in keywords:
-			if not keyword.startswith("~") and \
-				not keyword.startswith("-"):
-				stable_keywords.append(keyword)
-		if stable_keywords:
-			if ebuild_path in new_ebuilds and catdir != "virtual":
-				stable_keywords.sort()
-				stats["KEYWORDS.stable"] += 1
-				fails["KEYWORDS.stable"].append(
-					x + "/" + y + ".ebuild added with stable keywords: %s" % \
-						" ".join(stable_keywords))
+		if not options.straight_to_stable:
+			stable_keywords = []
+			for keyword in keywords:
+				if not keyword.startswith("~") and \
+					not keyword.startswith("-"):
+					stable_keywords.append(keyword)
+			if stable_keywords:
+				if ebuild_path in new_ebuilds and catdir != "virtual":
+					stable_keywords.sort()
+					stats["KEYWORDS.stable"] += 1
+					fails["KEYWORDS.stable"].append(
+						relative_path + " added with stable keywords: %s" % \
+							" ".join(stable_keywords))
 
 		ebuild_archs = set(kw.lstrip("~") for kw in keywords \
 			if not kw.startswith("-"))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-10 16:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-04-10 16:58 UTC (permalink / raw
  To: gentoo-commits

commit:     cb4594635a2ebced9e4e68a4324b83dcd70eff1c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  2 21:01:27 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 10 16:56:40 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cb459463

repoman: fix dependency.unknown to ignore USE deps (bug 525376)

The surrounding code is ignorant of USE flags, because it calls
use_reduce(matchall=True), therefore it makes sense for the
dependency.unknown code to ignore USE deps.

X-Gentoo-Bug: 525376
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=525376

 bin/repoman | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 7101a00..4a21e37 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2049,9 +2049,10 @@ for x in effective_scanlist:
 
 					# Skip dependency.unknown for blockers, so that we
 					# don't encourage people to remove necessary blockers,
-					# as discussed in bug #382407.
+					# as discussed in bug 382407. We use atom.without_use
+					# due to bug 525376.
 					if not is_blocker and \
-						not portdb.xmatch("match-all", atom) and \
+						not portdb.xmatch("match-all", atom.without_use) and \
 						not atom.cp.startswith("virtual/"):
 						unknown_pkgs.add((mytype, atom.unevaluated_atom))
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-11 15:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-04-11 15:57 UTC (permalink / raw
  To: gentoo-commits

commit:     ec0954d7a8e66cf07679ac94502b5dfa37a27882
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  8 22:31:52 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 11 15:55:17 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ec0954d7

repoman: handle removed packages in vcs_files_to_cps (bug 546010)

X-Gentoo-Bug: 546010
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=546010
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/repoman | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 4a21e37..5ff6857 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1047,7 +1047,10 @@ def vcs_files_to_cps(vcs_file_iter):
 			if len(f_split) > 3 and f_split[1] in categories:
 				modified_cps.append("/".join(f_split[1:3]))
 
-	return frozenset(modified_cps)
+	# Exclude packages that have been removed, since calling
+	# code assumes that the packages exist.
+	return frozenset(x for x in frozenset(modified_cps)
+		if os.path.exists(os.path.join(repodir, x)))
 
 def git_supports_gpg_sign():
 	status, cmd_output = \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-13 17:27 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-04-13 17:27 UTC (permalink / raw
  To: gentoo-commits

commit:     3ed886e510a4c905d80c500665a1ce4e245b19d5
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 13 17:19:46 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Apr 13 17:22:24 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3ed886e5

bin/repoman: Catch the case of gpgcmd == ''

prometheanfire was getting '' (null string) returned, so it was not erroring like it should.

 bin/repoman | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index 5ff6857..e9c89c2 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2953,7 +2953,7 @@ else:
 	# Setup the GPG commands
 	def gpgsign(filename):
 		gpgcmd = repoman_settings.get("PORTAGE_GPG_SIGNING_COMMAND")
-		if gpgcmd is None:
+		if gpgcmd in [None, '']:
 			raise MissingParameter("PORTAGE_GPG_SIGNING_COMMAND is unset!" + \
 				" Is make.globals missing?")
 		if "${PORTAGE_GPG_KEY}" in gpgcmd and \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-20 23:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-04-20 23:34 UTC (permalink / raw
  To: gentoo-commits

commit:     5a1b870fe54ac06f864a648c3ea5cc118f6ce911
Author:     Bertrand Jacquin <bertrand <AT> jacquin <DOT> bzh>
AuthorDate: Mon Apr 20 19:45:59 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 20 23:31:34 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870f

MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

When FEATURES="nodoc noinfo noman" is used, you will get the following
output for every packages, even virtual that contain no file:

  # FEATURES="nodoc noinfo noman" emerge -va1t virtual/cron
  ..
  >>> Installing (1 of 1) virtual/cron-0::gentoo
   * Removing /usr/share/man
   * Removing /usr/share/info
   * Removing /usr/share/doc
   * checking 0 files for package collisions
  >>> Merging virtual/cron-0 to /

The following patch makes the output as:

  # FEATURES="nodoc noinfo noman" emerge -va1t virtual/cron
  ..
  >>> Installing (1 of 1) virtual/cron-0::gentoo
   * checking 0 files for package collisions
  >>> Merging virtual/cron-0 to /

Signed-off-by: Bertrand Jacquin <bertrand <AT> jacquin.bzh>
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/misc-functions.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index e08c228..b5b7510 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -267,9 +267,12 @@ install_mask() {
 	local no_inst
 	for no_inst in ${install_mask}; do
 		set +o noglob
-		__quiet_mode || einfo "Removing ${no_inst}"
+
 		# normal stuff
-		rm -Rf "${root}"/${no_inst} >&/dev/null
+		if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo "${root}"/${no_inst}) ]] ; then
+			__quiet_mode || einfo "Removing ${no_inst}"
+			rm -Rf "${root}"/${no_inst} >&/dev/null
+		fi
 
 		# we also need to handle globs (*.a, *.h, etc)
 		find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-20 23:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-04-20 23:34 UTC (permalink / raw
  To: gentoo-commits

commit:     e74e2670e3f043608fced9847e54bdbb19f35169
Author:     Bertrand Jacquin <bertrand <AT> jacquin <DOT> bzh>
AuthorDate: Mon Apr 20 19:46:00 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 20 23:31:47 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e74e2670

MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob

When glob are defined in INSTALL_MASK, no output is given on what file
has been deleted.

The following patch provide more information to user about what is
actually removed.

Example:

  # INSTALL_MASK='*.h' emerge -va1t x11-proto/xproto
  ..
  >>> Installing (1 of 2) x11-proto/xproto-7.0.27::gentoo
   * Removing /usr/include/X11/DECkeysym.h
   * Removing /usr/include/X11/HPkeysym.h
   * Removing /usr/include/X11/Sunkeysym.h
   * Removing /usr/include/X11/X.h
   * Removing /usr/include/X11/XF86keysym.h
   * Removing /usr/include/X11/XWDFile.h
   * Removing /usr/include/X11/Xalloca.h
   * Removing /usr/include/X11/Xarch.h
   * Removing /usr/include/X11/Xatom.h
   * Removing /usr/include/X11/Xdefs.h
   * Removing /usr/include/X11/Xfuncproto.h
   * Removing /usr/include/X11/Xfuncs.h
   * Removing /usr/include/X11/Xmd.h
   * Removing /usr/include/X11/Xos.h
   * Removing /usr/include/X11/Xos_r.h
   * Removing /usr/include/X11/Xosdefs.h
   * Removing /usr/include/X11/Xpoll.h
   * Removing /usr/include/X11/Xproto.h
   * Removing /usr/include/X11/Xprotostr.h
   * Removing /usr/include/X11/Xthreads.h
   * Removing /usr/include/X11/Xw32defs.h
   * Removing /usr/include/X11/Xwindows.h
   * Removing /usr/include/X11/Xwinsock.h
   * Removing /usr/include/X11/ap_keysym.h
   * Removing /usr/include/X11/keysym.h
   * Removing /usr/include/X11/keysymdef.h
   * checking 1 files for package collisions
  >>> Merging x11-proto/xproto-7.0.27 to /

Signed-off-by: Bertrand Jacquin <bertrand <AT> jacquin.bzh>
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/misc-functions.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b5b7510..24941af 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -276,7 +276,13 @@ install_mask() {
 
 		# we also need to handle globs (*.a, *.h, etc)
 		find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
-			-exec rm -fR {} \; >/dev/null 2>&1
+			-print0 2> /dev/null \
+		| LC_ALL=C sort -z \
+		| while read -r -d ''; do
+			__quiet_mode || einfo "Removing /${REPLY#${root}}"
+			rm -Rf "${REPLY}" >&/dev/null
+		done
+
 	done
 	# set everything back the way we found it
 	set +o noglob


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-22  0:23 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-04-22  0:23 UTC (permalink / raw
  To: gentoo-commits

commit:     36f6378522faff389eb94ac1111936e3328a6688
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 22 00:21:10 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Apr 22 00:22:52 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=36f63785

Update best_version() docstrings

Original pull request by yaccz: https://github.com/gentoo/portage/pull/10
We ended up with a slightly different message.

 bin/phase-helpers.sh | 2 +-
 bin/portageq         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 47ca060..efd2cfa 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -884,7 +884,7 @@ has_version() {
 # @FUNCTION: best_version
 # @USAGE: [--host-root] <DEPEND ATOM>
 # @DESCRIPTION:
-# Returns the best/most-current match.
+# Returns highest installed matching category/package-version (without .ebuild).
 # Callers may override the ROOT variable in order to match packages from an
 # alternative ROOT.
 best_version() {

diff --git a/bin/portageq b/bin/portageq
index 8deeb8a..5e0ee8b 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -177,7 +177,7 @@ def best_version(argv):
 		return 1
 
 docstrings['best_version'] = """<eroot> <category/package>
-	Returns category/package-version (without .ebuild).
+	Returns highest installed matching category/package-version (without .ebuild).
 	"""
 best_version.__doc__ = docstrings['best_version']
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-04-28 23:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-04-28 23:47 UTC (permalink / raw
  To: gentoo-commits

commit:     bc53f538039006f49bdcd19d3f17ab7f6b7a48d9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 26 21:13:41 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 23:45:41 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bc53f538

Make the USE variable readonly (bug 325009)

This requires the EBUILD_FORCE_TEST code from dyn_test to execute
before USE is declared readonly.

X-Gentoo-Bug: 325009
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/ebuild.sh          | 10 +++++++++-
 bin/phase-functions.sh |  9 +--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b6b3723..4e26f87 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
@@ -746,6 +746,14 @@ else
 		declare -r ED EPREFIX EROOT
 	fi
 
+	# If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
+	# then it might not have USE=test like it's supposed to here.
+	if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 &&
+		test =~ ${PORTAGE_IUSE} ]] && ! has test ${USE} ; then
+		export USE="${USE} test"
+	fi
+	declare -r USE
+
 	if [[ -n $EBUILD_SH_ARGS ]] ; then
 		(
 			# Don't allow subprocesses to inherit the pipe which

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 2743e27..7bf4d63 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Hardcoded bash lists are needed for backward compatibility with
@@ -489,13 +489,6 @@ __dyn_test() {
 	elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test ${FEATURES} ; then
 		__vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
 	else
-		# If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
-		# then it might not have USE=test like it's supposed to here.
-		if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ ${PORTAGE_IUSE} ]] && \
-			! has test ${USE} ; then
-			export USE="${USE} test"
-		fi
-
 		local save_sp=${SANDBOX_PREDICT}
 		addpredict /
 		__ebuild_phase pre_src_test


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-05-06 18:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-05-06 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     0f191113cccd049e11fdbe73493eb1efbf4bf89e
Author:     Andrew Hamilton <andrew <AT> ahamilto <DOT> net>
AuthorDate: Wed May  6 18:24:31 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  6 18:25:51 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0f191113

repoman: enable copyright date check without vcs (bug 488836)

X-Gentoo-Bug: 488836
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=488836
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/repoman | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/repoman b/bin/repoman
index a758aea..4763b39 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -555,7 +555,7 @@ if options.if_modified == "y" and vcs is None:
 	options.if_modified = "n"
 
 # Disable copyright/mtime check if vcs does not preserve mtime (bug #324075).
-vcs_preserves_mtime = vcs in ('cvs',)
+vcs_preserves_mtime = vcs in ('cvs', None)
 
 vcs_local_opts = repoman_settings.get("REPOMAN_VCS_LOCAL_OPTS", "").split()
 vcs_global_opts = repoman_settings.get("REPOMAN_VCS_GLOBAL_OPTS")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-05-09 15:22 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-05-09 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     8403024820e736bdd650c41f42960b802c08794e
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat May  9 15:21:19 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat May  9 15:21:36 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=84030248

bin/portageq: Update the portdir, portdir_overlay and envvar deprecation messages

 bin/portageq | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 5e0ee8b..649ee04 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -722,12 +722,14 @@ repos_config.__doc__ = docstrings['repos_config']
 
 
 def portdir(_argv):
-	print("WARNING: 'portageq portdir' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
+	print("WARNING: 'portageq portdir' is deprecated. Use the get_repo_path "
+		"command instead. eg: "
+		"'portageq get_repo_path / gentoo' instead.", file=sys.stderr)
 	print(portage.settings["PORTDIR"])
 
 docstrings['portdir'] = """
 	Returns the PORTDIR path.
-	Deprecated in favor of repositories_configuration command.
+	Deprecated in favor of get_repo_path command.
 	"""
 portdir.__doc__ = docstrings['portdir']
 
@@ -750,12 +752,14 @@ docstrings['config_protect_mask'] = """
 config_protect_mask.__doc__ = docstrings['config_protect_mask']
 
 def portdir_overlay(_argv):
-	print("WARNING: 'portageq portdir_overlay' is deprecated. Use 'portageq repositories_configuration' instead.", file=sys.stderr)
+	print("WARNING: 'portageq portdir_overlay' is deprecated. Use the get_repos"
+		" and get_repo_path commands or the repos_config command instead. eg: "
+		"'portageq repos_config /'", file=sys.stderr)
 	print(portage.settings["PORTDIR_OVERLAY"])
 
 docstrings['portdir_overlay'] = """
 	Returns the PORTDIR_OVERLAY path.
-	Deprecated in favor of repositories_configuration command.
+	Deprecated in favor of get_repos & get_repo_path or repos_config commands.
 	"""
 portdir_overlay.__doc__ = docstrings['portdir_overlay']
 
@@ -798,7 +802,9 @@ def envvar(argv):
 
 	for arg in argv:
 		if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
-			print("WARNING: 'portageq envvar %s' is deprecated. Use 'portageq repositories_configuration' instead." % arg, file=sys.stderr)
+			print("WARNING: 'portageq envvar %s' is deprecated. Use any of "
+				"'get_repos, get_repo_path, repos_config' instead."
+				% arg, file=sys.stderr)
 		if verbose:
 			print(arg + "=" + portage._shell_quote(portage.settings[arg]))
 		else:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-05-09 23:10 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-05-09 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     f75db541b9bd45f2346e0bf7f293908c176994bc
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat May  9 23:04:43 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat May  9 23:04:43 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f75db541

bin/emerge-webrsync: Fix a missed websync to webrsync rename

 bin/emerge-webrsync | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index a603280..9961ad8 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -501,8 +501,8 @@ main() {
 
 	# This is a sanity check to help prevent people like funtoo users
 	# from accidentally wiping out their git tree.
-	if [[ -n ${repo_sync_type} &&  ${repo_sync_type} != rsync && ${repo_sync_type} != websync ]] ; then
-		echo "The current sync-type attribute of repository 'gentoo' is not set to 'rsync' or 'websync':" >&2
+	if [[ -n ${repo_sync_type} &&  ${repo_sync_type} != rsync && ${repo_sync_type} != webrsync ]] ; then
+		echo "The current sync-type attribute of repository 'gentoo' is not set to 'rsync' or 'webrsync':" >&2
 		echo >&2
 		echo "  sync-type=${repo_sync_type}" >&2
 		echo >&2


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-05-18 23:19 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-05-18 23:19 UTC (permalink / raw
  To: gentoo-commits

commit:     310c548e708f72ba25d66a423b679b24888ed863
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Mon May 18 18:52:45 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon May 18 18:53:47 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=310c548e

bin/repoman: Use pformat and newlines to *DEPEND output for clarity bug 534022

X-Gentoo-Bug: 534022
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=534022

 bin/repoman | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index b193ce5..7cb32ce 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -24,6 +24,7 @@ import time
 import platform
 from itertools import chain
 from stat import S_ISDIR
+from pprint import pformat
 
 try:
 	from urllib.parse import urlparse
@@ -2396,14 +2397,14 @@ for x in effective_scanlist:
 							if not atoms:
 								continue
 							stats[mykey] += 1
-							fails[mykey].append("%s: %s: %s(%s) %s" % \
+							fails[mykey].append("%s: %s: %s(%s)\n%s" % \
 								(relative_path, mytype, keyword,
-								prof, repr(atoms)))
+								prof, pformat(atoms, indent=6)))
 					else:
 						stats[mykey] += 1
-						fails[mykey].append("%s: %s: %s(%s) %s" % \
+						fails[mykey].append("%s: %s: %s(%s)\n%s" % \
 							(relative_path, mytype, keyword,
-							prof, repr(atoms)))
+							prof, pformat(atoms, indent=6)))
 
 		if not baddepsyntax and unknown_pkgs:
 			type_map = {}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-07-07 18:10 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-07-07 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     0dc7b2a3923508896cf217f325b8339d73353553
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  7 12:12:33 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul  7 18:09:51 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0dc7b2a3

unpack: avoid useless chmods to improve speed

X-Gentoo-Bug: 554084
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=554084

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index efd2cfa..b446060 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -531,8 +531,8 @@ unpack() {
 	done
 	# Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
 	# should be preserved.
-	find . -mindepth 1 -maxdepth 1 ! -type l -print0 | \
-		${XARGS} -0 chmod -fR a+rX,u+w,g-w,o-w
+	find . -mindepth 1 '!' -type l '!' -perm /a+rX,u+w,g-w,o-w \
+		-exec chmod -f a+rX,u+w,g-w,o-w '{}' +
 }
 
 econf() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-07-17 20:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-07-17 20:53 UTC (permalink / raw
  To: gentoo-commits

commit:     7a5e62a1e5d562d538e3c6b02961e41af3e7ba77
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 17 19:29:53 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul 17 20:52:51 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a5e62a1

die: call set +x since tracing only produces useless noise here

Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 003c01d..5766921 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -121,6 +121,7 @@ __helpers_die() {
 }
 
 die() {
+	set +x # tracing only produces useless noise here
 	local IFS=$' \t\n'
 
 	if ___eapi_die_can_respect_nonfatal; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-07-20 21:48 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-07-20 21:48 UTC (permalink / raw
  To: gentoo-commits

commit:     321855f69ed8bd2b15d0fbc5d8e79f118dde2ebf
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 19 16:08:51 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jul 20 21:41:50 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=321855f6

bin/misc-functions.sh: Elaborate on some comments in install_mask().

 bin/misc-functions.sh | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9b79351..c2ff70a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -261,20 +261,30 @@ install_mask() {
 	shift
 	local install_mask="$*"
 
-	# we don't want globbing for initial expansion, but afterwards, we do
+	# We think of $install_mask as a space-separated list of
+	# globs. We don't want globbing in the "for" loop; that is, we
+	# want to keep the asterisks in the indivual entries.
 	local shopts=$-
 	set -o noglob
 	local no_inst
 	for no_inst in ${install_mask}; do
+		# Here, $no_inst is a single "entry" potentially
+		# containing a glob. From now on, we *do* want to
+		# expand it.
 		set +o noglob
 
-		# normal stuff
+		# The standard case where $no_inst is something that
+		# the shell could expand on its own.
 		if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo "${root}"/${no_inst}) ]] ; then
 			__quiet_mode || einfo "Removing ${no_inst}"
 			rm -Rf "${root}"/${no_inst} >&/dev/null
 		fi
 
-		# we also need to handle globs (*.a, *.h, etc)
+		# We also want to allow the user to specify a "bare
+		# glob." For example, $no_inst="*.a" should prevent
+		# ALL files ending in ".a" from being installed,
+		# regardless of their location/depth. We achieve this
+		# by passing the pattern to `find`.
 		find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
 			-print0 2> /dev/null \
 		| LC_ALL=C sort -z \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-08-11 19:57 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-08-11 19:57 UTC (permalink / raw
  To: gentoo-commits

commit:     5982e0a819e51c344e25c91c738d851192e188c0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 11 17:37:04 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 19:56:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5982e0a8

egencache: Always output EAPI=0 in cache entries

Remove the code skipping EAPI=0 output in cache entries. There is really
no reason to treat EAPI=0 specially here, and this makes the output more
consistent.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/egencache | 2 --
 1 file changed, 2 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 6075ccf..5c00248 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -297,8 +297,6 @@ class GenCache(object):
 		# EAPI from _parse_eapi_ebuild_head, we don't write cache
 		# entries for unsupported EAPIs.
 		if metadata is not None and eapi_supported:
-			if metadata.get('EAPI') == '0':
-				del metadata['EAPI']
 			for trg_cache in self._trg_caches:
 				self._write_cache(trg_cache,
 					cpv, repo_path, metadata, ebuild_hash)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-08-26  1:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-08-26  1:52 UTC (permalink / raw
  To: gentoo-commits

commit:     041a81dd1b99d538620ea395d1cf1a36c47a7735
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 25 07:42:23 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 26 01:50:59 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=041a81dd

egencache: stable use.local.desc mtime for rsync (bug 557192)

Preserve mtime when the md5sum is identical.

X-Gentoo-Bug: 557192
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=557192
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/egencache | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/bin/egencache b/bin/egencache
index 5c00248..4f4c715 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -7,6 +7,7 @@ from __future__ import print_function, unicode_literals
 
 import platform
 import signal
+import stat
 import sys
 # This block ensures that ^C interrupts are handled quietly.
 try:
@@ -487,6 +488,8 @@ class GenUseLocalDesc(object):
 	def run(self):
 		repo_path = self._portdb.porttrees[0]
 		ops = {'<':0, '<=':1, '=':2, '>=':3, '>':4}
+		prev_mtime = None
+		prev_md5 = None
 
 		if self._output is None or self._output != '-':
 			if self._output is None:
@@ -500,6 +503,12 @@ class GenUseLocalDesc(object):
 				desc_path = self._output
 
 			try:
+				prev_md5 = portage.checksum.perform_md5(desc_path)
+				prev_mtime = os.stat(desc_path)[stat.ST_MTIME]
+			except (portage.exception.FileNotFound, OSError):
+				pass
+
+			try:
 				if self._preserve_comments:
 					# Probe in binary mode, in order to avoid
 					# potential character encoding issues.
@@ -651,6 +660,17 @@ class GenUseLocalDesc(object):
 						output.write('%s:%s - %s\n' % (cp, flag, resdesc))
 
 		output.close()
+		if (prev_mtime is not None and
+			prev_md5 == portage.checksum.perform_md5(desc_path)):
+			# Preserve mtime for rsync.
+			mtime = prev_mtime
+		else:
+			# For portability, and consistency with the mtime preservation
+			# code, set mtime to an exact integer value.
+			mtime = int(time.time())
+
+		os.utime(desc_path, (mtime, mtime))
+
 
 if sys.hexversion < 0x3000000:
 	_filename_base = unicode


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-09-28 19:10 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2015-09-28 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     24779b15daef7101111c12de2dd6a6a5c3e374d4
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 27 13:24:49 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 28 19:07:23 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=24779b15

Revert "unpack: avoid useless chmods to improve speed"

This reverts commit 0dc7b2a3923508896cf217f325b8339d73353553.

The "optimized" chmod is no longer recursive, which causes files to be
missed.

X-Gentoo-Bug: 561368
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=561368

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index b446060..efd2cfa 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -531,8 +531,8 @@ unpack() {
 	done
 	# Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
 	# should be preserved.
-	find . -mindepth 1 '!' -type l '!' -perm /a+rX,u+w,g-w,o-w \
-		-exec chmod -f a+rX,u+w,g-w,o-w '{}' +
+	find . -mindepth 1 -maxdepth 1 ! -type l -print0 | \
+		${XARGS} -0 chmod -fR a+rX,u+w,g-w,o-w
 }
 
 econf() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-10-04 21:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-10-04 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     c788a835067c5ffe8859f38078b390f06a223f5d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  3 22:21:01 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  4 21:29:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c788a835

dohtml: handle unicode (bug 561846)

Decode all arguments and listdir results as UTF-8, and return
unsuccessfully if anything fails to decode as UTF-8. Use portage
os and shutil wrappers to encode file names as UTF-8 regardless
of locale.

X-Gentoo-Bug: 561846
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=561846
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/dohtml.py | 47 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 12 deletions(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index 5359f5e..dfcaa60 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -28,13 +28,13 @@
 #  - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS
 #
 
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
 
-import os
-import shutil
+import os as _os
 import sys
 
-from portage.util import normalize_path
+from portage import _unicode_encode, _unicode_decode, os, shutil
+from portage.util import normalize_path, writemsg
 
 # Change back to original cwd _after_ all imports (bug #469338).
 os.chdir(os.environ["__PORTAGE_HELPER_CWD"])
@@ -92,7 +92,13 @@ def install(basename, dirname, options, prefix=""):
 			skipped_files.append(fullpath)
 	elif options.recurse and os.path.isdir(fullpath) and \
 	     basename not in options.disallowed_dirs:
-		for i in os.listdir(fullpath):
+		for i in _os.listdir(_unicode_encode(fullpath)):
+			try:
+				i = _unicode_decode(i, errors='strict')
+			except UnicodeDecodeError:
+				writemsg('dohtml: argument is not encoded as UTF-8: %s\n' %
+					_unicode_decode(i), noiselevel=-1)
+				sys.exit(1)
 			pfx = basename
 			if prefix:
 				pfx = os.path.join(prefix, pfx)
@@ -155,12 +161,29 @@ def print_help():
 	print()
 
 def parse_args():
+	argv = sys.argv[:]
+
+	if sys.hexversion >= 0x3000000:
+		# We can't trust that the filesystem encoding (locale dependent)
+		# correctly matches the arguments, so use surrogateescape to
+		# pass through the original argv bytes for Python 3.
+		fs_encoding = sys.getfilesystemencoding()
+		argv = [x.encode(fs_encoding, 'surrogateescape') for x in argv]
+
+	for x, arg in enumerate(argv):
+		try:
+			argv[x] = _unicode_decode(arg, errors='strict')
+		except UnicodeDecodeError:
+			writemsg('dohtml: argument is not encoded as UTF-8: %s\n' %
+				_unicode_decode(arg), noiselevel=-1)
+			sys.exit(1)
+
 	options = OptionsClass()
 	args = []
 
 	x = 1
-	while x < len(sys.argv):
-		arg = sys.argv[x]
+	while x < len(argv):
+		arg = argv[x]
 		if arg in ["-h","-r","-V"]:
 			if arg == "-h":
 				print_help()
@@ -169,17 +192,17 @@ def parse_args():
 				options.recurse = True
 			elif arg == "-V":
 				options.verbose = True
-		elif sys.argv[x] in ["-A","-a","-f","-x","-p"]:
+		elif argv[x] in ["-A","-a","-f","-x","-p"]:
 			x += 1
-			if x == len(sys.argv):
+			if x == len(argv):
 				print_help()
 				sys.exit(0)
 			elif arg == "-p":
-				options.doc_prefix = sys.argv[x]
+				options.doc_prefix = argv[x]
 				if options.doc_prefix:
 					options.doc_prefix = normalize_path(options.doc_prefix)
 			else:
-				values = sys.argv[x].split(",")
+				values = argv[x].split(",")
 				if arg == "-A":
 					options.allowed_exts.extend(values)
 				elif arg == "-a":
@@ -189,7 +212,7 @@ def parse_args():
 				elif arg == "-x":
 					options.disallowed_dirs = values
 		else:
-			args.append(sys.argv[x])
+			args.append(argv[x])
 		x += 1
 
 	return (options, args)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-11 22:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-11-11 22:43 UTC (permalink / raw
  To: gentoo-commits

commit:     d806eea86c6e2be5b17abeed6e930ea4ab32aeb2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 11 22:43:32 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov 11 22:43:32 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d806eea8

bin/save-ebuild-env.sh: remove bogus __1 function names

In commit 9b19ac5696c487dab58d7c10990fe07fd7f1f731, these bogus __1
values were inserted where unset_colors and set_colors used to be. The
unset_colors and set_colors function have been renamed to have __
prefixes, and they are correctly unset further down.

Fixes: 9b19ac5696c4 ("Convert funcs of isolated-functions.sh to __ prefixed namespace.")

 bin/save-ebuild-env.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 477ed28..17e4cdc 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -51,7 +51,7 @@ __save_ebuild_env() {
 		__dump_trace die \
 		__quiet_mode __vecho __elog_base eqawarn elog \
 		einfo einfon ewarn eerror ebegin __eend eend KV_major \
-		KV_minor KV_micro KV_to_int get_KV __1 __1 has \
+		KV_minor KV_micro KV_to_int get_KV has \
 		__has_phase_defined_up_to \
 		hasv hasq __qa_source __qa_call \
 		addread addwrite adddeny addpredict __sb_append_var \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 18:56 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 18:56 UTC (permalink / raw
  To: gentoo-commits

commit:     fd69b6822c9929d011e2da863b8dad162b803088
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 12 14:59:48 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 18:56:39 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fd69b682

egencache: Delay updating Manifests until all other tasks complete

Since thick Manifests can reference other files (ChangeLogs especially),
their generation should be run as the lask task done by egencache,
followed only by timestamp update.

Fixes: https://bugs.gentoo.org/565626

 bin/egencache | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 76eb00b..a9d4657 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1105,29 +1105,6 @@ def egencache_main(args):
 		else:
 			ret.append(gen_cache.returncode)
 
-	if options.update_manifests:
-
-		cp_iter = None
-		if atoms:
-			cp_iter = iter(atoms)
-
-		event_loop = global_event_loop()
-		scheduler = ManifestScheduler(portdb, cp_iter=cp_iter,
-			gpg_cmd=gpg_cmd, gpg_vars=gpg_vars,
-			force_sign_key=force_sign_key,
-			max_jobs=options.jobs,
-			max_load=options.load_average,
-			event_loop=event_loop)
-
-		signum = run_main_scheduler(scheduler)
-		if signum is not None:
-			sys.exit(128 + signum)
-
-		if options.tolerant:
-			ret.append(os.EX_OK)
-		else:
-			ret.append(scheduler.returncode)
-
 	if options.update_pkg_desc_index:
 		if repo_config.writable:
 			writable_location = repo_config.location
@@ -1167,6 +1144,29 @@ def egencache_main(args):
 			sys.exit(128 + signum)
 		ret.append(gen_clogs.returncode)
 
+	if options.update_manifests:
+
+		cp_iter = None
+		if atoms:
+			cp_iter = iter(atoms)
+
+		event_loop = global_event_loop()
+		scheduler = ManifestScheduler(portdb, cp_iter=cp_iter,
+			gpg_cmd=gpg_cmd, gpg_vars=gpg_vars,
+			force_sign_key=force_sign_key,
+			max_jobs=options.jobs,
+			max_load=options.load_average,
+			event_loop=event_loop)
+
+		signum = run_main_scheduler(scheduler)
+		if signum is not None:
+			sys.exit(128 + signum)
+
+		if options.tolerant:
+			ret.append(os.EX_OK)
+		else:
+			ret.append(scheduler.returncode)
+
 	if options.write_timestamp:
 		timestamp_path = os.path.join(repo_path, 'metadata', 'timestamp.chk')
 		try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 19:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     e3386ff407d0e6df8e3bdc15ed42f9373b88cddb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 16 10:04:46 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 19:32:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e3386ff4

eapply: Update parameter splitting to match the spec

 bin/phase-helpers.sh | 44 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 10 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 0c25ffe..5be71fa 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -997,18 +997,42 @@ if ___eapi_has_eapply; then
 			fi
 		}
 
-		local f patch_options=() failed started_applying options_terminated
-		for f; do
-			if [[ ${f} == -* && -z ${options_terminated} ]]; then
-				if [[ -n ${started_applying} ]]; then
-					die "eapply: options need to be specified before files"
+		local patch_options=() files=()
+		local i found_doublehyphen
+		# first, try to split on --
+		for (( i = 1; i <= ${#@}; ++i )); do
+			if [[ ${@:i:1} == -- ]]; then
+				patch_options=( "${@:1:i-1}" )
+				files=( "${@:i+1}" )
+				found_doublehyphen=1
+				break
+			fi
+		done
+
+		# then, try to split on first non-option
+		if [[ -z ${found_doublehyphen} ]]; then
+			for (( i = 1; i <= ${#@}; ++i )); do
+				if [[ ${@:i:1} != -* ]]; then
+					patch_options=( "${@:1:i-1}" )
+					files=( "${@:i+1}" )
+					break
 				fi
-				if [[ ${f} == -- ]]; then
-					options_terminated=1
-				else
-					patch_options+=( ${f} )
+			done
+
+			# ensure that no options were interspersed with files
+			for i in "${files[@]}"; then
+				if [[ ${i} == -* ]]; then
+					die "eapply: all options must be passed before non-options"
 				fi
-			elif [[ -d ${f} ]]; then
+			fi
+		fi
+
+		if [[ -z ${files[@]} ]]; then
+			die "eapply: no files specified"
+		fi
+
+		for i in "${files[@]}"; do
+			if [[ -d ${f} ]]; then
 				_eapply_get_files() {
 					local LC_ALL=POSIX
 					local prev_shopt=$(shopt -p nullglob)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 19:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     67e06a6eb992e222e67407ac5dd6d729b3f173fd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 16 07:44:33 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 19:32:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=67e06a6e

in_iuse: Make fatal in global scope

Reference: https://archives.gentoo.org/gentoo-pms/message/4a6bb2839e47407fa71cecb19a054375

 bin/ebuild.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 75a9d24..cc6a22f 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -32,6 +32,7 @@ else
 	# `use multislot` is false for the "depend" phase.
 	funcs="use useq usev"
 	___eapi_has_usex && funcs+=" usex"
+	___eapi_has_in_iuse && funcs+=" in_iuse"
 	for x in ${funcs} ; do
 		eval "${x}() {
 			if ___eapi_disallows_helpers_in_global_scope; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 19:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     6413684d6dfa039c01092e5caab15e72ce73d3bd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  9 17:18:40 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 19:32:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6413684d

eapply_user: Make idempotent per changes to EAPI 6

 bin/phase-helpers.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 2fea0b2..511a41a 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1070,6 +1070,10 @@ fi
 
 if ___eapi_has_eapply_user; then
 	eapply_user() {
+		local tagfile=${T}/.portage_user_patches_applied
+		[[ -f ${tagfile} ]] && return
+		>> "${tagfile}"
+
 		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
 
 		local d applied


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 19:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     c9c8f00f8dbfd026b2140df944749aec6e5abba4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 16 10:06:23 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 19:32:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c9c8f00f

eapply: Update default patch arguments

 bin/phase-helpers.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5be71fa..2fea0b2 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -990,7 +990,10 @@ if ___eapi_has_eapply; then
 			# -p1 as a sane default
 			# -f to avoid interactivity
 			# -s to silence progress output
-			patch -p1 -f -s "${patch_options[@]}" < "${f}"
+			# -g0 to guarantee no VCS interaction
+			# --no-backup-if-mismatch not to pollute the sources
+			patch -p1 -f -s -g0 --no-backup-if-mismatch \
+				"${patch_options[@]}" < "${f}"
 			if ! eend ${?}; then
 				__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"
 				failed=1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 19:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     cce284940034987fc45d922dc19d31f699cd46fc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  9 17:42:02 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 19:32:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cce28494

eapply: Order files using POSIX locale

 bin/phase-helpers.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 7e5dbbc..546973e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -982,6 +982,7 @@ fi
 if ___eapi_has_eapply; then
 	eapply() {
 		local failed
+		local -x LC_COLLATE=POSIX
 
 		_eapply_patch() {
 			local f=${1}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 19:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     c7b5c849905a00774bd4957e14b49cfe0e6ceafd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  9 17:39:47 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 19:32:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c7b5c849

eapply: Pass exit status through on non-fatal failures

 bin/phase-helpers.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 511a41a..7e5dbbc 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -981,6 +981,8 @@ fi
 
 if ___eapi_has_eapply; then
 	eapply() {
+		local failed
+
 		_eapply_patch() {
 			local f=${1}
 			local prefix=${2}
@@ -994,9 +996,9 @@ if ___eapi_has_eapply; then
 			# --no-backup-if-mismatch not to pollute the sources
 			patch -p1 -f -s -g0 --no-backup-if-mismatch \
 				"${patch_options[@]}" < "${f}"
-			if ! eend ${?}; then
+			failed=${?}
+			if ! eend "${failed}"; then
 				__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"
-				failed=1
 			fi
 		}
 
@@ -1054,13 +1056,13 @@ if ___eapi_has_eapply; then
 					_eapply_patch "${f2}" '  '
 
 					# in case of nonfatal
-					[[ -n ${failed} ]] && return 1
+					[[ ${failed} -ne 0 ]] && return "${failed}"
 				done
 			else
 				_eapply_patch "${f}"
 
 				# in case of nonfatal
-				[[ -n ${failed} ]] && return 1
+				[[ ${failed} -ne 0 ]] && return "${failed}"
 			fi
 		done
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 21:19 Robin H. Johnson
  0 siblings, 0 replies; 881+ messages in thread
From: Robin H. Johnson @ 2015-11-12 21:19 UTC (permalink / raw
  To: gentoo-commits

commit:     9a1470f569e9f14f3941cb70feefbbd647c3b104
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 11 22:27:15 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 21:17:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9a1470f5

egencache: fix results when GIT_DIR is used in the environment.

If GIT_DIR is used, and .git is outside the root of the checkout, then
--work-tree=... needs to be specified, otherwise any Git command that
relies on relative directories to the root will be wrong.

Also ensure that diff-tree's --relative argument is explicitly told
what path to make the relative output for, rather rely on it being
relative to work-tree.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bin/egencache | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index a9d4657..b44ad11 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -763,6 +763,16 @@ class GenChangeLogs(object):
 		self._changelog_reversed = changelog_reversed
 		self._max_jobs = max_jobs
 		self._max_load = max_load
+		self._repo_path = self._portdb.porttrees[0]
+		# --work-tree=... must be passed to Git if GIT_DIR is used
+		# and GIT_DIR is not a child of the root of the checkout
+		# eg:
+		# GIT_DIR=$parent/work/.git/
+		# work-tree=$parent/staging/
+		# If work-tree is not passed, Git tries to use the shared
+		# parent of the current directory and the $GIT_DIR, which can
+		# be outside the root of the checkout.
+		self._work_tree = '--work-tree=%s' % self._repo_path
 
 	@staticmethod
 	def grab(cmd):
@@ -790,7 +800,7 @@ class GenChangeLogs(object):
 			''' % (cp, time.strftime('%Y'))))
 
 		# now grab all the commits
-		revlist_cmd = ['git', 'rev-list']
+		revlist_cmd = ['git', self._work_tree, 'rev-list']
 		if self._changelog_reversed:
 			revlist_cmd.append('--reverse')
 		revlist_cmd.extend(['HEAD', '--', '.'])
@@ -802,12 +812,17 @@ class GenChangeLogs(object):
 			# --no-renames to avoid getting more complex records on the list
 			# --format to get the timestamp, author and commit description
 			# --root to make it work fine even with the initial commit
-			# --relative to get paths relative to ebuilddir
+			# --relative=$cp to get paths relative to ebuilddir
 			# -r (recursive) to get per-file changes
 			# then the commit-id and path.
 
-			cinfo = self.grab(['git', 'diff-tree', '--name-status', '--no-renames',
-					'--format=%ct %cN <%cE>%n%B', '--root', '--relative', '-r',
+			cinfo = self.grab(['git', self._work_tree, 'diff-tree',
+					'--name-status',
+					'--no-renames',
+					'--format=%ct %cN <%cE>%n%B',
+					'--root',
+					'--relative=%s' % (cp, ),
+					'-r',
 					c, '--', '.']).rstrip('\n').split('\n')
 
 			# Expected output:
@@ -888,8 +903,7 @@ class GenChangeLogs(object):
 		output.close()
 
 	def _task_iter(self):
-		repo_path = self._portdb.porttrees[0]
-		os.chdir(repo_path)
+		os.chdir(self._repo_path)
 
 		if 'git' not in FindVCS():
 			writemsg_level(
@@ -899,10 +913,10 @@ class GenChangeLogs(object):
 			return
 
 		for cp in self._portdb.cp_all():
-			os.chdir(os.path.join(repo_path, cp))
+			os.chdir(os.path.join(self._repo_path, cp))
 			# Determine whether ChangeLog is up-to-date by comparing
 			# the newest commit timestamp with the ChangeLog timestamp.
-			lmod = self.grab(['git', 'log', '--format=%ct', '-1', '.'])
+			lmod = self.grab(['git', self._work_tree, 'log', '--format=%ct', '-1', '.'])
 			if not lmod:
 				# This cp has not been added to the repo.
 				continue


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-12 21:43 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-12 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     00f69aed235e207c15a8fa906b33674fd90bee88
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 12 21:43:34 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 21:43:34 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=00f69aed

bin/phase-helpers: Fix accidental syntax error

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 546973e..b79884f 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1026,11 +1026,11 @@ if ___eapi_has_eapply; then
 			done
 
 			# ensure that no options were interspersed with files
-			for i in "${files[@]}"; then
+			for i in "${files[@]}"; do
 				if [[ ${i} == -* ]]; then
 					die "eapply: all options must be passed before non-options"
 				fi
-			fi
+			done
 		fi
 
 		if [[ -z ${files[@]} ]]; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-13  1:42 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2015-11-13  1:42 UTC (permalink / raw
  To: gentoo-commits

commit:     15cfd145f4d28e34f1901d7630bd6d8cff9d323f
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 11 04:34:22 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 13 01:42:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=15cfd145

ebuild: set up bash compat levels

To try and provide better stability across bash versions,
set the language compat level based on the current EAPI.
This does not ban newer features, it tells bash to use
the older bash behavior when the behavior changes across
versions.

 bin/eapi.sh            |  8 ++++++++
 bin/ebuild.sh          | 42 ++++++++++++++++++++++++++++++++++++++++++
 bin/save-ebuild-env.sh |  2 +-
 3 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 528e6f2..cd3e1a4 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -191,3 +191,11 @@ ___eapi_enables_failglob_in_global_scope() {
 ___eapi_enables_globstar() {
 	[[ ${1-${EAPI-0}} =~ ^(4-python|5-progress)$ ]]
 }
+
+___eapi_bash_3_2() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
+___eapi_bash_4_2() {
+	[[ ${1-${EAPI-0}} =~ ^(6)$ ]]
+}

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index cc6a22f..4319a17 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -6,8 +6,50 @@
 # Make sure it's before everything so we don't mess aliases that follow.
 unalias -a
 
+# Make sure this isn't exported to scripts we execute.
+unset BASH_COMPAT
+
 source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1
 
+# Set up the bash version compatibility level.  This does not disable
+# features when running with a newer version, but makes it so that when
+# bash changes behavior in an incompatible way, the older behavior is
+# used instead.
+__check_bash_version() {
+	# Figure out which min version of bash we require.
+	local maj min
+	if ___eapi_bash_3_2 ; then
+		maj=3 min=2
+	elif ___eapi_bash_4_2 ; then
+		maj=4 min=2
+	else
+		return
+	fi
+
+	# Make sure the active bash is sane.
+	if [[ ${BASH_VERSINFO[0]} -lt ${maj} ]] ||
+	   [[ ${BASH_VERSINFO[0]} -eq ${maj} && ${BASH_VERSINFO[1]} -lt ${min} ]] ; then
+		die ">=bash-${maj}.${min} is required"
+	fi
+
+	# Set the compat level in case things change with newer ones.  We must not
+	# export this into the env otherwise we might break  other shell scripts we
+	# execute (e.g. ones in /usr/bin).
+	BASH_COMPAT="${maj}.${min}"
+
+	# The variable above is new to bash-4.3.  For older versions, we have to use
+	# a compat knob.  Further, the compat knob only exists with older versions
+	# (e.g. bash-4.3 has compat42 but not compat43).  This means we only need to
+	# turn the knob with older EAPIs, and only when running newer bash versions:
+	# there is no bash-3.3 (it went 3.2 to 4.0), and when requiring bash-4.2, the
+	# var works with bash-4.3+, and you don't need to set compat to 4.2 when you
+	# are already running 4.2.
+	if ___eapi_bash_3_2 && [[ ${BASH_VERSINFO[0]} -gt 3 ]] ; then
+		shopt -s compat32
+	fi
+}
+__check_bash_version
+
 if [[ $EBUILD_PHASE != depend ]] ; then
 	source "${PORTAGE_BIN_PATH}/phase-functions.sh" || die
 	source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || die

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 17e4cdc..8036342 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -75,7 +75,7 @@ __save_ebuild_env() {
 		__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \
-		__source_env_files __try_source \
+		__source_env_files __try_source __check_bash_version \
 		__eqaquote __eqatag \
 		${QA_INTERCEPTORS}
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-13  2:55 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2015-11-13  2:55 UTC (permalink / raw
  To: gentoo-commits

commit:     5f713892dd9d4a5d06d6d2994c732b7abb96efd1
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 13 01:50:16 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 13 01:50:16 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5f713892

ebuild: clear __bashpid & __start_distcc from env

These are internal funcs that should not be exported into the env.

 bin/save-ebuild-env.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 8036342..31c2d60 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -76,6 +76,7 @@ __save_ebuild_env() {
 		__ebuild_arg_to_phase __ebuild_phase_funcs default \
 		__unpack_tar __unset_colors \
 		__source_env_files __try_source __check_bash_version \
+		__bashpid __start_distcc \
 		__eqaquote __eqatag \
 		${QA_INTERCEPTORS}
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-13  2:55 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2015-11-13  2:55 UTC (permalink / raw
  To: gentoo-commits

commit:     29f3837382babcac38d4c0e6498620b0dbc6df67
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 13 01:53:20 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 13 01:53:20 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=29f38373

ebuild: unset all funcs/vars that start with ___

Since the __* (two) namespace is reserved, and ___* (three) has rarely
(if ever) been used in ebuilds, we can nuke all funcs/vars that start
with that.  It makes clean up easier for us.

 bin/save-ebuild-env.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 31c2d60..ddef1fd 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -89,7 +89,9 @@ __save_ebuild_env() {
 	___eapi_has_package_manager_build_user && unset -f package_manager_build_user
 	___eapi_has_package_manager_build_group && unset -f package_manager_build_group
 
-	unset -f $(compgen -A function ___eapi_)
+	# Clear out the triple underscore namespace as it is reserved by the PM.
+	unset -f $(compgen -A function ___)
+	unset ${!___*}
 
 	# portage config variables and variables set directly by portage
 	unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-13 17:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-11-13 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     1ac5e7f9b92b33f76cdb1e6e6f7e5bba42f2b496
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 13 07:18:38 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 13 17:52:01 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1ac5e7f9

GenChangeLogs: parallelize remaining git calls, scale linearly (bug 565540)

Move all git calls to the subprocesses, so performance scales linearly
with --jobs.

X-Gentoo-Bug: 565540
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=565540
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/egencache | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index b44ad11..1cc2f3d 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -781,6 +781,23 @@ class GenChangeLogs(object):
 				encoding=_encodings['stdio'], errors='strict')
 
 	def generate_changelog(self, cp):
+
+		os.chdir(os.path.join(self._repo_path, cp))
+		# Determine whether ChangeLog is up-to-date by comparing
+		# the newest commit timestamp with the ChangeLog timestamp.
+		lmod = self.grab(['git', self._work_tree, 'log', '--format=%ct', '-1', '.'])
+		if not lmod:
+			# This cp has not been added to the repo.
+			return
+
+		try:
+			cmod = os.stat('ChangeLog').st_mtime
+		except OSError:
+			cmod = 0
+
+		if float(cmod) >= float(lmod):
+			return
+
 		try:
 			output = io.open(self._changelog_output,
 				mode='w', encoding=_encodings['repo.content'],
@@ -913,21 +930,7 @@ class GenChangeLogs(object):
 			return
 
 		for cp in self._portdb.cp_all():
-			os.chdir(os.path.join(self._repo_path, cp))
-			# Determine whether ChangeLog is up-to-date by comparing
-			# the newest commit timestamp with the ChangeLog timestamp.
-			lmod = self.grab(['git', self._work_tree, 'log', '--format=%ct', '-1', '.'])
-			if not lmod:
-				# This cp has not been added to the repo.
-				continue
-
-			try:
-				cmod = os.stat('ChangeLog').st_mtime
-			except OSError:
-				cmod = 0
-
-			if float(cmod) < float(lmod):
-				yield AsyncFunction(target=self.generate_changelog, args=[cp])
+			yield AsyncFunction(target=self.generate_changelog, args=[cp])
 
 	def run(self):
 		return run_main_scheduler(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-14 22:13 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-14 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     1845331d052783417c7d105b9fa409c35b728dd8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 14 21:41:44 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 14 22:12:55 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1845331d

eapply: Fix off-by-one error when parsing options

Fix off-by-one error that skipped the first path when processing options
without a double-hyphen.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 0f79fc1..afb85da 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1020,7 +1020,7 @@ if ___eapi_has_eapply; then
 			for (( i = 1; i <= ${#@}; ++i )); do
 				if [[ ${@:i:1} != -* ]]; then
 					patch_options=( "${@:1:i-1}" )
-					files=( "${@:i+1}" )
+					files=( "${@:i}" )
 					break
 				fi
 			done


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-14 22:13 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-14 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     a90d8e0ff82f01af1fb629472b2e5f459c624b08
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 14 21:30:30 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 14 22:12:32 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a90d8e0f

eapply: Fix typo

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index b79884f..0f79fc1 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1037,7 +1037,8 @@ if ___eapi_has_eapply; then
 			die "eapply: no files specified"
 		fi
 
-		for i in "${files[@]}"; do
+		local f
+		for f in "${files[@]}"; do
 			if [[ -d ${f} ]]; then
 				_eapply_get_files() {
 					local LC_ALL=POSIX


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-14 22:13 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-14 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     a144739b575c9be9c57afbe3d3ae9a52e9872b57
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 14 21:45:45 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 14 22:13:03 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a144739b

__eapi6_src_prepare: Silence 'declare -p PATCHES' errors

Silence the error message when PATCHES array is not declared.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3e619dc..6c45c25 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -805,7 +805,7 @@ __eapi4_src_install() {
 }
 
 __eapi6_src_prepare() {
-	if [[ $(declare -p PATCHES) == "declare -a"* ]]; then
+	if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
 		eapply "${PATCHES[@]}"
 	elif [[ -n ${PATCHES} ]]; then
 		eapply ${PATCHES}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-14 22:13 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-14 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     05482a79a56aef94f5e49b7215de0d822f7efc54
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 14 18:36:29 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 14 22:12:58 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=05482a79

eapply: Ensure that files are sorted lexically

Ensure that patch files are sorted lexically even when both *.diff
and *.patch files co-exist within a single directory.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index afb85da..3e619dc 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1044,12 +1044,17 @@ if ___eapi_has_eapply; then
 					local LC_ALL=POSIX
 					local prev_shopt=$(shopt -p nullglob)
 					shopt -s nullglob
-					files=( "${f}"/*.{patch,diff} )
+					local f
+					for f in "${1}"/*; do
+						if [[ ${f} == *.diff || ${f} == *.patch ]]; then
+							files+=( "${f}" )
+						fi
+					done
 					${prev_shopt}
 				}
 
-				local files
-				_eapply_get_files
+				local files=()
+				_eapply_get_files "${f}"
 				[[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}"
 
 				einfo "Applying patches from ${f} ..."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-18  5:12 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-18  5:12 UTC (permalink / raw
  To: gentoo-commits

commit:     4a9fb374532ca70035fab163afd24769d01d6bcb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 17 22:20:17 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 17 22:20:17 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a9fb374

EAPI 6: Fail if eapply_user is not called in src_prepare()

 bin/phase-functions.sh | 6 ++++++
 bin/phase-helpers.sh   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 7bf4d63..abbc602 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -374,6 +374,12 @@ __dyn_prepare() {
 	__ebuild_phase pre_src_prepare
 	__vecho ">>> Preparing source in $PWD ..."
 	__ebuild_phase src_prepare
+
+	# keep path in eapply_user in sync!
+	if [[ ! -f ${T}/.portage_user_patches_applied ]]; then
+		die "eapply_user (or default) must be called in src_prepare()!"
+	fi
+
 	>> "$PORTAGE_BUILDDIR/.prepared" || \
 		die "Failed to create $PORTAGE_BUILDDIR/.prepared"
 	__vecho ">>> Source prepared."

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6c45c25..da9aa7c 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1079,6 +1079,7 @@ fi
 
 if ___eapi_has_eapply_user; then
 	eapply_user() {
+		# keep path in __dyn_prepare in sync!
 		local tagfile=${T}/.portage_user_patches_applied
 		[[ -f ${tagfile} ]] && return
 		>> "${tagfile}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-18 16:50 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-11-18 16:50 UTC (permalink / raw
  To: gentoo-commits

commit:     8afd881d6f364a8fd8b71f46602caeda30c5ffe0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 18 16:32:27 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 18 16:32:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8afd881d

src_prepare: Do not expect eapply_user in EAPIs not having it

 bin/phase-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index abbc602..042e242 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -376,7 +376,7 @@ __dyn_prepare() {
 	__ebuild_phase src_prepare
 
 	# keep path in eapply_user in sync!
-	if [[ ! -f ${T}/.portage_user_patches_applied ]]; then
+	if ___eapi_has_eapply_user && [[ ! -f ${T}/.portage_user_patches_applied ]]; then
 		die "eapply_user (or default) must be called in src_prepare()!"
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-18 16:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-11-18 16:57 UTC (permalink / raw
  To: gentoo-commits

commit:     b01522a217a90850fd2a42d304708e468c9d065f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 18 07:59:40 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov 18 16:56:09 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b01522a2

eapply_user: die if current phase is not src_prepare

 bin/phase-helpers.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index da9aa7c..f42f805 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1079,6 +1079,8 @@ fi
 
 if ___eapi_has_eapply_user; then
 	eapply_user() {
+		[[ ${EBUILD_PHASE} == prepare ]] || \
+			die "eapply_user() called during invalid phase: ${EBUILD_PHASE}"
 		# keep path in __dyn_prepare in sync!
 		local tagfile=${T}/.portage_user_patches_applied
 		[[ -f ${tagfile} ]] && return


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-22 20:57 Robin H. Johnson
  0 siblings, 0 replies; 881+ messages in thread
From: Robin H. Johnson @ 2015-11-22 20:57 UTC (permalink / raw
  To: gentoo-commits

commit:     eeeee76cae467df4fe18ee49b9d53bfa2badd671
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  9 07:24:14 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Nov 22 20:57:35 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=eeeee76c

egencache --update-changelogs: Respect GIT_DIR

Allow generating ChangeLogs from external git checkout via using
GIT_DIR, rather than requiring the repository to be git.

Note: zmedico's suggestion to drop the chdir included.

X-URL: https://archives.gentoo.org/gentoo-portage-dev/message/181d99a68918ef659d5947b27c3ff322
X-URL: https://archives.gentoo.org/gentoo-portage-dev/message/24c479a4e994c5d896526a0f65f3db46
Acked-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bin/egencache | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 1cc2f3d..caf6613 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -75,8 +75,6 @@ else:
 	else:
 		from repoman.metadata import parse_metadata_use
 
-from repoman.vcs.vcs import FindVCS
-
 if sys.hexversion >= 0x3000000:
 	# pylint: disable=W0622
 	long = int
@@ -920,9 +918,7 @@ class GenChangeLogs(object):
 		output.close()
 
 	def _task_iter(self):
-		os.chdir(self._repo_path)
-
-		if 'git' not in FindVCS():
+		if not os.path.isdir(os.environ.get('GIT_DIR', os.path.join(repo_path, '.git'))):
 			writemsg_level(
 				"ERROR: --update-changelogs supported only in git repos\n",
 				level=logging.ERROR, noiselevel=-1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-22 21:07 Robin H. Johnson
  0 siblings, 0 replies; 881+ messages in thread
From: Robin H. Johnson @ 2015-11-22 21:07 UTC (permalink / raw
  To: gentoo-commits

commit:     66e11eea194dc4cde56851178234bb7312e3e551
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 22 21:06:24 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Nov 22 21:06:24 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=66e11eea

egencache: Fix correct variable for repo_path.

Copy & paste error :-(.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bin/egencache | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/egencache b/bin/egencache
index caf6613..ab36bbe 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -918,7 +918,7 @@ class GenChangeLogs(object):
 		output.close()
 
 	def _task_iter(self):
-		if not os.path.isdir(os.environ.get('GIT_DIR', os.path.join(repo_path, '.git'))):
+		if not os.path.isdir(os.environ.get('GIT_DIR', os.path.join(self._repo_path, '.git'))):
 			writemsg_level(
 				"ERROR: --update-changelogs supported only in git repos\n",
 				level=logging.ERROR, noiselevel=-1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-24  1:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2015-11-24  1:08 UTC (permalink / raw
  To: gentoo-commits

commit:     dddeca6e4409e2a8a0dedc907d208ce352a48b72
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 24 00:59:37 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 01:05:54 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=dddeca6e

einstalldocs: use lazy docinto calls (bug 566654)

This avoids unnecessary creation of an empty documentation directory.

X-Gentoo-Bug: 566654
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566654

 bin/phase-helpers.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f42f805..80f5946 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -954,26 +954,26 @@ fi
 if ___eapi_has_einstalldocs; then
 	einstalldocs() {
 		(
-			docinto .
 			if ! declare -p DOCS &>/dev/null ; then
 				local d
 				for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
 						THANKS BUGS FAQ CREDITS CHANGELOG ; do
-					[[ -s ${d} ]] && dodoc "${d}"
+					[[ -s ${d} ]] && docinto / && dodoc "${d}"
 				done
 			elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
-				[[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
+				[[ ${DOCS[@]} ]] && docinto / && dodoc -r "${DOCS[@]}"
 			else
-				[[ ${DOCS} ]] && dodoc -r ${DOCS}
+				[[ ${DOCS} ]] && docinto / && dodoc -r ${DOCS}
 			fi
 		)
 
 		(
-			docinto html
 			if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
-				[[ ${HTML_DOCS[@]} ]] && dodoc -r "${HTML_DOCS[@]}"
+				[[ ${HTML_DOCS[@]} ]] && \
+					docinto html && dodoc -r "${HTML_DOCS[@]}"
 			else
-				[[ ${HTML_DOCS} ]] && dodoc -r ${HTML_DOCS}
+				[[ ${HTML_DOCS} ]] && \
+					docinto html && dodoc -r ${HTML_DOCS}
 			fi
 		)
 	}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-11-25 12:51 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-25 12:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b8da04b86fdde6e2137dad51dc5917ef49c91a4a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Nov 25 12:49:19 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Wed Nov 25 12:49:19 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b8da04b8

portageq envvar: Return 1 for any nonexistent variable.

 bin/portageq | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 548d090..925640b 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1,5 +1,5 @@
 #!/usr/bin/python -bO
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function, unicode_literals
@@ -800,15 +800,25 @@ def envvar(argv):
 		print("ERROR: insufficient parameters!")
 		return 2
 
+	exit_status = 0
+
 	for arg in argv:
 		if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
 			print("WARNING: 'portageq envvar %s' is deprecated. Use any of "
 				"'get_repos, get_repo_path, repos_config' instead."
 				% arg, file=sys.stderr)
+
+		value = portage.settings.get(arg)
+		if value is None:
+			value = ""
+			exit_status = 1
+
 		if verbose:
-			print(arg + "=" + portage._shell_quote(portage.settings[arg]))
+			print(arg + "=" + portage._shell_quote(value))
 		else:
-			print(portage.settings[arg])
+			print(value)
+
+	return exit_status
 
 docstrings['envvar'] = """<variable>+
 	Returns a specific environment variable as exists prior to ebuild.sh.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-01  0:27 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-01  0:27 UTC (permalink / raw
  To: gentoo-commits

commit:     4f25fa69e4a57785163345b1f4cace62daad5fea
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec  1 00:27:04 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec  1 00:27:04 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4f25fa69

ebuild: Move imports to the top.

 bin/ebuild | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index ed1231f..1f99177 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -8,6 +8,8 @@ import argparse
 import platform
 import signal
 import sys
+import textwrap
+
 # This block ensures that ^C interrupts are handled quietly.
 try:
 
@@ -49,7 +51,9 @@ from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
 from portage.const import VDB_PATH
-from portage.exception import PortageKeyError
+from portage.exception import PermissionDenied, PortageKeyError, \
+	PortagePackageException, UnsupportedAPIException
+import portage.util
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
@@ -96,8 +100,6 @@ if not opts.ignore_default_opts:
 debug = opts.debug
 force = opts.force
 
-import portage.util, portage.const
-
 # do this _after_ 'import portage' to prevent unnecessary tracing
 if debug and "python-trace" in portage.features:
 	import portage.debug
@@ -305,8 +307,7 @@ def stale_env_warning():
 			msg = ("Existing ${T}/environment for '%s' will be sourced. " + \
 				"Run 'clean' to start with a fresh environment.") % \
 				(tmpsettings["PF"], )
-			from textwrap import wrap
-			msg = wrap(msg, 70)
+			msg = textwrap.wrap(msg, 70)
 			for x in msg:
 				portage.writemsg(">>> %s\n" % x)
 
@@ -314,9 +315,6 @@ def stale_env_warning():
 				open(os.path.join(tmpsettings['PORTAGE_BUILDDIR'],
 					'.ebuild_changed'), 'w').close()
 
-from portage.exception import PermissionDenied, \
-	PortagePackageException, UnsupportedAPIException
-
 if 'digest' in tmpsettings.features:
 	if pargs and pargs[0] not in ("digest", "manifest"):
 		pargs = ['digest'] + pargs
@@ -345,8 +343,7 @@ for arg in pargs:
 		# aux_get error
 		a = 1
 	except UnsupportedAPIException as e:
-		from textwrap import wrap
-		msg = wrap(str(e), 70)
+		msg = textwrap.wrap(str(e), 70)
 		del e
 		for x in msg:
 			portage.writemsg("!!! %s\n" % x, noiselevel=-1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-08  7:23 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-08  7:23 UTC (permalink / raw
  To: gentoo-commits

commit:     3917544bf2cc438b571effd00df8545d51736ffc
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec  8 07:20:07 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec  8 07:20:07 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3917544b

bin/socks5-server.py: Fix DeprecationWarning with Python >=3.4.4.

asyncio.async() is deprecated in favor of asyncio.ensure_future().

 bin/socks5-server.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index 71e6b01..cfe3ece 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -10,6 +10,13 @@ import socket
 import struct
 import sys
 
+if hasattr(asyncio, 'ensure_future'):
+	# Python >=3.4.4.
+	asyncio_ensure_future = asyncio.ensure_future
+else:
+	# getattr() necessary because async is a keyword in Python >=3.7.
+	asyncio_ensure_future = getattr(asyncio, 'async')
+
 
 class Socks5Server(object):
 	"""
@@ -141,7 +148,7 @@ class Socks5Server(object):
 
 			# otherwise, start two loops:
 			# remote -> local...
-			t = asyncio.async(self.handle_proxied_conn(
+			t = asyncio_ensure_future(self.handle_proxied_conn(
 					proxied_reader, writer, asyncio.Task.current_task()))
 
 			# and local -> remote...


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-08 10:32 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-08 10:32 UTC (permalink / raw
  To: gentoo-commits

commit:     9e104c424ef08d543546eb4ae54724af97d11c0e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec  8 10:28:20 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec  8 10:28:20 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e104c42

ebuild: Set PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY.

 bin/ebuild | 38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 1f99177..2c42771 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -50,7 +50,7 @@ from portage import _encodings
 from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
-from portage.const import VDB_PATH
+from portage.const import REPO_NAME_LOC, VDB_PATH
 from portage.exception import PermissionDenied, PortageKeyError, \
 	PortagePackageException, UnsupportedAPIException
 import portage.util
@@ -146,27 +146,23 @@ ebuild_portdir = os.path.realpath(
 ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
 vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 
-# Make sure that portdb.findname() returns the correct ebuild.
-if ebuild_portdir != vdb_path and \
-	ebuild_portdir not in portage.portdb.porttrees:
-	portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "")
-	if sys.hexversion >= 0x3000000:
-		os.environ["PORTDIR_OVERLAY"] = \
-			portdir_overlay + \
-			" " + _shell_quote(ebuild_portdir)
-	else:
-		os.environ["PORTDIR_OVERLAY"] = \
-			_unicode_encode(portdir_overlay,
-			encoding=_encodings['content'], errors='strict') + \
-			" " + _unicode_encode(_shell_quote(ebuild_portdir),
-			encoding=_encodings['content'], errors='strict')
-
-	print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir)
-	portage._reset_legacy_globals()
-
 myrepo = None
 if ebuild_portdir != vdb_path:
-	myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
+	myrepo = portage.repository.config._read_repo_name(ebuild_portdir)
+	if myrepo is None:
+		err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" %
+			(ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf")))
+
+	# Make sure that portdb.findname() returns the correct ebuild.
+	if ebuild_portdir not in portage.portdb.porttrees:
+		print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir))
+		tmp_conf_file = io.StringIO(textwrap.dedent("""
+			[%s]
+			location = %s
+			""" % (myrepo, ebuild_portdir)))
+		repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file])
+		os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string()
+		portage._reset_legacy_globals()
 
 if not os.path.exists(ebuild):
 	err('%s: does not exist' % (ebuild,))
@@ -198,7 +194,7 @@ else:
 	portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
 
 	if not portage_ebuild or portage_ebuild != ebuild:
-		err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,))
+		err('%s: Invalid structure of repository' % (ebuild,))
 
 if len(pargs) > 1 and "config" in pargs:
 	other_phases = set(pargs)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-08 20:57 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 881+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-08 20:57 UTC (permalink / raw
  To: gentoo-commits

commit:     fb4d1f4ff710c7d7c848cf5ed4a7232bc1dd1e19
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec  8 20:56:17 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec  8 20:56:17 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fb4d1f4f

ebuild: Rename some variables.

 bin/ebuild | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 2c42771..1afad25 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -141,25 +141,25 @@ if not os.path.isabs(ebuild):
 ebuild = portage.normalize_path(ebuild)
 # portdbapi uses the canonical path for the base of the portage tree, but
 # subdirectories of the base can be built from symlinks (like crossdev does).
-ebuild_portdir = os.path.realpath(
+repo_location = os.path.realpath(
 	os.path.dirname(os.path.dirname(os.path.dirname(ebuild))))
-ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
+ebuild = os.path.join(repo_location, *ebuild.split(os.path.sep)[-3:])
 vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 
-myrepo = None
-if ebuild_portdir != vdb_path:
-	myrepo = portage.repository.config._read_repo_name(ebuild_portdir)
-	if myrepo is None:
+repo_name = None
+if repo_location != vdb_path:
+	repo_name = portage.repository.config._read_repo_name(repo_location)
+	if repo_name is None:
 		err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" %
-			(ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf")))
+			(repo_location, os.path.join(repo_location, REPO_NAME_LOC), os.path.join(repo_location, "metadata", "layout.conf")))
 
 	# Make sure that portdb.findname() returns the correct ebuild.
-	if ebuild_portdir not in portage.portdb.porttrees:
-		print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir))
+	if repo_location not in portage.portdb.porttrees:
+		print("Appending repository '%s' located in '%s' to configuration of repositories" % (repo_name, repo_location))
 		tmp_conf_file = io.StringIO(textwrap.dedent("""
 			[%s]
 			location = %s
-			""" % (myrepo, ebuild_portdir)))
+			""" % (repo_name, repo_location)))
 		repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file])
 		os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string()
 		portage._reset_legacy_globals()
@@ -182,7 +182,7 @@ if ebuild.startswith(vdb_path):
 	mytree = "vartree"
 	pkg_type = "installed"
 
-	portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
+	portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=repo_name)
 
 	if os.path.realpath(portage_ebuild) != ebuild:
 		err('Portage seems to think that %s is at %s' % (cpv, portage_ebuild))
@@ -191,7 +191,7 @@ else:
 	mytree = "porttree"
 	pkg_type = "ebuild"
 
-	portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
+	portage_ebuild = portage.portdb.findname(cpv, myrepo=repo_name)
 
 	if not portage_ebuild or portage_ebuild != ebuild:
 		err('%s: Invalid structure of repository' % (ebuild,))
@@ -238,7 +238,7 @@ build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
 ebuild_changed = False
 if mytree == "porttree" and build_dir_phases.intersection(pargs):
 	ebuild_changed = \
-		portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None
+		portage.portdb._pull_valid_cache(cpv, ebuild, repo_location)[0] is None
 
 tmpsettings = portage.config(clone=portage.settings)
 tmpsettings["PORTAGE_VERBOSE"] = "1"
@@ -271,7 +271,7 @@ if "merge" in pargs and "noauto" in tmpsettings.features:
 try:
 	metadata = dict(zip(Package.metadata_keys,
 		portage.db[portage.settings['EROOT']][mytree].dbapi.aux_get(
-		cpv, Package.metadata_keys, myrepo=myrepo)))
+		cpv, Package.metadata_keys, myrepo=repo_name)))
 except PortageKeyError:
 	# aux_get failure, message should have been shown on stderr.
 	sys.exit(1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-13 12:57 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-12-13 12:57 UTC (permalink / raw
  To: gentoo-commits

commit:     1cb9b4edd13d8958ea6efa1cb2ee34482266aaea
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 12 15:31:31 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 07:33:29 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1cb9b4ed

Revert "ebuild: Set PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY."

This reverts commit 9e104c424ef08d543546eb4ae54724af97d11c0e. This was
unreviewed and the PORTAGE_REPOSITORIES design is at least
controversial.

 bin/ebuild | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 2c42771..1f99177 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -50,7 +50,7 @@ from portage import _encodings
 from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
-from portage.const import REPO_NAME_LOC, VDB_PATH
+from portage.const import VDB_PATH
 from portage.exception import PermissionDenied, PortageKeyError, \
 	PortagePackageException, UnsupportedAPIException
 import portage.util
@@ -146,23 +146,27 @@ ebuild_portdir = os.path.realpath(
 ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
 vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 
+# Make sure that portdb.findname() returns the correct ebuild.
+if ebuild_portdir != vdb_path and \
+	ebuild_portdir not in portage.portdb.porttrees:
+	portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "")
+	if sys.hexversion >= 0x3000000:
+		os.environ["PORTDIR_OVERLAY"] = \
+			portdir_overlay + \
+			" " + _shell_quote(ebuild_portdir)
+	else:
+		os.environ["PORTDIR_OVERLAY"] = \
+			_unicode_encode(portdir_overlay,
+			encoding=_encodings['content'], errors='strict') + \
+			" " + _unicode_encode(_shell_quote(ebuild_portdir),
+			encoding=_encodings['content'], errors='strict')
+
+	print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir)
+	portage._reset_legacy_globals()
+
 myrepo = None
 if ebuild_portdir != vdb_path:
-	myrepo = portage.repository.config._read_repo_name(ebuild_portdir)
-	if myrepo is None:
-		err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" %
-			(ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf")))
-
-	# Make sure that portdb.findname() returns the correct ebuild.
-	if ebuild_portdir not in portage.portdb.porttrees:
-		print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir))
-		tmp_conf_file = io.StringIO(textwrap.dedent("""
-			[%s]
-			location = %s
-			""" % (myrepo, ebuild_portdir)))
-		repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file])
-		os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string()
-		portage._reset_legacy_globals()
+	myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
 
 if not os.path.exists(ebuild):
 	err('%s: does not exist' % (ebuild,))
@@ -194,7 +198,7 @@ else:
 	portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
 
 	if not portage_ebuild or portage_ebuild != ebuild:
-		err('%s: Invalid structure of repository' % (ebuild,))
+		err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,))
 
 if len(pargs) > 1 and "config" in pargs:
 	other_phases = set(pargs)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-13 12:57 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-12-13 12:57 UTC (permalink / raw
  To: gentoo-commits

commit:     a696a7f98c4945bc9d70313484b39d2e67cd2ba4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 12 15:30:36 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 07:33:29 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a696a7f9

Revert "ebuild: Rename some variables."

This reverts commit fb4d1f4ff710c7d7c848cf5ed4a7232bc1dd1e19. The revert
is necessary to make it possible to sanely revert 9e104c4 ("ebuild: Set
PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY.")

 bin/ebuild | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 1afad25..2c42771 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -141,25 +141,25 @@ if not os.path.isabs(ebuild):
 ebuild = portage.normalize_path(ebuild)
 # portdbapi uses the canonical path for the base of the portage tree, but
 # subdirectories of the base can be built from symlinks (like crossdev does).
-repo_location = os.path.realpath(
+ebuild_portdir = os.path.realpath(
 	os.path.dirname(os.path.dirname(os.path.dirname(ebuild))))
-ebuild = os.path.join(repo_location, *ebuild.split(os.path.sep)[-3:])
+ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
 vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 
-repo_name = None
-if repo_location != vdb_path:
-	repo_name = portage.repository.config._read_repo_name(repo_location)
-	if repo_name is None:
+myrepo = None
+if ebuild_portdir != vdb_path:
+	myrepo = portage.repository.config._read_repo_name(ebuild_portdir)
+	if myrepo is None:
 		err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" %
-			(repo_location, os.path.join(repo_location, REPO_NAME_LOC), os.path.join(repo_location, "metadata", "layout.conf")))
+			(ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf")))
 
 	# Make sure that portdb.findname() returns the correct ebuild.
-	if repo_location not in portage.portdb.porttrees:
-		print("Appending repository '%s' located in '%s' to configuration of repositories" % (repo_name, repo_location))
+	if ebuild_portdir not in portage.portdb.porttrees:
+		print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir))
 		tmp_conf_file = io.StringIO(textwrap.dedent("""
 			[%s]
 			location = %s
-			""" % (repo_name, repo_location)))
+			""" % (myrepo, ebuild_portdir)))
 		repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file])
 		os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string()
 		portage._reset_legacy_globals()
@@ -182,7 +182,7 @@ if ebuild.startswith(vdb_path):
 	mytree = "vartree"
 	pkg_type = "installed"
 
-	portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=repo_name)
+	portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
 
 	if os.path.realpath(portage_ebuild) != ebuild:
 		err('Portage seems to think that %s is at %s' % (cpv, portage_ebuild))
@@ -191,7 +191,7 @@ else:
 	mytree = "porttree"
 	pkg_type = "ebuild"
 
-	portage_ebuild = portage.portdb.findname(cpv, myrepo=repo_name)
+	portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
 
 	if not portage_ebuild or portage_ebuild != ebuild:
 		err('%s: Invalid structure of repository' % (ebuild,))
@@ -238,7 +238,7 @@ build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
 ebuild_changed = False
 if mytree == "porttree" and build_dir_phases.intersection(pargs):
 	ebuild_changed = \
-		portage.portdb._pull_valid_cache(cpv, ebuild, repo_location)[0] is None
+		portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None
 
 tmpsettings = portage.config(clone=portage.settings)
 tmpsettings["PORTAGE_VERBOSE"] = "1"
@@ -271,7 +271,7 @@ if "merge" in pargs and "noauto" in tmpsettings.features:
 try:
 	metadata = dict(zip(Package.metadata_keys,
 		portage.db[portage.settings['EROOT']][mytree].dbapi.aux_get(
-		cpv, Package.metadata_keys, myrepo=repo_name)))
+		cpv, Package.metadata_keys, myrepo=myrepo)))
 except PortageKeyError:
 	# aux_get failure, message should have been shown on stderr.
 	sys.exit(1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2015-12-20 17:37 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2015-12-20 17:37 UTC (permalink / raw
  To: gentoo-commits

commit:     5ac36c898da7ad5924d976adfc8b002c0fd378d2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  6 19:46:13 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 20 17:37:00 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ac36c89

Move QA_PREBUILT handling into src_install()

Delay QA_PREBUILT handling until src_install(), to allow setting it in
phase function like pkg_setup(). This shouldn't cause any issues since
the resulting variables are not used before install.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh          | 25 -------------------------
 bin/phase-functions.sh | 27 +++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 4319a17..f1586b2 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -704,31 +704,6 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 
 				[[ -n $CCACHE_SIZE ]] && ccache -M $CCACHE_SIZE &> /dev/null
 			fi
-
-			if [[ -n $QA_PREBUILT ]] ; then
-
-				# these ones support fnmatch patterns
-				QA_EXECSTACK+=" $QA_PREBUILT"
-				QA_TEXTRELS+=" $QA_PREBUILT"
-				QA_WX_LOAD+=" $QA_PREBUILT"
-
-				# these ones support regular expressions, so translate
-				# fnmatch patterns to regular expressions
-				for x in QA_DT_NEEDED QA_FLAGS_IGNORED QA_PRESTRIPPED QA_SONAME ; do
-					if [[ $(declare -p $x 2>/dev/null) = declare\ -a* ]] ; then
-						eval "$x=(\"\${$x[@]}\" ${QA_PREBUILT//\*/.*})"
-					else
-						eval "$x+=\" ${QA_PREBUILT//\*/.*}\""
-					fi
-				done
-
-				unset x
-			fi
-
-			# This needs to be exported since prepstrip is a separate shell script.
-			[[ -n $QA_PRESTRIPPED ]] && export QA_PRESTRIPPED
-			eval "[[ -n \$QA_PRESTRIPPED_${ARCH/-/_} ]] && \
-				export QA_PRESTRIPPED_${ARCH/-/_}"
 		fi
 	fi
 fi

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 042e242..0b853bf 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -524,6 +524,33 @@ __dyn_install() {
 	trap "__abort_install" SIGINT SIGQUIT
 	__start_distcc
 
+	# Handle setting QA_* based on QA_PREBUILT
+	# Those variables shouldn't be needed before src_install()
+	# (QA_PRESTRIPPED is used in prepstrip, others in install-qa-checks)
+	# and delay in setting them allows us to set them in pkg_setup()
+	if [[ -n $QA_PREBUILT ]] ; then
+		# these ones support fnmatch patterns
+		QA_EXECSTACK+=" $QA_PREBUILT"
+		QA_TEXTRELS+=" $QA_PREBUILT"
+		QA_WX_LOAD+=" $QA_PREBUILT"
+
+		# these ones support regular expressions, so translate
+		# fnmatch patterns to regular expressions
+		for x in QA_DT_NEEDED QA_FLAGS_IGNORED QA_PRESTRIPPED QA_SONAME ; do
+			if [[ $(declare -p $x 2>/dev/null) = declare\ -a* ]] ; then
+				eval "$x=(\"\${$x[@]}\" ${QA_PREBUILT//\*/.*})"
+			else
+				eval "$x+=\" ${QA_PREBUILT//\*/.*}\""
+			fi
+		done
+
+		unset x
+	fi
+	# This needs to be exported since prepstrip is a separate shell script.
+	[[ -n $QA_PRESTRIPPED ]] && export QA_PRESTRIPPED
+	eval "[[ -n \$QA_PRESTRIPPED_${ARCH/-/_} ]] && \
+		export QA_PRESTRIPPED_${ARCH/-/_}"
+
 	__ebuild_phase pre_src_install
 
 	if ___eapi_has_prefix_variables; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-01-02  5:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-01-02  5:18 UTC (permalink / raw
  To: gentoo-commits

commit:     f9d1791dbb8f61e836d1b453258502d800776bf2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  2 04:59:07 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan  2 04:59:28 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f9d1791d

INSTALL_MASK: enable matching of broken symlinks (bug 570530)

Since commit 5a1b870fe54ac06f864a648c3ea5cc118f6ce911, INSTALL_MASK
does not match broken symlinks. Fix it to do so.

Fixes: 5a1b870fe54a ("MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK")
X-Gentoo-Bug: 570530
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=570530

 bin/misc-functions.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c2ff70a..15651b9 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -275,7 +275,8 @@ install_mask() {
 
 		# The standard case where $no_inst is something that
 		# the shell could expand on its own.
-		if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo "${root}"/${no_inst}) ]] ; then
+		if [[ -e "${root}"/${no_inst} || -L "${root}"/${no_inst} ||
+			"${root}"/${no_inst} != $(echo "${root}"/${no_inst}) ]] ; then
 			__quiet_mode || einfo "Removing ${no_inst}"
 			rm -Rf "${root}"/${no_inst} >&/dev/null
 		fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-01-15 13:43 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2016-01-15 13:43 UTC (permalink / raw
  To: gentoo-commits

commit:     3767128cf08a0a21559eb9c41ba393dcabc6f087
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 27 22:36:45 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 15 13:43:16 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3767128c

Print WORKDIR & D sizes in build logs

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/phase-functions.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 0b853bf..6a47fed 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -593,6 +593,15 @@ __dyn_install() {
 	__vecho
 	__ebuild_phase post_src_install
 
+	# record build & installed size in build log
+	if type -P du &>/dev/null; then
+		local sz=( $(du -ks "${WORKDIR}") )
+		einfo "Final size of build directory: ${sz[0]} KiB"
+		sz=( $(du -ks "${D}") )
+		einfo "Final size of installed tree: ${sz[0]} KiB"
+		__vecho
+	fi
+
 	cd "${PORTAGE_BUILDDIR}"/build-info
 	set -f
 	local f x


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-01-28 12:10 Alexander Berntsen
  2016-01-29 11:17 ` Alexander Berntsen
  0 siblings, 1 reply; 881+ messages in thread
From: Alexander Berntsen @ 2016-01-28 12:10 UTC (permalink / raw
  To: gentoo-commits

commit:     f0ce7366b137119f087974d52ae807940e74ed56
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 21:05:51 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 12:08:36 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0ce7366

isolated-functions.sh: Output error message for nofatal die.

X-Gentoo-Bug:     573056
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573056

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Brian Dolbec       <dolsen <AT> gentoo.org>

 bin/isolated-functions.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5766921..e320f71 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -124,10 +124,11 @@ die() {
 	set +x # tracing only produces useless noise here
 	local IFS=$' \t\n'
 
-	if ___eapi_die_can_respect_nonfatal; then
-		if [[ ${1} == -n ]]; then
-			[[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
-			shift
+	if ___eapi_die_can_respect_nonfatal && [[ $1 == -n ]]; then
+		shift
+		if [[ ${PORTAGE_NONFATAL} == 1 ]]; then
+			[[ $# -gt 0 ]] && eerror "$*"
+			return 1
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
  2016-01-28 12:10 Alexander Berntsen
@ 2016-01-29 11:17 ` Alexander Berntsen
  0 siblings, 0 replies; 881+ messages in thread
From: Alexander Berntsen @ 2016-01-29 11:17 UTC (permalink / raw
  To: gentoo-commits

commit:     f0ce7366b137119f087974d52ae807940e74ed56
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 21:05:51 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 12:08:36 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0ce7366

isolated-functions.sh: Output error message for nofatal die.

X-Gentoo-Bug:     573056
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573056

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Brian Dolbec       <dolsen <AT> gentoo.org>

 bin/isolated-functions.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5766921..e320f71 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -124,10 +124,11 @@ die() {
 	set +x # tracing only produces useless noise here
 	local IFS=$' \t\n'
 
-	if ___eapi_die_can_respect_nonfatal; then
-		if [[ ${1} == -n ]]; then
-			[[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
-			shift
+	if ___eapi_die_can_respect_nonfatal && [[ $1 == -n ]]; then
+		shift
+		if [[ ${PORTAGE_NONFATAL} == 1 ]]; then
+			[[ $# -gt 0 ]] && eerror "$*"
+			return 1
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-01-29 23:04 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2016-01-29 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     34dd17d154a4769c30a278f6bc407e8cb27706e9
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 21:05:51 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 23:03:17 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=34dd17d1

isolated-functions.sh: Output error message for nofatal die.

X-Gentoo-Bug:     573056
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573056

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Brian Dolbec       <dolsen <AT> gentoo.org>

 bin/isolated-functions.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5766921..e320f71 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -124,10 +124,11 @@ die() {
 	set +x # tracing only produces useless noise here
 	local IFS=$' \t\n'
 
-	if ___eapi_die_can_respect_nonfatal; then
-		if [[ ${1} == -n ]]; then
-			[[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
-			shift
+	if ___eapi_die_can_respect_nonfatal && [[ $1 == -n ]]; then
+		shift
+		if [[ ${PORTAGE_NONFATAL} == 1 ]]; then
+			[[ $# -gt 0 ]] && eerror "$*"
+			return 1
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-02-24 21:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-02-24 21:40 UTC (permalink / raw
  To: gentoo-commits

commit:     a95a27fdf101188e41a6e803f664610f9826925a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 24 21:31:19 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 24 21:39:09 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a95a27fd

bin/*-functions.sh: remove unnecessary sleep loops

Fixes: 46cafb3996d8 ("Remove all \a (alert/bell/beep) tokens (bug 336024)")

 bin/misc-functions.sh  | 2 +-
 bin/phase-functions.sh | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 15651b9..58755a1 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -396,7 +396,7 @@ preinst_suid_scan() {
 					__vecho "- ${install_path} is an approved suid file"
 				else
 					__vecho ">>> Removing sbit on non registered ${install_path}"
-					for x in 5 4 3 2 1 0; do sleep 0.25 ; done
+					LC_ALL=C sleep 1.5
 					ls_ret=$(ls -ldh "${i}")
 					chmod ugo-s "${i}"
 					grep "^#${install_path}$" "${sfconf}" > /dev/null || {

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 6a47fed..d75f43f 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -985,12 +985,7 @@ __ebuild_main() {
 					"You have 5 seconds to abort..."
 				echo
 
-				local x
-				for x in 1 2 3 4 5 6 7 8; do
-					LC_ALL=C sleep 0.25
-				done
-
-				sleep 3
+				sleep 5
 			fi
 
 			cd "$PORTAGE_BUILDDIR"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-03-06  2:11 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2016-03-06  2:11 UTC (permalink / raw
  To: gentoo-commits

commit:     5789c1c2d923692f221a17dcfb6a13dcd188d6f1
Author:     Göktürk Yüksek <gokturk <AT> binghamton <DOT> edu>
AuthorDate: Sat Mar  5 06:39:11 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Mar  6 02:08:34 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5789c1c2

bin/portageq: add a matcher to match the orphaned (maintainer-needed) packages

Per GLEP 67, orphaned packages do not have a <maintainer> in metadata.xml.
They can't be matched using '--maintainer-email=maintainer-needed <AT> gentoo.org'
anymore. Add a new command line argument '--orphaned' to match the orphaned
packages.

Signed-off-by: Göktürk Yüksek <gokturk <AT> binghamton.edu>
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/portageq | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/bin/portageq b/bin/portageq
index 925640b..803e26b 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1028,6 +1028,12 @@ class HerdMatcher(object):
 		herds = self._herds
 		return any(x in herds for x in metadata_xml.herds())
 
+# Match if metadata.xml contains no maintainer (orphaned package)
+def match_orphaned(metadata_xml):
+	if not metadata_xml.maintainers():
+		return True
+	else:
+		return False
 
 def pquery(parser, opts, args):
 	portdb = portage.db[portage.root]['porttree'].dbapi
@@ -1090,6 +1096,8 @@ def pquery(parser, opts, args):
 		for x in opts.herd:
 			herds.extend(x.split(","))
 		xml_matchers.append(HerdMatcher(herds))
+	if opts.orphaned:
+		xml_matchers.append(match_orphaned)
 
 	if opts.repo is not None:
 		repos = [portdb.repositories[opts.repo]]
@@ -1248,6 +1256,11 @@ def add_pquery_arguments(parser):
 					"longopt": "--maintainer-email",
 					"action": "append",
 					"help": "comma-separated list of maintainer email regexes to search for"
+				},
+				{
+					"longopt": "--orphaned",
+					"action": "store_true",
+					"help": "match only orphaned (maintainer-needed) packages"
 				}
 			)
 		),


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-03-06 18:05 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2016-03-06 18:05 UTC (permalink / raw
  To: gentoo-commits

commit:     24a33ede401d6d08a8e357eb1efaafb7158f3584
Author:     Göktürk Yüksek <gokturk <AT> binghamton <DOT> edu>
AuthorDate: Sun Mar  6 16:04:42 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Mar  6 17:56:42 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=24a33ede

bin/portageq: add 'match_orphaned' to the non_commands list

Reported-By: Coacher
Signed-off-by: Göktürk Yüksek <gokturk <AT> binghamton.edu>

 bin/portageq | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/portageq b/bin/portageq
index 803e26b..44eea2b 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1223,7 +1223,7 @@ pquery.__doc__ = docstrings['pquery']
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage', 'uses_eroot'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'match_orphaned', 'main', 'usage', 'uses_eroot'])
 commands = sorted(k for k, v in globals().items() \
 	if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-03-06 18:05 Brian Dolbec
  0 siblings, 0 replies; 881+ messages in thread
From: Brian Dolbec @ 2016-03-06 18:05 UTC (permalink / raw
  To: gentoo-commits

commit:     062684bf8febc88891fa7611e99712e2b67ddbc8
Author:     Göktürk Yüksek <gokturk <AT> binghamton <DOT> edu>
AuthorDate: Sun Mar  6 09:16:56 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Mar  6 17:57:05 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=062684bf

bin/portageq: remove the herd matcher per GLEP 67

Herds are obsolete per GLEP 67. Projects can be matched using
the project's email address just like any other maintainer.

Signed-off-by: Göktürk Yüksek <gokturk <AT> binghamton.edu>

 bin/portageq | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 44eea2b..07d3c49 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1020,14 +1020,6 @@ class MaintainerEmailMatcher(object):
 				break
 		return match
 
-class HerdMatcher(object):
-	def __init__(self, herds):
-		self._herds = frozenset(herds)
-
-	def __call__(self, metadata_xml):
-		herds = self._herds
-		return any(x in herds for x in metadata_xml.herds())
-
 # Match if metadata.xml contains no maintainer (orphaned package)
 def match_orphaned(metadata_xml):
 	if not metadata_xml.maintainers():
@@ -1091,11 +1083,6 @@ def pquery(parser, opts, args):
 		for x in opts.maintainer_email:
 			maintainer_emails.extend(x.split(","))
 		xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
-	if opts.herd is not None:
-		herds  = []
-		for x in opts.herd:
-			herds.extend(x.split(","))
-		xml_matchers.append(HerdMatcher(herds))
 	if opts.orphaned:
 		xml_matchers.append(match_orphaned)
 
@@ -1248,11 +1235,6 @@ def add_pquery_arguments(parser):
 			'Package matching options',
 			(
 				{
-					"longopt": "--herd",
-					"action": "append",
-					"help": "exact match on a herd"
-				},
-				{
 					"longopt": "--maintainer-email",
 					"action": "append",
 					"help": "comma-separated list of maintainer email regexes to search for"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-03-08 22:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-03-08 22:52 UTC (permalink / raw
  To: gentoo-commits

commit:     b71bd1001468d367e55d3e581e43ef3c0630f2e5
Author:     Jason A. Donenfeld <Jason <AT> zx2c4 <DOT> com>
AuthorDate: Mon Mar  7 13:06:29 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  8 22:50:29 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b71bd100

eapply_user: allow empty directories (bug 573920)

Without this, an empty directory in
/etc/portage/patches/$cat/$pkg will result in an fatal error.

X-Gentoo-Bug:     573920
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573920
Signed-off-by:    Jason A. Donenfeld <Jason <AT> zx2c4.com>

 bin/phase-helpers.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 80f5946..1a9ee7b 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1089,6 +1089,9 @@ if ___eapi_has_eapply_user; then
 		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
 
 		local d applied
+		local prev_shopt=$(shopt -p nullglob)
+		shopt -s nullglob
+
 		# possibilities:
 		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
 		#    ${P} twice)
@@ -1096,12 +1099,14 @@ if ___eapi_has_eapply_user; then
 		# 3. ${CATEGORY}/${PN}
 		# all of the above may be optionally followed by a slot
 		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
-			if [[ -d ${d} ]]; then
+			if [[ -n $(echo "${d}"/*.diff) || -n $(echo "${d}"/*.patch) ]]; then
 				eapply "${d}"
 				applied=1
 			fi
 		done
 
+		${prev_shopt}
+
 		[[ -n ${applied} ]] && ewarn "User patches applied."
 	}
 fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-03-12 18:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-03-12 18:47 UTC (permalink / raw
  To: gentoo-commits

commit:     4ec443f2ac57040304107720f24cad6b4651c7a4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 12 07:50:31 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 12 18:42:57 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4ec443f2

egencache --write-timestamp: use write_atomic (bug 577126)

Use write_atomic in order to create a new inode. This leads to
copy-on-write behavior with hardlinks, which is useful if someone
wants to use hardlinks to create copy-on-write repository
snapshots on a filesystem such as ext4 (no need for btrfs or zfs).

X-Gentoo-bug: 577126
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=577126
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/egencache | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 7e3387e..0123d57 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1165,9 +1165,9 @@ def egencache_main(args):
 	if options.write_timestamp:
 		timestamp_path = os.path.join(repo_path, 'metadata', 'timestamp.chk')
 		try:
-			with open(timestamp_path, 'w') as f:
-				f.write(time.strftime('%s\n' % TIMESTAMP_FORMAT, time.gmtime()))
-		except IOError:
+			portage.util.write_atomic(timestamp_path,
+				time.strftime('%s\n' % TIMESTAMP_FORMAT, time.gmtime()))
+		except (EnvironmentError, portage.exception.PortageException):
 			ret.append(os.EX_IOERR)
 		else:
 			ret.append(os.EX_OK)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-04-22  8:21 Alexander Berntsen
  0 siblings, 0 replies; 881+ messages in thread
From: Alexander Berntsen @ 2016-04-22  8:21 UTC (permalink / raw
  To: gentoo-commits

commit:     94e9bbb342ec6f2eec746f7500e9b0ae86722df7
Author:     Göktürk Yüksek <gokturk <AT> binghamton <DOT> edu>
AuthorDate: Tue Apr 19 07:53:50 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Fri Apr 22 08:18:25 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=94e9bbb3

portageq: Case-insensitive match maintainer emails

Reported-by:   NP-Hardass         <NP-Hardass <AT> gentoo.org>
Signed-off-by: Göktürk Yüksek     <gokturk <AT> binghamton.edu>
Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Reviewed-by:   Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/portageq | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/portageq b/bin/portageq
index 07d3c49..832d004 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1,5 +1,5 @@
 #!/usr/bin/python -bO
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function, unicode_literals
@@ -1009,7 +1009,7 @@ list_preserved_libs.__doc__ = docstrings['list_preserved_libs']
 
 class MaintainerEmailMatcher(object):
 	def __init__(self, maintainer_emails):
-		self._re = re.compile("^(%s)$" % "|".join(maintainer_emails))
+		self._re = re.compile("^(%s)$" % "|".join(maintainer_emails), re.I)
 
 	def __call__(self, metadata_xml):
 		match = False


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-05-18 16:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-05-18 16:20 UTC (permalink / raw
  To: gentoo-commits

commit:     363355277eca757af4c435a0592c1feedc31a097
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 20 18:51:26 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 18 16:19:01 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=36335527

__eapi6_src_prepare: handle empty PATCHES array (bug 579626)

Only call eapply with a non-empty PATCHES array, as specified by PMS.

X-Gentoo-bug: 579626
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=579626
Acked-by: Ulrich Mueller <ulm <AT> gentoo.org>
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 1a9ee7b..5af2784 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -806,7 +806,7 @@ __eapi4_src_install() {
 
 __eapi6_src_prepare() {
 	if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
-		eapply "${PATCHES[@]}"
+		[[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
 	elif [[ -n ${PATCHES} ]]; then
 		eapply ${PATCHES}
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-05-18 16:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-05-18 16:29 UTC (permalink / raw
  To: gentoo-commits

commit:     8e57a8b34cc552267dd987f744f04d021041c75b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr  8 05:34:15 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 18 16:27:58 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8e57a8b3

egencache --update-changelogs: fix timestamp assumptions (bug 579292)

Since commit times are not necessarily ordered, synchronize the
ChangeLog mtime with the last commit time, and use exact comparison
to detect changes.

X-Gentoo-bug: 579292
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=579292
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/egencache | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index af0e1f2..80738cf 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -775,12 +775,16 @@ class GenChangeLogs(object):
 			# This cp has not been added to the repo.
 			return
 
+		lmod = long(lmod)
+
 		try:
-			cmod = os.stat('ChangeLog').st_mtime
+			cmod = os.stat('ChangeLog')[stat.ST_MTIME]
 		except OSError:
 			cmod = 0
 
-		if float(cmod) >= float(lmod):
+		# Use exact comparison, since commit times are
+		# not necessarily ordered.
+		if cmod == lmod:
 			return
 
 		try:
@@ -903,6 +907,7 @@ class GenChangeLogs(object):
 				'\n%s\n\n' % '\n'.join(self._wrapper.fill(x) for x in body))
 
 		output.close()
+		os.utime(self._changelog_output, (lmod, lmod))
 
 	def _task_iter(self):
 		if not os.path.isdir(os.environ.get('GIT_DIR', os.path.join(self._repo_path, '.git'))):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-05-18 16:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-05-18 16:49 UTC (permalink / raw
  To: gentoo-commits

commit:     899fe21d9829275816455206a9fb48c496755b96
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  9 06:46:24 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 18 16:48:13 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=899fe21d

dispatch-conf: fix popen UnicodeDecode error (bug 576788)

X-Gentoo-Bug: 576788
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576788
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/dispatch-conf | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 678a66d..fdf564e 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -1,5 +1,5 @@
 #!/usr/bin/python -bO
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -16,6 +16,7 @@ from __future__ import print_function, unicode_literals
 import atexit
 import io
 import re
+import subprocess
 import sys
 
 from stat import ST_GID, ST_MODE, ST_UID
@@ -137,9 +138,15 @@ class dispatch:
                 path, basename = os.path.split(path)
                 find_opts = "-maxdepth 1"
 
-            with os.popen(FIND_EXTANT_CONFIGS %
-                (path, find_opts, basename)) as proc:
-                confs += self.massage(proc.readlines())
+            try:
+                path_list = _unicode_decode(subprocess.check_output(
+                    portage.util.shlex_split(FIND_EXTANT_CONFIGS %
+                    (path, find_opts, basename))),
+                    errors='strict').splitlines()
+            except subprocess.CalledProcessError:
+                pass
+            else:
+                confs.extend(self.massage(path_list))
 
         if self.options['use-rcs'] == 'yes':
             for rcs_util in ("rcs", "ci", "co", "rcsmerge"):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-05-20 21:14 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2016-05-20 21:14 UTC (permalink / raw
  To: gentoo-commits

commit:     7e2f80c57ff5dc18b0737e72693e68eea4bc625e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu May  5 20:49:21 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri May 20 21:13:28 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7e2f80c5

ebuild: Extend helper-in-global-scope ban to all EAPIs

Make helper calls in global scope fatal in all supported EAPIs since
this is the behavior required by PMS and all major offenders are fixed
already.

Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh   |  4 ----
 bin/ebuild.sh | 30 ++++++------------------------
 2 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index cd3e1a4..a9c56b8 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -166,10 +166,6 @@ ___eapi_helpers_can_die() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }
 
-___eapi_disallows_helpers_in_global_scope() {
-	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
-}
-
 ___eapi_unpack_is_case_sensitive() {
 	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index f1586b2..5b3146d 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -59,34 +59,16 @@ else
 	# These dummy functions are for things that are likely to be called
 	# in global scope, even though they are completely useless during
 	# the "depend" phase.
-	for x in diropts docompress exeopts get_KV insopts \
-		KV_major KV_micro KV_minor KV_to_int \
-		libopts register_die_hook register_success_hook \
-		__strip_duplicate_slashes \
-		use_with use_enable ; do
-		eval "${x}() {
-			if ___eapi_disallows_helpers_in_global_scope; then
-				die \"\${FUNCNAME}() calls are not allowed in global scope\"
-			fi
-		}"
-	done
-	# These dummy functions return false in non-strict EAPIs, in order to ensure that
-	# `use multislot` is false for the "depend" phase.
-	funcs="use useq usev"
+	funcs="diropts docompress exeopts get_KV insopts
+		KV_major KV_micro KV_minor KV_to_int
+		libopts register_die_hook register_success_hook
+		__strip_duplicate_slashes
+		use useq usev use_with use_enable"
 	___eapi_has_usex && funcs+=" usex"
 	___eapi_has_in_iuse && funcs+=" in_iuse"
-	for x in ${funcs} ; do
-		eval "${x}() {
-			if ___eapi_disallows_helpers_in_global_scope; then
-				die \"\${FUNCNAME}() calls are not allowed in global scope\"
-			else
-				return 1
-			fi
-		}"
-	done
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
-	funcs="best_version has_version portageq"
+	funcs+=" best_version has_version portageq"
 	___eapi_has_master_repositories && funcs+=" master_repositories"
 	___eapi_has_repository_path && funcs+=" repository_path"
 	___eapi_has_available_eclasses && funcs+=" available_eclasses"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-06-19  5:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-06-19  5:51 UTC (permalink / raw
  To: gentoo-commits

commit:     abf71501a7d81f95770322497995c205eff1999c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 19 05:49:25 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 19 05:51:31 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=abf71501

eapply: use gpatch for bsd userland (bug 574626)

This is needed because eapply uses GNU patch extensions, such as the -g
option.

X-Gentoo-Bug: 574626
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=574626

 bin/phase-helpers.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5af2784..995156a 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -981,9 +981,12 @@ fi
 
 if ___eapi_has_eapply; then
 	eapply() {
-		local failed
+		local failed patch_cmd=patch
 		local -x LC_COLLATE=POSIX
 
+		# for bsd userland support, use gpatch if available
+		type -P gpatch > /dev/null && patch_cmd=gpatch
+
 		_eapply_patch() {
 			local f=${1}
 			local prefix=${2}
@@ -995,7 +998,7 @@ if ___eapi_has_eapply; then
 			# -s to silence progress output
 			# -g0 to guarantee no VCS interaction
 			# --no-backup-if-mismatch not to pollute the sources
-			patch -p1 -f -s -g0 --no-backup-if-mismatch \
+			${patch_cmd} -p1 -f -s -g0 --no-backup-if-mismatch \
 				"${patch_options[@]}" < "${f}"
 			failed=${?}
 			if ! eend "${failed}"; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-06-26 23:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-06-26 23:40 UTC (permalink / raw
  To: gentoo-commits

commit:     8781a2a86b05cf2bc522fca9a22883844a64fdf6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 26 23:22:32 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 23:39:09 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8781a2a8

chpathtool.py: fix byte comparison logic for python3 (bug 587198)

Fix chpathtool.py so that it won't try to compare a byte string with an
integer in python3. This change is also compatible with python2.

X-Gentoo-Bug: 587198
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=587198
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/chpathtool.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 73c7a5f..fbd18b9 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -89,7 +89,7 @@ def chpath_inplace(filename, is_text_file, old, new):
 		if not in_byte:
 			break
 
-		if in_byte == old[matched_byte_count]:
+		if in_byte == old[matched_byte_count:matched_byte_count+1]:
 			matched_byte_count += 1
 			if matched_byte_count == len_old:
 				modified = True


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-09-26 17:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-09-26 17:19 UTC (permalink / raw
  To: gentoo-commits

commit:     120deae6d7e63a35fc068aa92ff2e4263c98e5b6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 25 01:45:37 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 26 17:05:27 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=120deae6

ebuild.sh: start phases in temporary HOME if available (bug 595028)

This will avoid undesirable interactions with the python sitedir,
as reported in bug 574002. Since the temporary HOME is not guaranteed
to exist for some phases, use PORTAGE_PYM_PATH as a fallback. Also,
use PORTAGE_PYM_PATH inside __dyn_clean, since HOME is removed there.

X-Gentoo-Bug: 595028
X-Gentoo-Bug-URL: https://bugs.gentoo.org/595028
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 bin/ebuild.sh          | 11 ++++++++---
 bin/phase-functions.sh |  8 +++++---
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5b3146d..a400ef7 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -167,9 +167,14 @@ export SANDBOX_ON=0
 
 # Ensure that $PWD is sane whenever possible, to protect against
 # exploitation of insecure search path for python -c in ebuilds.
-# See bug #239560 and bug #469338.
-cd "${PORTAGE_PYM_PATH}" || \
-	die "PORTAGE_PYM_PATH does not exist: '${PORTAGE_PYM_PATH}'"
+# See bug #239560, bug #469338, and bug #595028.
+if [[ -d ${HOME} ]]; then
+	# Use portage's temporary HOME directory if available.
+	cd "${HOME}" || die
+else
+	cd "${PORTAGE_PYM_PATH}" || \
+		die "PORTAGE_PYM_PATH does not exist: '${PORTAGE_PYM_PATH}'"
+fi
 
 #if no perms are specified, dirs/files will have decent defaults
 #(not secretive, but not stupid)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index d75f43f..50f0fdb 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -261,6 +261,11 @@ __dyn_clean() {
 		chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
 	fi
 
+	# Some kernels, such as Solaris, return EINVAL when an attempt
+	# is made to remove the current working directory.
+	cd "${PORTAGE_PYM_PATH}" || \
+		die "PORTAGE_PYM_PATH does not exist: '${PORTAGE_PYM_PATH}'"
+
 	rm -rf "${PORTAGE_BUILDDIR}/image" "${PORTAGE_BUILDDIR}/homedir"
 	rm -f "${PORTAGE_BUILDDIR}/.installed"
 
@@ -288,9 +293,6 @@ __dyn_clean() {
 	# result in it wiping the users distfiles directory (bad).
 	rm -rf "${PORTAGE_BUILDDIR}/distdir"
 
-	# Some kernels, such as Solaris, return EINVAL when an attempt
-	# is made to remove the current working directory.
-	cd "$PORTAGE_BUILDDIR"/../..
 	rmdir "$PORTAGE_BUILDDIR" 2>/dev/null
 
 	true


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-10-04 16:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-10-04 16:41 UTC (permalink / raw
  To: gentoo-commits

commit:     843ad4b4b9878d5d10b4e1be2229960100e482ce
Author:     Jan Chren (rindeal) <dev.rindeal <AT> gmail <DOT> com>
AuthorDate: Tue Oct  4 10:56:29 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 16:40:47 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=843ad4b4

einstalldocs: check whether default docs are indeed files

X-Gentoo-Bug: 596102
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=596102

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 995156a..d55165c 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -958,7 +958,7 @@ if ___eapi_has_einstalldocs; then
 				local d
 				for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
 						THANKS BUGS FAQ CREDITS CHANGELOG ; do
-					[[ -s ${d} ]] && docinto / && dodoc "${d}"
+					[[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}"
 				done
 			elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
 				[[ ${DOCS[@]} ]] && docinto / && dodoc -r "${DOCS[@]}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-11-25 19:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-11-25 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     d5851278daea670910cdcf1f8864b9c4494d0b31
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 24 18:23:43 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 25 19:34:27 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d5851278

unpack: fix txz unpack support (bug 600660)

Since txz unpack support was added in commit
daa65a336102050396482f08c77524fe99e48c9f, it has been non-functional,
as follows:

phase-helpers.sh: line 521: ___eapi_supports_txz: command not found
unpack portage-2.3.2.txz: file format not recognized. Ignoring.

Fixes: daa65a336102 ("Add tentative EAPI6 .txz unpack support")
X-Gentoo-Bug: 600660
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=600660
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/phase-helpers.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index d55165c..9e4e6a2 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -518,8 +518,11 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'txz'."
 				fi
-				if ___eapi_supports_txz; then
-					__unpack_tar "xz -d" || return 1
+				if ___eapi_unpack_supports_txz; then
+					if ! tar xof "$srcdir$x"; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2016-12-31 22:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2016-12-31 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     aa57d60d9c77a46f542475dcf448c83af40e73e1
Author:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 30 21:43:02 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 31 21:41:35 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=aa57d60d

portageq: allow disabling regex matching of maintainer emails #604164

When the email address of a maintainer contains unescaped
regex-special characters (such as '+'), the maintainer-email match may
return undesirable results.

Add a command line option '--no-regex' to use re.escape() with list
comprehension on maintainer emails when constructing the matcher
regex. This way, an exact string match can be made rather than a regex
match.

X-Gentoo-bug: 604164
X-Gentoo-bug-url: https://bugs.gentoo.org/604164

 bin/portageq | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/portageq b/bin/portageq
index d645635..06c8e0e 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1082,6 +1082,8 @@ def pquery(parser, opts, args):
 		maintainer_emails = []
 		for x in opts.maintainer_email:
 			maintainer_emails.extend(x.split(","))
+		if opts.no_regex: # Escape regex-special characters for an exact match
+			maintainer_emails = [re.escape(x) for x in maintainer_emails]
 		xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
 	if opts.orphaned:
 		xml_matchers.append(match_orphaned)
@@ -1240,6 +1242,11 @@ def add_pquery_arguments(parser):
 					"help": "comma-separated list of maintainer email regexes to search for"
 				},
 				{
+					"longopt": "--no-regex",
+					"action": "store_true",
+					"help": "Use exact matching instead of regex matching for --maintainer-email"
+				},
+				{
 					"longopt": "--orphaned",
 					"action": "store_true",
 					"help": "match only orphaned (maintainer-needed) packages"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-01-12 23:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-01-12 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     0d32c30b1db848e9eac6fe2e216e6373846467a2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  9 20:18:58 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 12 23:32:17 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0d32c30b

bin/socks5-server.py: convert address from bytes to str (bug 604474)

Use the idna codec to decode the destination address that is read
from the client. This fixes a "TypeError: must be str, not bytes"
exception raised from getaddrinfo with Python 3.4.5.

X-Gentoo-Bug: 604474
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=604474
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/socks5-server.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index cfe3ece..d46cf53 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -83,6 +83,11 @@ class Socks5Server(object):
 				data = yield from reader.readexactly(1)
 				addr_len, = struct.unpack('!B', data)
 				addr = yield from reader.readexactly(addr_len)
+				try:
+					addr = addr.decode('idna')
+				except UnicodeDecodeError:
+					rpl = 0x04  # host unreachable
+
 			elif atyp == 0x04:  # IPv6
 				data = yield from reader.readexactly(16)
 				addr = socket.inet_ntop(socket.AF_INET6, data)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-01-12 23:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-01-12 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     644ad0539ae9a6c2bea4aa57555e9a8f1a1e2b13
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 12 23:50:26 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 12 23:52:17 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=644ad053

bin/save-ebuild-env.sh: remove redundand unset of DISTCC_*

These variables are unset earlier by this code:

	# CCACHE and DISTCC config
	unset ${!CCACHE_*} ${!DISTCC_*}

 bin/save-ebuild-env.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index ddef1fd..f0bf001 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -95,7 +95,7 @@ __save_ebuild_env() {
 
 	# portage config variables and variables set directly by portage
 	unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
-		DISTCC_DIR DISTCC_SOCKS5_PROXY DISTDIR DOC_SYMLINKS_DIR \
+		DISTDIR DOC_SYMLINKS_DIR \
 		EBUILD_FORCE_TEST EBUILD_MASTER_PID \
 		ECLASS_DEPTH ENDCOL FAKEROOTKEY \
 		GOOD HILITE HOME \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-01-14  0:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-01-14  0:19 UTC (permalink / raw
  To: gentoo-commits

commit:     5a53e732efa0ee7e2a3f8afe90d729212ff187fb
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Tue May 24 10:54:38 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 14 00:13:42 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a53e732

__multijob_init: work around Cygwin FIFO shortcoming

Cygwin does not support multiple read-handles for one FIFO (yet).
As we really need just one readonly- and one writeonly-handle, we can
reorder to open one single readwrite- and one writeonly-handle.

X-Gentoo-Bug: 583962
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=583962

 bin/helper-functions.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
index c096aed..9b6e201 100644
--- a/bin/helper-functions.sh
+++ b/bin/helper-functions.sh
@@ -20,12 +20,17 @@ makeopts_jobs() {
 __multijob_init() {
 	# Setup a pipe for children to write their pids to when they finish.
 	# We have to allocate two fd's because POSIX has undefined behavior
-	# when you open a FIFO for simultaneous read/write. #487056
+	# when using one single fd for both read and write. #487056
+	# However, opening an fd for read or write only will block until the
+	# opposite end is opened as well. Thus we open the first fd for both
+	# read and write to not block ourselve, but use it for reading only.
+	# The second fd really is opened for write only, as Cygwin supports
+	# just one single read fd per FIFO. #583962
 	local pipe=$(mktemp -t multijob.XXXXXX)
 	rm -f "${pipe}"
 	mkfifo -m 600 "${pipe}"
-	__redirect_alloc_fd mj_write_fd "${pipe}"
 	__redirect_alloc_fd mj_read_fd "${pipe}"
+	__redirect_alloc_fd mj_write_fd "${pipe}" '>'
 	rm -f "${pipe}"
 
 	# See how many children we can fork based on the user's settings.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-01-17 17:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-01-17 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     652202b382c247dbc32296f03a9e654713776cbe
Author:     Christian Ruppert <idl0r <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 26 00:34:29 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 17:51:53 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=652202b3

glsa-check: Fix some pylint complains

 bin/glsa-check | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index 84481d8..54a7ae1 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -176,7 +176,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
 		if verbose:
 			access = ("[%-8s] " % myglsa.access)
 		else:
-			access=""
+			access = ""
 
 		fd1.write(color(myglsa.nr) + " " + color(status) + " " + color(access) + myglsa.title + " (")
 		if not verbose:
@@ -230,7 +230,7 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 						sys.stderr.write(emergecmd+"\n")
 					exitcode = os.system(emergecmd)
 					# system() returns the exitcode in the high byte of a 16bit integer
-					if exitcode >= 1<<8:
+					if exitcode >= 1 << 8:
 						exitcode >>= 8
 					if exitcode:
 						sys.exit(exitcode)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-01-18 16:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-01-18 16:29 UTC (permalink / raw
  To: gentoo-commits

commit:     75c790503028fd1d609b56c55865a38ae6a6e392
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  6 21:14:27 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 18 16:14:31 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=75c79050

glsa-check: Apply list only affected versions patch from bug 400763

Author: Roland Hopferwieser <gentoo <AT> int0x80.at>
X-Gentoo-bug: 400763
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=400763

 bin/glsa-check | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index 54a7ae1..afc8eb8 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -7,6 +7,8 @@ from __future__ import print_function
 import argparse
 import sys
 import codecs
+from functools import reduce
+import operator
 
 from os import path as osp
 if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
@@ -14,6 +16,7 @@ if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".porta
 import portage
 portage._internal_caller = True
 from portage import os
+from portage.glsa import match
 from portage.output import green, red, nocolor, white
 
 __program__ = "glsa-check"
@@ -185,11 +188,15 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
 			if len(myglsa.packages) > 3:
 				fd1.write("... ")
 		else:
-			for pkg in myglsa.packages:
-				mylist = vardb.match(pkg)
+			for cpv in myglsa.packages.keys():
+				pkg = myglsa.packages[cpv]
+				for path in pkg:
+					v_installed = reduce(operator.add, [match(v, vardb) for v in path["vul_atoms"]], [])
+					u_installed = reduce(operator.add, [match(u, vardb) for u in path["unaff_atoms"]], [])
+				mylist = sorted(set(v_installed).difference(set(u_installed)))
 				if len(mylist) > 0:
-					pkg = color(" ".join(mylist))
-				fd1.write(" " + pkg + " ")
+					cpv = color(" ".join(mylist))
+				fd1.write(" " + cpv + " ")
 
 		fd1.write(")")
 		if list_cve:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-02-22 22:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-02-22 22:28 UTC (permalink / raw
  To: gentoo-commits

commit:     246373bbe52c55e912381d8555cceb70db0ec41b
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 22 19:10:07 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 22 21:57:28 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=246373bb

etc-update: fix hang when using_editor is set, bug #544440

Don't try to use an interactive editor to obtain the difference between
files.  Fall back to plain `diff -q` in this case.

X-Gentoo-Bug: 544440
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=544440

 bin/etc-update | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index e0f7224dc..ea69f1478 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -649,10 +649,21 @@ do_distconf() {
 		elif [[ -L ${efile} || -L ${file} ]] ; then
 			# not the same file types
 			continue
-		elif diff_command "${file}" "${efile}" &> /dev/null; then
-			# replace identical copy
-			mv "${file}" "${efile}"
-			break
+		else
+			local ret=
+			if [[ ${using_editor} == 0 ]] ; then
+				diff_command "${file}" "${efile}" &> /dev/null
+				ret=$?
+			else
+				# fall back to plain diff
+				diff -q "${file}" "${efile}" &> /dev/null
+				ret=$?
+			fi
+			if [[ ${ret} == 0 ]] ; then
+				# replace identical copy
+				mv "${file}" "${efile}"
+				break
+			fi
 		fi
 	done
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-03-24 20:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-03-24 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     7defd54354c17afce7f36f53431260c1909481be
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 21 16:54:14 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 24 20:32:25 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7defd543

emirrordist: add debug SIGUSR1 handler

This is handy for debugging issues with SIGTERM/SIGINT
handling.

 bin/emirrordist | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/emirrordist b/bin/emirrordist
index 0368eee2a..17f99f590 100755
--- a/bin/emirrordist
+++ b/bin/emirrordist
@@ -2,6 +2,7 @@
 # Copyright 2013-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import signal
 import sys
 
 import portage
@@ -10,4 +11,11 @@ portage._disable_legacy_globals()
 from portage._emirrordist.main import emirrordist_main
 
 if __name__ == "__main__":
+
+	def debug_signal(_signum, _frame):
+		import pdb
+		pdb.set_trace()
+
+	signal.signal(signal.SIGUSR1, debug_signal)
+
 	sys.exit(emirrordist_main(sys.argv[1:]))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-03-26  7:43 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2017-03-26  7:43 UTC (permalink / raw
  To: gentoo-commits

commit:     6affafbd59262760091b3b7c2d63ff5c96e43807
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 26 07:25:11 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 26 07:42:40 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6affafbd

phase-functions: Fix cleaning fake FILESDIR, reported by Arfrever

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 50f0fdb9b..dfd8733c8 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -283,6 +283,7 @@ __dyn_clean() {
 
 		rm -rf "${PORTAGE_BUILDDIR}/build-info"
 		rm -rf "${WORKDIR}"
+		rm -f "${PORTAGE_BUILDDIR}/files"
 	fi
 
 	if [ -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-03-26  8:44 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2017-03-26  8:44 UTC (permalink / raw
  To: gentoo-commits

commit:     580eb604349b52309c0e70a86adbe12f69faaa7f
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 23 09:55:52 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Mar 26 08:43:17 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=580eb604

phase-helpers.sh: Loop over A rather than SRC_URI in __eapi0_pkg_nofetch.

Looping over SRC_URI also outputs non-filename elements (e.g, use
conditionals) which is avoided when looping over A.

Gentoo-Bug: 613132
Acked-by: Zac Medico <zmedico <AT> gentoo.org>

 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 9e4e6a2f8..e1dcfd5e8 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 export DESTTREE=/usr
@@ -726,11 +726,11 @@ einstall() {
 }
 
 __eapi0_pkg_nofetch() {
-	[ -z "${SRC_URI}" ] && return
+	[[ -z ${A} ]] && return
 
-	elog "The following are listed in SRC_URI for ${PN}:"
+	elog "The following files cannot be fetched for ${PN}:"
 	local x
-	for x in $(echo ${SRC_URI}); do
+	for x in ${A}; do
 		elog "   ${x}"
 	done
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-07-02 16:31 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-07-02 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     f4f1caaeb37825c01a2092d11bec4f932772bd38
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  2 09:37:19 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul  2 16:30:59 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f4f1caae

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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e1dcfd5e8..4b9b12b70 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -572,14 +572,14 @@ econf() {
 	if [ -x "${ECONF_SOURCE}/configure" ]; then
 		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 -p "${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}"
+			# preserve timestamp, see bug #440304
+			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 '(' \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-11 16:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-08-11 16:06 UTC (permalink / raw
  To: gentoo-commits

commit:     7d2c4fb609454b76d30c42fc7a0bb720decc39a3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  6 07:40:19 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 11 16:05:27 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7d2c4fb6

eapply_user: combine sort for all dirs (bug 608880)

Combine the patch basenames from all matched directories into a
list, and apply them in POSIX sorted order.  This allows patches in
more-specific directories to override patches of the same basename found
in less-specific directories. An empty patch (or /dev/null symlink)
negates a patch with the same basename found in a less-specific
directory.

This behavior is much more flexible and intuitive than the previous one,
while remaining backward-compatible to some extent.

NOTE: The implementation uses an associative array, which requires bash
version 4 or later.

X-Gentoo-bug: 608880
X-Gentoo-bug-url: https://bugs.gentoo.org/608880
Reviewed-by: Manuel Rüger <mrueg <AT> gentoo.org>

 bin/phase-helpers.sh | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 4b9b12b70..c02257eb6 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1094,23 +1094,44 @@ if ___eapi_has_eapply_user; then
 
 		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
 
-		local d applied
+		local applied d f
+		local -A _eapply_user_patches
 		local prev_shopt=$(shopt -p nullglob)
 		shopt -s nullglob
 
-		# possibilities:
+		# Patches from all matched directories are combined into a
+		# sorted (POSIX order) list of the patch basenames. Patches
+		# in more-specific directories override patches of the same
+		# basename found in less-specific directories. An empty patch
+		# (or /dev/null symlink) negates a patch with the same
+		# basename found in a less-specific directory.
+		#
+		# order of specificity:
 		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
 		#    ${P} twice)
 		# 2. ${CATEGORY}/${P}
 		# 3. ${CATEGORY}/${PN}
 		# all of the above may be optionally followed by a slot
-		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
-			if [[ -n $(echo "${d}"/*.diff) || -n $(echo "${d}"/*.patch) ]]; then
-				eapply "${d}"
-				applied=1
-			fi
+		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{:${SLOT%/*},}; do
+			for f in "${d}"/*; do
+				if [[ ( ${f} == *.diff || ${f} == *.patch ) &&
+					-z ${_eapply_user_patches[${f##*/}]} ]]; then
+					_eapply_user_patches[${f##*/}]=${f}
+				fi
+			done
 		done
 
+		if [[ ${#_eapply_user_patches[@]} -gt 0 ]]; then
+			while read -r -d '' f; do
+				f=${_eapply_user_patches[${f}]}
+				if [[ -s ${f} ]]; then
+					eapply "${f}"
+					applied=1
+				fi
+			done < <(printf -- '%s\0' "${!_eapply_user_patches[@]}" |
+				LC_ALL=C sort -z)
+		fi
+
 		${prev_shopt}
 
 		[[ -n ${applied} ]] && ewarn "User patches applied."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-16 23:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-08-16 23:03 UTC (permalink / raw
  To: gentoo-commits

commit:     31138fce479734a6db1fa7d162f3faf6b964bab2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 16 21:22:03 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 16 21:22:09 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=31138fce

quickpkg: revert accidental changes to "protect" function (bug 628010)

Revert accidental changes to the "protect" function's return value
that were mixed in with changes to the "quickpkg_atom" function's
return value.

Fixes: cff2c0149142 ("Support different compressors for binary packages")
X-Gentoo-bug: 628010
X-Gentoo-bug-url: https://bugs.gentoo.org/628010

 bin/quickpkg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 392e9da22..3094dd0ae 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -111,16 +111,16 @@ def quickpkg_atom(options, infos, arg, eout):
 					in settings.features))
 				def protect(filename):
 					if not confprot.isprotected(filename):
-						return 1
+						return False
 					if include_unmodified_config:
 						file_data = contents[filename]
 						if file_data[0] == "obj":
 							orig_md5 = file_data[2].lower()
 							cur_md5 = perform_md5(filename, calc_prelink=1)
 							if orig_md5 == cur_md5:
-								return 1
+								return False
 					excluded_config_files.append(filename)
-					return os.EX_OK
+					return True
 			existing_metadata = dict(zip(fix_metadata_keys,
 				vardb.aux_get(cpv, fix_metadata_keys)))
 			category, pf = portage.catsplit(cpv)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-16 23:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-08-16 23:06 UTC (permalink / raw
  To: gentoo-commits

commit:     fb199967a38ebb563e51ba50ceb413942b7ece98
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 16 21:37:48 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 16 22:18:26 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fb199967

quickpkg: revert premature return from quickpkg_atom (bug 628060)

Revert premature return from the quickpkg_atom function for atoms
that match multiple slots. This fixes it to create packages for
all matched slots, rather than just the lowest version.

Fixes: cff2c0149142 ("Support different compressors for binary packages")
X-Gentoo-bug: 628060
X-Gentoo-bug-url: https://bugs.gentoo.org/628060

 bin/quickpkg | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 3094dd0ae..81d6afa08 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -66,6 +66,7 @@ def quickpkg_atom(options, infos, arg, eout):
 
 	matches = vardb.match(atom)
 	pkgs_for_arg = 0
+	retval = 0
 	for cpv in matches:
 		excluded_config_files = []
 		dblnk = vardb._dblink(cpv)
@@ -177,20 +178,19 @@ def quickpkg_atom(options, infos, arg, eout):
 			eout.eerror(str(e))
 			del e
 			eout.eerror("Failed to create package: '%s'" % binpkg_path)
-			return 1
+			retval |= 1
 		else:
 			eout.eend(0)
 			infos["successes"].append((cpv, s.st_size))
 			infos["config_files_excluded"] += len(excluded_config_files)
 			for filename in excluded_config_files:
 				eout.ewarn("Excluded config: '%s'" % filename)
-			return os.EX_OK
 	if not pkgs_for_arg:
 		eout.eerror("Could not find anything " + \
 			"to match '%s'; skipping" % arg)
 		infos["missing"].append(arg)
-		return 1
-	return os.EX_OK
+		retval |= 1
+	return retval
 
 def quickpkg_set(options, infos, arg, eout):
 	eroot = portage.settings['EROOT']


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-16 23:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-08-16 23:06 UTC (permalink / raw
  To: gentoo-commits

commit:     2e18650ca6535305920d84c924a14e2c819a15a6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 16 22:56:37 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 16 23:00:20 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2e18650c

quickpkg: handle unsuccessful compressor exit in quickpkg_atom

Fixes: cff2c0149142 ("Support different compressors for binary packages")

 bin/quickpkg | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 81d6afa08..faf1eddd4 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -163,7 +163,16 @@ def quickpkg_atom(options, infos, arg, eout):
 				with tarfile.open(mode="w|",format=tarfile.PAX_FORMAT if xattrs else tarfile.DEFAULT_FORMAT, fileobj=proc.stdin) as tar:
 					tar_contents(contents, root, tar, protect=protect, xattrs=xattrs)
 				proc.stdin.close()
-				proc.wait()
+				if proc.wait() != os.EX_OK:
+					eout.eend(1)
+					eout.eerror("Compressor failed for package %s" % cpv)
+					retval |= 1
+					try:
+						os.unlink(binpkg_tmpfile)
+					except OSError as e:
+						if e.errno not in (errno.ENOENT, errno.ESTALE):
+							raise
+					continue
 			xpak.tbz2(binpkg_tmpfile).recompose_mem(xpdata)
 		finally:
 			if have_lock:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-28  6:24 Fabian Groffen
  0 siblings, 0 replies; 881+ messages in thread
From: Fabian Groffen @ 2017-08-28  6:24 UTC (permalink / raw
  To: gentoo-commits

commit:     4dc6f7494af1bcb6a051add9abb827087fd9e9e7
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 24 12:46:04 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Aug 28 06:23:43 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4dc6f749

__dyn_install: improve reporting of build and image sizes

Prior to this commit, the reported sizes would look like:

 * Final size of build directory: 34942 KiB
 * Final size of installed tree: 5627 KiB

Because the sizes aren't aligned, it is hard to (visually) compare them.
On top of this, because the numbers are sometimes bigger, print a human
friendly size after the KiB size if applicable, like so:

 * Final size of build directory: 1906 KiB (1.8 MiB)
 * Final size of installed tree:     7 KiB

It should be noted that in case both sizes have a human-readable
variant, they are also aligned.

The helper functions are defined and used in a subshell to avoid
pollution of the caller's environment.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 49 insertions(+), 4 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index dfd8733c8..ce174ba91 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -598,10 +598,55 @@ __dyn_install() {
 
 	# record build & installed size in build log
 	if type -P du &>/dev/null; then
-		local sz=( $(du -ks "${WORKDIR}") )
-		einfo "Final size of build directory: ${sz[0]} KiB"
-		sz=( $(du -ks "${D}") )
-		einfo "Final size of installed tree: ${sz[0]} KiB"
+		local nsz=( $(du -ks "${WORKDIR}") )
+		local isz=( $(du -ks "${D}") )
+
+		# subshell to avoid polluting the caller env with the helper
+		# functions below
+		(
+			# align $1 to the right to the width of the widest of $1 and $2
+			padl() {
+				local s1=$1
+				local s2=$2
+				local width=${#s1}
+				[[ ${#s2} -gt ${width} ]] && width=${#s2}
+				printf "%*s" ${width} "${s1}"
+			}
+
+			# transform number in KiB into MiB, GiB or TiB based on size
+			human() {
+				local s1=$1
+				local units=( KiB MiB GiB TiB )
+
+				s1=$((s1 * 10))
+				while [[ ${s1} -gt 10240 && ${#units[@]} -gt 1 ]] ; do
+					s1=$((s1 / 1024 ))
+					units=( ${units[@]:1} )
+				done
+
+				local r=${s1: -1}
+				s1=$((s1 / 10))
+				printf "%s.%s %s" "${s1}" "${r}" "${units[0]}"
+			}
+
+			size() {
+				local s1=$1
+				local s2=$2
+				local out="$(padl "${s1}" "${s2}") KiB"
+
+				if [[ ${s1} -gt 1024 ]] ; then
+					s1=$(human ${s1})
+					if [[ ${s2} -gt 1024 ]] ; then
+						s2=$(human ${s2})
+						s1=$(padl ${s1} ${s2})
+					fi
+					out+=" (${s1})"
+				fi
+				echo "${out}"
+			}
+			einfo "Final size of build directory: $(size ${nsz[0]} ${isz[0]})"
+			einfo "Final size of installed tree:  $(size ${isz[0]} ${nsz[0]})"
+		)
 		__vecho
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-28 13:23 Fabian Groffen
  0 siblings, 0 replies; 881+ messages in thread
From: Fabian Groffen @ 2017-08-28 13:23 UTC (permalink / raw
  To: gentoo-commits

commit:     e3e633394defeb88d69b8bca2c608da0c4be838f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 28 13:21:21 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Aug 28 13:21:21 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e3e63339

__dyn_install: fix output by fixing the call to padl

In case both build tree and image tree are larger than 1MiB, the output
would lack MiB/GiB/etc and be misaligned due to the arguments not being
quoted.

 bin/phase-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ce174ba91..7fc798e7f 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -638,7 +638,7 @@ __dyn_install() {
 					s1=$(human ${s1})
 					if [[ ${s2} -gt 1024 ]] ; then
 						s2=$(human ${s2})
-						s1=$(padl ${s1} ${s2})
+						s1=$(padl "${s1}" "${s2}")
 					fi
 					out+=" (${s1})"
 				fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-31 14:07 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2017-08-31 14:07 UTC (permalink / raw
  To: gentoo-commits

commit:     249ecdadd63b2b743d670f2776fe976d22e8808c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 30 08:58:36 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 31 14:06:14 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=249ecdad

ebuild.sh: Explicitly ban get_libdir in global scope

The value of get_libdir depends on the profile, and so it is not useful
for dependency calculations. Furthermore, it seems that Portage does
not handle defining it in global scope well due to EAPI checking magic.
Ban it completely where it is defined as EAPI function to let developers
catch their mistakes early rather than see them as 'command not found'
errors during dependency calculation / cache updates.

Bug: https://bugs.gentoo.org/629010
Closes: https://github.com/gentoo/portage/pull/197
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a400ef72e..f1ac3f278 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -66,6 +66,7 @@ else
 		use useq usev use_with use_enable"
 	___eapi_has_usex && funcs+=" usex"
 	___eapi_has_in_iuse && funcs+=" in_iuse"
+	___eapi_has_get_libdir && funcs+=" get_libdir"
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
 	funcs+=" best_version has_version portageq"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-08-31 18:10 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2017-08-31 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     40da7ee19c4c195da35083bf2d2fcbd852ad3846
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 31 14:31:11 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 31 18:10:05 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=40da7ee1

ebuild.sh: Fail on command-not-found in global scope

The PMS specifies that ebuilds must not call external commands in global
scope. We can not prevent that from happening at the moment since a few
ebuilds in Gentoo are still doing that.

Instead, start increasing strictness by explicitly failing if ebuilds
call external commands that are not found. This is not going to really
break any ebuilds that are not broken already (since command-not-found
usually indicates something is going wrong), and it will help noticing
typos and reliance on non-common external commands.

A similar change has been tested in pkgcore, and confirmed not to cause
any failures with the current state of the Gentoo repository.

Closes: https://github.com/gentoo/portage/pull/198
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index f1ac3f278..c23561651 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -79,6 +79,10 @@ else
 		eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }"
 	done
 	unset funcs x
+
+	command_not_found_handle() {
+		die "Command not found while sourcing ebuild: ${*}"
+	}
 fi
 
 # Don't use sandbox's BASH_ENV for new shells because it does


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-09-11 20:32 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2017-09-11 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     fb2459330cf226ee34d3875a1143531bd109aaf2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 31 20:29:50 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Sep 11 20:32:46 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fb245933

ebuild.sh: Completely ban external commands in global scope

Set PATH to /dev/null when sourcing the ebuild for dependency resolution
in order to prevent shell from finding external commands via PATH
lookup. While this does not prevent executing programs via full path, it
should catch the majority of accidental uses.

Closes: https://github.com/gentoo/portage/pull/199
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh             | 6 +++++-
 bin/isolated-functions.sh | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index c23561651..94a44d534 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -80,8 +80,12 @@ else
 	done
 	unset funcs x
 
+	# prevent the shell from finding external executables
+	# note: we can't use empty because it implies current directory
+	_PORTAGE_ORIG_PATH=${PATH}
+	export PATH=/dev/null
 	command_not_found_handle() {
-		die "Command not found while sourcing ebuild: ${*}"
+		die "External commands disallowed while sourcing ebuild: ${*}"
 	}
 fi
 

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index e320f7132..b28e44f18 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -121,6 +121,10 @@ __helpers_die() {
 }
 
 die() {
+	# restore PATH since die calls basename & sed
+	# TODO: make it pure bash
+	[[ -n ${_PORTAGE_ORIG_PATH} ]] && PATH=${_PORTAGE_ORIG_PATH}
+
 	set +x # tracing only produces useless noise here
 	local IFS=$' \t\n'
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-09-19  7:00 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-09-19  7:00 UTC (permalink / raw
  To: gentoo-commits

commit:     89a3c549bc5e019cf7f1a495676d0144c0035063
Author:     R0b0t1 <R030t1 <AT> gmail <DOT> com>
AuthorDate: Tue Sep 19 06:43:59 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 06:59:37 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=89a3c549

misc-functions.sh: Fix 'within' typo in comment

Closes: https://github.com/gentoo/portage/pull/206

 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 18cddea21..b0506bde7 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -7,7 +7,7 @@
 #
 # We're sourcing ebuild.sh here so that we inherit all of it's goodness,
 # including bashrc trickery.  This approach allows us to do our miscellaneous
-# shell work withing the same env that ebuild.sh has, but without polluting
+# shell work within the same env that ebuild.sh has, but without polluting
 # ebuild.sh itself with unneeded logic and shell code.
 #
 # XXX hack: clear the args so ebuild.sh doesn't see them


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-11-16 23:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-11-16 23:22 UTC (permalink / raw
  To: gentoo-commits

commit:     25ce021c8630fb75bab1bcce70f06fdafcd5c5a7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 16 23:13:26 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 16 23:15:12 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=25ce021c

quickpkg: fix stat sanity check for binpkg-multi-instance (bug 637902)

Fixes: 328dd4712f88 ("binpkg-multi-instance 3 of 7")
Bug: https://bugs.gentoo.org/637902

 bin/quickpkg | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index faf1eddd4..7e9aa1373 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -177,8 +177,12 @@ def quickpkg_atom(options, infos, arg, eout):
 		finally:
 			if have_lock:
 				dblnk.unlockdb()
-		bintree.inject(cpv, filename=binpkg_tmpfile)
-		binpkg_path = bintree.getname(cpv)
+		pkg_info = bintree.inject(cpv, filename=binpkg_tmpfile)
+		# The pkg_info value ensures that the following getname call
+		# returns the correct path when FEATURES=binpkg-multi-instance
+		# is enabled, but fallback to cpv in case the inject call
+		# returned None due to some kind of failure.
+		binpkg_path = bintree.getname(pkg_info or cpv)
 		try:
 			s = os.stat(binpkg_path)
 		except OSError as e:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-11-16 23:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-11-16 23:47 UTC (permalink / raw
  To: gentoo-commits

commit:     682fc4b8ea1b2caeeef88596508026edea8e8ac5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 16 23:41:57 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 16 23:47:18 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=682fc4b8

quickpkg: report all binarytree.inject failures (bug 637902)

The binarytree.inject method should not return None unless
something went wrong, therefore report failure whenever it
returns None.

Bug: https://bugs.gentoo.org/637902

 bin/quickpkg | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 7e9aa1373..ec6f50409 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -185,11 +185,12 @@ def quickpkg_atom(options, infos, arg, eout):
 		binpkg_path = bintree.getname(pkg_info or cpv)
 		try:
 			s = os.stat(binpkg_path)
-		except OSError as e:
+		except OSError:
+			s = None
+
+		if s is None or pkg_info is None:
 			# Sanity check, shouldn't happen normally.
 			eout.eend(1)
-			eout.eerror(str(e))
-			del e
 			eout.eerror("Failed to create package: '%s'" % binpkg_path)
 			retval |= 1
 		else:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-12-02 21:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-12-02 21:33 UTC (permalink / raw
  To: gentoo-commits

commit:     e8f9d69d760a772aa4bcc695d2ac655a9f89e8d9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 30 20:21:56 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec  2 21:17:41 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8f9d69d

bin/doins.py: optimize with copyfile from portage.util.file_copy

Bug: https://bugs.gentoo.org/624526

 bin/doins.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/bin/doins.py b/bin/doins.py
index 13b9c5fc0..ad8f90eee 100644
--- a/bin/doins.py
+++ b/bin/doins.py
@@ -1,4 +1,7 @@
 #!/usr/bin/python -b
+# Copyright 2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
 # Copyright 2017 The Chromium OS Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
@@ -25,6 +28,7 @@ import subprocess
 import sys
 
 from portage.util import movefile
+from portage.util.file_copy import copyfile
 
 
 def _warn(helper, msg):
@@ -177,12 +181,7 @@ class _InsInProcessInstallRunner(object):
 			if e.errno != errno.ENOENT:
 				raise
 		try:
-			# TODO: Consider to use portage.util.file_copy.copyfile
-			# introduced by
-			# https://gitweb.gentoo.org/proj/portage.git/commit/
-			#   ?id=8ab5c8835931fd9ec098dbf4c5f416eb32e4a3a4
-			# after uprev.
-			shutil.copyfile(source, dest)
+			copyfile(source, dest)
 			_set_attributes(self._parsed_options, dest)
 			if self._copy_xattr:
 				movefile._copyxattr(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-12-08  3:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-12-08  3:30 UTC (permalink / raw
  To: gentoo-commits

commit:     fe09b49fd09f42b9b6956f6c299bd325c62f0e83
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  8 03:22:41 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  8 03:29:49 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fe09b49f

phase-helpers.sh: make use() tolerate missing IUSE for binary packages

IUSE_IMPLICIT makes this code vulnerable to profile changes, therefore
it's risky to die for binary packages here.

 bin/phase-helpers.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index c02257eb6..9b1f6adbe 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -194,7 +194,8 @@ use() {
 	elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE &&
 		-n $PORTAGE_INTERNAL_CALLER ]] ; then
 		if [[ ! $u =~ $PORTAGE_IUSE ]] ; then
-			if [[ ! ${EAPI} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]] ; then
+			if [[ ${EMERGE_FROM} != binary &&
+				! ${EAPI} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]] ; then
 				# This is only strict starting with EAPI 5, since implicit IUSE
 				# is not well defined for earlier EAPIs (see bug #449708).
 				die "USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-12-10  8:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-12-10  8:51 UTC (permalink / raw
  To: gentoo-commits

commit:     bf39bfe9806ec6a6929d2a3475915dafd7fe0d39
Author:     Andrew Hlynskyi <ahlincq <AT> gmail <DOT> com>
AuthorDate: Sun Dec 10 07:52:52 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 10 08:48:49 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bf39bfe9

bin/phase-functions.sh: Fix SANDBOX_ON variable condition check

Fixes: 94015a2fe3b2 ("When signaling successful exit from an ebuild phase via ebuild-ipc")
Closes: https://github.com/gentoo/portage/pull/232

 bin/phase-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 7fc798e7f..10d54ca74 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -944,7 +944,7 @@ __ebuild_main() {
 		# so we ensure that there can't be a stale log to
 		# interfere with our logic.
 		local x=
-		if [[ -n SANDBOX_ON ]] ; then
+		if [[ -n $SANDBOX_ON ]] ; then
 			x=$SANDBOX_ON
 			export SANDBOX_ON=0
 		fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2017-12-10  8:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2017-12-10  8:55 UTC (permalink / raw
  To: gentoo-commits

commit:     992b4ffdcbf469db543c9cab90a5f7a3a4125c97
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 10 08:34:23 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 10 08:54:21 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=992b4ffd

bin/doins.py: remove file before creating symlink (bug 640376)

Fixes: d9522ba661b5 ("Rewrite doins in python (bug 624526)")
Bug: https://bugs.gentoo.org/640376

 bin/doins.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/doins.py b/bin/doins.py
index ad8f90eee..92e450979 100644
--- a/bin/doins.py
+++ b/bin/doins.py
@@ -405,7 +405,11 @@ def _doins(opts, install_runner, relpath, source_root):
 				not os.readlink(source).startswith(
 					opts.distdir)):
 				linkto = os.readlink(source)
-				shutil.rmtree(dest, ignore_errors=True)
+				try:
+					os.unlink(dest)
+				except OSError as e:
+					if e.errno == errno.EISDIR:
+						shutil.rmtree(dest, ignore_errors=True)
 				os.symlink(linkto, dest)
 				return True
 		except Exception:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-01-17 19:39 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-01-17 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     e81497dec819dbfc8e85e533db30d751fadaad81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 15 04:36:39 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 17 19:38:44 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e81497de

bin/doins.py: avoid timestamp precision loss with python2 (bug 642632)

Since conversion to/from float results in timestamp precision loss
with less than Python 3.3, do not use the python implementation
in this case.

Bug: https://bugs.gentoo.org/642632
Fixes: d459f05ff71f ("bin/doins.py: implement install -p option (bug 642632)")

 bin/doins.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/doins.py b/bin/doins.py
index 9e6566097..6bc30c90b 100644
--- a/bin/doins.py
+++ b/bin/doins.py
@@ -110,6 +110,10 @@ def _parse_install_options(
 	parser.add_argument('-p', '--preserve-timestamps', action='store_true')
 	split_options = shlex.split(options)
 	namespace, remaining = parser.parse_known_args(split_options)
+	if namespace.preserve_timestamps and sys.version_info < (3, 3):
+		# -p is not supported in this case, since timestamps cannot
+		# be preserved with full precision
+		remaining.append('-p')
 	# Because parsing '--mode' option is partially supported. If unknown
 	# arg for --mode is passed, namespace.mode is set to None.
 	if remaining or namespace.mode is None:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-01  6:18 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-01  6:18 UTC (permalink / raw
  To: gentoo-commits

commit:     ffd68477e5c1e1badf60c86ae221c90dad50390d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  1 06:12:41 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  1 06:12:41 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ffd68477

emerge-webrsync: uses gpg --status-fd

 bin/emerge-webrsync | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 9961ad815..560dd0236 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -175,13 +175,22 @@ check_file_signature() {
 	local signature="$1"
 	local file="$2"
 	local r=1
+	local gnupg_status line
 
 	if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
 
 		__vecho "Checking signature ..."
 
 		if type -P gpg > /dev/null; then
-			gpg --homedir "${PORTAGE_GPG_DIR}" --verify "$signature" "$file" && r=0
+			if gnupg_status=$(gpg --homedir "${PORTAGE_GPG_DIR}" --batch \
+				--status-fd 1 --verify "${signature}" "${file}"); then
+				while read -r line; do
+					if [[ ${line} == "[GNUPG:] GOODSIG"* ]]; then
+						r=0
+						break
+					fi
+				done <<< "${gnupg_status}"
+			fi
 		else
 			eecho "cannot check signature: gpg binary not found"
 			exit 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-05  1:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-05  1:03 UTC (permalink / raw
  To: gentoo-commits

commit:     46324633cbcf50fa6e09bedfe317f088de50fc08
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  5 00:58:01 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  5 01:02:38 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=46324633

einstall: borrow src_install code for Makefile test

This fixes the following error when 2 files exist:

$ [ -f ./[mM]akefile ]
bash: [: ./makefile: binary operator expected

Reported-by: R0b0t1 <r030t1 <AT> gmail.com>
See: https://github.com/gentoo/portage/pull/251

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 9b1f6adbe..23cf80b39 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -696,7 +696,7 @@ einstall() {
 		unset EI_DESTLIBDIR
 	fi
 
-	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
+	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
 		if [ "${PORTAGE_DEBUG}" == "1" ]; then
 			${MAKE:-make} -n prefix="${ED}usr" \
 				datadir="${ED}usr/share" \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-05  3:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-05  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     541a28f114fe7cc200dad01f0aeaecff6ad7a398
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  5 03:32:39 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  5 03:33:42 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=541a28f1

ebuild.sh: use -gt comparison for ${ECLASS_DEPTH}

Reported-by: R0b0t1 <r030t1 <AT> gmail.com>

 bin/ebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 94a44d534..4a80fdd06 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -232,7 +232,7 @@ debug-print-section() {
 declare -ix ECLASS_DEPTH=0
 inherit() {
 	ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
-	if [[ ${ECLASS_DEPTH} > 1 ]]; then
+	if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
 		debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-05  4:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-05  4:22 UTC (permalink / raw
  To: gentoo-commits

commit:     2a5be51673654d9605308f8c80d5588f67a5e8e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  5 04:22:05 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  5 04:22:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2a5be516

etc-update: quote array expansions

Reported-by: R0b0t1 <r030t1 <AT> gmail.com>

 bin/etc-update | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index ea69f1478..7b48be215 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -767,7 +767,7 @@ portage_vars=(
 )
 
 if type -P portageq > /dev/null; then
-	eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
+	eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v "${portage_vars[@]}")
 else
 	[[ $OS_FAMILY == 'gentoo' ]] && die "missing portageq"
 fi
@@ -801,7 +801,7 @@ cfg_vars=(
 	mode
 )
 # default them all to ""
-eval ${cfg_vars[@]/%/=}
+eval "${cfg_vars[@]/%/=}"
 # then extract them all from the conf in one shot
 # (ugly var at end is due to printf appending a '|' to last item)
 get_config "($(printf '%s|' "${cfg_vars[@]}")NOVARFOROLDMEN)"
@@ -846,7 +846,7 @@ if ${NONINTERACTIVE_MV} ; then
 fi
 
 if ${VERBOSE} ; then
-	for v in ${portage_vars[@]} ${cfg_vars[@]} TMP SCAN_PATHS ; do
+	for v in "${portage_vars[@]}" "${cfg_vars[@]}" TMP SCAN_PATHS ; do
 		echo "${v}=${!v}"
 	done
 fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-07  4:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-07  4:58 UTC (permalink / raw
  To: gentoo-commits

commit:     2306b8f4a2d781db87ee61707f6dea1c5f717936
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  7 04:54:42 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  7 04:58:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2306b8f4

isolated-functions.sh: optimize array length tests

This solves the following shellcheck error:

SC2199: Arrays implicitly concatenate in [[ ]].

Reported-by: R0b0t1 <r030t1 <AT> gmail.com>

 bin/isolated-functions.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index b28e44f18..1ca959bb3 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -82,7 +82,7 @@ __dump_trace() {
 		lineno=${BASH_LINENO[${n} - 1]}
 		# Display function arguments
 		args=
-		if [[ -n "${BASH_ARGV[@]}" ]]; then
+		if [[ ${#BASH_ARGV[@]} -gt 0 ]]; then
 			for (( j = 1 ; j <= ${BASH_ARGC[${n} - 1]} ; ++j )); do
 				newarg=${BASH_ARGV[$(( p - j - 1 ))]}
 				args="${args:+${args} }'${newarg}'"
@@ -550,13 +550,13 @@ __eqatag() {
 
 	(
 		echo "- tag: ${tag}"
-		if [[ ${data[@]} ]]; then
+		if [[ ${#data[@]} -gt 0 ]]; then
 			echo "  data:"
 			for i in "${data[@]}"; do
 				echo "    ${i%%=*}: \"$(__eqaquote "${i#*=}")\""
 			done
 		fi
-		if [[ ${filenames[@]} ]]; then
+		if [[ ${#filenames[@]} -gt 0 ]]; then
 			echo "  files:"
 			for i in "${filenames[@]}"; do
 				echo "    - \"$(__eqaquote "${i}")\""


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-07  5:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-07  5:08 UTC (permalink / raw
  To: gentoo-commits

commit:     e42e9b61024d752a3dfb56ab8e8ea6936333ec58
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  7 05:05:48 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  7 05:05:48 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e42e9b61

phase-helpers.sh: optimize array length tests

Reported-by: R0b0t1 <r030t1 <AT> gmail.com>

 bin/phase-helpers.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 23cf80b39..49dad234d 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -810,7 +810,7 @@ __eapi4_src_install() {
 
 __eapi6_src_prepare() {
 	if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
-		[[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
+		[[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"
 	elif [[ -n ${PATCHES} ]]; then
 		eapply ${PATCHES}
 	fi
@@ -965,7 +965,7 @@ if ___eapi_has_einstalldocs; then
 					[[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}"
 				done
 			elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
-				[[ ${DOCS[@]} ]] && docinto / && dodoc -r "${DOCS[@]}"
+				[[ ${#DOCS[@]} -gt 0 ]] && docinto / && dodoc -r "${DOCS[@]}"
 			else
 				[[ ${DOCS} ]] && docinto / && dodoc -r ${DOCS}
 			fi
@@ -973,7 +973,7 @@ if ___eapi_has_einstalldocs; then
 
 		(
 			if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
-				[[ ${HTML_DOCS[@]} ]] && \
+				[[ ${#HTML_DOCS[@]} -gt 0 ]] && \
 					docinto html && dodoc -r "${HTML_DOCS[@]}"
 			else
 				[[ ${HTML_DOCS} ]] && \
@@ -1040,7 +1040,7 @@ if ___eapi_has_eapply; then
 			done
 		fi
 
-		if [[ -z ${files[@]} ]]; then
+		if [[ ${#files[@]} -eq 0 ]]; then
 			die "eapply: no files specified"
 		fi
 
@@ -1062,7 +1062,7 @@ if ___eapi_has_eapply; then
 
 				local files=()
 				_eapply_get_files "${f}"
-				[[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}"
+				[[ ${#files[@]} -eq 0 ]] && die "No *.{patch,diff} files in directory ${f}"
 
 				einfo "Applying patches from ${f} ..."
 				local f2


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-02-07  5:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-02-07  5:24 UTC (permalink / raw
  To: gentoo-commits

commit:     4a0a949d601969c672d9cf70ef8cf8682553f787
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  7 05:22:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  7 05:24:24 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a0a949d

phase-functions.sh: suppress shellcheck SC1087

Adding braces to ${x} suppresses the following shellcheck
error:

SC1087: Braces are required when expanding arrays, as in ${array[idx]}.

Reported-by: R0b0t1 <r030t1 <AT> gmail.com>

 bin/phase-functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 10d54ca74..0ffabd99e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -541,9 +541,9 @@ __dyn_install() {
 		# fnmatch patterns to regular expressions
 		for x in QA_DT_NEEDED QA_FLAGS_IGNORED QA_PRESTRIPPED QA_SONAME ; do
 			if [[ $(declare -p $x 2>/dev/null) = declare\ -a* ]] ; then
-				eval "$x=(\"\${$x[@]}\" ${QA_PREBUILT//\*/.*})"
+				eval "${x}=(\"\${${x}[@]}\" ${QA_PREBUILT//\*/.*})"
 			else
-				eval "$x+=\" ${QA_PREBUILT//\*/.*}\""
+				eval "${x}+=\" ${QA_PREBUILT//\*/.*}\""
 			fi
 		done
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-04 18:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-04 18:22 UTC (permalink / raw
  To: gentoo-commits

commit:     56350cb6b1ee0b93a86e27bc59f7d3a0e73ad220
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Mar  4 05:32:20 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar  4 18:22:05 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=56350cb6

xattr-helper.py: Make restoring of extended attributes work again.

Set options.paths using standard input only in dump mode.
Also fix support for paths passed as arguments.

Bug: https://bugs.gentoo.org/649528
Fixes: 345c54de9e8c9daac190fbb07d33bf40e7bac5a9

 bin/xattr-helper.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index b5faed044..75844f279 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 2012-2014 Gentoo Foundation
+# Copyright 2012-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 doc = """Dump and restore extended attributes.
@@ -147,12 +147,13 @@ def main(argv):
 	actions.add_argument('--dump',
 		action='store_true',
 		help='Dump the values of all extended '
-			'attributes associated with null-separated'
-			' paths read from stdin.')
+			'attributes associated with paths '
+			'passed as arguments or null-separated '
+			'paths read from stdin.')
 	actions.add_argument('--restore',
 		action='store_true',
-		help='Restore extended attributes using'
-			' a dump read from stdin.')
+		help='Restore extended attributes using '
+			'a dump read from stdin.')
 
 	options = parser.parse_args(argv)
 
@@ -160,10 +161,12 @@ def main(argv):
 		file_in = sys.stdin.buffer.raw
 	else:
 		file_in = sys.stdin
-	if not options.paths:
-		options.paths += [x for x in file_in.read().split(b'\0') if x]
 
 	if options.dump:
+		if options.paths:
+			options.paths = [unicode_encode(x) for x in options.paths]
+		else:
+			options.paths = [x for x in file_in.read().split(b'\0') if x]
 		if sys.hexversion >= 0x3000000:
 			file_out = sys.stdout.buffer
 		else:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-04 18:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-04 18:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ab9392633796d671e54c2b46091beb8004441b3b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  4 18:33:22 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar  4 18:34:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab939263

xattr-helper.py: use surrogateescape with python3 in unicode_encode

 bin/xattr-helper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index 75844f279..49c981580 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -42,7 +42,7 @@ else:
 
 	def unicode_encode(s):
 		if isinstance(s, str):
-			s = s.encode(_FS_ENCODING)
+			s = s.encode(_FS_ENCODING, 'surrogateescape')
 		return s
 
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-04 21:05 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-03-04 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     2753a199c72f7f567c216ecc6d2fc7724e90bb0b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 21 09:55:44 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar  4 21:03:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2753a199

Use bash-4.2 for all future EAPIs, until declared otherwise

 bin/eapi.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index a9c56b8ac..7d35852cd 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # PHASES
@@ -193,5 +193,5 @@ ___eapi_bash_3_2() {
 }
 
 ___eapi_bash_4_2() {
-	[[ ${1-${EAPI-0}} =~ ^(6)$ ]]
+	! ___eapi_bash_3_2 "$@"
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-04 21:05 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-03-04 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     2b62104633008cc30df24808029430516a6d9a7b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 14:24:23 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar  4 21:03:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2b621046

isolated-functions.sh: Ensure informational command output to stderr

Ensure that einfo, elog, ewarn... commands direct all output to stderr
consistently. This ensures that various logging messages won't pollute
stdout, and therefore be accidentally caught in $().

This satisfies the 'output commands do not pollute' stdout requirement
that is tentatively included in EAPI 7.

Bug: https://bugs.gentoo.org/483240

 bin/isolated-functions.sh | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 1ca959bb3..0acb81607 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -247,7 +247,7 @@ __quiet_mode() {
 }
 
 __vecho() {
-	__quiet_mode || echo "$@"
+	__quiet_mode || echo "$@" >&2
 }
 
 # Internal logging function, don't use this in ebuilds
@@ -273,9 +273,9 @@ __elog_base() {
 
 eqawarn() {
 	__elog_base QA "$*"
-	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
+	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
 	echo -e "$@" | while read -r ; do
-		__vecho " $WARN*$NORMAL $REPLY" >&2
+		__vecho " $WARN*$NORMAL $REPLY"
 	done
 	LAST_E_CMD="eqawarn"
 	return 0
@@ -283,9 +283,9 @@ eqawarn() {
 
 elog() {
 	__elog_base LOG "$*"
-	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
+	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
 	echo -e "$@" | while read -r ; do
-		echo " $GOOD*$NORMAL $REPLY"
+		echo " $GOOD*$NORMAL $REPLY" >&2
 	done
 	LAST_E_CMD="elog"
 	return 0
@@ -293,9 +293,9 @@ elog() {
 
 einfo() {
 	__elog_base INFO "$*"
-	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
+	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
 	echo -e "$@" | while read -r ; do
-		echo " $GOOD*$NORMAL $REPLY"
+		echo " $GOOD*$NORMAL $REPLY" >&2
 	done
 	LAST_E_CMD="einfo"
 	return 0
@@ -303,15 +303,15 @@ einfo() {
 
 einfon() {
 	__elog_base INFO "$*"
-	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-	echo -ne " ${GOOD}*${NORMAL} $*"
+	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
+	echo -ne " ${GOOD}*${NORMAL} $*" >&2
 	LAST_E_CMD="einfon"
 	return 0
 }
 
 ewarn() {
 	__elog_base WARN "$*"
-	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
+	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
 	echo -e "$@" | while read -r ; do
 		echo " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2
 	done
@@ -321,7 +321,7 @@ ewarn() {
 
 eerror() {
 	__elog_base ERROR "$*"
-	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
+	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
 	echo -e "$@" | while read -r ; do
 		echo " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2
 	done
@@ -339,7 +339,7 @@ ebegin() {
 		msg="${msg} ..."
 	fi
 	einfon "${msg}"
-	[[ ${RC_ENDCOL} == "yes" ]] && echo
+	[[ ${RC_ENDCOL} == "yes" ]] && echo >&2
 	LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
 	LAST_E_CMD="ebegin"
 	return 0
@@ -359,10 +359,10 @@ __eend() {
 	fi
 
 	if [[ ${RC_ENDCOL} == "yes" ]] ; then
-		echo -e "${ENDCOL} ${msg}"
+		echo -e "${ENDCOL} ${msg}" >&2
 	else
 		[[ ${LAST_E_CMD} == ebegin ]] || LAST_E_LEN=0
-		printf "%$(( COLS - LAST_E_LEN - 7 ))s%b\n" '' "${msg}"
+		printf "%$(( COLS - LAST_E_LEN - 7 ))s%b\n" '' "${msg}" >&2
 	fi
 
 	return ${retval}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-15 20:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-15 20:43 UTC (permalink / raw
  To: gentoo-commits

commit:     a47b53bd5ee32ead478848d615778b013fa48e00
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Thu Mar 15 20:17:33 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 15 20:43:30 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a47b53bd

etc-update: add Arch Linux support

Closes: https://github.com/gentoo/portage/pull/267

 bin/etc-update | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 7b48be215..7cd880d7c 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -35,11 +35,15 @@ get_config() {
 OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2)
 
 case $OS_RELEASE_ID in
-	suse|opensuse) OS_FAMILY='suse' ;;
+	suse|opensuse) OS_FAMILY='suse' NEW_EXT='rpmnew';;
+	arch|manjaro) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac
 
 if [[ $OS_FAMILY == 'gentoo' ]]; then
+	get_basename() {
+		printf -- '%s\n' "${1:10}"
+	}
 	get_basename_find_opt() {
 		echo "._cfg????_${1}"
 	}
@@ -49,15 +53,18 @@ if [[ $OS_FAMILY == 'gentoo' ]]; then
 	get_live_file() {
 		echo "${rpath}/${rfile:10}"
 	}
-elif [[ $OS_FAMILY == 'suse' ]]; then
+elif [[ $OS_FAMILY == 'suse' ]] || [[ $OS_FAMILY == 'arch' ]]; then
+	get_basename() {
+		printf -- '%s\n' "${1%.${NEW_EXT}}"
+	}
 	get_basename_find_opt() {
-		echo "${1}.rpmnew"
+		printf -- '%s\n' "${1}.${NEW_EXT}"
 	}
 	get_scan_regexp() {
 		echo "s:\(^.*/\)\(.*\)\(\.rpmnew\):\1\2\3$b\1$b\3$b\2:"
 	}
 	get_live_file() {
-		echo "${cfg_file%.rpmnew}"
+		printf -- '%s\n' "${cfg_file%.${NEW_EXT}}"
 	}
 fi
 
@@ -160,7 +167,7 @@ scan() {
 					rm -f "${file}"
 					continue
 				fi
-				if [[ "${ofile:10}" != "${rfile:10}" ]] ||
+				if [[ $(get_basename "${ofile}") != $(get_basename "${rfile}") ]] ||
 				   [[ ${opath} != ${rpath} ]]
 				then
 					: $(( ++count ))
@@ -176,7 +183,7 @@ scan() {
 				continue
 			fi
 
-			if [[ "${ofile:10}" != "${rfile:10}" ]] ||
+			if [[ $(get_basename "${ofile}") != $(get_basename "${rfile}") ]] ||
 			   [[ ${opath} != ${rpath} ]]
 			then
 				MATCHES=0
@@ -753,6 +760,11 @@ if [[ $OS_FAMILY == 'suse' ]]; then
 	CONFIG_PROTECT='/etc'
 	CONFIG_PROTECT_MASK=''
 	[[ -f /etc/sysconfig/etc-update ]] && . /etc/sysconfig/etc-update
+elif [[ $OS_FAMILY == 'arch' ]]; then
+	PORTAGE_CONFIGROOT='/'
+	PORTAGE_TMPDIR='/tmp'
+	CONFIG_PROTECT='/etc /usr/lib /usr/share/config'
+	CONFIG_PROTECT_MASK=''
 fi
 
 portage_vars=(


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-26 17:43 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-26 17:43 UTC (permalink / raw
  To: gentoo-commits

commit:     382f4be415394886026ccd5dcd08ca96ecda31fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 16:29:13 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 26 17:42:50 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=382f4be4

portageq repos_config: fix <eroot> parameter (bug 648062)

The <eroot> parameter is ineffective for commands that query
configuration, since the PORTAGE_CONFIGROOT variable controls
the location of configuration files. Therefore, for portageq
repos_config, implicitly set PORTAGE_CONFIGROOT equal to the
value of the <eroot> parameter. Note that this works correctly
for both prefix and non-prefix systems, because both EROOT and
PORTAGE_CONFIGROOT are supposed to include the EPREFIX offset.

Bug: https://bugs.gentoo.org/648062

 bin/portageq | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/bin/portageq b/bin/portageq
index 0ac124fde..e9b8b20e0 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function, unicode_literals
@@ -62,6 +62,12 @@ def eval_atom_use(atom):
 		atom = atom.evaluate_conditionals(use)
 	return atom
 
+
+def uses_configroot(function):
+	function.uses_configroot = True
+	return function
+
+
 def uses_eroot(function):
 	function.uses_eroot = True
 	return function
@@ -696,6 +702,7 @@ docstrings['gentoo_mirrors'] = """
 gentoo_mirrors.__doc__ = docstrings['gentoo_mirrors']
 
 
+@uses_configroot
 @uses_eroot
 def repositories_configuration(argv):
 	if len(argv) < 1:
@@ -710,6 +717,7 @@ docstrings['repositories_configuration'] = """<eroot>
 repositories_configuration.__doc__ = docstrings['repositories_configuration']
 
 
+@uses_configroot
 @uses_eroot
 def repos_config(argv):
 	return repositories_configuration(argv)
@@ -1425,6 +1433,14 @@ def main(argv):
 
 		os.environ["ROOT"] = root
 
+		if getattr(function, "uses_configroot", False):
+			os.environ["PORTAGE_CONFIGROOT"] = eroot
+			# Disable RepoConfigLoader location validation, allowing raw
+			# configuration to pass through, since repo locations are not
+			# necessarily expected to exist if the configuration comes
+			# from a chroot.
+			portage._sync_mode = True
+
 	args = argv[2:]
 
 	try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-28  5:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-28  5:47 UTC (permalink / raw
  To: gentoo-commits

commit:     07d568c986ec8dfde83447fe1ed39181877dd750
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 28 05:44:33 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 28 05:45:23 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=07d568c9

bin/eapi.sh: fix inverted ___eapi_has_dostrip logic

Fixes: 9aaa652c86b2 ("Add dostrip for EAPI 7")

 bin/eapi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index f9a4744e9..40af7b776 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -77,7 +77,7 @@ ___eapi_has_docompress() {
 }
 
 ___eapi_has_dostrip() {
-	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
 }
 
 ___eapi_has_nonfatal() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-28  6:52 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-28  6:52 UTC (permalink / raw
  To: gentoo-commits

commit:     9618f5501e3db3f29a16bfb92d4b104453258eae
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 24 21:31:39 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 28 05:58:35 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9618f550

{,PKG_}INSTALL_MASK: record value in vardb

Also, skip preinst_mask phase when INSTALL_MASK is empty.

 bin/misc-functions.sh  |  8 --------
 bin/phase-functions.sh | 12 +++++++++++-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index df8361036..ee65450f2 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -381,14 +381,6 @@ preinst_mask() {
 	# in there in case any tools were built with -pg in CFLAGS.
 	cd "${T}"
 
-	# remove man pages, info pages, docs if requested
-	local f
-	for f in man info doc; do
-		if has no${f} $FEATURES; then
-			INSTALL_MASK="${INSTALL_MASK} /usr/share/${f}"
-		fi
-	done
-
 	install_mask "${ED}" "${INSTALL_MASK}"
 
 	# remove share dir if unnessesary

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 3aae3ef56..bdae68f79 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -660,13 +660,23 @@ __dyn_install() {
 	cd "${PORTAGE_BUILDDIR}"/build-info
 	set -f
 	local f x
+
+	# remove man pages, info pages, docs if requested
+	for f in man info doc; do
+		if has no${f} ${FEATURES} && \
+			! has "/usr/share/${f}" ${INSTALL_MASK}; then
+			INSTALL_MASK+=" /usr/share/${f}"
+		fi
+	done
+
 	IFS=$' \t\n\r'
 	for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE \
 		PF PKGUSE SLOT KEYWORDS HOMEPAGE DESCRIPTION \
 		ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX \
 		CXXFLAGS EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \
 		LDFLAGS LIBCFLAGS LIBCXXFLAGS QA_CONFIGURE_OPTIONS \
-		QA_DESKTOP_FILE QA_PREBUILT PROVIDES_EXCLUDE REQUIRES_EXCLUDE ; do
+		QA_DESKTOP_FILE QA_PREBUILT PROVIDES_EXCLUDE REQUIRES_EXCLUDE \
+		INSTALL_MASK PKG_INSTALL_MASK; do
 
 		x=$(echo -n ${!f})
 		[[ -n $x ]] && echo "$x" > $f


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-03-28 15:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-03-28 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     dd8c0e06ab97797860023bc88b6f66bd19a2a3a5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 28 11:44:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 28 15:42:01 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=dd8c0e06

estrip: Fix handling slashes in STRIP_MASK

Fixes: 244a62a4f275 ("Fix uses of D/ED to account for no trailing slash")

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 41686aa39..030d9e8bf 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -395,7 +395,7 @@ do
 		set -o noglob
 		strip_this=true
 		for m in $(eval echo ${STRIP_MASK}) ; do
-			[[ /${x#${ED%/}} == ${m} ]] && strip_this=false && break
+			[[ ${x#${ED%/}} == ${m} ]] && strip_this=false && break
 		done
 		set +o noglob
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-07 17:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-07 17:12 UTC (permalink / raw
  To: gentoo-commits

commit:     c26bcc33c40e2259ae71e8f2666e29e087de420e
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Sat Apr  7 14:21:44 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr  7 17:09:27 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c26bcc33

etc-update: add antergos to Arch Linux derivatives

Closes: https://github.com/gentoo/portage/pull/294

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 7cd880d7c..5a4041c07 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -36,7 +36,7 @@ OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2)
 
 case $OS_RELEASE_ID in
 	suse|opensuse) OS_FAMILY='suse' NEW_EXT='rpmnew';;
-	arch|manjaro) OS_FAMILY='arch' NEW_EXT='pacnew';;
+	arch|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-24 20:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-24 20:20 UTC (permalink / raw
  To: gentoo-commits

commit:     37430278d193116760fede99bea13c41c57b36b2
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Tue Apr 24 19:31:27 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 20:18:51 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=37430278

etc-update: fix double / in merged file names

$2 already starts with /, no need to add one between $TMP and $2

Closes: https://github.com/gentoo/portage/pull/314

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 5a4041c07..fdf205a68 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -557,7 +557,7 @@ do_merge() {
 
 	local file="${1}"
 	local ofile="${2}"
-	local mfile="${TMP}/${2}.merged"
+	local mfile="${TMP}/${2#/}.merged"
 	local -i my_input=0
 
 	if [[ -L ${file} && -L ${ofile} ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-26  9:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-26  9:06 UTC (permalink / raw
  To: gentoo-commits

commit:     3029b90aac32fa82a3f87a8bcb1bc3658b589774
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Thu Apr 26 09:03:47 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 09:05:23 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3029b90a

etc-update: include opensuse-leap in suse OS_FAMILY

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 23903a105..b15cceb4c 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -35,7 +35,7 @@ get_config() {
 OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')
 
 case $OS_RELEASE_ID in
-	suse|opensuse) OS_FAMILY='suse' NEW_EXT='rpmnew';;
+	suse|opensuse|opensuse-leap) OS_FAMILY='suse' NEW_EXT='rpmnew';;
 	arch|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-26  9:06 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-26  9:06 UTC (permalink / raw
  To: gentoo-commits

commit:     9587a9bb7b728139ec85b126d7e19515c758f092
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Thu Apr 26 09:02:10 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 09:02:10 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9587a9bb

etc-update: filter quotes from OS_RELEASE_ID

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index fdf205a68..23903a105 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -32,7 +32,7 @@ get_config() {
 		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
 }
 
-OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2)
+OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')
 
 case $OS_RELEASE_ID in
 	suse|opensuse) OS_FAMILY='suse' NEW_EXT='rpmnew';;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-26 10:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-26 10:08 UTC (permalink / raw
  To: gentoo-commits

commit:     38813c6ef20d61245e914975f53c4f4d3d84fc86
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Thu Apr 26 10:07:31 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 10:07:31 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=38813c6e

etc-update: add /usr/share to CONFIG_PROTECT for suse OS_FAMILY

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index d5f5febb7..db62f6972 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -757,7 +757,7 @@ ${SET_X} && set -x
 if [[ $OS_FAMILY == 'suse' ]]; then
 	PORTAGE_CONFIGROOT='/'
 	PORTAGE_TMPDIR='/tmp'
-	CONFIG_PROTECT='/etc'
+	CONFIG_PROTECT='/etc /usr/share'
 	CONFIG_PROTECT_MASK=''
 	[[ -f /etc/sysconfig/etc-update ]] && . /etc/sysconfig/etc-update
 elif [[ $OS_FAMILY == 'arch' ]]; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-26 10:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-26 10:08 UTC (permalink / raw
  To: gentoo-commits

commit:     b79edd9d0a12d0bb49217989bad58c7556164166
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Thu Apr 26 10:06:39 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 10:06:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b79edd9d

etc-update: include opensuse-tumbleweed in suse OS_FAMILY

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index b15cceb4c..d5f5febb7 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -35,7 +35,7 @@ get_config() {
 OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')
 
 case $OS_RELEASE_ID in
-	suse|opensuse|opensuse-leap) OS_FAMILY='suse' NEW_EXT='rpmnew';;
+	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='suse' NEW_EXT='rpmnew';;
 	arch|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-26 17:57 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-26 17:57 UTC (permalink / raw
  To: gentoo-commits

commit:     e3155774215a3520a415f926ce4495cfb0349241
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Thu Apr 26 17:53:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 17:56:05 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e3155774

etc-update: support fedora and rhel with rpm OS_FAMILY

 bin/etc-update | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index db62f6972..8b3604a4c 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -35,7 +35,8 @@ get_config() {
 OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')
 
 case $OS_RELEASE_ID in
-	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='suse' NEW_EXT='rpmnew';;
+	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;;
+	fedora|rhel) OS_FAMILY='rpm' ;;
 	arch|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac
@@ -53,7 +54,7 @@ if [[ $OS_FAMILY == 'gentoo' ]]; then
 	get_live_file() {
 		echo "${rpath}/${rfile:10}"
 	}
-elif [[ $OS_FAMILY == 'suse' ]] || [[ $OS_FAMILY == 'arch' ]]; then
+elif [[ $OS_FAMILY == 'arch' ]]; then
 	get_basename() {
 		printf -- '%s\n' "${1%.${NEW_EXT}}"
 	}
@@ -66,6 +67,20 @@ elif [[ $OS_FAMILY == 'suse' ]] || [[ $OS_FAMILY == 'arch' ]]; then
 	get_live_file() {
 		printf -- '%s\n' "${cfg_file%.${NEW_EXT}}"
 	}
+# In rpm we have rpmsave, rpmorig, and rpmnew.
+elif [[ $OS_FAMILY == 'rpm' ]]; then
+	get_basename() {
+		printf -- '%s\n' "${1}" |sed -e 's/\.rpmsave$//' -e 's/\.rpmnew$//' -e 's/\.rpmorig$//'
+	}
+	get_basename_find_opt() {
+		printf -- '%s\n' "${1}.rpm????"
+	}
+	get_scan_regexp() {
+		echo "s:\(^.*/\)\(.*\)\(\.\(rpmnew|rpmsave|rpmorig\)\):\1\2\3$b\1$b\3$b\2:"
+	}
+	get_live_file() {
+		printf -- '%s\n' "${cfg_file}" |sed -e 's/\.rpmsave$//' -e 's/\.rpmnew$//' -e 's/\.rpmorig$//'
+	}
 fi
 
 cmd_var_is_valid() {
@@ -754,7 +769,7 @@ while [[ -n $1 ]] ; do
 done
 ${SET_X} && set -x
 
-if [[ $OS_FAMILY == 'suse' ]]; then
+if [[ $OS_FAMILY == 'rpm' ]]; then
 	PORTAGE_CONFIGROOT='/'
 	PORTAGE_TMPDIR='/tmp'
 	CONFIG_PROTECT='/etc /usr/share'


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-26 18:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-26 18:04 UTC (permalink / raw
  To: gentoo-commits

commit:     06387dc2f36ac77455bef31b3925fe3810e24482
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Thu Apr 26 18:03:19 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 18:03:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=06387dc2

etc-update: fix get_scan_regexp for arch OS_FAMILY

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 8b3604a4c..720bd83d3 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -62,7 +62,7 @@ elif [[ $OS_FAMILY == 'arch' ]]; then
 		printf -- '%s\n' "${1}.${NEW_EXT}"
 	}
 	get_scan_regexp() {
-		echo "s:\(^.*/\)\(.*\)\(\.rpmnew\):\1\2\3$b\1$b\3$b\2:"
+		echo "s:\(^.*/\)\(.*\)\(\.${NEW_EXT}\):\1\2\3$b\1$b\3$b\2:"
 	}
 	get_live_file() {
 		printf -- '%s\n' "${cfg_file%.${NEW_EXT}}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-30  6:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-30  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     452018c1fbf76cf097dbee1a9bb22a8b97958014
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 02:30:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 06:11:32 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=452018c1

FifoWriter: add_writer asyncio compat (bug 654382)

Use add_writer for asyncio compatibility.

Bug: https://bugs.gentoo.org/654382

 bin/ebuild-ipc.py | 44 +++++++++++++++++++-------------------------
 1 file changed, 19 insertions(+), 25 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index b47ee2333..c2773cb6a 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # This is a helper which ebuild processes can use
@@ -53,7 +53,7 @@ RETURNCODE_WRITE_FAILED = 2
 
 class FifoWriter(AbstractPollTask):
 
-	__slots__ = ('buf', 'fifo', '_fd', '_reg_id',)
+	__slots__ = ('buf', 'fifo', '_fd')
 
 	def _start(self):
 		try:
@@ -67,31 +67,27 @@ class FifoWriter(AbstractPollTask):
 				return
 			else:
 				raise
-		self._reg_id = self.scheduler.io_add_watch(
+		self.scheduler.add_writer(
 			self._fd,
-			self.scheduler.IO_OUT | self.scheduler.IO_HUP | \
-			self._exceptional_events, self._output_handler)
+			self._output_handler)
 		self._registered = True
 
-	def _output_handler(self, fd, event):
-		if event & self.scheduler.IO_OUT:
-			# The whole buf should be able to fit in the fifo with
-			# a single write call, so there's no valid reason for
-			# os.write to raise EAGAIN here.
-			buf = self.buf
-			while buf:
+	def _output_handler(self):
+		# The whole buf should be able to fit in the fifo with
+		# a single write call, so there's no valid reason for
+		# os.write to raise EAGAIN here.
+		fd = self._fd
+		buf = self.buf
+		while buf:
+			try:
 				buf = buf[os.write(fd, buf):]
-			self.returncode = os.EX_OK
-			self._unregister()
-			self.wait()
-			return False
-		else:
-			self._unregister_if_appropriate(event)
-			if not self._registered:
+			except EnvironmentError:
 				self.returncode = RETURNCODE_WRITE_FAILED
-				self.wait()
-				return False
-		return True
+				self._async_wait()
+				return
+
+		self.returncode = os.EX_OK
+		self._async_wait()
 
 	def _cancel(self):
 		self.returncode = self._cancelled_returncode
@@ -99,10 +95,8 @@ class FifoWriter(AbstractPollTask):
 
 	def _unregister(self):
 		self._registered = False
-		if self._reg_id is not None:
-			self.scheduler.source_remove(self._reg_id)
-			self._reg_id = None
 		if self._fd is not None:
+			self.scheduler.remove_writer(self._fd)
 			os.close(self._fd)
 			self._fd = None
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-04-30 18:28 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-04-30 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     09fe2dbd14419f5619c5331f3525bf827269021c
Author:     Tomáš Chvátal <tomas.chvatal <AT> gmail <DOT> com>
AuthorDate: Mon Apr 30 18:26:30 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 18:27:23 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=09fe2dbd

etc-update: fix rpm get_basename_find_opt for rpmnew

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 720bd83d3..4f02876ef 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -73,7 +73,7 @@ elif [[ $OS_FAMILY == 'rpm' ]]; then
 		printf -- '%s\n' "${1}" |sed -e 's/\.rpmsave$//' -e 's/\.rpmnew$//' -e 's/\.rpmorig$//'
 	}
 	get_basename_find_opt() {
-		printf -- '%s\n' "${1}.rpm????"
+		printf -- '%s\n' "${1}.rpm???*"
 	}
 	get_scan_regexp() {
 		echo "s:\(^.*/\)\(.*\)\(\.\(rpmnew|rpmsave|rpmorig\)\):\1\2\3$b\1$b\3$b\2:"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-01 16:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-01 16:26 UTC (permalink / raw
  To: gentoo-commits

commit:     d51ca86a44fd10b13db749a7945bba1573b76ff5
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 28 22:11:17 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  1 08:28:43 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d51ca86a

econf: Pass --with-sysroot="${ESYSROOT:-/}" under EAPI 7

Bug: https://bugs.gentoo.org/317337

 bin/eapi.sh          | 4 ++++
 bin/phase-helpers.sh | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 3f4c9691b..3b6a5c1a9 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -178,6 +178,10 @@ ___eapi_econf_passes_--docdir_and_--htmldir() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_econf_passes_--with-sysroot() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
+}
+
 ___eapi_use_enable_and_use_with_support_empty_third_argument() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 556d089b5..f6c9ef6fc 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -640,7 +640,7 @@ econf() {
 		fi
 
 		local conf_args=()
-		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules || ___eapi_econf_passes_--docdir_and_--htmldir; then
+		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules || ___eapi_econf_passes_--docdir_and_--htmldir || ___eapi_econf_passes_--with-sysroot; then
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
@@ -664,6 +664,12 @@ econf() {
 					conf_args+=( --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html )
 				fi
 			fi
+
+			if ___eapi_econf_passes_--with-sysroot; then
+				if [[ ${conf_help} == *--with-sysroot* ]]; then
+					conf_args+=( --with-sysroot="${ESYSROOT:-/}" )
+				fi
+			fi
 		fi
 
 		# if the profile defines a location to install libs to aside from default, pass it on.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-01 16:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-01 16:26 UTC (permalink / raw
  To: gentoo-commits

commit:     43b6be7423aaebee26e4659d580a9a17b4fde01e
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  7 23:14:40 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  1 08:28:44 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=43b6be74

phase-helpers.sh: Implement -r|-d|-b options for best/has_version

The code for these functions is practically identical so refactor them
around a common function.

 bin/eapi.sh          |   6 ++-
 bin/phase-helpers.sh | 146 ++++++++++++++++++++-------------------------------
 2 files changed, 63 insertions(+), 89 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 3b6a5c1a9..455bc9b0d 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -155,7 +155,11 @@ ___eapi_has_package_manager_build_group() {
 # HELPERS BEHAVIOR
 
 ___eapi_best_version_and_has_version_support_--host-root() {
-	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
+	[[ ${1-${EAPI-0}} =~ ^(5|5-progress|6)$ ]]
+}
+
+___eapi_best_version_and_has_version_support_-b_-d_-r() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
 }
 
 ___eapi_unpack_supports_xz() {

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f6c9ef6fc..59c19cf67 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -878,46 +878,55 @@ __eapi6_src_install() {
 	einstalldocs
 }
 
-# @FUNCTION: has_version
-# @USAGE: [--host-root] <DEPEND ATOM>
-# @DESCRIPTION:
-# Return true if given package is installed. Otherwise return false.
-# Callers may override the ROOT variable in order to match packages from an
-# alternative ROOT.
-has_version() {
-
-	local atom eroot host_root=false root=${ROOT}
-	if [[ $1 == --host-root ]] ; then
-		host_root=true
-		shift
-	fi
+___best_version_and_has_version_common() {
+	local atom root root_arg
+	case $1 in
+		--host-root|-r|-d|-b)
+			root_arg=$1
+			shift ;;
+	esac
 	atom=$1
 	shift
-	[ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
+	[ $# -gt 0 ] && die "${FUNCNAME[1]}: unused argument(s): $*"
 
-	if ${host_root} ; then
-		if ! ___eapi_best_version_and_has_version_support_--host-root; then
-			die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
-		fi
-		root=/
-	fi
+	case ${root_arg} in
+		"") if ___eapi_has_prefix_variables; then
+				root=${EROOT}
+			else
+				root=${ROOT}
+			fi ;;
+		--host-root)
+			if ! ___eapi_best_version_and_has_version_support_--host-root; then
+				die "${FUNCNAME[1]}: option ${root_arg} is not supported with EAPI ${EAPI}"
+			fi
+			if ___eapi_has_prefix_variables; then
+				root=/${PORTAGE_OVERRIDE_EPREFIX#/}
+			else
+				root=/
+			fi ;;
+		-r|-d|-b)
+			if ! ___eapi_best_version_and_has_version_support_-b_-d_-r; then
+				die "${FUNCNAME[1]}: option ${root_arg} is not supported with EAPI ${EAPI}"
+			fi
+			if ___eapi_has_prefix_variables; then
+				case ${root_arg} in
+					-r) root=${EROOT} ;;
+					-d) root=${ESYSROOT} ;;
+					-b) root=${BROOT:-/} ;;
+				esac
+			else
+				case ${root_arg} in
+					-r) root=${ROOT} ;;
+					-d) root=${SYSROOT} ;;
+					-b) root=/ ;;
+				esac
+			fi ;;
+	esac
 
-	if ___eapi_has_prefix_variables; then
-		# [[ ${root} == / ]] would be ambiguous here,
-		# since both prefixes can share root=/ while
-		# having different EPREFIX offsets.
-		if ${host_root} ; then
-			eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
-		else
-			eroot=${root%/}${EPREFIX}/
-		fi
-	else
-		eroot=${root}
-	fi
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "${atom}"
+		"${PORTAGE_BIN_PATH}"/ebuild-ipc "${FUNCNAME[1]}" "${root}" "${atom}"
 	else
-		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" has_version "${eroot}" "${atom}"
+		"${PORTAGE_BIN_PATH}"/ebuild-helpers/portageq "${FUNCNAME[1]}" "${root}" "${atom}"
 	fi
 	local retval=$?
 	case "${retval}" in
@@ -925,75 +934,36 @@ has_version() {
 			return ${retval}
 			;;
 		2)
-			die "${FUNCNAME[0]}: invalid atom: ${atom}"
+			die "${FUNCNAME[1]}: invalid atom: ${atom}"
 			;;
 		*)
 			if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
-				die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
+				die "${FUNCNAME[1]}: unexpected ebuild-ipc exit code: ${retval}"
 			else
-				die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
+				die "${FUNCNAME[1]}: unexpected portageq exit code: ${retval}"
 			fi
 			;;
 	esac
 }
 
+# @FUNCTION: has_version
+# @USAGE: [--host-root|-r|-d|-b] <DEPEND ATOM>
+# @DESCRIPTION:
+# Return true if given package is installed. Otherwise return false.
+# Callers may override the ROOT variable in order to match packages from an
+# alternative ROOT.
+has_version() {
+	___best_version_and_has_version_common "$@"
+}
+
 # @FUNCTION: best_version
-# @USAGE: [--host-root] <DEPEND ATOM>
+# @USAGE: [--host-root|-r|-d|-b] <DEPEND ATOM>
 # @DESCRIPTION:
 # Returns highest installed matching category/package-version (without .ebuild).
 # Callers may override the ROOT variable in order to match packages from an
 # alternative ROOT.
 best_version() {
-
-	local atom eroot host_root=false root=${ROOT}
-	if [[ $1 == --host-root ]] ; then
-		host_root=true
-		shift
-	fi
-	atom=$1
-	shift
-	[ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
-
-	if ${host_root} ; then
-		if ! ___eapi_best_version_and_has_version_support_--host-root; then
-			die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
-		fi
-		root=/
-	fi
-
-	if ___eapi_has_prefix_variables; then
-		# [[ ${root} == / ]] would be ambiguous here,
-		# since both prefixes can share root=/ while
-		# having different EPREFIX offsets.
-		if ${host_root} ; then
-			eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
-		else
-			eroot=${root%/}${EPREFIX}/
-		fi
-	else
-		eroot=${root}
-	fi
-	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "${atom}"
-	else
-		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" best_version "${eroot}" "${atom}"
-	fi
-	local retval=$?
-	case "${retval}" in
-		0|1)
-			return ${retval}
-			;;
-		2)
-			die "${FUNCNAME[0]}: invalid atom: ${atom}"
-			;;
-		*)
-			if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
-				die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
-			else
-				die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
-			fi
-			;;
-	esac
+	___best_version_and_has_version_common "$@"
 }
 
 if ___eapi_has_get_libdir; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-03  1:15 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-03  1:15 UTC (permalink / raw
  To: gentoo-commits

commit:     9ad4ed599f2e56d7a73f129ec8969d7295fd8df3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May  3 01:12:55 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May  3 01:12:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9ad4ed59

bin/ebuild: selectively handle PortageKeyerror from doebuild

In order to avoid swallowing an unexpected KeyError, selectively
handle PortageKeyerror from doebuild.

 bin/ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index b1ef0573b..5221b21a8 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -352,7 +352,7 @@ for arg in pargs:
 	except KeyboardInterrupt:
 		print("Interrupted.")
 		a = 1
-	except KeyError:
+	except PortageKeyError:
 		# aux_get error
 		a = 1
 	except UnsupportedAPIException as e:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-16 16:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-16 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     9abebd3e6aae049d2eb9c8039453d7f187bca00f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 16 16:48:16 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 16 16:51:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9abebd3e

phase-helpers.sh: fix ROOT overrides for has/best_version (bug 655860)

Since it's common for code to override the ROOT variable, use
${ROOT%/}/${EPREFIX} instead of ${EROOT}. Thanks to Mike Gilbert
<floppym <AT> gentoo.org> for finding the cause.

Fixes: 43b6be7423aa ("phase-helpers.sh: Implement -r|-d|-b options for best/has_version")
Bug: https://bugs.gentoo.org/655860

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 59c19cf67..9163ef014 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -891,7 +891,7 @@ ___best_version_and_has_version_common() {
 
 	case ${root_arg} in
 		"") if ___eapi_has_prefix_variables; then
-				root=${EROOT}
+				root=${ROOT%/}/${EPREFIX}
 			else
 				root=${ROOT}
 			fi ;;
@@ -910,7 +910,7 @@ ___best_version_and_has_version_common() {
 			fi
 			if ___eapi_has_prefix_variables; then
 				case ${root_arg} in
-					-r) root=${EROOT} ;;
+					-r) root=${ROOT%/}/${EPREFIX} ;;
 					-d) root=${ESYSROOT} ;;
 					-b) root=${BROOT:-/} ;;
 				esac


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-16 17:32 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-16 17:32 UTC (permalink / raw
  To: gentoo-commits

commit:     1d1a20f48f5f37316b7827428e95714137078ea1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 16 17:25:56 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 16 17:32:20 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d1a20f4

phase-helpers.sh: normalize has/best_version root more (cosmetic)

This eliminates a double slash when ${EPREFIX} is non-empty,
though it's only a cosmetic fix since both portageq and
QueryCommand normalize the root argument.

Fixes: 9abebd3e6aae ("phase-helpers.sh: fix ROOT overrides for has/best_version (bug 655860)")
Reported-by: Douglas Freed <dwfreed <AT> mtu.edu>
Reported-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 9163ef014..3e455d715 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -891,7 +891,7 @@ ___best_version_and_has_version_common() {
 
 	case ${root_arg} in
 		"") if ___eapi_has_prefix_variables; then
-				root=${ROOT%/}/${EPREFIX}
+				root=${ROOT%/}/${EPREFIX#/}
 			else
 				root=${ROOT}
 			fi ;;
@@ -910,7 +910,7 @@ ___best_version_and_has_version_common() {
 			fi
 			if ___eapi_has_prefix_variables; then
 				case ${root_arg} in
-					-r) root=${ROOT%/}/${EPREFIX} ;;
+					-r) root=${ROOT%/}/${EPREFIX#/} ;;
 					-d) root=${ESYSROOT} ;;
 					-b) root=${BROOT:-/} ;;
 				esac


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-16 20:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-16 20:46 UTC (permalink / raw
  To: gentoo-commits

commit:     17fce85669beec41747d65b37a55747b2f3ddb3c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 16 20:35:57 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 16 20:35:57 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=17fce856

phase-helpers.sh: fix has/best_version for cross-prefix portageq (bug 655414)

When the portageq root argument refers to ${PORTAGE_OVERRIDE_EPREFIX},
also export a consistent ${EPREFIX}, since portageq asserts that the
root argument ends with ${EPREFIX}.

Bug: https://bugs.gentoo.org/655414

 bin/phase-helpers.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3e455d715..99a30a176 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -900,7 +900,10 @@ ___best_version_and_has_version_common() {
 				die "${FUNCNAME[1]}: option ${root_arg} is not supported with EAPI ${EAPI}"
 			fi
 			if ___eapi_has_prefix_variables; then
+				# Since portageq requires the root argument be consistent
+				# with EPREFIX, ensure consistency here (bug 655414).
 				root=/${PORTAGE_OVERRIDE_EPREFIX#/}
+				local -x EPREFIX=${PORTAGE_OVERRIDE_EPREFIX}
 			else
 				root=/
 			fi ;;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-16 20:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-16 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     1582103b2f0f64e5dc57eddc4217360eac230b8a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 16 20:54:23 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 16 20:56:43 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1582103b

phase-helpers.sh: handle readonly EPREFIX for local override (bug 655414)

Since ebuild.sh calls "declare -r ED EPREFIX EROOT", use env to
override EPREFIX for the called command.

Fixes: 17fce85669be ("phase-helpers.sh: fix has/best_version for cross-prefix portageq (bug 655414)")

 bin/phase-helpers.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 99a30a176..5c9f957e9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -880,6 +880,7 @@ __eapi6_src_install() {
 
 ___best_version_and_has_version_common() {
 	local atom root root_arg
+	local -a cmd=()
 	case $1 in
 		--host-root|-r|-d|-b)
 			root_arg=$1
@@ -903,7 +904,7 @@ ___best_version_and_has_version_common() {
 				# Since portageq requires the root argument be consistent
 				# with EPREFIX, ensure consistency here (bug 655414).
 				root=/${PORTAGE_OVERRIDE_EPREFIX#/}
-				local -x EPREFIX=${PORTAGE_OVERRIDE_EPREFIX}
+				cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
 			else
 				root=/
 			fi ;;
@@ -927,10 +928,11 @@ ___best_version_and_has_version_common() {
 	esac
 
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
-		"${PORTAGE_BIN_PATH}"/ebuild-ipc "${FUNCNAME[1]}" "${root}" "${atom}"
+		cmd+=("${PORTAGE_BIN_PATH}"/ebuild-ipc "${FUNCNAME[1]}" "${root}" "${atom}")
 	else
-		"${PORTAGE_BIN_PATH}"/ebuild-helpers/portageq "${FUNCNAME[1]}" "${root}" "${atom}"
+		cmd+=("${PORTAGE_BIN_PATH}"/ebuild-helpers/portageq "${FUNCNAME[1]}" "${root}" "${atom}")
 	fi
+	"${cmd[@]}"
 	local retval=$?
 	case "${retval}" in
 		0|1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-18 16:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-18 16:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6c32161a8a2db662c49c7763803a4219fd994612
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 04:07:24 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 18 16:06:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6c32161a

misc-functions: fix selinux labelling on musl

musl's implementation of getopt is different from glibc's in that it
does not accept flags after non-flag arguments, moving the flags earlier
makes SELinux labelling work on musl also.

Bug: https://bugs.gentoo.org/655996
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>

 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index f3ad52305..de8af955d 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -447,7 +447,7 @@ preinst_selinux_labels() {
 
 				addwrite /sys/fs/selinux/context
 
-				/usr/sbin/setfiles -F "${file_contexts_path}" -r "${D}" "${D}"
+				/usr/sbin/setfiles -F -r "${D}" "${file_contexts_path}" "${D}"
 			) || die "Failed to set SELinux security labels."
 		else
 			# nonfatal, since merging can happen outside a SE kernel


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-18 16:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-18 16:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7bbbee4c03367c09ec9cb19737066c781f28c06d
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 04:05:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 18 16:05:56 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7bbbee4c

misc-functions: /selinux is gone in favour of /sys/fs/selinux

It was moved to /sys/fs/selinux/ long ago and not supported anymore

Bug: https://bugs.gentoo.org/655996
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>

 bin/misc-functions.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 0648e6cfd..f3ad52305 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -439,14 +439,12 @@ preinst_selinux_labels() {
 		# SELinux file labeling (needs to execute after preinst)
 		# only attempt to label if setfiles is executable
 		# and 'context' is available on selinuxfs.
-		if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
-			[ -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
+		if [ -f /sys/fs/selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
 			__vecho ">>> Setting SELinux security labels"
 			(
 				eval "$(/usr/sbin/selinuxconfig)" || \
 					die "Failed to determine SELinux policy paths.";
 
-				addwrite /selinux/context
 				addwrite /sys/fs/selinux/context
 
 				/usr/sbin/setfiles -F "${file_contexts_path}" -r "${D}" "${D}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-05-26  6:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-05-26  6:36 UTC (permalink / raw
  To: gentoo-commits

commit:     a468a995ba3e5931971804bdda485a88e68b0e18
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Sat May 26 06:05:59 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 26 06:29:21 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a468a995

etc-update: consistently use double bracket operator

Closes: https://github.com/gentoo/portage/pull/323

 bin/etc-update | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index 4f02876ef..afdd48ce8 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -146,8 +146,8 @@ scan() {
 		find_opts+=( "$name_opt" )
 		find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
 
-		if [ ! -w "${path}" ] ; then
-			[ -e "${path}" ] || continue
+		if [[ ! -w ${path} ]] ; then
+			[[ -e ${path} ]] || continue
 			die "Need write access to ${path}"
 		fi
 
@@ -383,7 +383,7 @@ read_int() {
 }
 
 do_file() {
-	interactive_echo() { [ "${OVERWRITE_ALL}" != "yes" ] && [ "${DELETE_ALL}" != "yes" ] && echo; }
+	interactive_echo() { [[ ${OVERWRITE_ALL} != yes ]] && [[ ${DELETE_ALL} != yes ]] && echo; }
 	interactive_echo
 	local -i my_input
 	local -i linecnt
@@ -541,17 +541,17 @@ do_cfg() {
 		case ${my_input} in
 			1)	echo "Replacing ${ofile} with ${file}"
 				do_mv_ln ${mv_opts} "${file}" "${ofile}"
-				[ -n "${OVERWRITE_ALL}" ] && my_input=-1
+				[[ -n ${OVERWRITE_ALL} ]] && my_input=-1
 				continue
 				;;
 			2)	echo "Deleting ${file}"
 				rm ${rm_opts} "${file}"
-				[ -n "${DELETE_ALL}" ] && my_input=-1
+				[[ -n ${DELETE_ALL} ]] && my_input=-1
 				continue
 				;;
 			3)	do_merge "${file}" "${ofile}"
 				my_input=${?}
-#				[ ${my_input} == 255 ] && my_input=-1
+#				[[ ${my_input} == 255 ]] && my_input=-1
 				continue
 				;;
 			4)	continue
@@ -696,10 +696,10 @@ die() {
 	trap SIGINT
 	local msg=$1 exitcode=${2:-1}
 
-	if [ ${exitcode} -eq 0 ] ; then
+	if [[ ${exitcode} -eq 0 ]] ; then
 		${QUIET} || printf 'Exiting: %b\n' "${msg}"
 		scan > /dev/null
-		! ${QUIET} && [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
+		! ${QUIET} && [[ ${count} -gt 0 ]] && echo "NOTE: ${count} updates remaining"
 	else
 		error "${msg}"
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-06-15 23:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-06-15 23:56 UTC (permalink / raw
  To: gentoo-commits

commit:     779468506ce7cfa22050eced1588f870e7404a00
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Fri Jun 15 21:42:43 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 15 23:54:43 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=77946850

etc-update: add archarm to arch OS_FAMILY

Closes: https://github.com/gentoo/portage/pull/325

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index afdd48ce8..850f6a21b 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -37,7 +37,7 @@ OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 |
 case $OS_RELEASE_ID in
 	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;;
 	fedora|rhel) OS_FAMILY='rpm' ;;
-	arch|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
+	arch|archarm|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-07-28  6:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-07-28  6:12 UTC (permalink / raw
  To: gentoo-commits

commit:     ef01e3d9373cb64320df290494c13e3f2cf6a0c0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 23 04:26:25 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul 27 16:08:26 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ef01e3d9

emerge-webrsync: exit early for signature problem (bug 661838)

Exit early after signature verification failure, since it's
typically inappropriate to try other mirrors in this case
(it may indicate a keyring problem).

Bug: https://bugs.gentoo.org/661838
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/emerge-webrsync | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 560dd0236..b135567b7 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -191,6 +191,13 @@ check_file_signature() {
 					fi
 				done <<< "${gnupg_status}"
 			fi
+			if [[ ${r} -ne 0 ]]; then
+				# Exit early since it's typically inappropriate to
+				# try other mirrors in this case (it may indicate
+				# a keyring problem).
+				eecho "signature verification failed"
+				exit 1
+			fi
 		else
 			eecho "cannot check signature: gpg binary not found"
 			exit 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-08-01 20:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-08-01 20:51 UTC (permalink / raw
  To: gentoo-commits

commit:     50232e5d8c153e5500c97be29d6347f960e01760
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Wed Aug  1 20:05:48 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug  1 20:50:20 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=50232e5d

etc-update: add arch32 to arch OS_FAMILY (for the 32-bit users)

Closes: https://github.com/gentoo/portage/pull/349

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 850f6a21b..f0aaca1e6 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -37,7 +37,7 @@ OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 |
 case $OS_RELEASE_ID in
 	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;;
 	fedora|rhel) OS_FAMILY='rpm' ;;
-	arch|archarm|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
+	arch|archarm|arch32|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo' ;;
 esac
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-08-08 21:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-08-08 21:45 UTC (permalink / raw
  To: gentoo-commits

commit:     24d4a557cba289327b67b0d339e04995cc293020
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  8 21:22:50 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug  8 21:26:31 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=24d4a557

bin/phase-functions.sh: Filter SYSROOT unconditionally

It is propagated in every EAPI because it was used unofficially before
EAPI 7.

Bug: https://bugs.gentoo.org/661006
Closes: https://github.com/gentoo/portage/pull/356

 bin/phase-functions.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 1f9faaa41..51b480bfb 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -100,12 +100,13 @@ __filter_readonly_variables() {
 	filtered_vars="$readonly_bash_vars $bash_misc_vars
 		$PORTAGE_READONLY_VARS $misc_garbage_vars"
 
+	# Filter SYSROOT unconditionally. It is propagated in every EAPI
+	# because it was used unofficially before EAPI 7. See bug #661006.
+	filtered_vars+=" SYSROOT"
+
 	if ___eapi_has_BROOT; then
 		filtered_vars+=" BROOT"
 	fi
-	if ___eapi_has_SYSROOT; then
-		filtered_vars+=" SYSROOT"
-	fi
 	# Don't filter/interfere with prefix variables unless they are
 	# supported by the current EAPI.
 	if ___eapi_has_prefix_variables; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-08-11  8:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-08-11  8:14 UTC (permalink / raw
  To: gentoo-commits

commit:     9f66589863e10c074c8bf652d7f9ef7631e10d61
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  9 22:56:33 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 10 00:00:25 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9f665898

XARGS: use gxargs for USERLAND=BSD (bug 663256)

For USERLAND=BSD, set XARGS="gxargs -r" if gxargs is available,
so the code from bug 630292 works for USERLAND=BSD.

Fixes: 50283f1abb77 (install-qa-check.d/60pngfix: parallel support (bug 630292))
Bug: https://bugs.gentoo.org/663256
Reported-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: M. J. Everitt <m.j.everitt <AT> iee.org>
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/isolated-functions.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 28ca94532..cac42a4c5 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -448,7 +448,11 @@ fi
 if [[ -z ${XARGS} ]] ; then
 	case ${USERLAND} in
 	BSD)
-		export XARGS="xargs"
+		if type -P gxargs > /dev/null; then
+			export XARGS="gxargs -r"
+		else
+			export XARGS="xargs"
+		fi
 		;;
 	*)
 		export XARGS="xargs -r"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-08-16 17:15 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-08-16 17:15 UTC (permalink / raw
  To: gentoo-commits

commit:     1d2e1ee6ec7fd3d9a1e2713a19ef8a4f4db6ecf0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 16 17:11:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 16 17:11:29 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d2e1ee6

bin/ebuild: fix --debug to work during manifest generation

Reported-by: M. J. Everitt <m.j.everitt <AT> iee.org>

 bin/ebuild | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/ebuild b/bin/ebuild
index 5aa3ead95..8b58988c4 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -104,6 +104,12 @@ if not opts.ignore_default_opts:
 debug = opts.debug
 force = opts.force
 
+if debug:
+	# Ensure that all config instances have this setting,
+	# including the one that's used by portdbapi for aux_get.
+	os.environ['PORTAGE_DEBUG'] = '1'
+	portage._reset_legacy_globals()
+
 # do this _after_ 'import portage' to prevent unnecessary tracing
 if debug and "python-trace" in portage.features:
 	import portage.debug


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-03 18:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-09-03 18:25 UTC (permalink / raw
  To: gentoo-commits

commit:     102220e1f71341e9bc85236074813f191bb389a4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  2 21:55:56 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  3 17:38:15 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=102220e1

phase-helpers.sh: has/best_version -b in any phase (bug 665038)

Since BROOT is only defined in src_* phases, make has/best_version -b
use the equivalent /${PORTAGE_OVERRIDE_EPREFIX#/} value that is defined
in all phases. This makes has/best_version -b in EAPI 7 behave exactly
the same as --host-root behaves in EAPI 6, allowing python ebuilds to
call python_setup in any ebuild phase.

Bug: https://bugs.gentoo.org/665038
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 bin/phase-helpers.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5c9f957e9..ba3f27930 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -916,7 +916,12 @@ ___best_version_and_has_version_common() {
 				case ${root_arg} in
 					-r) root=${ROOT%/}/${EPREFIX#/} ;;
 					-d) root=${ESYSROOT} ;;
-					-b) root=${BROOT:-/} ;;
+					-b)
+						# Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
+						# to BROOT, except BROOT is only defined in src_* phases.
+						root=/${PORTAGE_OVERRIDE_EPREFIX#/}
+						cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
+						;;
 				esac
 			else
 				case ${root_arg} in


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-17 18:18 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-09-17 18:18 UTC (permalink / raw
  To: gentoo-commits

commit:     ebe96286279fde6dfc989d03e5da834f0382d1a2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 28 12:18:20 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Sep 17 18:17:18 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ebe96286

estrip: Use find -delete instead of manual rm

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/364

 bin/estrip | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 5709b862c..3ee4b01ac 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -363,10 +363,9 @@ done < <(
 )
 else
 while IFS= read -d '' -r x ; do
-	rm -f "${x}" || die
 	inode_link=$(get_inode_number "${x%.estrip}") || die "stat failed unexpectedly"
 	echo "${x%.estrip}" >> "${inode_link}" || die "echo failed unexpectedly"
-done < <(find "${ED}" -name '*.estrip' -print0)
+done < <(find "${ED}" -name '*.estrip' -delete -print0)
 fi
 
 # Now we look for unstripped binaries.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-20 18:49 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-09-20 18:49 UTC (permalink / raw
  To: gentoo-commits

commit:     289d9a17dc9d9287e5dcb75f84b38ad0388e5fde
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 20 18:20:25 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 20 18:48:42 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=289d9a17

ecompress: Run compression in parallel

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/365

 bin/ecompress | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 075f4225e..83d97ae6e 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -136,8 +136,8 @@ fix_symlinks() {
 }
 
 export PORTAGE_COMPRESS PORTAGE_COMPRESS_FLAGS
-find "${ED}" -name '*.ecompress' -delete \
-	-exec "${PORTAGE_BIN_PATH}"/ecompress-file {} +
+find "${ED}" -name '*.ecompress' -delete -print0 |
+	___parallel_xargs -0 "${PORTAGE_BIN_PATH}"/ecompress-file
 ret=${?}
 
 fix_symlinks


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-24 20:24 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-09-24 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     fbc100e6880291ea18cfcf8aa0a40c4d921dceaf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 24 20:22:20 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 24 20:24:03 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fbc100e6

ecompress: delete *.ecompress for empty PORTAGE_COMPRESS (bug 667008)

Fixes: aa0a94198794 ("ecompress: Replace with implementation from portage[mgorny]")
Bug: https://bugs.gentoo.org/667008
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/ecompress b/bin/ecompress
index 83d97ae6e..36bdb585b 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -69,7 +69,10 @@ done
 
 # setup compression stuff
 PORTAGE_COMPRESS=${PORTAGE_COMPRESS-bzip2}
-[[ -z ${PORTAGE_COMPRESS} ]] && exit 0
+if [[ -z ${PORTAGE_COMPRESS} ]]; then
+	find "${ED}" -name '*.ecompress' -delete
+	exit 0
+fi
 
 if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
 	case ${PORTAGE_COMPRESS} in


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-25 21:04 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-09-25 21:04 UTC (permalink / raw
  To: gentoo-commits

commit:     8a1d36088aa54ecb087e76fef166d51a6d5383f7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 20:58:40 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 25 21:01:15 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8a1d3608

Revert "ecompress: Run compression in parallel" (bug 667072)

This reverts commit 289d9a17dc9d9287e5dcb75f84b38ad0388e5fde.
The parallel ecompress-file calls can interfere with eachoter
if a file is installed with both compressed and uncompressed
forms. Since compressed files are typically very small,
parallel compression is typically not very helpful anyway.

Bug: https://bugs.gentoo.org/667072
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 36bdb585b..434456f0c 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -139,8 +139,8 @@ fix_symlinks() {
 }
 
 export PORTAGE_COMPRESS PORTAGE_COMPRESS_FLAGS
-find "${ED}" -name '*.ecompress' -delete -print0 |
-	___parallel_xargs -0 "${PORTAGE_BIN_PATH}"/ecompress-file
+find "${ED}" -name '*.ecompress' -delete \
+	-exec "${PORTAGE_BIN_PATH}"/ecompress-file {} +
 ret=${?}
 
 fix_symlinks


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-26 22:53 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-09-26 22:53 UTC (permalink / raw
  To: gentoo-commits

commit:     1fc311ce0afeef9f982213e43220d079a4ffec26
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 22:29:30 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 22:39:31 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1fc311ce

ecompress-file: de-duplicate filtered_args (bug 667072)

Use an associated array to de-duplicate filtered_args, in order to
ensure that compressor arguments are unique when a file is installed
in both compressed and uncompressed forms.

Bug: https://bugs.gentoo.org/667072
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress-file | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/ecompress-file b/bin/ecompress-file
index 18269c91b..e65b21ee4 100755
--- a/bin/ecompress-file
+++ b/bin/ecompress-file
@@ -13,7 +13,7 @@ compress_file() {
 	done
 	set +f
 	mask_ext_re="^(${mask_ext_re:1})\$"
-	local filtered_args=()
+	local -A filtered_args
 	local had_precompressed=
 	for x in "$@" ; do
 		[[ ${x##*.} =~ $mask_ext_re ]] && continue
@@ -35,10 +35,10 @@ compress_file() {
 				had_precompressed=1;;
 		esac
 
-		filtered_args+=( "$x" )
+		filtered_args[${x}]=
 	done
 	[[ ${#filtered_args[@]} -eq 0 ]] && return 0
-	set -- "${filtered_args[@]}"
+	set -- "${!filtered_args[@]}"
 
 	if [[ ${had_precompressed} ]]; then
 		eqawarn "One or more compressed files were found in docompress-ed directories."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-28 20:33 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-09-28 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     78c036c507ec8c87bf5dd7cc388cbf7e038a51ed
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 19:12:20 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 28 20:32:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=78c036c5

ecompress: Detect and report colliding (un)compressed files

Whenever the install directory contains files that would collide upon
(re)compressing, report them explicitly and skip decompressing.

To reduce performance impact, the check is only done whenever compressed
files are found.  This is sufficient since for issue to occur there must
be at least one compressed variant.

Bug: https://bugs.gentoo.org/667072
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/bin/ecompress b/bin/ecompress
index 36bdb585b..635073b5f 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -48,9 +48,41 @@ while [[ $# -gt 0 ]] ; do
 			[[ -n ${PORTAGE_DOCOMPRESS_SIZE_LIMIT} ]] &&
 				find_args+=( -size "+${PORTAGE_DOCOMPRESS_SIZE_LIMIT}c" )
 
+			declare -A collisions
 			while IFS= read -d '' -r path; do
+				# detect the horrible posibility of the ebuild installing
+				# colliding compressed and/or uncompressed variants
+				# and fail hard (bug #667072)
+				#
+				# note: to save time, we need to do this only if there's
+				# at least one compressed file
+				case ${path} in
+					*.Z|*.gz|*.bz2|*.lzma|*.xz)
+						vpath=${path%.*}
+						for comp in '' .Z .gz .bz2 .lzma .xz; do
+							if [[ ${vpath}${comp} != ${path} && \
+									-e ${vpath}${comp} ]]; then
+								collisions[${path}]=1
+								collisions[${vpath}]=1
+								# ignore compressed variants in that case
+								continue 2
+							fi
+						done
+						;;
+				esac
+
 				>> "${path}.ecompress" || die
 			done < <(find "${find_args[@]}" -print0 || die)
+
+			if [[ ${#collisions[@]} -gt 0 ]]; then
+				eqawarn "Colliding files found by ecompress:"
+				eqawarn
+				for x in "${!collisions[@]}"; do
+					eqawarn "  ${x}"
+				done
+				eqawarn
+				eqawarn "Please remove the extraneous compressed variants."
+			fi
 		fi
 
 		exit 0


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-28 20:33 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-09-28 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     519b35146fdd334dbc2d5168c06ec167d1fc7084
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 28 07:16:58 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 28 20:32:33 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=519b3514

Revert "ecompress-file: de-duplicate filtered_args (bug 667072)"

Reverts: 1fc311ce0afeef9f982213e43220d079a4ffec26
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress-file | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/ecompress-file b/bin/ecompress-file
index e65b21ee4..18269c91b 100755
--- a/bin/ecompress-file
+++ b/bin/ecompress-file
@@ -13,7 +13,7 @@ compress_file() {
 	done
 	set +f
 	mask_ext_re="^(${mask_ext_re:1})\$"
-	local -A filtered_args
+	local filtered_args=()
 	local had_precompressed=
 	for x in "$@" ; do
 		[[ ${x##*.} =~ $mask_ext_re ]] && continue
@@ -35,10 +35,10 @@ compress_file() {
 				had_precompressed=1;;
 		esac
 
-		filtered_args[${x}]=
+		filtered_args+=( "$x" )
 	done
 	[[ ${#filtered_args[@]} -eq 0 ]] && return 0
-	set -- "${!filtered_args[@]}"
+	set -- "${filtered_args[@]}"
 
 	if [[ ${had_precompressed} ]]; then
 		eqawarn "One or more compressed files were found in docompress-ed directories."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-28 20:33 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-09-28 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     fe4f9bd02f5085e631452d4b5617f5537c5d9b66
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 19:13:57 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 28 20:32:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fe4f9bd0

ecompress: Fix duplicate pre-compressed file warning

Fix the pre-compressed file warning to be reported only once, now that
files are processed in parallel.  Also, print the list of precompressed
files verbosely.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress      | 16 ++++++++++++++++
 bin/ecompress-file | 16 +++-------------
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 635073b5f..dfa1a0b44 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -68,6 +68,7 @@ while [[ $# -gt 0 ]] ; do
 								continue 2
 							fi
 						done
+						echo "${path}" >> "${T}"/.ecompress_had_precompressed
 						;;
 				esac
 
@@ -175,6 +176,21 @@ find "${ED}" -name '*.ecompress' -delete -print0 |
 	___parallel_xargs -0 "${PORTAGE_BIN_PATH}"/ecompress-file
 ret=${?}
 
+if [[ -f ${T}/.ecompress_had_precompressed ]]; then
+	eqawarn "One or more compressed files were found in docompress-ed directories."
+	eqawarn "Please fix the ebuild not to install compressed files (manpages,"
+	eqawarn "documentation) when automatic compression is used:"
+	eqawarn
+	n=0
+	while read -r f; do
+		eqawarn "  ${f#${D%/}}"
+		if [[ $(( n++ )) -eq 10 ]]; then
+			eqawarn "  ..."
+			break
+		fi
+	done <"${T}"/.ecompress_had_precompressed
+fi
+
 fix_symlinks
 : $(( ret |= ${?} ))
 [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"

diff --git a/bin/ecompress-file b/bin/ecompress-file
index 18269c91b..bc8fe5451 100755
--- a/bin/ecompress-file
+++ b/bin/ecompress-file
@@ -14,7 +14,6 @@ compress_file() {
 	set +f
 	mask_ext_re="^(${mask_ext_re:1})\$"
 	local filtered_args=()
-	local had_precompressed=
 	for x in "$@" ; do
 		[[ ${x##*.} =~ $mask_ext_re ]] && continue
 		[[ -s ${x} ]] || continue
@@ -23,16 +22,13 @@ compress_file() {
 		case ${x} in
 			*.gz|*.Z)
 				gunzip -f "${x}" || __helpers_die "gunzip failed"
-				x=${x%.*}
-				had_precompressed=1;;
+				x=${x%.*};;
 			*.bz2)
 				bunzip2 -f "${x}" || __helpers_die "bunzip2 failed"
-				x=${x%.bz2}
-				had_precompressed=1;;
+				x=${x%.bz2};;
 			*.lzma|*.xz)
 				unxz -f "${x}" || __helpers_die "unxz failed"
-				x=${x%.*}
-				had_precompressed=1;;
+				x=${x%.*};;
 		esac
 
 		filtered_args+=( "$x" )
@@ -40,12 +36,6 @@ compress_file() {
 	[[ ${#filtered_args[@]} -eq 0 ]] && return 0
 	set -- "${filtered_args[@]}"
 
-	if [[ ${had_precompressed} ]]; then
-		eqawarn "One or more compressed files were found in docompress-ed directories."
-		eqawarn "Please fix the ebuild not to install compressed files (manpages,"
-		eqawarn "documentation) when automatic compression is used."
-	fi
-
 	# If a compressed version of the file already exists, simply
 	# delete it so that the compressor doesn't whine (bzip2 will
 	# complain and skip, gzip will prompt for input)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-09-28 20:33 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-09-28 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     5ba7e7b3393c2a942dc528a06d5886b2396bc7f9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 20 18:20:25 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 28 20:32:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ba7e7b3

ecompress: Run compression in parallel

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 434456f0c..36bdb585b 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -139,8 +139,8 @@ fix_symlinks() {
 }
 
 export PORTAGE_COMPRESS PORTAGE_COMPRESS_FLAGS
-find "${ED}" -name '*.ecompress' -delete \
-	-exec "${PORTAGE_BIN_PATH}"/ecompress-file {} +
+find "${ED}" -name '*.ecompress' -delete -print0 |
+	___parallel_xargs -0 "${PORTAGE_BIN_PATH}"/ecompress-file
 ret=${?}
 
 fix_symlinks


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-10-06  1:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-10-06  1:35 UTC (permalink / raw
  To: gentoo-commits

commit:     d5ed2a39f1ba4c9c67e0ec79ec18986d37a198c1
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Wed Oct  3 18:37:44 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct  6 01:24:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d5ed2a39

etc-update: combined use of /etc/os-release ID and ID_LIKE

Closes: https://github.com/gentoo/portage/pull/372
Signed-off-by: Kewl Fft xrjy <AT> nygb.rh.bet (rot13)
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/etc-update | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index f0aaca1e6..3951ec674 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -32,13 +32,13 @@ get_config() {
 		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
 }
 
-OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')
+OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE}:")
 
-case $OS_RELEASE_ID in
-	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;;
-	fedora|rhel) OS_FAMILY='rpm' ;;
-	arch|archarm|arch32|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
-	*) OS_FAMILY='gentoo' ;;
+case ${OS_RELEASE_POSSIBLE_IDS} in
+	*:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';;
+	*:fedora:*|*:rhel:*) OS_FAMILY='rpm';;
+	*:arch:*|*:manjaro:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
+	*) OS_FAMILY='gentoo';;
 esac
 
 if [[ $OS_FAMILY == 'gentoo' ]]; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-10-08 21:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-10-08 21:47 UTC (permalink / raw
  To: gentoo-commits

commit:     de791662d152f3645274750d3f22b853716927aa
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 25 12:31:36 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct  8 21:42:11 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=de791662

estrip: Report pre-stripped files even with RESTRICT=strip

The purpose of RESTRICT=strip is to prevent files from being stripped,
not to silence QA checks about pre-stripped files.

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 3ee4b01ac..369755cfe 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -308,7 +308,7 @@ process_elf() {
 # The existance of the section .symtab tells us that a binary is stripped.
 # We want to log already stripped binaries, as this may be a QA violation.
 # They prevent us from getting the splitdebug data.
-if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
+if ! ${RESTRICT_binchecks} ; then
 	# We need to do the non-stripped scan serially first before we turn around
 	# and start stripping the files ourselves.  The log parsing can be done in
 	# parallel though.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-10-20  4:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-10-20  4:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7a3d898b33d6c13f184d1328278e1ddaed368cf4
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Tue Oct  9 20:16:14 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 20 04:05:29 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a3d898b

etc-update: handle whitespace in ID_LIKE

In case ID_LIKE contains space separated identifiers,
handle all whitespace characters including tabs.

Closes: https://github.com/gentoo/portage/pull/377
Signed-off-by: Kewl Fft <kewl <AT> alto.eu.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 3951ec674..be8656008 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -32,7 +32,7 @@ get_config() {
 		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
 }
 
-OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE}:")
+OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE//[[:space:]]/:}:")
 
 case ${OS_RELEASE_POSSIBLE_IDS} in
 	*:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-10-31 16:37 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-10-31 16:37 UTC (permalink / raw
  To: gentoo-commits

commit:     2404ddca9d5db7992bf6853cbde8ca944224560c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 29 16:41:45 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Oct 31 16:37:35 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2404ddca

estrip: Run RANLIB after stripping static archives to fix LTO

Run RANLIB after stripping static archives in order to fix potentially
mangled LTO symbol indexes.  According to the user's report, strip lacks
support for LTO symbols (and for binutils plugins that could add
the missing support) and breaks them.  Upstream suggests fixing
the archive by running ranlib -- and since there should be no harm
in doing that, we can do that unconditionally.

Suggested-by: Shane Peelar
Bug: https://github.com/mgorny/portage-mgorny/issues/21
Bug: https://bugs.gentoo.org/603594
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/estrip | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 369755cfe..f72341da9 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -113,7 +113,7 @@ if [[ ${KERNEL} == linux ]] && ${FEATURES_xattr} ; then
 fi
 
 # look up the tools we might be using
-for t in STRIP:strip OBJCOPY:objcopy READELF:readelf ; do
+for t in STRIP:strip OBJCOPY:objcopy READELF:readelf RANLIB:ranlib ; do
 	v=${t%:*} # STRIP
 	t=${t#*:} # strip
 	eval ${v}=\"${!v:-${CHOST}-${t}}\"
@@ -423,7 +423,8 @@ do
 			# linked in (only for finally linked ELFs), so we have to
 			# retain the debug info in the archive itself.
 			if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then
-				${STRIP} -g "${x}"
+				${STRIP} -g "${x}" &&
+				${RANLIB} "${x}"
 			fi
 		fi
 	elif [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* ||


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-11-02 19:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-11-02 19:14 UTC (permalink / raw
  To: gentoo-commits

commit:     1cc3352b6580af95965e231b35e80627b8391df4
Author:     Bruce Schultz <brulzki <AT> gmail <DOT> com>
AuthorDate: Fri Nov  2 19:04:52 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov  2 19:14:13 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1cc3352b

portageq get_repo_path: fix <eroot> parameter (bug 670082)

Use the @uses_configroot decorator to make portage get_repo_path
respect the <eroot> parameter, like portage repos_config since
commit 382f4be415394886026ccd5dcd08ca96ecda31fa.

Bug: https://bugs.gentoo.org/670082
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/portageq | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/portageq b/bin/portageq
index c63591a77..ab22b1c4b 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -882,6 +882,7 @@ docstrings['master_repos'] = """<eroot> <repo_id>+
 master_repos.__doc__ = docstrings['master_repos']
 
 
+@uses_configroot
 @uses_eroot
 def get_repo_path(argv):
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-11-05 18:48 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-11-05 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     946cb7a9a690ac7f9c7222872d97b3df899441c9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 31 16:44:43 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Nov  5 18:48:01 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=946cb7a9

misc-functions.sh: Inline and reflow __prepall

Inline the __prepall function into install_qa_check(), and reflow it
to cover the code more correctly.  The arbitrary split between these
functions has resulted in mismatches, with e.g. prepstrip being covered
by mtree flag saving but dostrip being accidentally omitted.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/misc-functions.sh | 48 ++++++++++++++++++++++--------------------------
 1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ff3d2a1ff..db7aaed5a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -43,30 +43,6 @@ install_symlink_html_docs() {
 	fi
 }
 
-__prepall() {
-	if has chflags $FEATURES ; then
-		# Save all the file flags for restoration at the end of prepall.
-		mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
-		# Remove all the file flags so that prepall can do anything necessary.
-		chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
-		chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
-	fi
-
-	[[ -d ${ED%/}/usr/share/info ]] && prepinfo
-
-	# Apply compression.
-	"${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}"
-	"${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}"
-	"${PORTAGE_BIN_PATH}"/ecompress --dequeue
-
-	___eapi_has_dostrip || prepallstrip
-
-	if has chflags $FEATURES ; then
-		# Restore all the file flags that were saved at the beginning of prepall.
-		mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
-	fi
-}
-
 install_qa_check() {
 	local d f i qa_var x paths qa_checks=() checks_run=()
 	if ! ___eapi_has_prefix_variables; then
@@ -123,13 +99,33 @@ install_qa_check() {
 		)
 	done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
 
-	export STRIP_MASK
-	__prepall
+	if has chflags $FEATURES ; then
+		# Save all the file flags for restoration afterwards.
+		mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
+		# Remove all the file flags so that we can do anything necessary.
+		chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
+		chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
+	fi
+
+	[[ -d ${ED%/}/usr/share/info ]] && prepinfo
+
+	# Apply compression.
+	"${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}"
+	"${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}"
+	"${PORTAGE_BIN_PATH}"/ecompress --dequeue
 
+	export STRIP_MASK
 	if ___eapi_has_dostrip; then
 		"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
 		"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
 		"${PORTAGE_BIN_PATH}"/estrip --dequeue
+	else
+		prepallstrip
+	fi
+
+	if has chflags $FEATURES ; then
+		# Restore all the file flags that were saved earlier on.
+		mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
 	fi
 
 	# Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-11-05 22:10 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2018-11-05 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     beb317e71c2d88e20c4dd95217737274d00c145e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  5 20:12:50 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Nov  5 22:09:08 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=beb317e7

isolated-functions.sh: Do not define any aliases.

save_IFS and restore_IFS are the only aliases that Portage defines,
and they are used exactly once. Rewrite __source_all_bashrcs() not to
depend on them, and remove their definitions.

The intention is to drop the expand_aliases shell option at some time
in the future.

Acked-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/ebuild.sh             | 8 ++------
 bin/isolated-functions.sh | 2 --
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5491c4f58..00524d019 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -421,13 +421,9 @@ __source_all_bashrcs() {
 
 	if [[ $EBUILD_PHASE != depend ]] ; then
 		# source the existing profile.bashrcs.
-		save_IFS
-		IFS=$'\n'
-		local bashenv_files=($PORTAGE_BASHRC_FILES)
-		restore_IFS
-		for x in "${bashenv_files[@]}" ; do
+		while read -r x; do
 			__try_source "${x}"
-		done
+		done <<<"${PORTAGE_BASHRC_FILES}"
 	fi
 
 	# The user's bashrc is the ONLY non-portage bit of code

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 39b0ad344..22a6dbb0f 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -11,8 +11,6 @@ fi
 # We need this next line for "die" and "assert". It expands
 # It _must_ preceed all the calls to die and assert.
 shopt -s expand_aliases
-alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"'
-alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi'
 
 assert() {
 	local x pipestatus=${PIPESTATUS[*]}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-11-18  8:13 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2018-11-18  8:13 UTC (permalink / raw
  To: gentoo-commits

commit:     7bda36f3103e0fa1a1a9b56fea3f552164e74c27
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 17 08:13:20 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov 18 08:13:04 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7bda36f3

ecompress-file: Support decompressing .lz

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/ecompress-file | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/ecompress-file b/bin/ecompress-file
index bc8fe5451..ccc2701c3 100755
--- a/bin/ecompress-file
+++ b/bin/ecompress-file
@@ -29,6 +29,9 @@ compress_file() {
 			*.lzma|*.xz)
 				unxz -f "${x}" || __helpers_die "unxz failed"
 				x=${x%.*};;
+			*.lz)
+				lzip -df "${x}" || __helpers_die "lzip -d failed"
+				x=${x%.lz};;
 		esac
 
 		filtered_args+=( "$x" )


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-11-19  7:29 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-11-19  7:29 UTC (permalink / raw
  To: gentoo-commits

commit:     089a6082e7d115b7dc07862121f68b72d9f123f6
Author:     Bruce Schultz <brulzki <AT> gmail <DOT> com>
AuthorDate: Mon Nov 19 07:22:53 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 19 07:22:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=089a6082

portageq get_repos: fix <eroot> parameter (bug 670082)

Use the @uses_configroot decorator to make portage get_repos
respect the <eroot> parameter, like portage repos_config since
commit 382f4be415394886026ccd5dcd08ca96ecda31fa. Apply the same
fix to master_repositories and master_repos.

Bug: https://bugs.gentoo.org/670082
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/portageq | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/portageq b/bin/portageq
index ab22b1c4b..3be5ab584 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -836,6 +836,7 @@ docstrings['envvar'] = """<variable>+
 envvar.__doc__ = docstrings['envvar']
 
 
+@uses_configroot
 @uses_eroot
 def get_repos(argv):
 	if len(argv) < 1:
@@ -849,6 +850,7 @@ docstrings['get_repos'] = """<eroot>
 get_repos.__doc__ = docstrings['get_repos']
 
 
+@uses_configroot
 @uses_eroot
 def master_repositories(argv):
 	if len(argv) < 2:
@@ -872,6 +874,7 @@ docstrings['master_repositories'] = """<eroot> <repo_id>+
 master_repositories.__doc__ = docstrings['master_repositories']
 
 
+@uses_configroot
 @uses_eroot
 def master_repos(argv):
 	return master_repositories(argv)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2018-11-19 21:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2018-11-19 21:40 UTC (permalink / raw
  To: gentoo-commits

commit:     cd3effcd48ca83057ca49d6e2727df931bfad4a0
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Mon Nov 19 21:24:27 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 19 21:38:37 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cd3effcd

etc-update: manjaro now uses arch ID_LIKE

Closes: https://github.com/gentoo/portage/pull/381
Signed-off-by: Kewl Fft <kewl <AT> alto.eu.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index be8656008..0c7a51995 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -37,7 +37,7 @@ OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:$
 case ${OS_RELEASE_POSSIBLE_IDS} in
 	*:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';;
 	*:fedora:*|*:rhel:*) OS_FAMILY='rpm';;
-	*:arch:*|*:manjaro:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
+	*:arch:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo';;
 esac
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-06 19:07 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-06 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     14cba20cebace229e1075eb4911f202102c849d4
Author:     kewl fft <kewl <AT> alto <DOT> eu <DOT> org>
AuthorDate: Sun Jan  6 17:12:31 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan  6 19:04:50 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=14cba20c

etc-update: Antergos uses arch ID_LIKE now

Closes: https://github.com/gentoo/portage/pull/395
Signed-off-by: Kewl Fft <kewl <AT> alto.eu.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/etc-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/etc-update b/bin/etc-update
index 0c7a51995..7897d9b16 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -37,7 +37,7 @@ OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:$
 case ${OS_RELEASE_POSSIBLE_IDS} in
 	*:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';;
 	*:fedora:*|*:rhel:*) OS_FAMILY='rpm';;
-	*:arch:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
+	*:arch:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
 	*) OS_FAMILY='gentoo';;
 esac
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-16  8:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-16  8:33 UTC (permalink / raw
  To: gentoo-commits

commit:     707a230042658e98b329c0a9141bc17d80a2f454
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 16 04:15:18 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 16 07:49:00 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=707a2300

bin/socks5-server.py: fix PendingDeprecationWarning for asyncio.Task.current_task()

PendingDeprecationWarning: Task.current_task() is deprecated, use asyncio.current_task() instead

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/socks5-server.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index d46cf5345..f5d995f0d 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -17,6 +17,12 @@ else:
 	# getattr() necessary because async is a keyword in Python >=3.7.
 	asyncio_ensure_future = getattr(asyncio, 'async')
 
+try:
+	current_task = asyncio.current_task
+except AttributeError:
+	# Deprecated since Python 3.7
+	current_task = asyncio.Task.current_task
+
 
 class Socks5Server(object):
 	"""
@@ -154,7 +160,7 @@ class Socks5Server(object):
 			# otherwise, start two loops:
 			# remote -> local...
 			t = asyncio_ensure_future(self.handle_proxied_conn(
-					proxied_reader, writer, asyncio.Task.current_task()))
+					proxied_reader, writer, current_task()))
 
 			# and local -> remote...
 			try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-17 18:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-17 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     0180b4e4a4499878a01005b317c8cea431bbb5fa
Author:     junwei <337560754 <AT> qq <DOT> com>
AuthorDate: Thu Jan 17 16:06:12 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 17 18:29:54 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0180b4e4

ebuild.sh: fix try_source qa condition test

Fixes: 60ee4deefb70 ("Refactor bashrc scripts sourcing")
Closes: https://github.com/gentoo/portage/pull/400
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 978643af7..820db50ca 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -476,7 +476,7 @@ __try_source() {
 		# If $- contains x, then tracing has already been enabled
 		# elsewhere for some reason. We preserve it's state so as
 		# not to interfere.
-		if [[ ${qa} ]]; then
+		if ! ${qa} ; then
 			source "${1}"
 		else
 			__qa_source "${1}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-23  1:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-23  1:08 UTC (permalink / raw
  To: gentoo-commits

commit:     e77663ab90311c7407e3e8e6d7b72be4cf3e955d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 23 01:06:26 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 23 01:07:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e77663ab

ebuild.sh: eliminate inherit eqawarn call to external fmt command

Fixes: fb2459330cf2 ("ebuild.sh: Completely ban external commands in global scope")
Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 820db50ca..0ec033ae7 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -243,10 +243,9 @@ inherit() {
 	fi
 
 	if [[ -n $ECLASS && -n ${!__export_funcs_var} ]] ; then
-		echo "QA Notice: EXPORT_FUNCTIONS is called before inherit in" \
-			"$ECLASS.eclass. For compatibility with <=portage-2.1.6.7," \
-			"only call EXPORT_FUNCTIONS after inherit(s)." \
-			| fmt -w 75 | while read -r ; do eqawarn "$REPLY" ; done
+		eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
+		eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
+		eqawarn "after inherit(s)."
 	fi
 
 	local repo_location


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-23  4:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-23  4:35 UTC (permalink / raw
  To: gentoo-commits

commit:     6a738002397ab9cfe1ff02571ffb4cddb596544a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 03:38:14 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 23 02:41:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a738002

inherit: use local -x ECLASS (bug 676014)

Use local -x ECLASS, and also make __export_funcs_var a local variable,
since this is simpler than managing these variables as globals
(eliminates PECLASS and prev_export_funcs_var variables). As an
additional benefit, this prevents interference from ebuild variables
as reported in bug 656354 for the ECLASS variable.

Bug: https://bugs.gentoo.org/656354
Bug: https://bugs.gentoo.org/676014

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 0ec033ae7..d3bf0fd29 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -240,23 +240,22 @@ inherit() {
 	ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
 	if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
 		debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
-	fi
 
-	if [[ -n $ECLASS && -n ${!__export_funcs_var} ]] ; then
-		eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
-		eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
-		eqawarn "after inherit(s)."
+		# Since ECLASS_DEPTH > 1, the following variables are locals from the
+		# previous inherit call in the call stack.
+		if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
+			eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
+			eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
+			eqawarn "after inherit(s)."
+		fi
 	fi
 
+	local -x ECLASS
+	local __export_funcs_var
 	local repo_location
 	local location
 	local potential_location
 	local x
-
-	# These variables must be restored before returning.
-	local PECLASS=$ECLASS
-	local prev_export_funcs_var=$__export_funcs_var
-
 	local B_IUSE
 	local B_REQUIRED_USE
 	local B_DEPEND
@@ -268,7 +267,7 @@ inherit() {
 		location=""
 		potential_location=""
 
-		export ECLASS="$1"
+		ECLASS="$1"
 		__export_funcs_var=__export_functions_$ECLASS_DEPTH
 		unset $__export_funcs_var
 
@@ -378,12 +377,6 @@ inherit() {
 		shift
 	done
 	((--ECLASS_DEPTH)) # Returns 1 when ECLASS_DEPTH reaches 0.
-	if (( ECLASS_DEPTH > 0 )) ; then
-		export ECLASS=$PECLASS
-		__export_funcs_var=$prev_export_funcs_var
-	else
-		unset ECLASS __export_funcs_var
-	fi
 	return 0
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-23  5:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-23  5:33 UTC (permalink / raw
  To: gentoo-commits

commit:     37e4dc5ae842afa03849a47b123345906fdd81a2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 07:17:18 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 23 04:47:25 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=37e4dc5a

pid-sandbox: pid-ns-init setsid support (bug 675870)

Use setsid to isolate the parent process from signals sent
to the process group, and forward signals to the entire
process group with kill(0, signum).

Bug: https://bugs.gentoo.org/675870
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index f9b8cc4f3..76ae8de75 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -33,8 +33,12 @@ KILL_SIGNALS = (
 )
 
 
-def forward_kill_signal(main_child_pid, signum, frame):
-	os.kill(main_child_pid, signum)
+def forward_kill_signal(pid, signum, frame):
+	if pid == 0:
+		# Avoid a signal feedback loop, since signals sent to the
+		# process group are also sent to the current process.
+		signal.signal(signum, signal.SIG_DFL)
+	os.kill(pid, signum)
 
 
 def main(argv):
@@ -47,6 +51,7 @@ def main(argv):
 		# (forwarding signals to init and forwarding exit status to the parent
 		# process).
 		main_child_pid = int(argv[1])
+		setsid = False
 		proc = None
 	else:
 		# The current process is init (pid 1) in a child pid namespace.
@@ -55,11 +60,16 @@ def main(argv):
 		popen_kwargs = {}
 		if sys.version_info.major > 2:
 			popen_kwargs['pass_fds'] = pass_fds
+		# Isolate parent process from process group SIGSTOP (bug 675870)
+		setsid = True
+		os.setsid()
 		proc = subprocess.Popen(args, executable=binary,
 			preexec_fn=signal_disposition_preexec, **popen_kwargs)
 		main_child_pid = proc.pid
 
-	sig_handler = functools.partial(forward_kill_signal, main_child_pid)
+	# If setsid has been called, use kill(0, signum) to
+	# forward signals to the entire process group.
+	sig_handler = functools.partial(forward_kill_signal, 0 if setsid else main_child_pid)
 	for signum in KILL_SIGNALS:
 		signal.signal(signum, sig_handler)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-28  6:41 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-28  6:41 UTC (permalink / raw
  To: gentoo-commits

commit:     ce0656337268601aeadff091ea4f683eeea16148
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 27 20:24:55 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 27 20:45:53 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ce065633

pid-sandbox: pid-ns-init TIOCSCTTY after setsid (bug 675868)

Set the controlling terminal to the stdout pty after calling setsid,
in order to avoid "No such device or address" ENXIO errors when
attempting to open /dev/tty.

Bug: https://bugs.gentoo.org/675868
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index f01d69fc2..d8e67cf6d 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -3,12 +3,14 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
+import fcntl
 import functools
 import os
 import platform
 import signal
 import subprocess
 import sys
+import termios
 
 
 KILL_SIGNALS = (
@@ -75,6 +77,17 @@ def main(argv):
 		# Isolate parent process from process group SIGSTOP (bug 675870)
 		setsid = True
 		os.setsid()
+		if sys.stdout.isatty():
+			try:
+				fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0)
+			except OSError as e:
+				if e.errno == errno.EPERM:
+					# This means that stdout refers to the controlling terminal
+					# of the parent process, and in this case we do not want to
+					# steel it.
+					pass
+				else:
+					raise
 		proc = subprocess.Popen(args, executable=binary, **popen_kwargs)
 		main_child_pid = proc.pid
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-01-28 19:45 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-01-28 19:45 UTC (permalink / raw
  To: gentoo-commits

commit:     d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 28 19:27:47 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan 28 19:42:21 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d66f4238

pid-sandbox: handle EnvironmentError for python2 compat (bug 675868)

The fcntl.ioctl call raises IOError, which is different from OSError
for python2. Use EnvironmentError for compatibility.

Bug: https://bugs.gentoo.org/675868
Reported-by: Ivan Ivanich <ivanich <AT> ivanich.org.ua>
Fixes: ce0656337268 ("pid-sandbox: pid-ns-init TIOCSCTTY after setsid (bug 675868)")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index d8e67cf6d..cfbd65280 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -80,7 +80,7 @@ def main(argv):
 		if sys.stdout.isatty():
 			try:
 				fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0)
-			except OSError as e:
+			except EnvironmentError as e:
 				if e.errno == errno.EPERM:
 					# This means that stdout refers to the controlling terminal
 					# of the parent process, and in this case we do not want to
@@ -101,7 +101,7 @@ def main(argv):
 	while True:
 		try:
 			pid, status = os.wait()
-		except OSError as e:
+		except EnvironmentError as e:
 			if e.errno == errno.EINTR:
 				continue
 			raise


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-03-19  1:20 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2019-03-19  1:20 UTC (permalink / raw
  To: gentoo-commits

commit:     06086354fdd66fdf84c812f4be1757cb96e16c45
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  9 08:16:17 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 01:18:37 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=06086354

__dyn_test: Make fallback to WORKDIR conditional.

When the fallback from S to WORKDIR was made conditional in EAPI 4,
src_test() was originally omitted. This has been fixed retroactively
in PMS:
https://gitweb.gentoo.org/proj/pms.git/commit/?id=0038f90a942f0856ae2533b26f709002a3ec80ae

There should be no issues with backwards compatibility of existing
ebuilds. The feature is not used in the Gentoo repository. Plus, the
scenario is very unlikely, because in src_test the fallback to WORKDIR
could only happen for an ebuild that:
- Has no files in A to be unpacked.
- Doesn't define any of the unpack, prepare, configure, compile or
  install phases (otherwise it would die in one of these phases).

Acked-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-functions.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index d8ebf3d3e..ee07ea0f9 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Hardcoded bash lists are needed for backward compatibility with
@@ -358,7 +358,7 @@ __abort_install() {
 
 __has_phase_defined_up_to() {
 	local phase
-	for phase in unpack prepare configure compile install; do
+	for phase in unpack prepare configure compile test install; do
 		has ${phase} ${DEFINED_PHASES} && return 0
 		[[ ${phase} == $1 ]] && return 1
 	done
@@ -495,10 +495,14 @@ __dyn_test() {
 	trap "__abort_test" SIGINT SIGQUIT
 	__start_distcc
 
-	if [ -d "${S}" ]; then
+	if [[ -d ${S} ]]; then
 		cd "${S}"
-	else
+	elif ___eapi_has_S_WORKDIR_fallback; then
+		cd "${WORKDIR}"
+	elif [[ -z ${A} ]] && ! __has_phase_defined_up_to test; then
 		cd "${WORKDIR}"
+	else
+		die "The source directory '${S}' doesn't exist"
 	fi
 
 	if has test ${RESTRICT} ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-04-30 18:56 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-04-30 18:56 UTC (permalink / raw
  To: gentoo-commits

commit:     445784f2cd9529ad03712d8d4b85784401d8b863
Author:     Bertrand Jacquin <bertrand <AT> jacquin <DOT> bzh>
AuthorDate: Tue Apr 30 18:09:31 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 18:55:26 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=445784f2

__dyn_install: print category before package name

It is more common in gentoo to see ${CATEGORY}/${PF} rather than ${PF}
followed by ${CATEGORY}.

Closes: https://github.com/gentoo/portage/pull/423
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ee07ea0f9..e6380f554 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -592,7 +592,7 @@ __dyn_install() {
 	fi
 
 	__vecho
-	__vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
+	__vecho ">>> Install ${CATEGORY}/${PF} into ${D}"
 	#our custom version of libtool uses $S and $D to fix
 	#invalid paths in .la files
 	export S D
@@ -613,7 +613,7 @@ __dyn_install() {
 	__ebuild_phase src_install
 	>> "$PORTAGE_BUILDDIR/.installed" || \
 		die "Failed to create $PORTAGE_BUILDDIR/.installed"
-	__vecho ">>> Completed installing ${PF} into ${D}"
+	__vecho ">>> Completed installing ${CATEGORY}/${PF} into ${D}"
 	__vecho
 	__ebuild_phase post_src_install
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-05-20  0:35 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-05-20  0:35 UTC (permalink / raw
  To: gentoo-commits

commit:     5473a2695aa3fb3a7cdee889fe8c861fcb274277
Author:     Ross Konsolebox <konsolebox <AT> gmail <DOT> com>
AuthorDate: Wed Aug  1 14:40:59 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 20 00:04:12 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5473a269

Add bash ___is_indexed_array_var function (bug 662468)

Closes: https://bugs.gentoo.org/662468
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/isolated-functions.sh | 10 ++++++++++
 bin/phase-helpers.sh      |  8 ++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 22a6dbb0f..e4e769a04 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -593,4 +593,14 @@ __eqatag() {
 	) >> "${T}"/qa.log
 }
 
+if [[ BASH_VERSINFO -gt 4 || (BASH_VERSINFO -eq 4 && BASH_VERSINFO[1] -ge 4) ]] ; then
+	___is_indexed_array_var() {
+		[[ ${!1@a} == *a* ]]
+	}
+else
+	___is_indexed_array_var() {
+		[[ $(declare -p "$1" 2>/dev/null) == 'declare -a'* ]]
+	}
+fi
+
 true

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 64a82b4b7..02633125f 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -853,7 +853,7 @@ __eapi4_src_install() {
 				THANKS BUGS FAQ CREDITS CHANGELOG ; do
 			[[ -s "${d}" ]] && dodoc "${d}"
 		done
-	elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
+	elif ___is_indexed_array_var DOCS ; then
 		dodoc "${DOCS[@]}"
 	else
 		dodoc ${DOCS}
@@ -861,7 +861,7 @@ __eapi4_src_install() {
 }
 
 __eapi6_src_prepare() {
-	if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
+	if ___is_indexed_array_var PATCHES ; then
 		[[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"
 	elif [[ -n ${PATCHES} ]]; then
 		eapply ${PATCHES}
@@ -996,7 +996,7 @@ if ___eapi_has_einstalldocs; then
 						THANKS BUGS FAQ CREDITS CHANGELOG ; do
 					[[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}"
 				done
-			elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
+			elif ___is_indexed_array_var DOCS ; then
 				[[ ${#DOCS[@]} -gt 0 ]] && docinto / && dodoc -r "${DOCS[@]}"
 			else
 				[[ ${DOCS} ]] && docinto / && dodoc -r ${DOCS}
@@ -1004,7 +1004,7 @@ if ___eapi_has_einstalldocs; then
 		)
 
 		(
-			if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
+			if ___is_indexed_array_var HTML_DOCS ; then
 				[[ ${#HTML_DOCS[@]} -gt 0 ]] && \
 					docinto html && dodoc -r "${HTML_DOCS[@]}"
 			else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-05-20  4:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-05-20  4:21 UTC (permalink / raw
  To: gentoo-commits

commit:     6d00040a7ce0f7aca2374bb0e3aa0095d5653230
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri May 10 19:30:44 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 20 03:41:11 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6d00040a

estrip: Move handling of ar archives to process_ar() function.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/estrip | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index f72341da9..6f9201d7e 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1
@@ -305,6 +305,23 @@ process_elf() {
 	[[ -n ${lockfile} ]] && rm -f "${lockfile}"
 }
 
+# Usage: process_ar <ar archive>
+process_ar() {
+	local x=$1
+
+	__vecho "   ${x:${#ED}}"
+
+	if ${strip_this} ; then
+		# If we have split debug enabled, then do not strip this.
+		# There is no concept of splitdebug for objects not yet
+		# linked in (only for finally linked ELFs), so we have to
+		# retain the debug info in the archive itself.
+		if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then
+			${STRIP} -g "${x}" && ${RANLIB} "${x}"
+		fi
+	fi
+}
+
 # The existance of the section .symtab tells us that a binary is stripped.
 # We want to log already stripped binaries, as this may be a QA violation.
 # They prevent us from getting the splitdebug data.
@@ -416,17 +433,7 @@ do
 
 	buildid=
 	if [[ ${f} == *"current ar archive"* ]] ; then
-		__vecho "   ${x:${#ED}}"
-		if ${strip_this} ; then
-			# If we have split debug enabled, then do not strip this.
-			# There is no concept of splitdebug for objects not yet
-			# linked in (only for finally linked ELFs), so we have to
-			# retain the debug info in the archive itself.
-			if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then
-				${STRIP} -g "${x}" &&
-				${RANLIB} "${x}"
-			fi
-		fi
+		process_ar "${x}"
 	elif [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* ||
 		${f} == *"SB shared object"* ]] ; then
 		process_elf "${x}" "${inode_link}" ${PORTAGE_STRIP_FLAGS}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-05-20  4:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-05-20  4:21 UTC (permalink / raw
  To: gentoo-commits

commit:     decce090cf8625eef45461992e5f52c0be0c1a7d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri May 10 19:31:56 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 20 03:41:18 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=decce090

estrip: Fix inconsistent behavior between EAPI < 7 and EAPI >= 7.

Bug: https://bugs.gentoo.org/685532
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/estrip | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 6f9201d7e..6133c3dee 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -239,17 +239,18 @@ save_elf_debug() {
 		local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}"
 		local buildid_file="${buildid_dir}/${buildid:2}"
 		mkdir -p "${buildid_dir}"
-		[ -L "${buildid_file}".debug ] || ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug"
-		[ -L "${buildid_file}" ] || ln -s "/${x:${#D}}" "${buildid_file}"
+		[ -L "${buildid_file}".debug ] || ln -s "../../${x:$((${#d_noslash} + 1))}.debug" "${buildid_file}.debug"
+		[ -L "${buildid_file}" ] || ln -s "/${x:$((${#d_noslash} + 1))}" "${buildid_file}"
 	fi
 }
 
 # Usage: process_elf <elf>
 process_elf() {
 	local x=$1 inode_link=$2 strip_flags=${*:3}
+	local ed_noslash=${ED%/}
 	local already_stripped lockfile xt_data
 
-	__vecho "   ${x:${#ED}}"
+	__vecho "   ${x:${#ed_noslash}}"
 
 	# If two processes try to debugedit or strip the same hardlink at the
 	# same time, it may corrupt files or cause loss of splitdebug info.
@@ -308,8 +309,9 @@ process_elf() {
 # Usage: process_ar <ar archive>
 process_ar() {
 	local x=$1
+	local ed_noslash=${ED%/}
 
-	__vecho "   ${x:${#ED}}"
+	__vecho "   ${x:${#ed_noslash}}"
 
 	if ${strip_this} ; then
 		# If we have split debug enabled, then do not strip this.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-05-20  5:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-05-20  5:09 UTC (permalink / raw
  To: gentoo-commits

commit:     86f211e3a552753eb945670a39c1a3b14c3c3bd1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun May 19 05:01:06 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 20 05:08:41 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=86f211e3

estrip: Strip __gentoo_check_ldflags__ symbol.

Bug: https://bugs.gentoo.org/686282
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 6133c3dee..81f78e847 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -133,7 +133,7 @@ case $(${STRIP} --version 2>/dev/null) in
 *GNU*) # sys-devel/binutils
 	# We'll leave out -R .note for now until we can check out the relevance
 	# of the section when it has the ALLOC flag set on it ...
-	SAFE_STRIP_FLAGS="--strip-unneeded"
+	SAFE_STRIP_FLAGS="--strip-unneeded -N __gentoo_check_ldflags__"
 	DEF_STRIP_FLAGS="-R .comment -R .GCC.command.line -R .note.gnu.gold-version"
 	SPLIT_STRIP_FLAGS=
 	;;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-06-05 20:33 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-06-05 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     7f1aac1113203cb43d2a44bfafd6b8deb045efea
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  5 20:28:52 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  5 20:32:29 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7f1aac11

ebuild.sh: unexport ___in_portage_iuse function (bug 680810)

The exported BASH_FUNC____in_portage_iuse%% variable can trigger
problems for some shells, so do not export it.

Reported-by: Fabian Groffen <grobian <AT> gentoo.org>
Bug: https://bugs.gentoo.org/680810
Fixes: 9cac3bfa782f ("Speed up testing against IUSE by not using regexp")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 20dff6f3f..50a0330f3 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -8,6 +8,7 @@ unalias -a
 
 # Make sure this isn't exported to scripts we execute.
 unset BASH_COMPAT
+export -n -f ___in_portage_iuse
 
 source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-07-03 21:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-07-03 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     f4aa49bc1ba210a1257ae6291a60d0944c32691d
Author:     Zac Medico <zachary.medico <AT> sony <DOT> com>
AuthorDate: Wed Jul  3 21:20:00 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul  3 21:26:25 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f4aa49bc

ebuild.sh: suppress export error messages for eix-update

Suppress export error messages like this for eix-update:

/usr/lib/portage/python3.6/ebuild.sh: line 11: export: ___in_portage_iuse: not a function

Fixes: 7f1aac111320 ("ebuild.sh: unexport ___in_portage_iuse function (bug 680810)")
Bug: https://bugs.gentoo.org/680810
Bug: https://bugs.gentoo.org/689128
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 50a0330f3..56555a5b7 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -8,7 +8,7 @@ unalias -a
 
 # Make sure this isn't exported to scripts we execute.
 unset BASH_COMPAT
-export -n -f ___in_portage_iuse
+declare -F ___in_portage_iuse >/dev/null && export -n -f ___in_portage_iuse
 
 source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-07-21  4:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-07-21  4:12 UTC (permalink / raw
  To: gentoo-commits

commit:     3ebe48e61a02cb00c3bb2366e50b4c83ef390ecb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 20 20:06:50 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 20 20:08:01 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3ebe48e6

dispatch-conf: use writemsg for unicode safety (bug 690304)

Bug: https://bugs.gentoo.org/690304
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/dispatch-conf | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 32a0a731e..62ab3f6cc 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -31,6 +31,7 @@ from portage import os, shutil
 from portage import _encodings, _unicode_decode
 from portage.dispatch_conf import diffstatusoutput, diff_mixed_wrapper
 from portage.process import find_binary, spawn
+from portage.util import writemsg, writemsg_stdout
 
 FIND_EXTANT_CONFIGS  = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname '.*.bak' -print"
 DIFF_CONTENTS        = "diff -Nu '%s' '%s'"
@@ -294,7 +295,7 @@ class dispatch:
                     diff_pager(conf['current'], newconf)
 
                 print()
-                print('>> (%i of %i) -- %s' % (count, len(confs), conf ['current']))
+                writemsg_stdout('>> (%i of %i) -- %s\n' % (count, len(confs), conf['current']), noiselevel=-1)
                 print('>> q quit, h help, n next, e edit-new, z zap-new, u use-new\n   m merge, t toggle-merge, l look-merge: ', end=' ')
 
                 # In some cases getch() will return some spurious characters
@@ -369,7 +370,7 @@ class dispatch:
             print(" One or more updates are frozen and have been automatically zapped:")
             print()
             for frozen in auto_zapped:
-                print("  * '%s'" % frozen)
+                writemsg_stdout("  * '%s'\n" % frozen, noiselevel=-1)
             print()
 
     def replace (self, newconf, curconf):
@@ -384,8 +385,8 @@ class dispatch:
         try:
             os.rename(newconf, curconf)
         except (IOError, os.error) as why:
-            print('dispatch-conf: Error renaming %s to %s: %s; fatal' % \
-                  (newconf, curconf, str(why)), file=sys.stderr)
+            writemsg('dispatch-conf: Error renaming %s to %s: %s; fatal\n' % \
+                  (newconf, curconf, str(why)), noiselevel=-1)
 
 
     def post_process(self, curconf):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-03 17:38 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-03 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     a6daeb01acd1425c198b0420374f8f0c2d3a05c4
Author:     Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Sat Aug  3 16:33:13 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 17:36:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6daeb01

ebuild: apply_priorities (PORTAGE_NICENESS)

Respect PORTAGE_NICENESS variable.

Closes: https://github.com/gentoo/portage/pull/441
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/ebuild b/bin/ebuild
index 8b58988c4..baa842570 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -56,6 +56,7 @@ from portage.exception import PermissionDenied, PortageKeyError, \
 from portage.localization import _
 import portage.util
 from portage.util._eventloop.global_event_loop import global_event_loop
+from _emerge.actions import apply_priorities
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
@@ -126,6 +127,8 @@ if not opts.color == 'y' and \
 	portage.settings.backup_changes('NOCOLOR')
 	portage.settings.lock()
 
+apply_priorities(portage.settings)
+
 ebuild = pargs.pop(0)
 
 pf = None


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-10 19:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-10 19:12 UTC (permalink / raw
  To: gentoo-commits

commit:     03b441713d299a04c6bdba10e0fbd5ba2340a68d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 10 18:44:11 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 10 18:51:11 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=03b44171

bin/ebuild: Fix to work with installed package

Fix the following AttributeError error:

# ebuild /var/db/pkg/sys-apps/portage-2.3.71/portage-2.3.71.ebuild clean pretend clean
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/ebuild", line 318, in <module>
    type_name=pkg_type)
  File "/usr/lib64/python3.6/site-packages/_emerge/Package.py", line 72, in __init__
    db = self.cpv._db
AttributeError: 'str' object has no attribute '_db'

Bug: https://bugs.gentoo.org/532674
Fixes: bfe7892202b8 ("_pkg_str: add _db attribute (bug 640318)")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild b/bin/ebuild
index baa842570..460aa0fd1 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -312,6 +312,11 @@ except PortageKeyError:
 root_config = RootConfig(portage.settings,
 	portage.db[portage.settings['EROOT']], None)
 
+cpv = portage.versions._pkg_str(cpv,
+	metadata=metadata,
+	settings=portage.settings,
+	db=portage.db[portage.settings['EROOT']][mytree].dbapi)
+
 pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv,
 	installed=(pkg_type=="installed"),
 	metadata=metadata, root_config=root_config,


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-14  2:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-14  2:08 UTC (permalink / raw
  To: gentoo-commits

commit:     17ecafa949c87a6f2a2d2c98c7de18ed06f08f2f
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 20:20:16 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 02:02:44 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=17ecafa9

unpack: Unconditionally die if an unpacker returns an error.

As specified by PMS: "If unpacking a supported file format fails,
unpack shall abort the build process."
https://projects.gentoo.org/pms/7/pms.html#x1-13500012.3.15:

This partially reverts commit 525e69351d45621c34a9326fcbc11ca592cb6539,
as far as unpack() is concerned.

Bug: https://bugs.gentoo.org/691776
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/isolated-functions.sh | 13 ++-----
 bin/phase-helpers.sh      | 87 +++++++++++++----------------------------------
 2 files changed, 27 insertions(+), 73 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index e4e769a04..893c02f9b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -38,18 +38,11 @@ __assert_sigpipe_ok() {
 	local x pipestatus=${PIPESTATUS[*]}
 	for x in $pipestatus ; do
 		# Allow SIGPIPE through (128 + 13)
-		if [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]]
-		then
-			__helpers_die "$@"
-			return 1
-		fi
+		[[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
 	done
 
 	# Require normal success for the last process (tar).
-	if [[ $x -ne 0 ]]; then
-		__helpers_die "$@"
-		return 1
-	fi
+	[[ $x -eq 0 ]] || die "$@"
 }
 
 shopt -s extdebug

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 02633125f..15fe8c682 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -347,10 +347,7 @@ unpack() {
 				die "Relative paths to unpack() must be prefixed with './' in EAPI ${EAPI}"
 			fi
 		fi
-		if [[ ! -s ${srcdir}${x} ]]; then
-			__helpers_die "unpack: ${x} does not exist"
-			return 1
-		fi
+		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
 
 		__unpack_tar() {
 			if [[ ${y_insensitive} == tar ]] ; then
@@ -361,18 +358,15 @@ unpack() {
 						"supported with EAPI '${EAPI}'. Instead use 'tar'."
 				fi
 				$1 -c -- "$srcdir$x" | tar xof -
-				__assert_sigpipe_ok "$myfail" || return 1
+				__assert_sigpipe_ok "$myfail"
 			else
 				local cwd_dest=${x##*/}
 				cwd_dest=${cwd_dest%.*}
-				if ! $1 -c -- "${srcdir}${x}" > "${cwd_dest}"; then
-					__helpers_die "$myfail"
-					return 1
-				fi
+				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
 			fi
 		}
 
-		myfail="unpack: failure unpacking ${x}"
+		myfail="failure unpacking ${x}"
 		case "${suffix_insensitive}" in
 			tar)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -381,10 +375,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'tar'."
 				fi
-				if ! tar xof "$srcdir$x"; then
-					__helpers_die "$myfail"
-					return 1
-				fi
+				tar xof "$srcdir$x" || die "$myfail"
 				;;
 			tgz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -393,10 +384,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'tgz'."
 				fi
-				if ! tar xozf "$srcdir$x"; then
-					__helpers_die "$myfail"
-					return 1
-				fi
+				tar xozf "$srcdir$x" || die "$myfail"
 				;;
 			tbz|tbz2)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -406,7 +394,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
 				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
-				__assert_sigpipe_ok "$myfail" || return 1
+				__assert_sigpipe_ok "$myfail"
 				;;
 			zip|jar)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -418,10 +406,8 @@ unpack() {
 				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
-				if ! unzip -qo "${srcdir}${x}"; then
-					__helpers_die "$myfail"
-					return 1
-				fi < <(set +x ; while true ; do echo n || break ; done)
+				( set +x ; while true ; do echo n || break ; done ) | \
+				unzip -qo "${srcdir}${x}" || die "$myfail"
 				;;
 			gz|z)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -430,7 +416,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
 				fi
-				__unpack_tar "gzip -d" || return 1
+				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -439,8 +425,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
 				fi
-				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}" \
-					|| return 1
+				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
 				local my_output
@@ -457,10 +442,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
 				fi
-				if ! unrar x -idq -o+ "${srcdir}${x}"; then
-					__helpers_die "$myfail"
-					return 1
-				fi
+				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
 				;;
 			lha|lzh)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -470,10 +452,7 @@ unpack() {
 						"with EAPI '${EAPI}'." \
 						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
 				fi
-				if ! lha xfq "${srcdir}${x}"; then
-					__helpers_die "$myfail"
-					return 1
-				fi
+				lha xfq "${srcdir}${x}" || die "$myfail"
 				;;
 			a)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -482,10 +461,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'a'."
 				fi
-				if ! ar x "${srcdir}${x}"; then
-					__helpers_die "$myfail"
-					return 1
-				fi
+				ar x "${srcdir}${x}" || die "$myfail"
 				;;
 			deb)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -508,32 +484,20 @@ unpack() {
 						# deb2targz always extracts into the same directory as
 						# the source file, so create a symlink in the current
 						# working directory if necessary.
-						if ! ln -sf "$srcdir$x" "$y"; then
-							__helpers_die "$myfail"
-							return 1
-						fi
+						ln -sf "$srcdir$x" "$y" || die "$myfail"
 						created_symlink=1
 					fi
-					if ! deb2targz "$y"; then
-						__helpers_die "$myfail"
-						return 1
-					fi
+					deb2targz "$y" || die "$myfail"
 					if [ $created_symlink = 1 ] ; then
 						# Clean up the symlink so the ebuild
 						# doesn't inadvertently install it.
 						rm -f "$y"
 					fi
-					if ! mv -f "${y%.deb}".tar.gz data.tar.gz; then
-						if ! mv -f "${y%.deb}".tar.xz data.tar.xz; then
-							__helpers_die "$myfail"
-							return 1
-						fi
-					fi
+					mv -f "${y%.deb}".tar.gz data.tar.gz \
+						|| mv -f "${y%.deb}".tar.xz data.tar.xz \
+						|| die "$myfail"
 				else
-					if ! ar x "$srcdir$x"; then
-						__helpers_die "$myfail"
-						return 1
-					fi
+					ar x "$srcdir$x" || die "$myfail"
 				fi
 				;;
 			lzma)
@@ -543,7 +507,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'lzma'."
 				fi
-				__unpack_tar "lzma -d" || return 1
+				__unpack_tar "lzma -d"
 				;;
 			xz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -553,7 +517,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'xz'."
 				fi
 				if ___eapi_unpack_supports_xz; then
-					__unpack_tar "xz -d" || return 1
+					__unpack_tar "xz -d"
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
@@ -566,10 +530,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'txz'."
 				fi
 				if ___eapi_unpack_supports_txz; then
-					if ! tar xof "$srcdir$x"; then
-						__helpers_die "$myfail"
-						return 1
-					fi
+					tar xof "$srcdir$x" || die "$myfail"
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-14  2:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-14  2:19 UTC (permalink / raw
  To: gentoo-commits

commit:     06756a72592e621c8f071e5d17c5c79136e31155
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 20:58:17 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 02:10:13 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=06756a72

econf: Unconditionally die on error in EAPIs 0 to 3.

As specified by PMS: "econf [...] Should any portion of it fail, it
must abort the build using die, unless run using nonfatal, in which
case it must return non-zero exit status."
https://projects.gentoo.org/pms/7/pms.html#x1-12800012.3.8

Bug: https://bugs.gentoo.org/692024
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 15fe8c682..5f0e202c2 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -676,6 +676,8 @@ econf() {
 				echo "!!! Please attach the following file when seeking support:"
 				echo "!!! ${PWD}/config.log"
 			fi
+			# econf dies unconditionally in EAPIs 0 to 3
+			___eapi_helpers_can_die || die "econf failed"
 			__helpers_die "econf failed"
 			return 1
 		fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-16  1:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-16  1:09 UTC (permalink / raw
  To: gentoo-commits

commit:     f44d32550861cb25c209ef61dcd7ae1aa230da1f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 16 01:06:01 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 16 01:06:59 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f44d3255

Revert "Generate a QA Notice when EXPORT_FUNCTIONS is called before inherit"

This reverts commit 7cb39877b7f6231ce11f1161cf2d3fe42e287b59.

Bug: https://bugs.gentoo.org/692262
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild.sh | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 56555a5b7..5bd727aed 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -241,14 +241,6 @@ inherit() {
 	ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
 	if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
 		debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
-
-		# Since ECLASS_DEPTH > 1, the following variables are locals from the
-		# previous inherit call in the call stack.
-		if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
-			eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
-			eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
-			eqawarn "after inherit(s)."
-		fi
 	fi
 
 	local -x ECLASS


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-18 19:27 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2019-08-18 19:27 UTC (permalink / raw
  To: gentoo-commits

commit:     39f909a6eb7012a5a53f3dd7936976ca804431b5
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 18 19:26:06 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Aug 18 19:26:06 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=39f909a6

unpack: Restore error message.

This was inavertently reverted with commit 17ecafa949.

Fixes: 17ecafa949c87a6f2a2d2c98c7de18ed06f08f2f
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5f0e202c2..cbc803277 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -366,7 +366,7 @@ unpack() {
 			fi
 		}
 
-		myfail="failure unpacking ${x}"
+		myfail="unpack: failure unpacking ${x}"
 		case "${suffix_insensitive}" in
 			tar)
 				if ___eapi_unpack_is_case_sensitive && \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-23 17:58 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-23 17:58 UTC (permalink / raw
  To: gentoo-commits

commit:     eb4bc1b1d155d7807bd3047083c480b77828556f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Aug 23 17:57:17 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 17:57:48 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=eb4bc1b1

unpack: Restore error message.

This was inavertently reverted with commit 17ecafa949.

Fixes: 17ecafa949c87a6f2a2d2c98c7de18ed06f08f2f
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index cbc803277..42d3bcc54 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -347,7 +347,7 @@ unpack() {
 				die "Relative paths to unpack() must be prefixed with './' in EAPI ${EAPI}"
 			fi
 		fi
-		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
+		[[ ! -s ${srcdir}${x} ]] && die "unpack: ${x} does not exist"
 
 		__unpack_tar() {
 			if [[ ${y_insensitive} == tar ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-26 18:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-26 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     ccba5a6ff0c4a2d6896827da9fa779919e86f744
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 25 22:20:15 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 18:09:59 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ccba5a6f

bin/glsa-check: align help menu with the man page updates

* This simply aligns the help menu text with the man page
* Update copyright
* Bump version to 1.0.1

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index b5b76aae2..83ea6b7c3 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 2008-2014 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -21,51 +21,50 @@ from portage.output import green, red, nocolor, white
 
 __program__ = "glsa-check"
 __author__ = "Marius Mauch <genone@gentoo.org>"
-__version__ = "1.0"
+__version__ = "1.0.1"
 
 # option parsing
 epilog = "glsa-list can contain an arbitrary number of GLSA ids," \
 		" filenames containing GLSAs or the special identifiers" \
 		" 'all', 'new' and 'affected'"
-parser = argparse.ArgumentParser(usage=__program__ + " <option> [glsa-list]",
+parser = argparse.ArgumentParser(usage=__program__ + " <option> [glsa-id | all | new | affected]",
 	epilog=epilog)
 
 modes = parser.add_argument_group("Modes")
 modes.add_argument("-l", "--list", action="store_const",
 		const="list", dest="mode",
-		help="List all unapplied GLSA")
+		help="List a summary for the given GLSA(s) or set and whether they affect the system")
 modes.add_argument("-d", "--dump", action="store_const",
 		const="dump", dest="mode",
-		help="Show all information about the given GLSA")
+		help="Show all information about the GLSA(s) or set")
 modes.add_argument("--print", action="store_const",
 		const="dump", dest="mode",
 		help="Alias for --dump")
 modes.add_argument("-t", "--test", action="store_const",
 		const="test", dest="mode",
-		help="Test if this system is affected by the given GLSA")
+		help="Test if this system is affected by the GLSA(s) or set and output the GLSA ID(s)")
 modes.add_argument("-p", "--pretend", action="store_const",
 		const="pretend", dest="mode",
-		help="Show the necessary commands to apply this GLSA")
+		help="Show the necessary steps to remediate the system")
 modes.add_argument("-f", "--fix", action="store_const",
 		const="fix", dest="mode",
-		help="Try to auto-apply this GLSA (experimental)")
+		help="(experimental) Attempt to remediate the system based on the instructions given in the GLSA(s) or set. This will only upgrade (when an upgrade path exists) or remove packages")
 modes.add_argument("-i", "--inject", action="store_const",
 		const="inject", dest="mode",
-		help="inject the given GLSA into the glsa_injected file")
+		help="Inject the given GLSA(s) into the glsa_injected file")
 modes.add_argument("-m", "--mail", action="store_const",
 		const="mail", dest="mode",
 		help="Send a mail with the given GLSAs to the administrator")
-
 parser.add_argument("-V", "--version", action="store_true",
-		help="Some information about this tool")
+		help="Show information about glsa-check")
 parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
-		help="Print more information")
+		help="Print more messages")
 parser.add_argument("-n", "--nocolor", action="store_true",
-		help="Disable colors")
+		help="Removes color from output")
 parser.add_argument("-e", "--emergelike", action="store_false", dest="least_change",
 		help="Do not use a least-change algorithm")
 parser.add_argument("-c", "--cve", action="store_true", dest="list_cve",
-		help="Show CAN ids in listing mode")
+		help="Show CVE IDs in listing mode")
 
 options, params = parser.parse_known_args()
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-30 17:05 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-30 17:05 UTC (permalink / raw
  To: gentoo-commits

commit:     af9574c902d4844d2d85fa954f5b1cf1ef7adda8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 29 18:30:58 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 29 19:27:19 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=af9574c9

glsa-check: Hide non-vuln glsas in quiet mode

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d3e4aad5a03efbd5089f96558d2ddd1e9bf158a8

commit d3e4aad5a03efbd5089f96558d2ddd1e9bf158a8
Author:     vapier <vapier <AT> gentoo.org>
AuthorDate: 2010-03-07 01:37:57 +0000
Commit:     vapier <vapier <AT> gentoo.org>
CommitDate: 2010-03-07 01:37:57 +0000

    glsa-check: hide non-vuln glsas in quiet mode

    svn path=/trunk/gentoolkit/; revision=750

Bug: https://bugs.gentoo.org/692872
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index bfcbaa61f..f6c744d84 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -222,10 +222,14 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 		if mode == "dump":
 			myglsa.dump()
 		elif mode == "fix":
-			sys.stdout.write("Fixing GLSA "+myid+"\n")
+			if not quiet:
+				sys.stdout.write("Fixing GLSA "+myid+"\n")
 			if not myglsa.isVulnerable():
-				sys.stdout.write(">>> no vulnerable packages installed\n")
+				if not quiet:
+					sys.stdout.write(">>> no vulnerable packages installed\n")
 			else:
+				if quiet:
+					sys.stdout.write("Fixing GLSA "+myid+"\n")
 				mergelist = myglsa.getMergeList(least_change=least_change)
 				if mergelist == []:
 					sys.stdout.write(">>> cannot fix GLSA, no unaffected packages available\n")
@@ -247,10 +251,14 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 			if len(mergelist):
 				sys.stdout.write("\n")
 		elif mode == "pretend":
-			sys.stdout.write("Checking GLSA "+myid+"\n")
+			if not quiet:
+				sys.stdout.write("Checking GLSA "+myid+"\n")
 			if not myglsa.isVulnerable():
-				sys.stdout.write(">>> no vulnerable packages installed\n")
+				if not quiet:
+					sys.stdout.write(">>> no vulnerable packages installed\n")
 			else:
+				if quiet:
+					sys.stdout.write("Checking GLSA "+myid+"\n")
 				mergedict = {}
 				for (vuln, update) in myglsa.getAffectionTable(least_change=least_change):
 					mergedict.setdefault(update, []).append(vuln)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-31  3:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-31  3:42 UTC (permalink / raw
  To: gentoo-commits

commit:     82797924dcc6dbfcca22067633cd160ead1199a7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 22:52:51 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 31 03:14:21 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=82797924

glsa-check: Remove 'new' target from glsa-list

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8190a7299a618e0ce120fe1c894b944075576342

commit 8190a7299a618e0ce120fe1c894b944075576342
Author:     rbu <rbu <AT> gentoo.org>
AuthorDate: 2009-08-18 18:25:59 +0000
Commit:     rbu <rbu <AT> gentoo.org>
CommitDate: 2009-08-18 18:25:59 +0000

    Remove 'new' target from glsa-list

    Everyone should use 'affected' or 'all'
    Update man page and changelog

    svn path=/trunk/gentoolkit/; revision=672

Bug: https://bugs.gentoo.org/693088
Acked-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index bf81eca63..7a6916d15 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -26,7 +26,7 @@ __version__ = "1.0.1"
 # option parsing
 epilog = "glsa-list can contain an arbitrary number of GLSA ids," \
 		" filenames containing GLSAs or the special identifiers" \
-		" 'all', 'new' and 'affected'"
+		" 'all' and 'affected'"
 parser = argparse.ArgumentParser(usage=__program__ + " <option> [glsa-id | all | new | affected]",
 	epilog=epilog)
 
@@ -64,7 +64,7 @@ parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
 parser.add_argument("-n", "--nocolor", action="store_true",
 		help="Removes color from output")
 parser.add_argument("-e", "--emergelike", action="store_false", dest="least_change",
-		help="Do not use a least-change algorithm")
+		help="Upgrade to latest version (not least-change)")
 parser.add_argument("-c", "--cve", action="store_true", dest="list_cve",
 		help="Show CVE IDs in listing mode")
 
@@ -101,7 +101,7 @@ elif mode in ["fix", "inject"] and os.geteuid() != 0:
 	sys.stderr.write("\nThis tool needs root access to "+options.mode+" this GLSA\n\n")
 	sys.exit(2)
 elif mode == "list" and not params:
-	params.append("new")
+	params.append("affected")
 
 # delay this for speed increase
 from portage.glsa import (Glsa, GlsaTypeException, GlsaFormatException,
@@ -119,14 +119,15 @@ todolist = [e for e in completelist if e not in checklist]
 
 glsalist = []
 if "new" in params:
-	glsalist = todolist
 	params.remove("new")
+	sys.stderr.write("Warning: The 'new' glsa-list target has been removed, using 'affected'.\n")
+	params.append("affected")
 
 if "all" in params:
 	glsalist = completelist
 	params.remove("all")
+
 if "affected" in params:
-	# replaced completelist with todolist on request of wschlich
 	for x in todolist:
 		try:
 			myglsa = Glsa(x, portage.settings, vardb, portdb)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-31  3:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-31  3:42 UTC (permalink / raw
  To: gentoo-commits

commit:     42787293f725536abaa6b92605e48daae750e803
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 22:14:43 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 31 03:14:01 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=42787293

glsa-check: Fix traceback with glsa-check -f (Bug 275105)

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=232d69fa230abb490e0b0f8eef550f28745be6a3

commit 232d69fa230abb490e0b0f8eef550f28745be6a3
Author:     fuzzyray <fuzzyray <AT> gentoo.org>
AuthorDate: 2009-06-22 20:45:49 +0000
Commit:     fuzzyray <fuzzyray <AT> gentoo.org>
CommitDate: 2009-06-22 20:45:49 +0000

    Fix traceback with glsa-check -f (Bug 275105)

    svn path=/trunk/gentoolkit/; revision=665

Bug: https://bugs.gentoo.org/693088
Acked-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index f6c744d84..3502812d9 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -248,8 +248,8 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 						exitcode >>= 8
 					if exitcode:
 						sys.exit(exitcode)
-			if len(mergelist):
-				sys.stdout.write("\n")
+				if len(mergelist):
+					sys.stdout.write("\n")
 		elif mode == "pretend":
 			if not quiet:
 				sys.stdout.write("Checking GLSA "+myid+"\n")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-31  3:42 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-31  3:42 UTC (permalink / raw
  To: gentoo-commits

commit:     db3bcdad84ea115ee94e20beb780713a1cf86839
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 22:41:08 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 31 03:14:13 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=db3bcdad

glsa-check: Make --pretend output nicer

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=72ba7b1274faf37451b1641ee51140f53f4b7098

commit 72ba7b1274faf37451b1641ee51140f53f4b7098
Author:     rbu <rbu <AT> gentoo.org>
AuthorDate: 2009-08-18 17:47:20 +0000
Commit:     rbu <rbu <AT> gentoo.org>
CommitDate: 2009-08-18 17:47:20 +0000

    Make --pretend output in glsa-check nicer. Add colors and fix linebreaks.

    svn path=/trunk/gentoolkit/; revision=670

Bug: https://bugs.gentoo.org/693088
Acked-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index 3502812d9..bf81eca63 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -263,13 +263,23 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 				for (vuln, update) in myglsa.getAffectionTable(least_change=least_change):
 					mergedict.setdefault(update, []).append(vuln)
 
+				# first, extract the atoms that cannot be upgraded (where key == "")
+				no_upgrades = []
 				sys.stdout.write(">>> The following updates will be performed for this GLSA:\n")
-				for pkg in mergedict:
-					if pkg != "":
-						sys.stdout.write("     " + pkg + " (vulnerable: " + ", ".join(mergedict[pkg]) + ")\n")
 				if "" in mergedict:
-					sys.stdout.write("\n>>> For the following packages, no upgrade path exists:\n")
-					sys.stdout.write("     " + ", ".join(mergedict[""]))
+					no_upgrades = mergedict[""]
+					del mergedict[""]
+
+				# see if anything is left that can be upgraded
+				if mergedict:
+					sys.stdout.write(">>> Updates that will be performed:\n")
+					for (upd, vuln) in mergedict.items():
+						sys.stdout.write("     " + green(upd) + " (vulnerable: " + red(", ".join(vuln)) + ")\n")
+
+				if no_upgrades:
+					sys.stdout.write(">>> No upgrade path exists for these packages:\n")
+					sys.stdout.write("     " + red(", ".join(no_upgrades)) + "\n")
+			sys.stdout.write("\n")
 		elif mode == "inject":
 			sys.stdout.write("injecting " + myid + "\n")
 			myglsa.inject()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-08-31  3:44 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-08-31  3:44 UTC (permalink / raw
  To: gentoo-commits

commit:     4d9c10704b2eaf6cd7467ff0929a94e64429bfa6
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 19:18:56 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 31 03:40:06 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4d9c1070

glsa-check: add exit code for affected GLSAs

Bug: https://bugs.gentoo.org/587930

Reported-by: Bandie Yip Kojote <bandie <AT> ttygap.net>
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/glsa-check b/bin/glsa-check
index 7a6916d15..95ef16fde 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -305,6 +305,7 @@ if mode == "test":
 			summarylist(outputlist)
 		else:
 			sys.stdout.write("\n".join(outputlist)+"\n")
+			sys.exit(6)
 	else:
 		sys.stderr.write("This system is not affected by any of the listed GLSAs\n")
 	sys.exit(0)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-09-01 18:26 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-09-01 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     ea1e8468c971e99dc317c3f2e8d8242366ffb426
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  1 03:54:54 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  1 17:56:20 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ea1e8468

glsa-check: fix truncated CVE ids in listmode (bug 692134)

Use a regular expression to search for CVE ids in GLSA references.
Import unicode_literals from __future__ since portage's Glsa class
returns unicode strings for all python versions.

Reported-by: Georg Weiss <gentoo <AT> georgweiss.de>
Bug: https://bugs.gentoo.org/692134
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index 95ef16fde..6bb2ee21e 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -2,9 +2,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
 
 import argparse
+import re
 import sys
 import codecs
 from functools import reduce
@@ -204,7 +205,13 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
 
 		fd1.write(")")
 		if list_cve:
-			fd1.write(" "+(",".join([r[:13] for r in myglsa.references if r[:4] in ["CAN-", "CVE-"]])))
+			cve_ids = []
+			for r in myglsa.references:
+				m = re.search(r'(CAN|CVE)-[\d-]+', r)
+				if m is not None:
+					cve_ids.append(m.group(0))
+			if cve_ids:
+				fd1.write(" "+(",".join(cve_ids)))
 		fd1.write("\n")
 	return 0
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-09-01 19:03 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-09-01 19:03 UTC (permalink / raw
  To: gentoo-commits

commit:     a17c3627190aa2e9594220b22f9f1acf46c81d2f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  1 04:36:05 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  1 18:29:10 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a17c3627

glsa-check: add --reverse option (bug 235970)

Add --reverse option which causes GLSAs to be listed in reverse order,
so that the most recent GLSAs are listed earlier.

Suggested-by: Pavel Sanda <ps <AT> twin.jikos.cz>
Bug: https://bugs.gentoo.org/235970
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index 6bb2ee21e..eff01cf31 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -68,6 +68,8 @@ parser.add_argument("-e", "--emergelike", action="store_false", dest="least_chan
 		help="Upgrade to latest version (not least-change)")
 parser.add_argument("-c", "--cve", action="store_true", dest="list_cve",
 		help="Show CVE IDs in listing mode")
+parser.add_argument("-r", "--reverse", action="store_true", dest="reverse",
+		help="List GLSAs in reverse order")
 
 options, params = parser.parse_known_args()
 
@@ -163,8 +165,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
 		fd2.write(green("[U]")+" means the system is not affected and\n")
 		fd2.write(red("[N]")+" indicates that the system might be affected.\n\n")
 
-	myglsalist.sort()
-	for myid in myglsalist:
+	for myid in sorted(myglsalist, reverse=options.reverse):
 		try:
 			myglsa = Glsa(myid, portage.settings, vardb, portdb)
 		except (GlsaTypeException, GlsaFormatException) as e:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-09-15  1:50 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-09-15  1:50 UTC (permalink / raw
  To: gentoo-commits

commit:     8c14bedd62636df4f49b8ece9874a2c6c6b4df79
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Sep 15 01:38:46 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 01:49:49 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8c14bedd

_eapply_patch: Delete no longer used variable.

Fixes: e3386ff407d0e6df8e3bdc15ed42f9373b88cddb
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 42d3bcc54..b53d39650 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -990,7 +990,6 @@ if ___eapi_has_eapply; then
 			local f=${1}
 			local prefix=${2}
 
-			started_applying=1
 			ebegin "${prefix:-Applying }${f##*/}"
 			# -p1 as a sane default
 			# -f to avoid interactivity


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-09-15  1:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-09-15  1:51 UTC (permalink / raw
  To: gentoo-commits

commit:     964fea3031a91769ebf88237f7e77c8ab3e38d5c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Sep 15 01:40:03 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 01:51:12 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=964fea30

pid-ns-init: Fix typo in comment.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index cfbd65280..18c74f799 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -84,7 +84,7 @@ def main(argv):
 				if e.errno == errno.EPERM:
 					# This means that stdout refers to the controlling terminal
 					# of the parent process, and in this case we do not want to
-					# steel it.
+					# steal it.
 					pass
 				else:
 					raise


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-09-15  3:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-09-15  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6f25ddc48be233c8c832eb733c2f46a3a587051a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Sep 15 02:56:59 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 03:06:50 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6f25ddc4

__filter_readonly_variables: Filter ___* variables.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index e6380f554..0bc0d525e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -97,7 +97,7 @@ __filter_readonly_variables() {
 	# Untrusted due to possible application of package renames to binpkgs
 	local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
 	local misc_garbage_vars="_portage_filter_opts"
-	filtered_vars="$readonly_bash_vars $bash_misc_vars
+	filtered_vars="___.* $readonly_bash_vars $bash_misc_vars
 		$PORTAGE_READONLY_VARS $misc_garbage_vars"
 
 	# Filter SYSROOT unconditionally. It is propagated in every EAPI


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-09-15  3:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-09-15  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6619580ca329fef1df86670457e87fdfddba6589
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Sep 15 02:57:53 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 03:07:11 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6619580c

__ebuild_main: Rename phase_func variable to ___phase_func.

___* variables are now automatically filtered by __filter_readonly_variables().
`unset` does not actually remove local variables, it only removes their values.
Previously phase_func variable was stored (without value) in environment.bz2 files in VDB.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 0bc0d525e..92fcd3929 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -981,9 +981,8 @@ __ebuild_main() {
 	# respect FEATURES="-ccache".
 	has ccache $FEATURES || export CCACHE_DISABLE=1
 
-	local phase_func=$(__ebuild_arg_to_phase "$EBUILD_PHASE")
-	[[ -n $phase_func ]] && __ebuild_phase_funcs "$EAPI" "$phase_func"
-	unset phase_func
+	local ___phase_func=$(__ebuild_arg_to_phase "$EBUILD_PHASE")
+	[[ -n ${___phase_func} ]] && __ebuild_phase_funcs "$EAPI" "${___phase_func}"
 
 	__source_all_bashrcs
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-10-18  3:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-10-18  3:47 UTC (permalink / raw
  To: gentoo-commits

commit:     be825fc0930945bfe18a52c89765957fe5ac1f08
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 18 03:46:26 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 18 03:46:58 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=be825fc0

asyncio.start_unix_server: suppress DeprecationWarning for loop argument

See: https://bugs.python.org/issue36373
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/socks5-server.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index f5d995f0d..d1649ad4a 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -228,7 +228,7 @@ if __name__ == '__main__':
 	loop = asyncio.get_event_loop()
 	s = Socks5Server()
 	server = loop.run_until_complete(
-		asyncio.start_unix_server(s.handle_proxy_conn, sys.argv[1], loop=loop))
+		asyncio.start_unix_server(s.handle_proxy_conn, sys.argv[1]))
 
 	ret = 0
 	try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-11-08 16:02 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2019-11-08 16:02 UTC (permalink / raw
  To: gentoo-commits

commit:     f6369a67d33fd5e95e02cf9b3cee41213a3b8804
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Nov  7 18:16:09 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov  8 15:59:47 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f6369a67

install.py: ignore -Z / --context

The --context option accepts an optional argument, but only if it is
passed via --context=arg. The argparse module does not deal with this
properly.

To work around this, have argparse ignore this option, and filter out
any remaining arguments that start with a hyphen and do not occur after
a "--" delimiter.

Bug: https://bugs.gentoo.org/699548
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Reviewed-by: Zec Medico <zmedico <AT> gentoo.org>

 bin/install.py | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/bin/install.py b/bin/install.py
index d3789ed96..495534d33 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -111,12 +111,6 @@ def parse_args(args):
 		action="store_true",
 		dest="no_target_directory"
 	)
-	parser.add_argument(
-		"--context",
-		"-Z",
-		action="store",
-		dest="context"
-	)
 	parser.add_argument(
 		"--verbose",
 		"-v",
@@ -143,11 +137,21 @@ def parse_args(args):
 	# for known options in order for argparse to correctly
 	# separate option arguments from file arguments in all
 	# cases (it also allows for optparse compatibility).
-	parsed_args = parser.parse_known_args()
+	(opts, args) = parser.parse_known_args(args)
+
+	files = []
+	i = 0
+	while i < len(args):
+		if args[i] == "--":
+			i += 1
+			break
+		if not args[i].startswith("-"):
+			files.append(args[i])
+		i += 1
 
-	opts  = parsed_args[0]
-	files = parsed_args[1]
-	files = [f for f in files if f != "--"]	# filter out "--"
+	while i < len(args):
+		files.append(args[i])
+		i += 1
 
 	return (opts, files)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-11-25 16:59 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2019-11-25 16:59 UTC (permalink / raw
  To: gentoo-commits

commit:     12d0c48addaf4506dfd7b33f85f2441618a46dd2
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 25 13:03:13 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Nov 25 13:03:13 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=12d0c48a

eapply: Drop -s option for patch.

We generally try to have verbose build logs, e.g., by calling
configure with --disable-silent-rules. Silencing patch contradicts
this, and will suppress reporting of fuzz factors.

Note that the eapply specification in PMS calls patch without -s:
https://projects.gentoo.org/pms/7/pms.html#x1-127001r1
Traditionally, the -s option wasn't used by epatch either.

Bug: https://bugs.gentoo.org/674562
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index b53d39650..60f8d3243 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -993,10 +993,9 @@ if ___eapi_has_eapply; then
 			ebegin "${prefix:-Applying }${f##*/}"
 			# -p1 as a sane default
 			# -f to avoid interactivity
-			# -s to silence progress output
 			# -g0 to guarantee no VCS interaction
 			# --no-backup-if-mismatch not to pollute the sources
-			${patch_cmd} -p1 -f -s -g0 --no-backup-if-mismatch \
+			${patch_cmd} -p1 -f -g0 --no-backup-if-mismatch \
 				"${patch_options[@]}" < "${f}"
 			failed=${?}
 			if ! eend "${failed}"; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-11-27 19:39 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2019-11-27 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     4a315c41b43867320b27e882bb1427ac553e683c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 27 18:49:37 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 27 19:38:46 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a315c41

eapply: Output verbosely only if patch fails to apply with -F0

12d0c48ad disabled silent output for eapply, in order to obtain fuzz
factors in build logs.  However, this also causes eapply to report all
patched files which can make logs unreadable when there are no fuzz
factors to be reported.  Instead, use verbose output only when applying
the patch with -F0 fails.

To achieve that, attempt to apply each patch with -F0 --dry-run first.
If this succeeds, just silently apply the patch for real.  If it
doesn't, output an explicit eqawarn that the patch does not apply
cleanly and retry with the default fuzz factor and verbose output.
Non-silenced output applies both to successful application with fuzz
and to failure.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/phase-helpers.sh | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 60f8d3243..b5691bd70 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -995,8 +995,20 @@ if ___eapi_has_eapply; then
 			# -f to avoid interactivity
 			# -g0 to guarantee no VCS interaction
 			# --no-backup-if-mismatch not to pollute the sources
-			${patch_cmd} -p1 -f -g0 --no-backup-if-mismatch \
-				"${patch_options[@]}" < "${f}"
+			local all_opts=(
+				-p1 -f -g0 --no-backup-if-mismatch
+				"${patch_options[@]}"
+			)
+			# try applying with -F0 first, output a verbose warning
+			# if fuzz factor is necessary
+			if ${patch_cmd} "${all_opts[@]}" --dry-run -s -F0 \
+					< "${f}" &>/dev/null; then
+				all_opts+=( -s -F0 )
+			else
+				eqawarn "    ${f}: patch failed to apply without a fuzz factor, please rebase"
+			fi
+
+			${patch_cmd} "${all_opts[@]}" < "${f}"
 			failed=${?}
 			if ! eend "${failed}"; then
 				__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-12-09  9:19 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-12-09  9:19 UTC (permalink / raw
  To: gentoo-commits

commit:     92f4b283c86a74c99fcfa98f8baccaf1b0603dc8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  9 09:12:11 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec  9 09:14:05 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=92f4b283

emerge-webrsync: handle gentoo-YYYYMMDD directory name

Bug: https://bugs.gentoo.org/693454
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emerge-webrsync | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 25daaf8eb..2190ad20b 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -239,7 +239,7 @@ check_file_signature() {
 get_snapshot_timestamp() {
 	local file="$1"
 
-	do_tar "${file}" --to-stdout -xf - portage/metadata/timestamp.x | cut -f 1 -d " "
+	do_tar "${file}" --to-stdout -f - --wildcards -x '*/metadata/timestamp.x' | cut -f 1 -d " "
 }
 
 sync_local() {
@@ -268,9 +268,8 @@ sync_local() {
 			return 1
 		fi
 	else
-		if ! do_tar "${file}" xf -; then
+		if ! do_tar "${file}" -x --strip-components=1 -f -; then
 			eecho "tar failed to extract the image. tarball is corrupt? (${file})"
-			rm -fr portage
 			return 1
 		fi
 
@@ -278,16 +277,13 @@ sync_local() {
 		${keep} || rm -f "${file}"
 
 		local rsync_opts="${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS}"
-		if chown ${ownership} portage > /dev/null 2>&1; then
-			chown -R ${ownership} portage
+		if chown ${ownership} . > /dev/null 2>&1; then
+			chown -R ${ownership} .
 			rsync_opts+=" --owner --group"
 		fi
-		cd portage
 		rsync ${rsync_opts} . "${repo_location%%/}"
-		cd ..
 
 		__vecho "Cleaning up ..."
-		rm -fr portage
 	fi
 
 	if has metadata-transfer ${FEATURES} ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-12-15  7:40 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-12-15  7:40 UTC (permalink / raw
  To: gentoo-commits

commit:     ce0f37932dfa194566aa32bf6f3a11066c4854fe
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 15 07:21:01 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 15 07:39:29 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ce0f3793

emerge-webrsync: enable xz snapshots for tarsync

There's xz support in current versions of diffball.

Bug: https://bugs.gentoo.org/702970
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emerge-webrsync | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 2190ad20b..5fe30133d 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -309,11 +309,7 @@ do_snapshot() {
 	local mirror
 
 	local compressions=""
-	# xz is not supported in app-arch/tarsync, so use
-	# bz2 format if we have tarsync.
-	if ! type -P tarsync > /dev/null ; then
-		type -P xzcat > /dev/null && compressions="${compressions} xz"
-	fi
+	type -P xzcat > /dev/null && compressions="${compressions} xz"
 	type -P bzcat > /dev/null && compressions="${compressions} bz2"
 	type -P  zcat > /dev/null && compressions="${compressions} gz"
 	if [[ -z ${compressions} ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-12-15 22:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-12-15 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     b39c1731abd2b16e31e98e8deba9699dd73bbf7c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 15 08:14:00 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 15 08:26:21 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b39c1731

emerge-webrsync: support gentoo-YYYYMMDD snapshots

Support gentoo-YYYYMMDD snapshots for forward compatibility, and
portage-YYYYMMDD snapshots for backward compatibility.

Bug: https://bugs.gentoo.org/693454
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emerge-webrsync | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 5fe30133d..c259b7daa 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -303,15 +303,15 @@ do_snapshot() {
 
 	local r=1
 
-	local base_file="portage-${date}.tar"
+	local compression
 
 	local have_files=0
 	local mirror
 
 	local compressions=""
-	type -P xzcat > /dev/null && compressions="${compressions} xz"
-	type -P bzcat > /dev/null && compressions="${compressions} bz2"
-	type -P  zcat > /dev/null && compressions="${compressions} gz"
+	type -P xzcat > /dev/null && compressions="${compressions} ${repo_name}:xz portage:xz"
+	type -P bzcat > /dev/null && compressions="${compressions} ${repo_name}:bz2 portage:bz2"
+	type -P  zcat > /dev/null && compressions="${compressions} ${repo_name}:gz portage:gz"
 	if [[ -z ${compressions} ]] ; then
 		eecho "unable to locate any decompressors (xzcat or bzcat or zcat)"
 		exit 1
@@ -323,7 +323,9 @@ do_snapshot() {
 		__vecho "Trying to retrieve ${date} snapshot from ${mirror} ..."
 
 		for compression in ${compressions} ; do
-			local file="portage-${date}.tar.${compression}"
+			local name=${compression%%:*}
+			compression=${compression#*:}
+			local file="${name}-${date}.tar.${compression}"
 			local digest="${file}.md5sum"
 			local signature="${file}.gpgsig"
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-12-26 20:36 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2019-12-26 20:36 UTC (permalink / raw
  To: gentoo-commits

commit:     42e7a93971ec55b87d5f290a67ef83fe7454c844
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 13 22:41:23 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Dec 26 15:31:34 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=42e7a939

eapply: Drop QA warning for fuzz factor.

This didn't add any information beyond what is already present in the
output of patch. Developers will know how to interpret its output, and
users won't see the warning anyway with the standard configuration.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index b5691bd70..020862ba0 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1004,8 +1004,6 @@ if ___eapi_has_eapply; then
 			if ${patch_cmd} "${all_opts[@]}" --dry-run -s -F0 \
 					< "${f}" &>/dev/null; then
 				all_opts+=( -s -F0 )
-			else
-				eqawarn "    ${f}: patch failed to apply without a fuzz factor, please rebase"
 			fi
 
 			${patch_cmd} "${all_opts[@]}" < "${f}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2019-12-30 21:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2019-12-30 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     605ae9eb6dae230d8bb967edbdd719c61a2b14b8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 30 21:25:06 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 30 21:29:46 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=605ae9eb

emerge-webrsync: chmod 755 temp dir (bug 704256)

Before the rsync call, chmod 755 the temporary directory so that the
root directory of the repository will have appropriate permissions.

Fixes: 92f4b283c86a ("emerge-webrsync: handle gentoo-YYYYMMDD directory name")
Bug: https://bugs.gentoo.org/704256
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emerge-webrsync | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index c259b7daa..db39b272e 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -281,6 +281,7 @@ sync_local() {
 			chown -R ${ownership} .
 			rsync_opts+=" --owner --group"
 		fi
+		chmod 755 .
 		rsync ${rsync_opts} . "${repo_location%%/}"
 
 		__vecho "Cleaning up ..."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-02-08 18:19 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2020-02-08 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     81c88389f0456385545abb1bd703f8c25f009697
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 17:47:03 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 18:18:56 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=81c88389

phase-helpers.sh: avoid passing an empty root value to portageq

Bug: https://bugs.gentoo.org/708660
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 020862ba0..3deb28c68 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -878,7 +878,7 @@ ___best_version_and_has_version_common() {
 			if ___eapi_has_prefix_variables; then
 				case ${root_arg} in
 					-r) root=${ROOT%/}/${EPREFIX#/} ;;
-					-d) root=${ESYSROOT} ;;
+					-d) root=${ESYSROOT:-/} ;;
 					-b)
 						# Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
 						# to BROOT, except BROOT is only defined in src_* phases.
@@ -888,8 +888,8 @@ ___best_version_and_has_version_common() {
 				esac
 			else
 				case ${root_arg} in
-					-r) root=${ROOT} ;;
-					-d) root=${SYSROOT} ;;
+					-r) root=${ROOT:-/} ;;
+					-d) root=${SYSROOT:-/} ;;
 					-b) root=/ ;;
 				esac
 			fi ;;


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-02-21  6:35 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2020-02-21  6:35 UTC (permalink / raw
  To: gentoo-commits

commit:     42fe7eadad8c80836ace0de527e988383f63b7da
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 20 13:04:34 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Feb 20 13:27:33 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=42fe7ead

einstalldocs: Fix test for DOCS being unset.

The current test does not exactly test for unset DOCS, because it also
evaluates as true if the variable has attributes. Such attributes can
be defined even for an unset variable.

Therefore test the output of declare -p for presence of an = sign
instead, which indicates that a value has been assigned to the
variable (bug 710076 comment #2).

PMS reference: Algorithm 12.4, line 7:
https://projects.gentoo.org/pms/7/pms.html#x1-135011r183

See also bash upstream discussion:
https://lists.gnu.org/archive/html/bug-bash/2020-02/msg00045.html

Closes: https://bugs.gentoo.org/710076
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3deb28c68..9495465f9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -953,7 +953,7 @@ fi
 if ___eapi_has_einstalldocs; then
 	einstalldocs() {
 		(
-			if ! declare -p DOCS &>/dev/null ; then
+			if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then
 				local d
 				for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
 						THANKS BUGS FAQ CREDITS CHANGELOG ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-03-02  6:13 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-03-02  6:13 UTC (permalink / raw
  To: gentoo-commits

commit:     e836c4ffb32aba02b28b0254a3edb2147dd362b5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  2 05:56:12 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  2 05:57:53 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e836c4ff

bin/socks5-server.py: PEP 492 coroutines with async and await syntax

https://bugs.gentoo.org/709334
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/socks5-server.py | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index d1649ad4a..1d07c98ed 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -29,8 +29,7 @@ class Socks5Server(object):
 	An asynchronous SOCKSv5 server.
 	"""
 
-	@asyncio.coroutine
-	def handle_proxy_conn(self, reader, writer):
+	async def handle_proxy_conn(self, reader, writer):
 		"""
 		Handle incoming client connection. Perform SOCKSv5 request
 		exchange, open a proxied connection and start relaying.
@@ -43,7 +42,7 @@ class Socks5Server(object):
 
 		try:
 			# SOCKS hello
-			data = yield from reader.readexactly(2)
+			data = await reader.readexactly(2)
 			vers, method_no = struct.unpack('!BB', data)
 
 			if vers != 0x05:
@@ -53,7 +52,7 @@ class Socks5Server(object):
 				return
 
 			# ...and auth method list
-			data = yield from reader.readexactly(method_no)
+			data = await reader.readexactly(method_no)
 			for method in data:
 				if method == 0x00:
 					break
@@ -64,13 +63,13 @@ class Socks5Server(object):
 			# auth reply
 			repl = struct.pack('!BB', 0x05, method)
 			writer.write(repl)
-			yield from writer.drain()
+			await writer.drain()
 			if method == 0xFF:
 				writer.close()
 				return
 
 			# request
-			data = yield from reader.readexactly(4)
+			data = await reader.readexactly(4)
 			vers, cmd, rsv, atyp = struct.unpack('!BBBB', data)
 
 			if vers != 0x05 or rsv != 0x00:
@@ -83,31 +82,31 @@ class Socks5Server(object):
 			if cmd != 0x01:  # CONNECT
 				rpl = 0x07  # command not supported
 			elif atyp == 0x01:  # IPv4
-				data = yield from reader.readexactly(4)
+				data = await reader.readexactly(4)
 				addr = socket.inet_ntoa(data)
 			elif atyp == 0x03:  # domain name
-				data = yield from reader.readexactly(1)
+				data = await reader.readexactly(1)
 				addr_len, = struct.unpack('!B', data)
-				addr = yield from reader.readexactly(addr_len)
+				addr = await reader.readexactly(addr_len)
 				try:
 					addr = addr.decode('idna')
 				except UnicodeDecodeError:
 					rpl = 0x04  # host unreachable
 
 			elif atyp == 0x04:  # IPv6
-				data = yield from reader.readexactly(16)
+				data = await reader.readexactly(16)
 				addr = socket.inet_ntop(socket.AF_INET6, data)
 			else:
 				rpl = 0x08  # address type not supported
 
 			# try to connect if we can handle it
 			if rpl == 0x00:
-				data = yield from reader.readexactly(2)
+				data = await reader.readexactly(2)
 				port, = struct.unpack('!H', data)
 
 				try:
 					# open a proxied connection
-					proxied_reader, proxied_writer = yield from asyncio.open_connection(
+					proxied_reader, proxied_writer = await asyncio.open_connection(
 							addr, port)
 				except (socket.gaierror, socket.herror):
 					# DNS failure
@@ -150,7 +149,7 @@ class Socks5Server(object):
 			# reply to the request
 			repl = struct.pack('!BBB', 0x05, rpl, 0x00)
 			writer.write(repl + repl_addr)
-			yield from writer.drain()
+			await writer.drain()
 
 			# close if an error occured
 			if rpl != 0x00:
@@ -166,7 +165,7 @@ class Socks5Server(object):
 			try:
 				try:
 					while True:
-						data = yield from reader.read(4096)
+						data = await reader.read(4096)
 						if data == b'':
 							# client disconnected, stop relaying from
 							# remote host
@@ -174,7 +173,7 @@ class Socks5Server(object):
 							break
 
 						proxied_writer.write(data)
-						yield from proxied_writer.drain()
+						await proxied_writer.drain()
 				except OSError:
 					# read or write failure
 					t.cancel()
@@ -193,8 +192,7 @@ class Socks5Server(object):
 			writer.close()
 			raise
 
-	@asyncio.coroutine
-	def handle_proxied_conn(self, proxied_reader, writer, parent_task):
+	async def handle_proxied_conn(self, proxied_reader, writer, parent_task):
 		"""
 		Handle the proxied connection. Relay incoming data
 		to the client.
@@ -208,12 +206,12 @@ class Socks5Server(object):
 		try:
 			try:
 				while True:
-					data = yield from proxied_reader.read(4096)
+					data = await proxied_reader.read(4096)
 					if data == b'':
 						break
 
 					writer.write(data)
-					yield from writer.drain()
+					await writer.drain()
 			finally:
 				parent_task.cancel()
 		except (OSError, asyncio.CancelledError):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-03-21 22:08 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-03-21 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6569381d5d22b287963bcbabe4c510fad9845ea2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 21 21:27:43 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 21 21:42:42 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6569381d

eqawarn: output to build log regardless of --quiet (bug 713818)

Make eqwarn output to the build log regardless of --quiet, via echo
to stderr instead of __vecho. This __vecho usage was originally
introduced in commit c53f52941c88, which was during the time when
build output went to the tty regardless of --quiet mode (that
changed in commit 0398470e5029).

Bug: https://bugs.gentoo.org/713818
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/isolated-functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index e8d41fd64..fde684013 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -270,7 +270,7 @@ eqawarn() {
 	__elog_base QA "$*"
 	[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2
 	echo -e "$@" | while read -r ; do
-		__vecho " $WARN*$NORMAL $REPLY"
+		echo " $WARN*$NORMAL $REPLY" >&2
 	done
 	LAST_E_CMD="eqawarn"
 	return 0


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-05-03 21:42 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2020-05-03 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     e2df750e074a54f85aa4f2c109fe8ceea2b9359a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun May  3 21:28:44 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun May  3 21:38:13 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e2df750e

phase-functions.sh: do not set PKG_CONFIG_PATH

Recent pkg-config should have the correct path built in by default.

Bug: https://bugs.gentoo.org/720866
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 709fd7527..90e622e75 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1019,10 +1019,6 @@ __ebuild_main() {
 				[[ ${SANDBOX_WRITE/$DISTCC_DIR} = $SANDBOX_WRITE ]] && \
 				addwrite "$DISTCC_DIR"
 
-			x=LIBDIR_$ABI
-			[ -z "$PKG_CONFIG_PATH" -a -n "$ABI" -a -n "${!x}" ] && \
-				export PKG_CONFIG_PATH=${EPREFIX}/usr/${!x}/pkgconfig
-
 			if has noauto $FEATURES && \
 				[[ ! -f $PORTAGE_BUILDDIR/.unpacked ]] ; then
 				echo


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-05-24 23:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-05-24 23:49 UTC (permalink / raw
  To: gentoo-commits

commit:     5508bf7a6db59149bbc9ad2ff45fb0329fb83644
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 24 21:02:06 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 24 23:43:01 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5508bf7a

ecompress: ignore docompress -x files in precompressed QA check (bug 721516)

Ignore files passed to docompress -x in the QA check for
precompressed files.

Bug: https://bugs.gentoo.org/721516
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index dfa1a0b44..2d74ed07a 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -19,16 +19,28 @@ while [[ $# -gt 0 ]] ; do
 		shift
 
 		skip_dirs=()
+		skip_files=()
 		for skip; do
 			if [[ -d ${ED%/}/${skip#/} ]]; then
 				skip_dirs+=( "${ED%/}/${skip#/}" )
 			else
 				rm -f "${ED%/}/${skip#/}.ecompress" || die
+				skip_files+=("${ED%/}/${skip#/}")
 			fi
 		done
 
 		if [[ ${#skip_dirs[@]} -gt 0 ]]; then
-			find "${skip_dirs[@]}" -name '*.ecompress' -delete || die
+			while read -r -d ''; do
+				skip_files+=(${REPLY#.ecompress})
+			done < <(find "${skip_dirs[@]}" -name '*.ecompress' -print0 -delete || die)
+		fi
+
+		if [[ ${#skip_files[@]} -gt 0 && -s ${T}/.ecompress_had_precompressed ]]; then
+			sed_args=()
+			for f in "${skip_files[@]}"; do
+				sed_args+=(-e "s|^${f}\$||")
+			done
+			sed "${sed_args[@]}" -e '/^$/d' -i "${T}/.ecompress_had_precompressed" || die
 		fi
 
 		exit 0
@@ -176,7 +188,7 @@ find "${ED}" -name '*.ecompress' -delete -print0 |
 	___parallel_xargs -0 "${PORTAGE_BIN_PATH}"/ecompress-file
 ret=${?}
 
-if [[ -f ${T}/.ecompress_had_precompressed ]]; then
+if [[ -s ${T}/.ecompress_had_precompressed ]]; then
 	eqawarn "One or more compressed files were found in docompress-ed directories."
 	eqawarn "Please fix the ebuild not to install compressed files (manpages,"
 	eqawarn "documentation) when automatic compression is used:"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-06-14 19:12 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-06-14 19:12 UTC (permalink / raw
  To: gentoo-commits

commit:     e838026204d9e8ff63cac5c33a86b0b1f179f3e1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 14 19:10:21 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 14 19:10:59 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8380262

ecompress: prefix eqawarn messages with QA Notice (bug 728046)

Reported-by: Agostino Sarubbo <ago <AT> gentoo.org>
Bug: https://bugs.gentoo.org/728046
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 2d74ed07a..7aabc8e4c 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
@@ -88,7 +88,7 @@ while [[ $# -gt 0 ]] ; do
 			done < <(find "${find_args[@]}" -print0 || die)
 
 			if [[ ${#collisions[@]} -gt 0 ]]; then
-				eqawarn "Colliding files found by ecompress:"
+				eqawarn "QA Notice: Colliding files found by ecompress:"
 				eqawarn
 				for x in "${!collisions[@]}"; do
 					eqawarn "  ${x}"
@@ -189,9 +189,9 @@ find "${ED}" -name '*.ecompress' -delete -print0 |
 ret=${?}
 
 if [[ -s ${T}/.ecompress_had_precompressed ]]; then
-	eqawarn "One or more compressed files were found in docompress-ed directories."
-	eqawarn "Please fix the ebuild not to install compressed files (manpages,"
-	eqawarn "documentation) when automatic compression is used:"
+	eqawarn "QA Notice: One or more compressed files were found in docompress-ed"
+	eqawarn "directories. Please fix the ebuild not to install compressed files"
+	eqawarn "(manpages, documentation) when automatic compression is used:"
 	eqawarn
 	n=0
 	while read -r f; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-06-24  3:01 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-06-24  3:01 UTC (permalink / raw
  To: gentoo-commits

commit:     2f21153a85d43ea466a3289a833f35f1049314cf
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 24 00:25:07 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 24 00:33:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2f21153a

ecompress: fix "Argument list too long" for sed (bug 727522)

Use sed -f to feed commands to sed via stdin, in order to avoid
the "Argument list too long" error reported in bug 727522.

Fixes: 5508bf7a6db5 ("ecompress: ignore docompress -x files in precompressed QA check (bug 721516)")
Bug: https://bugs.gentoo.org/727522
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 7aabc8e4c..1ab07ccd7 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -38,9 +38,10 @@ while [[ $# -gt 0 ]] ; do
 		if [[ ${#skip_files[@]} -gt 0 && -s ${T}/.ecompress_had_precompressed ]]; then
 			sed_args=()
 			for f in "${skip_files[@]}"; do
-				sed_args+=(-e "s|^${f}\$||")
+				sed_args+=("s|^${f}\$||;")
 			done
-			sed "${sed_args[@]}" -e '/^$/d' -i "${T}/.ecompress_had_precompressed" || die
+			sed_args+=('/^$/d')
+			sed -f - -i "${T}/.ecompress_had_precompressed" <<< "${sed_args[@]}" || die
 		fi
 
 		exit 0


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-06-24 23:09 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-06-24 23:09 UTC (permalink / raw
  To: gentoo-commits

commit:     03d4c33f48eb5e98c9fdc8bf49ee239489229b8e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 24 22:58:44 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 24 23:06:46 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=03d4c33f

ecompress: fix precompressed false positive for docompress -x <directory>

Use ${REPLY%.ecompress} to correctly strip the .ecompress suffix.

Fixes: 5508bf7a6db5 ("ecompress: ignore docompress -x files in precompressed QA check (bug 721516)")
Bug: https://bugs.gentoo.org/721516
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ecompress | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ecompress b/bin/ecompress
index 1ab07ccd7..60b083834 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -31,7 +31,7 @@ while [[ $# -gt 0 ]] ; do
 
 		if [[ ${#skip_dirs[@]} -gt 0 ]]; then
 			while read -r -d ''; do
-				skip_files+=(${REPLY#.ecompress})
+				skip_files+=("${REPLY%.ecompress}")
 			done < <(find "${skip_dirs[@]}" -name '*.ecompress' -print0 -delete || die)
 		fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-07-13  5:22 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-07-13  5:22 UTC (permalink / raw
  To: gentoo-commits

commit:     25e360ca5584fd0f366f13c2ffc3233010accd89
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 13 05:20:39 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 13 05:21:17 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=25e360ca

quickpkg: split tokens in BINPKG_COMPRESS_FLAGS

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/quickpkg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index df8c1a8e8..c4ff198b8 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -137,7 +137,7 @@ def quickpkg_atom(options, infos, arg, eout):
 				missing_package = compression["package"]
 				eout.eerror("File compression unsupported %s. Missing package: %s" % (binpkg_compression, missing_package))
 				return 1
-			cmd = [varexpand(x, mydict=settings) for x in shlex_split(compression["compress"])]
+			cmd = shlex_split(varexpand(compression["compress"], mydict=settings))
 			# Filter empty elements that make Popen fail
 			cmd = [x for x in cmd if x != ""]
 			with open(binpkg_tmpfile, "wb") as fobj:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-08-03 19:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-08-03 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     6ed68deea863db94942da1fd487850bbe401b980
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 19:05:56 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 19:22:12 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6ed68dee

bin/doins.py: drop unused-import

* Drop unused-import
* Update copyright

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/doins.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/bin/doins.py b/bin/doins.py
index 4929cb90a..5bbf92635 100644
--- a/bin/doins.py
+++ b/bin/doins.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python -b
-# Copyright 2017 Gentoo Foundation
+# Copyright 2017-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # Copyright 2017 The Chromium OS Authors. All rights reserved.
@@ -11,7 +11,6 @@
 This script is designed to be executed by ebuild-helpers/doins.
 """
 
-
 from __future__ import print_function
 
 import argparse
@@ -20,7 +19,6 @@ import grp
 import logging
 import os
 import pwd
-import re
 import shlex
 import shutil
 import stat


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-10-18  9:32 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2020-10-18  9:32 UTC (permalink / raw
  To: gentoo-commits

commit:     c2f413d6a1b820854681847870f94ff08ac35c2a
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 18 09:32:26 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Oct 18 09:32:26 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c2f413d6

Revert "Skip QA Notice for hasq/useq during *rm phases."

Almost a decade later, the reason for this is no longer valid.
This reverts commit 6620e74643e0baf040488557b1fff7273654a44d.

Bug: https://bugs.gentoo.org/199722#c8
Acked-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/isolated-functions.sh | 3 +--
 bin/phase-helpers.sh      | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index fde684013..ba224b96f 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -475,8 +475,7 @@ ___parallel_xargs() {
 }
 
 hasq() {
-	has $EBUILD_PHASE prerm postrm || eqawarn \
-		"QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
+	eqawarn "QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
 	has "$@"
 }
 

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 9495465f9..e7b0a4171 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -190,8 +190,7 @@ dostrip() {
 }
 
 useq() {
-	has $EBUILD_PHASE prerm postrm || eqawarn \
-		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"
+	eqawarn "QA Notice: The 'useq' function is deprecated (replaced by 'use')"
 	use ${1}
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-11-01 21:46 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2020-11-01 21:46 UTC (permalink / raw
  To: gentoo-commits

commit:     8b7edb648814cc53774c5841e45d8cc325bcef6e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 28 08:34:51 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov  1 21:45:01 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8b7edb64

pid-sandbox: Forward SIGTSTP and SIGCONT (bug 704498)

For correct operation of Ctrl+Z, forward SIGTSTP and SIGCONT
to all sandboxed pids.

Fixes: 37e4dc5ae842 ("pid-sandbox: pid-ns-init setsid support (bug 675870)")
Bug: https://bugs.gentoo.org/704498
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index 3a218a5df..e410dd028 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 2018-2019 Gentoo Authors
+# Copyright 2018-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -19,6 +19,11 @@ KILL_SIGNALS = (
 	signal.SIGHUP,
 )
 
+SIGTSTP_SIGCONT = (
+	signal.SIGTSTP,
+	signal.SIGCONT,
+)
+
 
 def forward_kill_signal(pid, signum, frame):
 	if pid == 0:
@@ -28,6 +33,18 @@ def forward_kill_signal(pid, signum, frame):
 	os.kill(pid, signum)
 
 
+def forward_sigtstp_sigcont(pid, signum, frame):
+	handler = None
+	if pid == 0:
+		# Temporarily disable the handler in order to prevent it from
+		# being called recursively, since the signal will also be sent
+		# to the current process.
+		handler = signal.signal(signum, signal.SIG_DFL)
+	os.kill(pid, signum)
+	if handler is not None:
+		signal.signal(signum, handler)
+
+
 def preexec_fn(uid, gid, groups, umask):
 	if gid is not None:
 		os.setgid(gid)
@@ -97,6 +114,11 @@ def main(argv):
 	for signum in KILL_SIGNALS:
 		signal.signal(signum, sig_handler)
 
+	# For correct operation of Ctrl+Z, forward SIGTSTP and SIGCONT.
+	sigtstp_sigcont_handler = functools.partial(forward_sigtstp_sigcont, 0 if setsid else main_child_pid)
+	for signum in SIGTSTP_SIGCONT:
+		signal.signal(signum, sigtstp_sigcont_handler)
+
 	# wait for child processes
 	while True:
 		try:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2020-12-24 17:55 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2020-12-24 17:55 UTC (permalink / raw
  To: gentoo-commits

commit:     aa20110bde339046fc3d57538ca8ad47227fba99
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 24 03:21:12 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Dec 24 03:30:04 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=aa20110b

Adjust mangling of "arch" value from scanelf output

scanelf may generate output that looks like this:

```
UNKNOWN_TYPE;lib/firmware/ath10k/WCN3990/hw1.0/wlanmdsp.mbn;;  -  ;
EM_ARM;lib/firmware/mediatek/mt8183/scp.img;;  -  ;
...
```

Previously, we removed the first 3 characters of the first field and
stored this as the "arch" in NEEDED.ELF.2. This unintentionally
changes "UNKNOWN_TYPE" to "NOWN_TYPE".

Instead, let's just remove the string "EM_" from the front.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c2a16cbe0..d7009d7eb 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -194,7 +194,7 @@ install_qa_check() {
 			fi
 
 			echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-			echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
+			echo "${arch#EM_};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
 		done }
 
 		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-02-24 18:51 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-02-24 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     bec96b544b88f7416c04ce4e9c3da1548e99cff2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 24 18:47:36 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 24 18:48:04 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bec96b54

bin/shelve-utils: add sys.path insert

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/shelve-utils | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/shelve-utils b/bin/shelve-utils
index 5088ab5eb..83daeccbc 100755
--- a/bin/shelve-utils
+++ b/bin/shelve-utils
@@ -5,7 +5,11 @@
 import argparse
 import sys
 
+from os import path as osp
+if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
+	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib"))
 import portage
+portage._internal_caller = True
 from portage.util.shelve import dump, restore
 
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-03-04  9:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-03-04  9:14 UTC (permalink / raw
  To: gentoo-commits

commit:     cec73041df583bfd46e1fa9739286a74a2e85b18
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  4 08:34:43 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar  4 08:59:04 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cec73041

bin/ebuild-pyhelper: wrapper for portage python helpers

Merge the shell script wrappers for chmod-lite and ebuild-ipc
into a single ebuild-pyhelper script.

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/chmod-lite      | 11 +----------
 bin/ebuild-ipc      |  9 +--------
 bin/ebuild-pyhelper | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/bin/chmod-lite b/bin/chmod-lite
deleted file mode 100755
index ffa8d4d23..000000000
--- a/bin/chmod-lite
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright 2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-export __PORTAGE_HELPER_CWD=${PWD}
-
-# Use safe cwd, avoiding unsafe import for bug #469338.
-cd "${PORTAGE_PYM_PATH}" || exit 1
-PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
-	exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/chmod-lite.py" "$@"

diff --git a/bin/chmod-lite b/bin/chmod-lite
new file mode 120000
index 000000000..d64cd615b
--- /dev/null
+++ b/bin/chmod-lite
@@ -0,0 +1 @@
+ebuild-pyhelper
\ No newline at end of file

diff --git a/bin/ebuild-ipc b/bin/ebuild-ipc
deleted file mode 100755
index e77b94b2c..000000000
--- a/bin/ebuild-ipc
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-# Copyright 2010-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# Use safe cwd, avoiding unsafe import for bug #469338.
-cd "${PORTAGE_PYM_PATH}" || exit 1
-PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
-	exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"

diff --git a/bin/ebuild-ipc b/bin/ebuild-ipc
new file mode 120000
index 000000000..d64cd615b
--- /dev/null
+++ b/bin/ebuild-ipc
@@ -0,0 +1 @@
+ebuild-pyhelper
\ No newline at end of file

diff --git a/bin/ebuild-pyhelper b/bin/ebuild-pyhelper
new file mode 100755
index 000000000..d32bc6f6f
--- /dev/null
+++ b/bin/ebuild-pyhelper
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright 2010-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+export __PORTAGE_HELPER_CWD=${PWD}
+
+if [[ ${0##*/} == "ebuild-pyhelper" ]]; then
+	echo "ebuild-pyhelper: must be called via symlink" &>2
+	exit 1
+fi
+
+# Use safe cwd, avoiding unsafe import for bug #469338.
+cd "${PORTAGE_PYM_PATH}" || exit 1
+for path in "${PORTAGE_BIN_PATH}/${0##*/}"{.py,}; do
+	if [[ -x "${path}" ]]; then
+		PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
+			exec "${PORTAGE_PYTHON:-/usr/bin/python}" "${path}" "$@"
+	fi
+done
+echo "File not found: ${path}" >&2
+exit 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-03-29  0:30 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-03-29  0:30 UTC (permalink / raw
  To: gentoo-commits

commit:     482177991dd27f2e776176233c097dfa6ea84439
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 29 00:27:26 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 29 00:29:53 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=48217799

glsa-check: suppress line 293 newline for --quiet (bug 719260)

Bug: https://bugs.gentoo.org/719260#c2
Reported-by: Ramon Fischer <Ramon_Fischer <AT> hotmail.de>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/glsa-check | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index a3e7aa043..c8610f7df 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -290,7 +290,8 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 		elif mode == "inject":
 			sys.stdout.write("injecting " + myid + "\n")
 			myglsa.inject()
-		sys.stdout.write("\n")
+		if not quiet:
+			sys.stdout.write("\n")
 	sys.exit(0)
 
 # test is a bit different as Glsa.test() produces no output


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-01 23:25 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-05-01 23:25 UTC (permalink / raw
  To: gentoo-commits

commit:     3b518fe224c6b6006eeadf4fe929325ab5cc5c6a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May  1 23:01:24 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May  1 23:18:00 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3b518fe2

ebuild-ipc: silently handle KeyboardInterrupt

Bug: https://bugs.gentoo.org/787563
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild-ipc.py | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index be4a320ce..32f6d53b9 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -1,16 +1,30 @@
 #!/usr/bin/python -b
-# Copyright 2010-2018 Gentoo Foundation
+# Copyright 2010-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # This is a helper which ebuild processes can use
 # to communicate with portage's main python process.
 
+# This block ensures that ^C interrupts are handled quietly.
+try:
+	import os
+	import signal
+
+	def exithandler(signum, _frame):
+		signal.signal(signum, signal.SIG_DFL)
+		os.kill(os.getpid(), signum)
+
+	signal.signal(signal.SIGINT, exithandler)
+	signal.signal(signal.SIGTERM, exithandler)
+	signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+except KeyboardInterrupt:
+	raise SystemExit(130)
+
 import errno
 import logging
-import os
 import pickle
 import platform
-import signal
 import sys
 import time
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-12 11:28 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-05-12 11:28 UTC (permalink / raw
  To: gentoo-commits

commit:     35d75bb9cf78c05cb6767ca4f559d7272d6ca0be
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 09:46:33 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 12 11:21:38 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=35d75bb9

Support new econf-passed parameters for EAPI 8

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/637
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/eapi.sh          |  8 ++++++++
 bin/phase-helpers.sh | 13 +++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 29dfb008c..a93efa8cd 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -174,6 +174,14 @@ ___eapi_econf_passes_--disable-silent-rules() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
+___eapi_econf_passes_--datarootdir() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_econf_passes_--disable-static() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
 ___eapi_econf_passes_--docdir_and_--htmldir() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e7b0a4171..116c233fb 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -603,6 +603,12 @@ econf() {
 		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules || ___eapi_econf_passes_--docdir_and_--htmldir || ___eapi_econf_passes_--with-sysroot; then
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
+			if ___eapi_econf_passes_--datarootdir; then
+				if [[ ${conf_help} == *--datarootdir* ]]; then
+					conf_args+=( --datarootdir="${EPREFIX}"/usr/share )
+				fi
+			fi
+
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
 				if [[ ${conf_help} == *--disable-dependency-tracking* ]]; then
 					conf_args+=( --disable-dependency-tracking )
@@ -615,6 +621,13 @@ econf() {
 				fi
 			fi
 
+			if ___eapi_econf_passes_--disable-static; then
+				if [[ ${conf_help} == *--disable-static* || \
+						${conf_help} == *--enable-static* ]]; then
+					conf_args+=( --disable-static )
+				fi
+			fi
+
 			if ___eapi_econf_passes_--docdir_and_--htmldir; then
 				if [[ ${conf_help} == *--docdir* ]]; then
 					conf_args+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-12 11:28 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-05-12 11:28 UTC (permalink / raw
  To: gentoo-commits

commit:     56421775978dbee167dd241c43d3a56b8a3ea48e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 10:00:28 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 12 11:21:44 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=56421775

Accumulated PROPERTIES and RESTRICT for EAPI 8

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/638
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/eapi.sh   |  8 ++++++++
 bin/ebuild.sh | 48 ++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index a93efa8cd..e2b6f62a0 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -50,6 +50,14 @@ ___eapi_has_PORTDIR_ECLASSDIR() {
 	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
 }
 
+___eapi_has_accumulated_PROPERTIES() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_has_accumulated_RESTRICT() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
 # HELPERS PRESENCE
 
 ___eapi_has_dohard() {

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index cfcf6eba3..ed0218787 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -255,6 +255,8 @@ inherit() {
 	local B_RDEPEND
 	local B_PDEPEND
 	local B_BDEPEND
+	local B_PROPERTIES
+	local B_RESTRICT
 	while [ "$1" ]; do
 		location=""
 		potential_location=""
@@ -299,7 +301,7 @@ inherit() {
 
 			# Retain the old data and restore it later.
 			unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND
-			unset B_BDEPEND
+			unset B_BDEPEND B_PROPERTIES B_RESTRICT
 			[ "${IUSE+set}"       = set ] && B_IUSE="${IUSE}"
 			[ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
 			[ "${DEPEND+set}"     = set ] && B_DEPEND="${DEPEND}"
@@ -307,6 +309,16 @@ inherit() {
 			[ "${PDEPEND+set}"    = set ] && B_PDEPEND="${PDEPEND}"
 			[ "${BDEPEND+set}"    = set ] && B_BDEPEND="${BDEPEND}"
 			unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND BDEPEND
+
+			if ___eapi_has_accumulated_PROPERTIES; then
+				[[ ${PROPERTIES+set} == set ]] && B_PROPERTIES=${PROPERTIES}
+				unset PROPERTIES
+			fi
+			if ___eapi_has_accumulated_RESTRICT; then
+				[[ ${RESTRICT+set} == set ]] && B_RESTRICT=${RESTRICT}
+				unset RESTRICT
+			fi
+
 			#turn on glob expansion
 			set +f
 		fi
@@ -344,6 +356,23 @@ inherit() {
 			[ "${B_BDEPEND+set}"  = set ] && BDEPEND="${B_BDEPEND}"
 			[ "${B_BDEPEND+set}"  = set ] || unset BDEPEND
 
+			if ___eapi_has_accumulated_PROPERTIES; then
+				[[ ${PROPERTIES+set} == set ]] &&
+					E_PROPERTIES+=${E_PROPERTIES:+ }${PROPERTIES}
+				[[ ${B_PROPERTIES+set} == set ]] &&
+					PROPERTIES=${B_PROPERTIES}
+				[[ ${B_PROPERTIES+set} == set ]] ||
+					unset PROPERTIES
+			fi
+			if ___eapi_has_accumulated_RESTRICT; then
+				[[ ${RESTRICT+set} == set ]] &&
+					E_RESTRICT+=${E_RESTRICT:+ }${RESTRICT}
+				[[ ${B_RESTRICT+set} == set ]] &&
+					RESTRICT=${B_RESTRICT}
+				[[ ${B_RESTRICT+set} == set ]] ||
+					unset RESTRICT
+			fi
+
 			#turn on glob expansion
 			set +f
 
@@ -600,10 +629,10 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		# In order to ensure correct interaction between ebuilds and
 		# eclasses, they need to be unset before this process of
 		# interaction begins.
-		unset EAPI DEPEND RDEPEND PDEPEND BDEPEND
+		unset EAPI DEPEND RDEPEND PDEPEND BDEPEND PROPERTIES RESTRICT
 		unset INHERITED IUSE REQUIRED_USE ECLASS E_IUSE E_REQUIRED_USE
-		unset E_DEPEND E_RDEPEND E_PDEPEND E_BDEPEND
-		unset PROVIDES_EXCLUDE REQUIRES_EXCLUDE
+		unset E_DEPEND E_RDEPEND E_PDEPEND E_BDEPEND E_PROPERTIES
+		unset E_RESTRICT PROVIDES_EXCLUDE REQUIRES_EXCLUDE
 
 		if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
 			source "$EBUILD" || die "error sourcing ebuild"
@@ -640,9 +669,16 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		PDEPEND+="${PDEPEND:+ }${E_PDEPEND}"
 		BDEPEND+="${BDEPEND:+ }${E_BDEPEND}"
 		REQUIRED_USE+="${REQUIRED_USE:+ }${E_REQUIRED_USE}"
-		
+
+		if ___eapi_has_accumulated_PROPERTIES; then
+			PROPERTIES+=${PROPERTIES:+ }${E_PROPERTIES}
+		fi
+		if ___eapi_has_accumulated_RESTRICT; then
+			RESTRICT+=${RESTRICT:+ }${E_RESTRICT}
+		fi
+
 		unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
-		unset E_BDEPEND __INHERITED_QA_CACHE
+		unset E_BDEPEND E_PROPERTIES E_RESTRICT __INHERITED_QA_CACHE
 
 		# alphabetically ordered by $EBUILD_PHASE value
 		case ${EAPI} in


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-24  4:34 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-05-24  4:34 UTC (permalink / raw
  To: gentoo-commits

commit:     7c8edfbb8001d447c6f02695954ed9e348dbd088
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 12:06:06 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 04:33:49 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7c8edfbb

Ban hasq, hasv and useq in EAPI 8

Bug: https://bugs.gentoo.org/199722
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh               | 14 +++++++++++++-
 bin/isolated-functions.sh |  6 +++++-
 bin/phase-helpers.sh      |  4 +++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e2b6f62a0..b03871690 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2012-2018 Gentoo Foundation
+# Copyright 2012-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # PHASES
@@ -128,6 +128,18 @@ ___eapi_has_version_functions() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
 }
 
+___eapi_has_hasq() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_has_hasv() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_has_useq() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI-0}} =~ ^(5-progress)$ ]]
 }

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index ba224b96f..b495ae6c7 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -475,11 +475,15 @@ ___parallel_xargs() {
 }
 
 hasq() {
+	___eapi_has_hasq || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+
 	eqawarn "QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
 	has "$@"
 }
 
 hasv() {
+	___eapi_has_hasv || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+
 	if has "$@" ; then
 		echo "$1"
 		return 0

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 116c233fb..7a82dad20 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -190,6 +190,8 @@ dostrip() {
 }
 
 useq() {
+	___eapi_has_useq || die "'${FUNCNAME}' banned in EAPI ${EAPI}"
+
 	eqawarn "QA Notice: The 'useq' function is deprecated (replaced by 'use')"
 	use ${1}
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-24  4:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-05-24  4:37 UTC (permalink / raw
  To: gentoo-commits

commit:     fc728f5d4ab0dd58ef9cd940397a8990bb066d15
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 12:26:32 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 04:36:45 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fc728f5d

Require bash-5.0 in EAPI 8

Bug: https://bugs.gentoo.org/636652
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh   | 6 +++++-
 bin/ebuild.sh | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index a999c68e6..7c2a5b1b2 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -277,7 +277,11 @@ ___eapi_bash_3_2() {
 }
 
 ___eapi_bash_4_2() {
-	! ___eapi_bash_3_2 "$@"
+	[[ ${1-${EAPI-0}} =~ ^(6|7)$ ]]
+}
+
+___eapi_bash_5_0() {
+	true
 }
 
 ___eapi_has_ENV_UNSET() {

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index bf070080d..72990edc5 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -23,6 +23,8 @@ __check_bash_version() {
 		maj=3 min=2
 	elif ___eapi_bash_4_2 ; then
 		maj=4 min=2
+	elif ___eapi_bash_5_0 ; then
+		maj=5 min=0
 	else
 		return
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-24  4:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-05-24  4:37 UTC (permalink / raw
  To: gentoo-commits

commit:     9ea780739f2489611da13223acf87ce3780bef6a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 12:19:15 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 04:35:28 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9ea78073

Remove unpack support for 7z, lha and rar in EAPI 8

Bug: https://bugs.gentoo.org/690968
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh          | 12 ++++++++++++
 bin/phase-helpers.sh | 26 +++++++++++++++++++-------
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index b03871690..a999c68e6 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -186,6 +186,18 @@ ___eapi_unpack_supports_txz() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
+___eapi_unpack_supports_7z() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_unpack_supports_lha() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_unpack_supports_rar() {
+	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
 ___eapi_econf_passes_--disable-dependency-tracking() {
 	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 7a82dad20..6294f6a5c 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -429,11 +429,15 @@ unpack() {
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
-				local my_output
-				my_output="$(7z x -y "${srcdir}${x}")"
-				if [ $? -ne 0 ]; then
-					echo "${my_output}" >&2
-					die "$myfail"
+				if ___eapi_unpack_supports_7z; then
+					local my_output
+					my_output="$(7z x -y "${srcdir}${x}")"
+					if [ $? -ne 0 ]; then
+						echo "${my_output}" >&2
+						die "$myfail"
+					fi
+				else
+					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
 			rar)
@@ -443,7 +447,11 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
 				fi
-				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
+				if ___eapi_unpack_supports_rar; then
+					unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
+				else
+					__vecho "unpack ${x}: file format not recognized. Ignoring."
+				fi
 				;;
 			lha|lzh)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -453,7 +461,11 @@ unpack() {
 						"with EAPI '${EAPI}'." \
 						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
 				fi
-				lha xfq "${srcdir}${x}" || die "$myfail"
+				if ___eapi_unpack_supports_lha; then
+					lha xfq "${srcdir}${x}" || die "$myfail"
+				else
+					__vecho "unpack ${x}: file format not recognized. Ignoring."
+				fi
 				;;
 			a)
 				if ___eapi_unpack_is_case_sensitive && \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-24  4:37 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-05-24  4:37 UTC (permalink / raw
  To: gentoo-commits

commit:     96c2cf5ac78f0886e23186dd84f9080572d98adf
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 12:36:53 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 04:36:52 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=96c2cf5a

Support second usev arg in EAPI 8

Bug: https://bugs.gentoo.org/744868
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh          | 4 ++++
 bin/phase-helpers.sh | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 7c2a5b1b2..d3cac807c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -262,6 +262,10 @@ ___eapi_has_DESTTREE_INSDESTTREE() {
 	[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
 }
 
+___eapi_usev_has_second_arg() {
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
 # OTHERS
 
 ___eapi_enables_failglob_in_global_scope() {

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6294f6a5c..6c9e4424e 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -197,8 +197,12 @@ useq() {
 }
 
 usev() {
+	local nargs=1
+	___eapi_usev_has_second_arg && nargs=2
+	[[ ${#} -gt ${nargs} ]] && die "usev takes at most ${nargs} arguments"
+
 	if use ${1}; then
-		echo "${1#!}"
+		echo "${2:-${1#!}}"
 		return 0
 	fi
 	return 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-24  4:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-05-24  4:55 UTC (permalink / raw
  To: gentoo-commits

commit:     23727e2b902b2352aeed3ded659f19d5aa65898a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 16:21:33 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 04:47:49 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=23727e2b

Disallow options in PATCHES in EAPI 8

Bug: https://bugs.gentoo.org/752486
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-functions.sh |  6 ++++++
 bin/phase-helpers.sh   | 11 +++++++++++
 2 files changed, 17 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index db30fdefa..a6837390f 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -926,6 +926,12 @@ __ebuild_phase_funcs() {
 				declare -F src_prepare >/dev/null || \
 					src_prepare() { default; }
 			fi
+
+			# defaults starting with EAPI 8
+			if ! has ${eapi} 2 3 4 4-python 4-slot-abi 5 5-progress 6 7; then
+				[[ ${phase_func} == src_prepare ]] && \
+					default_src_prepare() { __eapi8_src_prepare; }
+			fi
 			;;
 	esac
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6c9e4424e..3f53e6c57 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -871,6 +871,17 @@ __eapi6_src_install() {
 	einstalldocs
 }
 
+__eapi8_src_prepare() {
+	local f
+	if ___is_indexed_array_var PATCHES ; then
+		[[ ${#PATCHES[@]} -gt 0 ]] && eapply -- "${PATCHES[@]}"
+	elif [[ -n ${PATCHES} ]]; then
+		eapply -- ${PATCHES}
+	fi
+
+	eapply_user
+}
+
 ___best_version_and_has_version_common() {
 	local atom root root_arg
 	local -a cmd=()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-05-31 16:35 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-05-31 16:35 UTC (permalink / raw
  To: gentoo-commits

commit:     5ee55de6c7547a68327cb3d57cd0e536d40b41e7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon May 31 12:36:01 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May 31 16:35:29 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ee55de6

Detect and report incorrect use of <stabilize-allarches/>

Report a QA warning when <stabilize-allarches/> is used on a package
installing ELF files.  We can easily check this through presence of
(non-empty) NEEDED build-info files.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/723

 bin/misc-functions.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index d7009d7eb..ddf53beea 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -201,10 +201,15 @@ install_qa_check() {
 			echo "${QA_SONAME_NO_SYMLINK}" > \
 			"${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
 
-		if has binchecks ${RESTRICT} && \
-			[ -s "${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2" ] ; then
-			eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
-			eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
+		if [[ -s ${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2 ]]; then
+			if grep -qs '<stabilize-allarches/>' "${EBUILD%/*}/metadata.xml"; then
+				eqawarn "QA Notice: stabilize-allarches/> found on package installing ELF files"
+			fi
+
+			if has binchecks ${RESTRICT}; then
+				eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
+				eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
+			fi
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-06-02 21:47 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-06-02 21:47 UTC (permalink / raw
  To: gentoo-commits

commit:     95da84733ff80fec09601e677709197ff8b2a9a7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  2 21:47:30 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun  2 21:47:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=95da8473

Fix typo in <stabilize-allarches/> QA notice

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ddf53beea..97bd78ec8 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -203,7 +203,7 @@ install_qa_check() {
 
 		if [[ -s ${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2 ]]; then
 			if grep -qs '<stabilize-allarches/>' "${EBUILD%/*}/metadata.xml"; then
-				eqawarn "QA Notice: stabilize-allarches/> found on package installing ELF files"
+				eqawarn "QA Notice: <stabilize-allarches/> found on package installing ELF files"
 			fi
 
 			if has binchecks ${RESTRICT}; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-06-05 18:47 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-06-05 18:47 UTC (permalink / raw
  To: gentoo-commits

commit:     916aba5a91733a2f39ea26e35879fc2f993e7ad1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  4 07:07:44 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  5 18:34:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=916aba5a

Replace deprecated distutils.sysconfig uses

Closes: https://github.com/gentoo/portage/pull/725
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild-ipc.py | 6 ++++--
 bin/portageq      | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 32f6d53b9..fa6ac4395 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -43,8 +43,10 @@ if os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(
 	pym_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib")]
 	sys.path.insert(0, pym_paths[0])
 else:
-	import distutils.sysconfig
-	pym_paths = [os.path.join(distutils.sysconfig.get_python_lib(), x) for x in ("_emerge", "portage")]
+	import sysconfig
+	pym_paths = [
+		os.path.join(sysconfig.get_path("purelib"), x) for x in ("_emerge", "portage")
+	]
 # Avoid sandbox violations after Python upgrade.
 if os.environ.get("SANDBOX_ON") == "1":
 	sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")

diff --git a/bin/portageq b/bin/portageq
index 67fdc9d38..385259f9d 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -26,8 +26,10 @@ if os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(
 	pym_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib")]
 	sys.path.insert(0, pym_paths[0])
 else:
-	import distutils.sysconfig
-	pym_paths = [os.path.join(distutils.sysconfig.get_python_lib(), x) for x in ("_emerge", "portage")]
+	import sysconfig
+	pym_paths = [
+		os.path.join(sysconfig.get_path("purelib"), x) for x in ("_emerge", "portage")
+	]
 # Avoid sandbox violations after Python upgrade.
 if os.environ.get("SANDBOX_ON") == "1":
 	sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-06-13 21:48 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-06-13 21:48 UTC (permalink / raw
  To: gentoo-commits

commit:     209be9a8bee13384dd04a4762436b4c2a5e35bc6
Author:     Florian Schmaus <flo <AT> geekplace <DOT> eu>
AuthorDate: Fri Apr 23 10:56:33 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 13 21:45:33 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=209be9a8

pid-ns-init: Carry the autogroup's nice value into the new session

Closes: https://github.com/gentoo/portage/pull/693
Signed-off-by: Florian Schmaus <flo <AT> geekplace.eu>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index e410dd028..c8e82bdb7 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 2018-2020 Gentoo Authors
+# Copyright 2018-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -12,6 +12,7 @@ import subprocess
 import sys
 import termios
 
+from pathlib import Path
 
 KILL_SIGNALS = (
 	signal.SIGINT,
@@ -91,9 +92,28 @@ def main(argv):
 			'preexec_fn': functools.partial(preexec_fn, uid, gid, groups, umask),
 			'pass_fds': pass_fds,
 		}
+
+		# Try to obtain the current autogroup's nice value.
+		autogroup_nice = None
+		autogroup_file = Path("/proc/self/autogroup")
+		try:
+			f = autogroup_file.open("r")
+		except EnvironmentError:
+			pass
+		else:
+			with f:
+				line = f.readline()
+				autogroup_nice = line.split(" ")[2]
+
 		# Isolate parent process from process group SIGSTOP (bug 675870)
 		setsid = True
 		os.setsid()
+
+		if autogroup_nice:
+			# Set the previously obtained autogroup nice value again,
+			# since we created a new session with os.setsid() above.
+			autogroup_file.write_text(autogroup_nice)
+
 		if sys.stdout.isatty():
 			try:
 				fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-06-18  6:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-06-18  6:59 UTC (permalink / raw
  To: gentoo-commits

commit:     8e47286b7082aac21fe25402a1f9d03db968cd30
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 18 06:58:10 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 18 06:59:17 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8e47286b

Revert "pid-ns-init: Carry the autogroup's nice value into the new session"

This reverts commit 209be9a8bee13384dd04a4762436b4c2a5e35bc6
due to another regression.

Reported-by: Joonas Niilola <juippis <AT> gentoo.org>
Bug: https://bugs.gentoo.org/777492
Bug: https://bugs.gentoo.org/785484
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/pid-ns-init | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index c8e82bdb7..e410dd028 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 2018-2021 Gentoo Authors
+# Copyright 2018-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -12,7 +12,6 @@ import subprocess
 import sys
 import termios
 
-from pathlib import Path
 
 KILL_SIGNALS = (
 	signal.SIGINT,
@@ -92,28 +91,9 @@ def main(argv):
 			'preexec_fn': functools.partial(preexec_fn, uid, gid, groups, umask),
 			'pass_fds': pass_fds,
 		}
-
-		# Try to obtain the current autogroup's nice value.
-		autogroup_nice = None
-		autogroup_file = Path("/proc/self/autogroup")
-		try:
-			f = autogroup_file.open("r")
-		except EnvironmentError:
-			pass
-		else:
-			with f:
-				line = f.readline()
-				autogroup_nice = line.split(" ")[2]
-
 		# Isolate parent process from process group SIGSTOP (bug 675870)
 		setsid = True
 		os.setsid()
-
-		if autogroup_nice:
-			# Set the previously obtained autogroup nice value again,
-			# since we created a new session with os.setsid() above.
-			autogroup_file.write_text(autogroup_nice)
-
 		if sys.stdout.isatty():
 			try:
 				fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-06-20 20:21 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-06-20 20:21 UTC (permalink / raw
  To: gentoo-commits

commit:     c8a52e17017058394ea35394ebfae0e049c8779c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 19:48:43 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 20 20:21:29 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c8a52e17

Fix exposing evaluated PROPERTIES & RESTRICT in EAPI 8

Reorder the code to prevent eclass PROPERTIES & RESTRICT logic from
overriding the processed values gotten from PORTAGE_PROPERTIES
and PORTAGE_RESTRICT.  Otherwise, code in Portage misbehaves due to
unexpected USE-conditionals in PROPERTIES/RESTRICT.

Bug: https://bugs.gentoo.org/796959
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/733
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/ebuild.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2c3b985a9..904fdf54e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -653,13 +653,6 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 			shopt -u failglob
 		fi
 
-		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
-			PROPERTIES=${PORTAGE_PROPERTIES}
-			RESTRICT=${PORTAGE_RESTRICT}
-			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
-			rm "$PORTAGE_BUILDDIR/.ebuild_changed"
-		fi
-
 		[ "${EAPI+set}" = set ] || EAPI=0
 
 		# export EAPI for helpers (especially since we unset it above)
@@ -688,6 +681,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
 		unset E_BDEPEND E_PROPERTIES E_RESTRICT __INHERITED_QA_CACHE
 
+		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
+			PROPERTIES=${PORTAGE_PROPERTIES}
+			RESTRICT=${PORTAGE_RESTRICT}
+			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
+			rm "$PORTAGE_BUILDDIR/.ebuild_changed"
+		fi
+
 		# alphabetically ordered by $EBUILD_PHASE value
 		case ${EAPI} in
 			0|1)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-07-17 22:16 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-07-17 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     e083c8bf20d8488d329e3dccd643c28429e6fe30
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 17 19:59:49 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 17 22:09:32 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e083c8bf

bin/estrip: avoid copying directories in FEATURES=installsources

Initially problem is noticed on gcc-11 as a full ${WORKDIR} syncing
into /usr/src/debug. It happens because `debug.sources` sometimes
contains directory. For example on bash-5 it has:

    $ grep -zv '/<[^/>]*>$' debug.sources | LANG=C sort -z -u  | sed -e 's/\x00/\n/g'
    bash-5.0/
    bash-5.0/alias.c
    ...

This causes syncing object files, config.log, final binaries
and other unexpected data. The change avoids syncking paths
that end with '/'.

Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/estrip | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 7ef1ec35c..665f377fd 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -464,7 +464,9 @@ if [[ -s ${tmpdir}/debug.sources ]] && \
 then
 	__vecho "installsources: rsyncing source files"
 	[[ -d ${D%/}/${prepstrip_sources_dir#/} ]] || mkdir -p "${D%/}/${prepstrip_sources_dir#/}"
-	grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
+	# skip installation of ".../<foo>" (system headers? why inner slashes are forbidden?)
+	# skip syncing of ".../foo/" (complete directories)
+	grep -zv -e '/<[^/>]*>$' -e '/$' "${tmpdir}"/debug.sources | \
 		(cd "${WORKDIR}"; LANG=C sort -z -u | \
 		rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D%/}/${prepstrip_sources_dir#/}/" )
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-09-03 11:34 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-09-03 11:34 UTC (permalink / raw
  To: gentoo-commits

commit:     5ec443ed7dab583f3c654ee81fff563cbda5a9d4
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 30 06:22:12 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  3 11:32:12 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ec443ed

ebuild.sh: Update QA notice in inherit()

Bug: https://bugs.gentoo.org/399039
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/ebuild.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1bca2c965..3042e6c8c 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -248,8 +248,8 @@ inherit() {
 		# previous inherit call in the call stack.
 		if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
 			eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
-			eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
-			eqawarn "after inherit(s)."
+			eqawarn "For compatibility with PMS and to avoid breakage with Pkgcore, only call"
+			eqawarn "EXPORT_FUNCTIONS after inherit(s). Portage behavior may change in future."
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-09-03 11:34 Michał Górny
  0 siblings, 0 replies; 881+ messages in thread
From: Michał Górny @ 2021-09-03 11:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c401d1781c5cc2945e8a7234716ad1c4f1b03ed3
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 30 06:22:10 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  3 11:32:10 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c401d178

Revert "Revert "Generate a QA Notice when EXPORT_FUNCTIONS is called before inherit""

Reinstate the QA notice, because Portage behavior deviates from PMS,
and breakage of eclasses with Pkgcore has been observed recently.

This reverts commit f44d32550861cb25c209ef61dcd7ae1aa230da1f.

Bug: https://bugs.gentoo.org/399039
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/ebuild.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5916bedfc..1bca2c965 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -243,6 +243,14 @@ inherit() {
 	ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
 	if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
 		debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
+
+		# Since ECLASS_DEPTH > 1, the following variables are locals from the
+		# previous inherit call in the call stack.
+		if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
+			eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass."
+			eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS"
+			eqawarn "after inherit(s)."
+		fi
 	fi
 
 	local -x ECLASS


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-09-21 17:27 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2021-09-21 17:27 UTC (permalink / raw
  To: gentoo-commits

commit:     83af7270fafbd7b1eed0031a5e06836ad1edf06d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 21 00:56:36 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 21 17:27:39 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=83af7270

bin/misc-function.sh: check scanelf return code

This is part of a series of fixes for the linked bug (failure
to preserve libraries in some situations).

We need to check if scanelf failed when calling it in the
installed-files QA check as we later use it to populate the VDB.

Silently continuing results in either blank e.g. PROVIDES,
NEEDED{,.ELF.2} or those files may be missing entirely,
resulting in a corrupt state both on the system and in
any generated binpkgs.

Adds an escape variable (PORTAGE_NO_SCANELF_CHECK) to allow
re-emerging pax-utils if it's broken.

Bug: https://bugs.gentoo.org/811462
See: https://github.com/gentoo/portage/pull/744
Closes: https://github.com/gentoo/portage/pull/750
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/misc-functions.sh | 64 ++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 14 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index bd1fb7553..e4defa550 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -177,25 +177,61 @@ install_qa_check() {
 	if type -P scanelf > /dev/null ; then
 		# Save NEEDED information after removing self-contained providers
 		rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2}
+
 		# We don't use scanelf -q, since that would omit libraries like
 		# musl's /usr/lib/libc.so which do not have any DT_NEEDED or
 		# DT_SONAME settings. Since we don't use scanelf -q, we have to
 		# handle the special rpath value "  -  " below.
-		scanelf -yRBF '%a;%p;%S;%r;%n' "${D%/}/" | { while IFS= read -r l; do
-			arch=${l%%;*}; l=${l#*;}
-			obj="/${l%%;*}"; l=${l#*;}
-			soname=${l%%;*}; l=${l#*;}
-			rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
-			needed=${l%%;*}; l=${l#*;}
-
-			# Infer implicit soname from basename (bug 715162).
-			if [[ -z ${soname} && $(file "${D%/}${obj}") == *"SB shared object"* ]]; then
-				soname=${obj##*/}
-			fi
+		scanelf_output=$(scanelf -yRBF '%a;%p;%S;%r;%n' "${D%/}/")
+
+		case $? in
+			0)
+				# Proceed
+				;;
+			159)
+				# Unknown syscall
+				eerror "Failed to run scanelf (unknown syscall)"
+
+				if [[ -z ${PORTAGE_NO_SCANELF_CHECK} ]]; then
+					# Abort only if the special recovery variable isn't set
+					eerror "Please upgrade pax-utils with:"
+					eerror " PORTAGE_NO_SCANELF_CHECK=1 emerge -v1 app-misc/pax-utils"
+					eerror "Aborting to avoid corrupting metadata"
+					die "${0##*/}: Failed to run scanelf! Update pax-utils?"
+				fi
+				;;
+			*)
+				# Failed in another way
+				eerror "Failed to run scanelf (returned: $?)!"
+
+				if [[ -z ${PORTAGE_NO_SCANELF_CHECK} ]]; then
+					# Abort only if the special recovery variable isn't set
+					eerror "Please report this bug at https://bugs.gentoo.org/!"
+					eerror "It may be possible to re-emerge pax-utils with:"
+					eerror " PORTAGE_NO_SCANELF_CHECK=1 emerge -v1 app-misc/pax-utils"
+					eerror "Aborting to avoid corrupting metadata"
+					die "${0##*/}: Failed to run scanelf!"
+				fi
+				;;
+		esac
+
+		if [[ -n ${scanelf_output} ]]; then
+			while IFS= read -r l; do
+				arch=${l%%;*}; l=${l#*;}
+				obj="/${l%%;*}"; l=${l#*;}
+				soname=${l%%;*}; l=${l#*;}
+				rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
+				needed=${l%%;*}; l=${l#*;}
+
+				# Infer implicit soname from basename (bug 715162).
+				if [[ -z ${soname} && $(file "${D%/}${obj}") == *"SB shared object"* ]]; then
+					soname=${obj##*/}
+				fi
 
-			echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-			echo "${arch#EM_};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
-		done }
+				echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+				echo "${arch#EM_};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
+			done <<< ${scanelf_output}
+		fi
 
 		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \
 			echo "${QA_SONAME_NO_SYMLINK}" > \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-09-27 11:19 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2021-09-27 11:19 UTC (permalink / raw
  To: gentoo-commits

commit:     95cd9583d415dfeb07917d7b111502f0b991413d
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  3 16:03:27 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Sep 27 11:15:04 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=95cd9583

eend: Output QA notice when called without argument

PMS says about eend: "Takes one fixed argument, which is a numeric
return code, and an optional message in all subsequent arguments."

Bug: https://bugs.gentoo.org/703520
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index b495ae6c7..5630dcf4c 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -364,6 +364,7 @@ __eend() {
 }
 
 eend() {
+	[[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
 	local retval=${1:-0}
 	shift
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-10-20  7:02 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2021-10-20  7:02 UTC (permalink / raw
  To: gentoo-commits

commit:     5b69971969a77ed435cbea0330a5ac9caf0b33df
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 20 07:02:12 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 20 07:02:12 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5b699719

bin/estrip: don't mention rpm anymore in splitdebug error

Closes: https://bugs.gentoo.org/818967
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 665f377fd..abe523fff 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -172,7 +172,7 @@ save_elf_sources() {
 		if ! ${debugedit_warned} ; then
 			debugedit_warned=true
 			ewarn "FEATURES=installsources is enabled but the debugedit binary could not be"
-			ewarn "found. This feature will not work unless debugedit or rpm is installed!"
+			ewarn "found. This feature will not work unless debugedit is installed!"
 		fi
 		return 0
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-11-01 17:32 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2021-11-01 17:32 UTC (permalink / raw
  To: gentoo-commits

commit:     77288903dfbc98a0d707fd8093d3b2b55ee049e6
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 31 18:43:17 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Oct 31 18:44:24 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=77288903

estrip: skip build-id link creation if we fail to create a debug file

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/estrip | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index e33977091..050d30a6f 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -243,23 +243,24 @@ save_elf_debug() {
 			chmod ${args} "${dst}"
 			# symlink so we can read the name back.
 			ln -s "${dst}" "${inode_debug}" || die
+
+			# if we don't already have build-id from debugedit, look it up
+			if [[ -z ${buildid} ]] ; then
+				# convert the readelf output to something useful
+				buildid=$(${READELF} -n "${src}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }')
+			fi
+			if [[ -n ${buildid} ]] ; then
+				local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}"
+				local buildid_file="${buildid_dir}/${buildid:2}"
+				local src_buildid_rel="../../../../../${src#${ED%/}/}"
+				local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}"
+				mkdir -p "${buildid_dir}" || die
+				[[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug" || die
+				[[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}" || die
+			fi
 		fi
 	fi
 
-	# if we don't already have build-id from debugedit, look it up
-	if [[ -z ${buildid} ]] ; then
-		# convert the readelf output to something useful
-		buildid=$(${READELF} -n "${src}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }')
-	fi
-	if [[ -n ${buildid} ]] ; then
-		local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}"
-		local buildid_file="${buildid_dir}/${buildid:2}"
-		local src_buildid_rel="../../../../../${src#${ED%/}/}"
-		local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}"
-		mkdir -p "${buildid_dir}"
-		[[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug"
-		[[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}"
-	fi
 }
 
 # Usage: process_elf <elf>


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-11-01 17:32 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2021-11-01 17:32 UTC (permalink / raw
  To: gentoo-commits

commit:     84206c6200eb003314cf4f2d640bf73f04654012
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 25 15:30:08 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Oct 31 18:15:27 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=84206c62

estrip: rework hard link logic in save_elf_debug

GDB loads debug files based on the file name given in the .gnu_debuglink
section, prepended with /usr/lib/debug/${dirname}, where dirname is the
absolute path to the parent directory of the binary being executed.

For each unique inode as input, we need a link to the debug file with
the GNU debuglink as its basename. A link to the debug file should exist
for each directory in which the input inode exists.

The debug link names should be based on the .gnu_debuglink value instead
of the name of the file we are processing as input.

The .gnu_debuglink value is based on the name of the first link
processed for each inode. We save this value as a symlink, and then read
it back as we process subsequent links.

For example, given the following input:

INODE PATH
    1 /usr/bin/git
    1 /usr/libexec/git-core/git-add
    2 /usr/bin/git-shell
    2 /usr/libexec/git-core/git-shell

We generate the following inodes for the debug files:

INODE DEBUGLINK
    3 git.debug
    4 git-shell.debug

We should generate the following links:

INODE PATH
    3 /usr/lib/debug/usr/bin/git.debug
    3 /usr/lib/debug/usr/libexec/git-core/git.debug
    4 /usr/bin/debug/usr/bin/git-shell.debug
    4 /usr/bin/debug/usr/libexec/git-core/git-shell.debug

The previous code would have generated this broken output:

INODE PATH
    3 /usr/lib/debug/usr/bin/git.debug
    3 /usr/lib/debug/usr/libexec/git-core/git-add.debug (*)
    4 /usr/bin/debug/usr/bin/git-shell.debug
    4 /usr/bin/debug/usr/libexec/git-core/git-shell.debug

(*) This link has the wrong name.

Bug: https://bugs.gentoo.org/820107
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/estrip | 60 +++++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 39 insertions(+), 21 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index abe523fff..e33977091 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -189,7 +189,7 @@ save_elf_sources() {
 		"${x}")
 }
 
-# Usage: save_elf_debug <elf> [splitdebug file]
+# Usage: save_elf_debug <src> <inode_debug> [splitdebug]
 save_elf_debug() {
 	${FEATURES_splitdebug} || return 0
 	${PORTAGE_RESTRICT_splitdebug} && return 0
@@ -198,49 +198,67 @@ save_elf_debug() {
 	# ${EPREFIX}/usr/lib/debug/${EPREFIX} (note that ${EPREFIX} occurs
 	# twice in this path) in order for gdb's debug-file-directory
 	# lookup to work correctly.
-	local x=$1
-	local inode_debug=$2
-	local splitdebug=$3
-	local d_noslash=${D%/}
-	local y=${ED%/}/usr/lib/debug/${x:${#d_noslash}}.debug
+	local src=$1         # File from which we extract symbols.
+	local inode_debug=$2 # Temp path for hard link tracking
+	local splitdebug=$3  # Existing debug file optionally created by eu-strip in parent function
 
-	# dont save debug info twice
-	[[ ${x} == *".debug" ]] && return 0
+	# Source paths
+	local src_basename=${src##*/}
+	local src_dirname=${src%/*}
 
-	mkdir -p "${y%/*}"
+	# Destination paths
+	local dst_dirname=${ED%/}/usr/lib/debug/${src_dirname#${D%/}/}
+	local dst_basename dst
 
-	if [ -f "${inode_debug}" ] ; then
-		ln "${inode_debug}" "${y}" || die "ln failed unexpectedly"
+	# dont save debug info twice
+	[[ ${src} == *".debug" ]] && return 0
+
+	mkdir -p "${dst_dirname}" || die
+
+	if [[ -L ${inode_debug} ]] ; then
+		# We already created a debug file for this inode.
+		# Read back the file name, and create another hard link if necessary.
+		dst_basename=$(readlink "${inode_debug}") || die
+		dst_basename=${dst_basename##*/}
+		dst=${dst_dirname}/${dst_basename}
+		if [[ ! -e ${dst} ]]; then
+			ln -L "${inode_debug}" "${dst}" || die
+		fi
 	else
+		dst_basename=${src_basename}.debug
+		dst=${dst_dirname}/${dst_basename}
 		if [[ -n ${splitdebug} ]] ; then
-			mv "${splitdebug}" "${y}"
+			mv "${splitdebug}" "${dst}"
 		else
 			local objcopy_flags="--only-keep-debug"
 			${FEATURES_compressdebug} && objcopy_flags+=" --compress-debug-sections"
-			${OBJCOPY} ${objcopy_flags} "${x}" "${y}"
-			${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
+			${OBJCOPY} ${objcopy_flags} "${src}" "${dst}" &&
+			${OBJCOPY} --add-gnu-debuglink="${dst}" "${src}"
 		fi
 		# Only do the following if the debug file was
 		# successfully created (see bug #446774).
-		if [ $? -eq 0 ] ; then
+		if [[ $? -eq 0 ]] ; then
 			local args="a-x,o-w"
-			[[ -g ${x} || -u ${x} ]] && args+=",go-r"
-			chmod ${args} "${y}"
-			ln "${y}" "${inode_debug}" || die "ln failed unexpectedly"
+			[[ -g ${src} || -u ${src} ]] && args+=",go-r"
+			chmod ${args} "${dst}"
+			# symlink so we can read the name back.
+			ln -s "${dst}" "${inode_debug}" || die
 		fi
 	fi
 
 	# if we don't already have build-id from debugedit, look it up
 	if [[ -z ${buildid} ]] ; then
 		# convert the readelf output to something useful
-		buildid=$(${READELF} -n "${x}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }')
+		buildid=$(${READELF} -n "${src}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }')
 	fi
 	if [[ -n ${buildid} ]] ; then
 		local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}"
 		local buildid_file="${buildid_dir}/${buildid:2}"
+		local src_buildid_rel="../../../../../${src#${ED%/}/}"
+		local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}"
 		mkdir -p "${buildid_dir}"
-		[ -L "${buildid_file}".debug ] || ln -s "../../${x:$((${#d_noslash} + 1))}.debug" "${buildid_file}.debug"
-		[ -L "${buildid_file}" ] || ln -s "/${x:$((${#d_noslash} + 1))}" "${buildid_file}"
+		[[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug"
+		[[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}"
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-11-19 16:17 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2021-11-19 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     fe3e50025fee15d59c4956a39b675faf50555c46
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 17 18:23:07 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 16:16:07 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fe3e5002

estrip: fix lockfile handling

The previous code would wait for the first link to an inode to be
processed, and would then allow multiple processes to process duplicate
links to the same inode. This behavior leads to a race condition in
save_elf_debug.

The new code ensures that each inode is accessed by a single process at
a time.

Closes: https://bugs.gentoo.org/823798
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/estrip | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 0ad79e2a3..599ca2ceb 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -270,7 +270,9 @@ save_elf_debug() {
 process_elf() {
 	local x=$1 inode_link=$2 strip_flags=${*:3}
 	local ed_noslash=${ED%/}
-	local already_stripped lockfile xt_data
+	local already_stripped xt_data
+	local lockfile=${inode_link}_lockfile
+	local locktries=100
 
 	__vecho "   ${x:${#ed_noslash}}"
 
@@ -279,13 +281,10 @@ process_elf() {
 	# So, use a lockfile to prevent interference (easily observed with
 	# dev-vcs/git which creates ~111 hardlinks to one file in
 	# /usr/libexec/git-core).
-	lockfile=${inode_link}_lockfile
-	if ! ln "${inode_link}" "${lockfile}" 2>/dev/null ; then
-		while [[ -f ${lockfile} ]] ; do
-			sleep 1
-		done
-		unset lockfile
-	fi
+	while ! ln "${inode_link}" "${lockfile}" 2>/dev/null; do
+		(( --locktries > 0 )) || die "failed to acquire lock '${lockfile}'"
+		sleep 1
+	done
 
 	[ -f "${inode_link}_stripped" ] && already_stripped=true || already_stripped=false
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-11-19 16:17 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2021-11-19 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     d1731fb1390dde14f02510e3f91901a340a6e9c9
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 16 18:20:49 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 16:16:04 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d1731fb1

Move debug-print to isolated-functions.sh

This allows it to be called from various helpers.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/ebuild.sh             | 39 ---------------------------------------
 bin/isolated-functions.sh | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 07ca58d22..ba406034b 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -198,45 +198,6 @@ fi
 #(not secretive, but not stupid)
 umask 022
 
-# debug-print() gets called from many places with verbose status information useful
-# for tracking down problems. The output is in $T/eclass-debug.log.
-# You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.
-# The special "on" setting echoes the information, mixing it with the rest of the
-# emerge output.
-# You can override the setting by exporting a new one from the console, or you can
-# set a new default in make.*. Here the default is "" or unset.
-
-# in the future might use e* from /etc/init.d/functions.sh if i feel like it
-debug-print() {
-	# if $T isn't defined, we're in dep calculation mode and
-	# shouldn't do anything
-	[[ $EBUILD_PHASE = depend || ! -d ${T} || ${#} -eq 0 ]] && return 0
-
-	if [[ ${ECLASS_DEBUG_OUTPUT} == on ]]; then
-		printf 'debug: %s\n' "${@}" >&2
-	elif [[ -n ${ECLASS_DEBUG_OUTPUT} ]]; then
-		printf 'debug: %s\n' "${@}" >> "${ECLASS_DEBUG_OUTPUT}"
-	fi
-
-	if [[ -w $T ]] ; then
-		# default target
-		printf '%s\n' "${@}" >> "${T}/eclass-debug.log"
-		# let the portage user own/write to this file
-		chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/eclass-debug.log"
-		chmod g+w "${T}/eclass-debug.log"
-	fi
-}
-
-# The following 2 functions are debug-print() wrappers
-
-debug-print-function() {
-	debug-print "${1}: entering function, parameters: ${*:2}"
-}
-
-debug-print-section() {
-	debug-print "now in section ${*}"
-}
-
 # Sources all eclasses in parameters
 declare -ix ECLASS_DEPTH=0
 inherit() {

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index df806d403..6d9b73474 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -609,4 +609,43 @@ else
 	}
 fi
 
+# debug-print() gets called from many places with verbose status information useful
+# for tracking down problems. The output is in $T/eclass-debug.log.
+# You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.
+# The special "on" setting echoes the information, mixing it with the rest of the
+# emerge output.
+# You can override the setting by exporting a new one from the console, or you can
+# set a new default in make.*. Here the default is "" or unset.
+
+# in the future might use e* from /etc/init.d/functions.sh if i feel like it
+debug-print() {
+	# if $T isn't defined, we're in dep calculation mode and
+	# shouldn't do anything
+	[[ $EBUILD_PHASE = depend || ! -d ${T} || ${#} -eq 0 ]] && return 0
+
+	if [[ ${ECLASS_DEBUG_OUTPUT} == on ]]; then
+		printf 'debug: %s\n' "${@}" >&2
+	elif [[ -n ${ECLASS_DEBUG_OUTPUT} ]]; then
+		printf 'debug: %s\n' "${@}" >> "${ECLASS_DEBUG_OUTPUT}"
+	fi
+
+	if [[ -w $T ]] ; then
+		# default target
+		printf '%s\n' "${@}" >> "${T}/eclass-debug.log"
+		# let the portage user own/write to this file
+		chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/eclass-debug.log"
+		chmod g+w "${T}/eclass-debug.log"
+	fi
+}
+
+# The following 2 functions are debug-print() wrappers
+
+debug-print-function() {
+	debug-print "${1}: entering function, parameters: ${*:2}"
+}
+
+debug-print-section() {
+	debug-print "now in section ${*}"
+}
+
 true


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-11-19 16:17 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2021-11-19 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     2cd58ac5a96541d0b1ba0440666114d48dc2c889
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 16 19:58:42 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 16:16:07 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2cd58ac5

estrip: add death messages and debug prints in save_elf_debug

Bug: https://bugs.gentoo.org/823798
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/estrip | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 050d30a6f..0ad79e2a3 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -194,6 +194,8 @@ save_elf_debug() {
 	${FEATURES_splitdebug} || return 0
 	${PORTAGE_RESTRICT_splitdebug} && return 0
 
+	debug-print-function "${FUNCNAME}" "$@"
+
 	# NOTE: Debug files must be installed in
 	# ${EPREFIX}/usr/lib/debug/${EPREFIX} (note that ${EPREFIX} occurs
 	# twice in this path) in order for gdb's debug-file-directory
@@ -213,16 +215,17 @@ save_elf_debug() {
 	# dont save debug info twice
 	[[ ${src} == *".debug" ]] && return 0
 
-	mkdir -p "${dst_dirname}" || die
+	mkdir -p "${dst_dirname}" || die "failed to create directory '${dst_dirname}'"
 
 	if [[ -L ${inode_debug} ]] ; then
 		# We already created a debug file for this inode.
 		# Read back the file name, and create another hard link if necessary.
-		dst_basename=$(readlink "${inode_debug}") || die
+		dst_basename=$(readlink "${inode_debug}") || die "failed to read link '${inode_debug}'"
 		dst_basename=${dst_basename##*/}
 		dst=${dst_dirname}/${dst_basename}
 		if [[ ! -e ${dst} ]]; then
-			ln -L "${inode_debug}" "${dst}" || die
+			debug-print "creating hard link: target: '${inode_debug}' name: '${dst}'"
+			ln -L "${inode_debug}" "${dst}" || die "failed to create hard link '${dst}'"
 		fi
 	else
 		dst_basename=${src_basename}.debug
@@ -242,7 +245,7 @@ save_elf_debug() {
 			[[ -g ${src} || -u ${src} ]] && args+=",go-r"
 			chmod ${args} "${dst}"
 			# symlink so we can read the name back.
-			ln -s "${dst}" "${inode_debug}" || die
+			ln -s "${dst}" "${inode_debug}" || die "failed to create symlink '${inode_debug}'"
 
 			# if we don't already have build-id from debugedit, look it up
 			if [[ -z ${buildid} ]] ; then
@@ -255,8 +258,8 @@ save_elf_debug() {
 				local src_buildid_rel="../../../../../${src#${ED%/}/}"
 				local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}"
 				mkdir -p "${buildid_dir}" || die
-				[[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug" || die
-				[[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}" || die
+				[[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug" || die "failed to create symlink '${buildid_file}.debug'"
+				[[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}" || die "failed to create symlink '${buildid_file}'"
 			fi
 		fi
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2021-11-19 23:59 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2021-11-19 23:59 UTC (permalink / raw
  To: gentoo-commits

commit:     47fb9590b57162a786d668f663c1d0dfbfd1cfb0
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Nov 19 22:00:00 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 23:55:08 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=47fb9590

eapply_user(): Add message about applying user patches and minor decoration.

Bug: https://bugs.gentoo.org/825066
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 94f4f24f2..6a078caad 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1139,6 +1139,10 @@ if ___eapi_has_eapply_user; then
 
 		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
 
+		local columns=${COLUMNS:-0}
+		[[ ${columns} == 0 ]] && columns=$(set -- $( ( stty size </dev/tty ) 2>/dev/null || echo 24 80 ) ; echo $2)
+		(( columns > 0 )) || (( columns = 80 ))
+
 		local applied d f
 		local -A _eapply_user_patches
 		local prev_shopt=$(shopt -p nullglob)
@@ -1170,6 +1174,11 @@ if ___eapi_has_eapply_user; then
 			while read -r -d '' f; do
 				f=${_eapply_user_patches[${f}]}
 				if [[ -s ${f} ]]; then
+					if [[ -z ${applied} ]]; then
+						einfo "${PORTAGE_COLOR_INFO}$(for ((column = 0; column < ${columns} - 3; column++)); do echo -n =; done)${PORTAGE_COLOR_NORMAL}"
+						einfo "Applying user patches from ${basedir} ..."
+					fi
+
 					eapply "${f}"
 					applied=1
 				fi
@@ -1179,7 +1188,10 @@ if ___eapi_has_eapply_user; then
 
 		${prev_shopt}
 
-		[[ -n ${applied} ]] && ewarn "User patches applied."
+		if [[ -n ${applied} ]]; then
+			einfo "User patches applied."
+			einfo "${PORTAGE_COLOR_INFO}$(for ((column = 0; column < ${columns} - 3; column++)); do echo -n =; done)${PORTAGE_COLOR_NORMAL}"
+		fi
 	}
 fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-01-24  2:07 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-01-24  2:07 UTC (permalink / raw
  To: gentoo-commits

commit:     1837b14d69ed663f62c33ba258b531fd41f8adb7
Author:     Sheng Yu <syu.os <AT> protonmail <DOT> com>
AuthorDate: Mon Jan 24 01:56:46 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 24 02:07:11 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1837b14d

quickpkg: check gpg status

Closes: https://bugs.gentoo.org/831944
Signed-off-by: Sheng Yu <syu.os <AT> protonmail.com>
Closes: https://github.com/gentoo/portage/pull/784
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/quickpkg | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 7733bc833..27dda85ed 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -285,8 +285,9 @@ def quickpkg_main(options, args, eout):
 		portage.settings.features.remove('xattr')
 		portage.settings.lock()
 
-	gpg = GPG(portage.settings)
-	gpg.unlock()
+	if portage.settings.get("BINPKG_GPG_SIGNING_KEY", None):
+		gpg = GPG(portage.settings)
+		gpg.unlock()
 
 	infos = {}
 	infos["successes"] = []


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-02-04 17:32 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2022-02-04 17:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d610d14325fbe65f9a011d643be74c95098c3241
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  2 18:07:19 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Feb  2 18:11:29 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d610d143

estrip: fix race when creating build-id debug symlinks

Bug: https://bugs.gentoo.org/831927
Closes: https://github.com/gentoo/portage/pull/786
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/estrip | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 599ca2ceb..cdad58c31 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -189,6 +189,19 @@ save_elf_sources() {
 		"${x}")
 }
 
+# Try to create a symlink.
+# Return success if it already exists.
+__try_symlink() {
+	local target=$1
+	local name=$2
+	# Check for an existing link before and after in case we are racing against
+	# another process.
+	[[ -L ${name} ]] ||
+		ln -s "${target}" "${name}" ||
+		[[ -L ${name} ]] ||
+		die "failed to create symlink '${name}'"
+}
+
 # Usage: save_elf_debug <src> <inode_debug> [splitdebug]
 save_elf_debug() {
 	${FEATURES_splitdebug} || return 0
@@ -245,7 +258,7 @@ save_elf_debug() {
 			[[ -g ${src} || -u ${src} ]] && args+=",go-r"
 			chmod ${args} "${dst}"
 			# symlink so we can read the name back.
-			ln -s "${dst}" "${inode_debug}" || die "failed to create symlink '${inode_debug}'"
+			__try_symlink "${dst}" "${inode_debug}"
 
 			# if we don't already have build-id from debugedit, look it up
 			if [[ -z ${buildid} ]] ; then
@@ -258,8 +271,8 @@ save_elf_debug() {
 				local src_buildid_rel="../../../../../${src#${ED%/}/}"
 				local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}"
 				mkdir -p "${buildid_dir}" || die
-				[[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug" || die "failed to create symlink '${buildid_file}.debug'"
-				[[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}" || die "failed to create symlink '${buildid_file}'"
+				__try_symlink "${dst_buildid_rel}" "${buildid_file}.debug"
+				__try_symlink "${src_buildid_rel}" "${buildid_file}"
 			fi
 		fi
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-02-15 21:30 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2022-02-15 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     937227f72d4e6eb057bb53f793686fe721f52ac2
Author:     Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Tue Feb 15 21:28:02 2022 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 15 21:28:02 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=937227f7

die: omit $S display if not set

If die is used during the depend phase, there is no $S setting, so
don't bother displaying it in the first place.  This cuts down on
the log spam a bit.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 bin/isolated-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 51678958b..bd8c065b2 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -227,7 +227,7 @@ die() {
 		eerror "The ebuild environment file is located at '${T}/die.env'."
 	fi
 	eerror "Working directory: '$(pwd)'"
-	eerror "S: '${S}'"
+	[[ -n ${S} ]] && eerror "S: '${S}'"
 
 	[[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"
 	[[ -n $PORTAGE_IPC_DAEMON ]] && "$PORTAGE_BIN_PATH"/ebuild-ipc exit 1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-02-15 21:30 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2022-02-15 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     f64ce32426f7be047dde583ada96f0cf3128a0a3
Author:     Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Tue Feb 15 21:17:56 2022 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 15 21:17:56 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f64ce324

ebuild: clarify EAPI bash requirements in error message

When installing a package with an older bash than the ebuild's EAPI
requires, the simple error message ">=bash-5.0 is required" is much
too terse.  Add details explaining why a newer version of bash is
required.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 bin/ebuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index ba406034b..5b0b79585 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -32,7 +32,7 @@ __check_bash_version() {
 	# Make sure the active bash is sane.
 	if [[ ${BASH_VERSINFO[0]} -lt ${maj} ]] ||
 	   [[ ${BASH_VERSINFO[0]} -eq ${maj} && ${BASH_VERSINFO[1]} -lt ${min} ]] ; then
-		die ">=bash-${maj}.${min} is required"
+		die "EAPI=\"${EAPI}\" requires >=bash-${maj}.${min}, but bash-${BASH_VERSION} found"
 	fi
 
 	# Set the compat level in case things change with newer ones.  We must not


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-02-15 21:30 Mike Frysinger
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Frysinger @ 2022-02-15 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     625690fe22734f9290fecc7631809a971a01b40e
Author:     Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Tue Feb 15 21:26:24 2022 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 15 21:26:24 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=625690fe

die: do not kill $EBUILD_MASTER_PID if it isn't yet setup

If die is used during the depend phase, EBUILD_MASTER_PID isn't setup,
and the kill call here prints a confusing error message.  Just skip
the step entirely if $EBUILD_MASTER_PID isn't set.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 bin/isolated-functions.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 6d9b73474..51678958b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -233,7 +233,9 @@ die() {
 	[[ -n $PORTAGE_IPC_DAEMON ]] && "$PORTAGE_BIN_PATH"/ebuild-ipc exit 1
 
 	# subshell die support
-	[[ ${BASHPID:-$(__bashpid)} == ${EBUILD_MASTER_PID} ]] || kill -s SIGTERM ${EBUILD_MASTER_PID}
+	if [[ -n ${EBUILD_MASTER_PID} && ${BASHPID:-$(__bashpid)} != ${EBUILD_MASTER_PID} ]] ; then
+		kill -s SIGTERM ${EBUILD_MASTER_PID}
+	fi
 	exit 1
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-03-28  6:20 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-03-28  6:20 UTC (permalink / raw
  To: gentoo-commits

commit:     bb88e766897f5e7e0b0a10c48cf99a04edb73a40
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  5 05:32:45 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 28 06:20:45 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bb88e766

estrip: avoid calling scanelf twice

We can use the previous scanelf data to not call it again to find
all of the dynamically linked executables/libraries which need stripping.

Bug: https://bugs.gentoo.org/749624
Closes: https://github.com/gentoo/portage/pull/794
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip            |  3 ++-
 bin/misc-functions.sh | 29 +++++++++++++++--------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index cdad58c31..686afb763 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -410,8 +410,9 @@ while read -r x ; do
 done < <(
 	# Use sort -u to eliminate duplicates for bug #445336.
 	(
-		scanelf -yqRBF '#k%F' -k '.symtab' "$@"
 		find "$@" -type f ! -type l -name '*.a'
+		cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \
+			| sed -e "s:^:${ED}:"
 	) | LC_ALL=C sort -u
 )
 else

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ccb07075f..0e1791937 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -151,20 +151,6 @@ install_qa_check() {
 		"${PORTAGE_BIN_PATH}"/ecompress --dequeue
 	fi
 
-	# If binpkg-dostrip is enabled, apply stripping before creating
-	# the binary package.
-	# Note: disabling it won't help with packages calling prepstrip directly.
-	if has binpkg-dostrip ${FEATURES}; then
-		export STRIP_MASK
-		if ___eapi_has_dostrip; then
-			"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
-			"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
-			"${PORTAGE_BIN_PATH}"/estrip --dequeue
-		else
-			prepallstrip
-		fi
-	fi
-
 	if has chflags $FEATURES ; then
 		# Restore all the file flags that were saved earlier on.
 		mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
@@ -249,6 +235,21 @@ install_qa_check() {
 		fi
 	fi
 
+	# If binpkg-dostrip is enabled, apply stripping before creating
+	# the binary package.
+	# Note: disabling it won't help with packages calling prepstrip directly.
+	# We do this after the scanelf bits so that we can reuse the data. bug #749624.
+	if has binpkg-dostrip ${FEATURES}; then
+		export STRIP_MASK
+		if ___eapi_has_dostrip; then
+			"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
+			"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
+			"${PORTAGE_BIN_PATH}"/estrip --dequeue
+		else
+			prepallstrip
+		fi
+	fi
+
 	# Portage regenerates this on the installed system.
 	rm -f "${ED%/}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!"
 }


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-04-12  2:00 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-04-12  2:00 UTC (permalink / raw
  To: gentoo-commits

commit:     23c4a45827fccebb969d5130ccc234ed3d1a9b35
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Mon Apr 11 13:46:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 12 01:59:50 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=23c4a458

eend: Output QA warning if ebegin has not been called

The assumption here is that ebegin-eend aren't nested.

Closes: https://bugs.gentoo.org/835824
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/portage/pull/807
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/isolated-functions.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index bd8c065b2..539fea952 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -339,6 +339,7 @@ ebegin() {
 	[[ ${RC_ENDCOL} == "yes" ]] && echo >&2
 	LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
 	LAST_E_CMD="ebegin"
+	EBEGIN_EEND=1
 	return 0
 }
 
@@ -367,6 +368,11 @@ __eend() {
 
 eend() {
 	[[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
+	if [[ -v EBEGIN_EEND ]] ; then
+		unset EBEGIN_EEND
+	else
+		eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})"
+	fi
 	local retval=${1:-0}
 	shift
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-04-13  4:02 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-04-13  4:02 UTC (permalink / raw
  To: gentoo-commits

commit:     51dd930ec597ac438ef9fc3c4e7dc80ecd738903
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 13 03:58:41 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 04:02:40 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=51dd930e

bin/*.sh: cosmetic cleanups to comments, whitespace

Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/814
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ebuild.sh             | 33 +++++++++++++++++----------------
 bin/isolated-functions.sh |  4 ++--
 bin/misc-functions.sh     | 10 +++++-----
 bin/phase-helpers.sh      | 14 +++++++-------
 4 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 628d7eb80..811f1f8a2 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -96,7 +96,7 @@ unset BASH_ENV
 # earlier portage versions do not detect a version change in this case
 # (9999 to 9999) and therefore they try execute an incompatible version of
 # ebuild.sh during the upgrade.
-export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2} 
+export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2}
 
 # These two functions wrap sourcing and calling respectively.  At present they
 # perform a qa check to make sure eclasses and ebuilds and profiles don't mess
@@ -144,7 +144,7 @@ fi
 
 [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
 
-# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex)
+# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (e.g. /usr/lib64/conftest)
 __sb_append_var() {
 	local _v=$1 ; shift
 	local var="SANDBOX_${_v}"
@@ -175,7 +175,7 @@ elif [[ $SANDBOX_ON = 1 ]] ; then
 	unset x
 fi
 
-# the sandbox is disabled by default except when overridden in the relevant stages
+# The sandbox is disabled by default except when overridden in the relevant stages
 export SANDBOX_ON=0
 
 # Ensure that $PWD is sane whenever possible, to protect against
@@ -189,8 +189,8 @@ else
 		die "PORTAGE_PYM_PATH does not exist: '${PORTAGE_PYM_PATH}'"
 fi
 
-#if no perms are specified, dirs/files will have decent defaults
-#(not secretive, but not stupid)
+# If no perms are specified, dirs/files will have decent defaults
+# (not secretive, but not stupid)
 umask 022
 
 # Sources all eclasses in parameters
@@ -258,12 +258,12 @@ inherit() {
 		debug-print "inherit: $1 -> $location"
 		[[ -z ${location} ]] && die "${1}.eclass could not be found by inherit()"
 
-		# inherits in QA checks can't handle metadata assignments
+		# Inherits in QA checks can't handle metadata assignments
 		if [[ -z ${_IN_INSTALL_QA_CHECK} ]]; then
-			#We need to back up the values of *DEPEND to B_*DEPEND
-			#(if set).. and then restore them after the inherit call.
+			# We need to back up the values of *DEPEND to B_*DEPEND
+			# (if set).. and then restore them after the inherit call.
 
-			#turn off glob expansion
+			# Turn off glob expansion
 			set -f
 
 			# Retain the old data and restore it later.
@@ -291,9 +291,9 @@ inherit() {
 		fi
 
 		__qa_source "$location" || die "died sourcing $location in inherit()"
-		
+
 		if [[ -z ${_IN_INSTALL_QA_CHECK} ]]; then
-			#turn off glob expansion
+			# Turn off glob expansion
 			set -f
 
 			# If each var has a value, append it to the global variable E_* to
@@ -308,7 +308,7 @@ inherit() {
 
 			[ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
 			[ "${B_IUSE+set}"     = set ] || unset IUSE
-			
+
 			[ "${B_REQUIRED_USE+set}"     = set ] && REQUIRED_USE="${B_REQUIRED_USE}"
 			[ "${B_REQUIRED_USE+set}"     = set ] || unset REQUIRED_USE
 
@@ -344,7 +344,7 @@ inherit() {
 					unset RESTRICT
 			fi
 
-			#turn on glob expansion
+			# Turn on glob expansion
 			set +f
 
 			if [[ -n ${!__export_funcs_var} ]] ; then
@@ -472,7 +472,7 @@ __try_source() {
 export SANDBOX_ON="1"
 export S=${WORKDIR}/${P}
 
-# Turn of extended glob matching so that g++ doesn't get incorrectly matched.
+# Turn off extended glob matching so that g++ doesn't get incorrectly matched.
 shopt -u extglob
 
 if [[ ${EBUILD_PHASE} == depend ]] ; then
@@ -484,7 +484,8 @@ elif [[ ${EBUILD_PHASE} == clean* ]] ; then
 else
 	QA_INTERCEPTORS="autoconf automake aclocal libtoolize"
 fi
-# level the QA interceptors if we're in depend
+
+# Level the QA interceptors if we're in depend
 if [[ -n ${QA_INTERCEPTORS} ]] ; then
 	for BIN in ${QA_INTERCEPTORS}; do
 		BIN_PATH=$(type -Pf ${BIN})
@@ -627,7 +628,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 			debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
 		fi
 
-		# add in dependency info from eclasses
+		# Add in dependency info from eclasses
 		IUSE+="${IUSE:+ }${E_IUSE}"
 		DEPEND+="${DEPEND:+ }${E_DEPEND}"
 		RDEPEND+="${RDEPEND:+ }${E_RDEPEND}"

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 539fea952..41ca106a4 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -624,8 +624,8 @@ fi
 # emerge output.
 # You can override the setting by exporting a new one from the console, or you can
 # set a new default in make.*. Here the default is "" or unset.
-
-# in the future might use e* from /etc/init.d/functions.sh if i feel like it
+#
+# (TODO: in the future, might use e* from /lib/gentoo/functions.sh?)
 debug-print() {
 	# if $T isn't defined, we're in dep calculation mode and
 	# shouldn't do anything

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 0e1791937..de7ebf4a2 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -21,7 +21,7 @@ install_symlink_html_docs() {
 		local ED=${D}
 	fi
 	cd "${ED}" || die "cd failed"
-	#symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
+	# Symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
 	if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
 		local mydocdir docdir
 		for docdir in "${HTMLDOC_DIR:-does/not/exist}" "${PF}/html" "${PF}/HTML" "${P}/html" "${P}/HTML" ; do
@@ -433,7 +433,7 @@ preinst_suid_scan() {
 		local ED=${D}
 	fi
 
-	# total suid control.
+	# Total suid control
 	if has suidctl $FEATURES; then
 		local i sfconf x
 		sfconf=${PORTAGE_CONFIGROOT}etc/portage/suidctl.conf
@@ -487,8 +487,8 @@ preinst_selinux_labels() {
 				/usr/sbin/setfiles -F -r "${D}" "${file_contexts_path}" "${D}"
 			) || die "Failed to set SELinux security labels."
 		else
-			# nonfatal, since merging can happen outside a SE kernel
-			# like during a recovery situation
+			# nonfatal, since merging can happen outside a SELinux kernel
+			# (like during a recovery situation)
 			__vecho "!!! Unable to set SELinux security labels"
 		fi
 	fi
@@ -538,7 +538,7 @@ __dyn_package() {
 		[[ -n "${md5_hash}" ]] && \
 			echo ${md5_hash} > "${PORTAGE_BUILDDIR}"/build-info/BINPKGMD5
 		__vecho ">>> Done."
-	
+
 	elif [[ "${BINPKG_FORMAT}" == "gpkg" ]]; then
 		PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
 			"${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/gpkg-helper.py compress \

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 0a3bc5cb7..cbe0b825d 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -223,7 +223,7 @@ use() {
 	local u=$1
 	local found=0
 
-	# if we got something like '!flag', then invert the return value
+	# If we got something like '!flag', then invert the return value
 	if [[ ${u:0:1} == "!" ]] ; then
 		u=${u:1}
 		found=1
@@ -602,7 +602,7 @@ econf() {
 				-e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \
 				"${ECONF_SOURCE}/configure._portage_tmp_.${pid}" \
 				|| die "Substition of shebang in '${ECONF_SOURCE}/configure' failed"
-			# preserve timestamp, see bug #440304
+			# Preserve timestamp, see bug #440304
 			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
@@ -663,8 +663,8 @@ econf() {
 			fi
 		fi
 
-		# if the profile defines a location to install libs to aside from default, pass it on.
-		# if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
+		# If the profile defines a location to install libs to aside from default, pass it on.
+		# If the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
 		local CONF_LIBDIR LIBDIR_VAR="LIBDIR_${ABI}"
 		if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
 			CONF_LIBDIR=${!LIBDIR_VAR}
@@ -906,7 +906,7 @@ ___best_version_and_has_version_common() {
 			fi
 			if ___eapi_has_prefix_variables; then
 				# Since portageq requires the root argument be consistent
-				# with EPREFIX, ensure consistency here (bug 655414).
+				# with EPREFIX, ensure consistency here (bug #655414).
 				root=/${PORTAGE_OVERRIDE_EPREFIX#/}
 				cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
 			else
@@ -1040,7 +1040,7 @@ if ___eapi_has_eapply; then
 				-p1 -f -g0 --no-backup-if-mismatch
 				"${patch_options[@]}"
 			)
-			# try applying with -F0 first, output a verbose warning
+			# Try applying with -F0 first, output a verbose warning
 			# if fuzz factor is necessary
 			if ${patch_cmd} "${all_opts[@]}" --dry-run -s -F0 \
 					< "${f}" &>/dev/null; then
@@ -1132,7 +1132,7 @@ if ___eapi_has_eapply_user; then
 	eapply_user() {
 		[[ ${EBUILD_PHASE} == prepare ]] || \
 			die "eapply_user() called during invalid phase: ${EBUILD_PHASE}"
-		# keep path in __dyn_prepare in sync!
+		# Keep path in __dyn_prepare in sync!
 		local tagfile=${T}/.portage_user_patches_applied
 		[[ -f ${tagfile} ]] && return
 		>> "${tagfile}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-04-14  2:36 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-04-14  2:36 UTC (permalink / raw
  To: gentoo-commits

commit:     f9f55b42f1602e79a5541afcace6b2a30af394e8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 13 04:01:07 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 14 02:35:56 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f9f55b42

ebuild.sh: add missing IDEPEND re-sourcing

Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/815
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ebuild.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 811f1f8a2..ec96c757d 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -275,6 +275,7 @@ inherit() {
 			[ "${RDEPEND+set}"    = set ] && B_RDEPEND="${RDEPEND}"
 			[ "${PDEPEND+set}"    = set ] && B_PDEPEND="${PDEPEND}"
 			[ "${BDEPEND+set}"    = set ] && B_BDEPEND="${BDEPEND}"
+			[ "${IDEPEND+set}"    = set ] && B_IDEPEND="${IDEPEND}"
 			unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND BDEPEND IDEPEND
 
 			if ___eapi_has_accumulated_PROPERTIES; then
@@ -634,6 +635,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		RDEPEND+="${RDEPEND:+ }${E_RDEPEND}"
 		PDEPEND+="${PDEPEND:+ }${E_PDEPEND}"
 		BDEPEND+="${BDEPEND:+ }${E_BDEPEND}"
+		IDEPEND+="${IDEPEND:+ }${E_IDEPEND}"
 		REQUIRED_USE+="${REQUIRED_USE:+ }${E_REQUIRED_USE}"
 
 		if ___eapi_has_accumulated_PROPERTIES; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-04-15  4:47 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-04-15  4:47 UTC (permalink / raw
  To: gentoo-commits

commit:     3994939f982f22afbc7aaf3b8eca6680ad85c617
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Tue Apr 12 08:59:11 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 15 04:47:35 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3994939f

ebegin: Output QA warning if call to eend is missing

The idea here is to check if EBEGIN_EEND is set after the phase has been
executed. If so, then a call to eend is probably missing. This is under
the assumption that ebegin-eend invocations should be properly paired
within the same phase.

In ebegin, the EBEGIN_EEND variable is also checked, and, if set,
indicates that ebegin has been called and is missing the closing call to
eend.

I doubt that this check is perfect, but it seems to work in what little
testing I've done.

Closes: https://bugs.gentoo.org/835823
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/portage/pull/811
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/isolated-functions.sh | 3 +++
 bin/phase-functions.sh    | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 41ca106a4..03983a9fa 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -339,6 +339,9 @@ ebegin() {
 	[[ ${RC_ENDCOL} == "yes" ]] && echo >&2
 	LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
 	LAST_E_CMD="ebegin"
+	if [[ -v EBEGIN_EEND ]] ; then
+		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})"
+	fi
 	EBEGIN_EEND=1
 	return 0
 }

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 301ce75ea..bccf88226 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1088,6 +1088,10 @@ __ebuild_main() {
 		;;
 	esac
 
+	if [[ -v EBEGIN_EEND ]] ; then
+		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})"
+	fi
+
 	# Save the env only for relevant phases.
 	if ! has "${1}" clean help info nofetch ; then
 		umask 002


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-04-28 15:50 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-04-28 15:50 UTC (permalink / raw
  To: gentoo-commits

commit:     605ad0d675a64eb39144122cf284100192cdfea0
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Thu Apr 21 08:41:14 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 15:50:16 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=605ad0d6

ebegin/eend: accept properly nested calls in different functions

Turn the EBEGIN_EEND variable into a stack that tracks which function
called ebegin. Calls to ebegin may be stacked and do not generate a QA
warning if the callers are different functions. Calls to eend then check
that the function name at the top of the stack matches the caller's
function name.

Bug: https://bugs.gentoo.org/839585
Bug: https://bugs.gentoo.org/839588
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/portage/pull/824
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/isolated-functions.sh | 22 ++++++++++++++++++----
 bin/phase-functions.sh    |  4 +++-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 03983a9fa..912782914 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -340,9 +340,15 @@ ebegin() {
 	LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
 	LAST_E_CMD="ebegin"
 	if [[ -v EBEGIN_EEND ]] ; then
-		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})"
+		# Already a call to ebegin
+		local prev="${EBEGIN_EEND[-1]}"
+		if [[ "${prev}" == "${FUNCNAME[1]}" ]] ; then
+			eqawarn "QA Notice: ebegin called in ${prev}, but missing call to eend (${FUNCNAME[1]})"
+		fi
+		EBEGIN_EEND+=( "${FUNCNAME[1]}" )
+	else
+		EBEGIN_EEND=( "${FUNCNAME[1]}" )
 	fi
-	EBEGIN_EEND=1
 	return 0
 }
 
@@ -372,9 +378,17 @@ __eend() {
 eend() {
 	[[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
 	if [[ -v EBEGIN_EEND ]] ; then
-		unset EBEGIN_EEND
+		local caller="${FUNCNAME[1]}"
+		local tos="${EBEGIN_EEND[-1]}"
+		if [[ "${caller}" != "${tos}" ]] ; then
+			eqawarn "QA Notice: eend (in ${caller}) improperly matched with ebegin (called in ${tos})"
+		fi
+		unset EBEGIN_EEND[-1]
+		if [[ ${#EBEGIN_EEND[@]} -eq 0 ]] ; then
+			unset EBEGIN_EEND
+		fi
 	else
-		eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})"
+		eqawarn "QA Notice: eend called without preceding ebegin (phase: ${FUNCNAME[1]})"
 	fi
 	local retval=${1:-0}
 	shift

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index bccf88226..6b48c2351 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1089,7 +1089,9 @@ __ebuild_main() {
 	esac
 
 	if [[ -v EBEGIN_EEND ]] ; then
-		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})"
+		for func in "${EBEGIN_EEND[@]}" ; do
+			eqawarn "QA Notice: ebegin called in ${func} but missing call to eend"
+		done
 	fi
 
 	# Save the env only for relevant phases.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-05-15  1:02 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-05-15  1:02 UTC (permalink / raw
  To: gentoo-commits

commit:     17d2932ad68bf7ada21cbba5283db8d027a8c84e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun May 15 01:01:57 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 15 01:02:45 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=17d2932a

portageq: egrep -> grep -E

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/portageq | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/portageq b/bin/portageq
index a4ee319a0..6d12c98dd 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -935,7 +935,7 @@ docstrings[
     "envvar"
 ] = """<variable>+
 	Returns a specific environment variable as exists prior to ebuild.sh.
-	Similar to: emerge --verbose --info | egrep '^<variable>='
+	Similar to: emerge --verbose --info | grep -E '^<variable>='
 	"""
 envvar.__doc__ = docstrings["envvar"]
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-05-22 14:51 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2022-05-22 14:51 UTC (permalink / raw
  To: gentoo-commits

commit:     110f999894f2dfef4b5d9aff9cc999c1cf0d1283
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Mon May  9 16:35:08 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun May 22 14:50:46 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=110f9998

bin/*.sh: pull logical operators into extended-test bultin expression

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/ebuild.sh          | 2 +-
 bin/phase-functions.sh | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 056372283..dbadd7919 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -556,7 +556,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 		y="PORTAGE_${x}"
 		if [[ -z "${!x}" ]]; then
 			export ${x}="${!y}"
-		elif [[ -n "${!y}" ]] && [[ "${!y}" != "${!x}" ]]; then
+		elif [[ -n "${!y}" && "${!y}" != "${!x}" ]]; then
 			# filter out dupes
 			export ${x}="$(printf "${!y}:${!x}" | tr ":" "\0" | \
 				sort -z -u | tr "\0" ":")"

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 5aba2519c..0a36af297 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -988,7 +988,7 @@ __ebuild_main() {
 			ewarn  "pkg_${1}() is not defined: '${EBUILD##*/}'"
 		fi
 		export SANDBOX_ON="0"
-		if [[ "${PORTAGE_DEBUG}" != "1" ]] || [[ "${-/x/}" != "$-" ]]; then
+		if [[ "${PORTAGE_DEBUG}" != "1" || "${-/x/}" != "$-" ]]; then
 			__ebuild_phase_with_hooks pkg_${1}
 		else
 			set -x
@@ -1055,7 +1055,7 @@ __ebuild_main() {
 			;;
 		esac
 
-		if [[ "${PORTAGE_DEBUG}" != "1" ]] || [[ "${-/x/}" != "$-" ]]; then
+		if [[ "${PORTAGE_DEBUG}" != "1" || "${-/x/}" != "$-" ]]; then
 			__dyn_${1}
 		else
 			set -x
@@ -1069,7 +1069,7 @@ __ebuild_main() {
 		#for example, awking and piping a file in /tmp requires a temp file to be created
 		#in /etc.  If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
 		export SANDBOX_ON="0"
-		if [[ "${PORTAGE_DEBUG}" != "1" ]] || [[ "${-/x/}" != "$-" ]]; then
+		if [[ "${PORTAGE_DEBUG}" != "1" || "${-/x/}" != "$-" ]]; then
 			__dyn_${1}
 		else
 			set -x


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-05-22 14:51 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2022-05-22 14:51 UTC (permalink / raw
  To: gentoo-commits

commit:     5ebec80b176a0493fde0b8f2278ed507ec0ec8d7
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Fri May  6 11:26:18 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun May 22 14:50:46 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ebec80b

bin/*.sh: use bash's extended-test builtin ('[[' and ']]')

The following sed was basically used to transform POSIX test to bash's
extended-test builtin:

sed -i \
  -e 's:\(\s\)\[ :\1[[ :' \
  -e 's: ] \?;: ]];:' \
  -e 's: ] : ]] :' \
  bin/*.sh

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/ebuild.sh             | 76 +++++++++++++++++++++++------------------------
 bin/isolated-functions.sh | 16 +++++-----
 bin/misc-functions.sh     | 32 ++++++++++----------
 bin/phase-functions.sh    | 34 ++++++++++-----------
 bin/phase-helpers.sh      | 48 +++++++++++++++---------------
 5 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index ec96c757d..056372283 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -224,7 +224,7 @@ inherit() {
 	local B_IDEPEND
 	local B_PROPERTIES
 	local B_RESTRICT
-	while [ "$1" ]; do
+	while [[ "$1" ]]; do
 		location=""
 		potential_location=""
 
@@ -269,13 +269,13 @@ inherit() {
 			# Retain the old data and restore it later.
 			unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND
 			unset B_BDEPEND B_IDEPEND B_PROPERTIES B_RESTRICT
-			[ "${IUSE+set}"       = set ] && B_IUSE="${IUSE}"
-			[ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
-			[ "${DEPEND+set}"     = set ] && B_DEPEND="${DEPEND}"
-			[ "${RDEPEND+set}"    = set ] && B_RDEPEND="${RDEPEND}"
-			[ "${PDEPEND+set}"    = set ] && B_PDEPEND="${PDEPEND}"
-			[ "${BDEPEND+set}"    = set ] && B_BDEPEND="${BDEPEND}"
-			[ "${IDEPEND+set}"    = set ] && B_IDEPEND="${IDEPEND}"
+			[[ "${IUSE+set}"       = set ]] && B_IUSE="${IUSE}"
+			[[ "${REQUIRED_USE+set}" = set ]] && B_REQUIRED_USE="${REQUIRED_USE}"
+			[[ "${DEPEND+set}"     = set ]] && B_DEPEND="${DEPEND}"
+			[[ "${RDEPEND+set}"    = set ]] && B_RDEPEND="${RDEPEND}"
+			[[ "${PDEPEND+set}"    = set ]] && B_PDEPEND="${PDEPEND}"
+			[[ "${BDEPEND+set}"    = set ]] && B_BDEPEND="${BDEPEND}"
+			[[ "${IDEPEND+set}"    = set ]] && B_IDEPEND="${IDEPEND}"
 			unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND BDEPEND IDEPEND
 
 			if ___eapi_has_accumulated_PROPERTIES; then
@@ -299,34 +299,34 @@ inherit() {
 
 			# If each var has a value, append it to the global variable E_* to
 			# be applied after everything is finished. New incremental behavior.
-			[ "${IUSE+set}"         = set ] && E_IUSE+="${E_IUSE:+ }${IUSE}"
-			[ "${REQUIRED_USE+set}" = set ] && E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
-			[ "${DEPEND+set}"       = set ] && E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
-			[ "${RDEPEND+set}"      = set ] && E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
-			[ "${PDEPEND+set}"      = set ] && E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
-			[ "${BDEPEND+set}"      = set ] && E_BDEPEND+="${E_BDEPEND:+ }${BDEPEND}"
-			[ "${IDEPEND+set}"      = set ] && E_IDEPEND+="${E_IDEPEND:+ }${IDEPEND}"
+			[[ "${IUSE+set}"         = set ]] && E_IUSE+="${E_IUSE:+ }${IUSE}"
+			[[ "${REQUIRED_USE+set}" = set ]] && E_REQUIRED_USE+="${E_REQUIRED_USE:+ }${REQUIRED_USE}"
+			[[ "${DEPEND+set}"       = set ]] && E_DEPEND+="${E_DEPEND:+ }${DEPEND}"
+			[[ "${RDEPEND+set}"      = set ]] && E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
+			[[ "${PDEPEND+set}"      = set ]] && E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
+			[[ "${BDEPEND+set}"      = set ]] && E_BDEPEND+="${E_BDEPEND:+ }${BDEPEND}"
+			[[ "${IDEPEND+set}"      = set ]] && E_IDEPEND+="${E_IDEPEND:+ }${IDEPEND}"
 
-			[ "${B_IUSE+set}"     = set ] && IUSE="${B_IUSE}"
-			[ "${B_IUSE+set}"     = set ] || unset IUSE
+			[[ "${B_IUSE+set}"     = set ]] && IUSE="${B_IUSE}"
+			[[ "${B_IUSE+set}"     = set ]] || unset IUSE
 
-			[ "${B_REQUIRED_USE+set}"     = set ] && REQUIRED_USE="${B_REQUIRED_USE}"
-			[ "${B_REQUIRED_USE+set}"     = set ] || unset REQUIRED_USE
+			[[ "${B_REQUIRED_USE+set}"     = set ]] && REQUIRED_USE="${B_REQUIRED_USE}"
+			[[ "${B_REQUIRED_USE+set}"     = set ]] || unset REQUIRED_USE
 
-			[ "${B_DEPEND+set}"   = set ] && DEPEND="${B_DEPEND}"
-			[ "${B_DEPEND+set}"   = set ] || unset DEPEND
+			[[ "${B_DEPEND+set}"   = set ]] && DEPEND="${B_DEPEND}"
+			[[ "${B_DEPEND+set}"   = set ]] || unset DEPEND
 
-			[ "${B_RDEPEND+set}"  = set ] && RDEPEND="${B_RDEPEND}"
-			[ "${B_RDEPEND+set}"  = set ] || unset RDEPEND
+			[[ "${B_RDEPEND+set}"  = set ]] && RDEPEND="${B_RDEPEND}"
+			[[ "${B_RDEPEND+set}"  = set ]] || unset RDEPEND
 
-			[ "${B_PDEPEND+set}"  = set ] && PDEPEND="${B_PDEPEND}"
-			[ "${B_PDEPEND+set}"  = set ] || unset PDEPEND
+			[[ "${B_PDEPEND+set}"  = set ]] && PDEPEND="${B_PDEPEND}"
+			[[ "${B_PDEPEND+set}"  = set ]] || unset PDEPEND
 
-			[ "${B_BDEPEND+set}"  = set ] && BDEPEND="${B_BDEPEND}"
-			[ "${B_BDEPEND+set}"  = set ] || unset BDEPEND
+			[[ "${B_BDEPEND+set}"  = set ]] && BDEPEND="${B_BDEPEND}"
+			[[ "${B_BDEPEND+set}"  = set ]] || unset BDEPEND
 
-			[ "${B_IDEPEND+set}"  = set ] && IDEPEND="${B_IDEPEND}"
-			[ "${B_IDEPEND+set}"  = set ] || unset IDEPEND
+			[[ "${B_IDEPEND+set}"  = set ]] && IDEPEND="${B_IDEPEND}"
+			[[ "${B_IDEPEND+set}"  = set ]] || unset IDEPEND
 
 			if ___eapi_has_accumulated_PROPERTIES; then
 				[[ ${PROPERTIES+set} == set ]] &&
@@ -375,7 +375,7 @@ inherit() {
 # code will be eval'd:
 # src_unpack() { base_src_unpack; }
 EXPORT_FUNCTIONS() {
-	if [ -z "$ECLASS" ]; then
+	if [[ -z "$ECLASS" ]]; then
 		die "EXPORT_FUNCTIONS without a defined ECLASS"
 	fi
 	eval $__export_funcs_var+=\" $*\"
@@ -416,8 +416,8 @@ __source_all_bashrcs() {
 		__source_env_files --no-qa "${PM_EBUILD_HOOK_DIR}"
 	fi
 
-	[ ! -z "${OCC}" ] && export CC="${OCC}"
-	[ ! -z "${OCXX}" ] && export CXX="${OCXX}"
+	[[ ! -z "${OCC}" ]] && export CC="${OCC}"
+	[[ ! -z "${OCXX}" ]] && export CXX="${OCXX}"
 }
 
 # @FUNCTION: __source_env_files
@@ -490,14 +490,14 @@ fi
 if [[ -n ${QA_INTERCEPTORS} ]] ; then
 	for BIN in ${QA_INTERCEPTORS}; do
 		BIN_PATH=$(type -Pf ${BIN})
-		if [ "$?" != "0" ]; then
+		if [[ "$?" != "0" ]]; then
 			BODY="echo \"*** missing command: ${BIN}\" >&2; return 127"
 		else
 			BODY="${BIN_PATH} \"\$@\"; return \$?"
 		fi
 		if [[ ${EBUILD_PHASE} == depend ]] ; then
 			FUNC_SRC="${BIN}() {
-				if [ \$ECLASS_DEPTH -gt 0 ]; then
+				if [[ \$ECLASS_DEPTH -gt 0 ]]; then
 					eqawarn \"QA Notice: '${BIN}' called in global scope: eclass \${ECLASS}\"
 				else
 					eqawarn \"QA Notice: '${BIN}' called in global scope: \${CATEGORY}/\${PF}\"
@@ -532,7 +532,7 @@ trap 'exit 1' SIGTERM
 
 if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	! [[ $EMERGE_FROM = ebuild && $EBUILD_PHASE = setup ]] && \
-	[ -f "${T}"/environment ] ; then
+	[[ -f "${T}"/environment ]]; then
 	# The environment may have been extracted from environment.bz2 or
 	# may have come from another version of ebuild.sh or something.
 	# In any case, preprocess it to prevent any potential interference.
@@ -554,9 +554,9 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
 	export SANDBOX_ON=0
 	for x in SANDBOX_DENY SANDBOX_PREDICT SANDBOX_READ SANDBOX_WRITE ; do
 		y="PORTAGE_${x}"
-		if [ -z "${!x}" ] ; then
+		if [[ -z "${!x}" ]]; then
 			export ${x}="${!y}"
-		elif [ -n "${!y}" ] && [ "${!y}" != "${!x}" ] ; then
+		elif [[ -n "${!y}" ]] && [[ "${!y}" != "${!x}" ]]; then
 			# filter out dupes
 			export ${x}="$(printf "${!y}:${!x}" | tr ":" "\0" | \
 				sort -z -u | tr "\0" ":")"
@@ -619,7 +619,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 			shopt -u failglob
 		fi
 
-		[ "${EAPI+set}" = set ] || EAPI=0
+		[[ "${EAPI+set}" = set ]] || EAPI=0
 
 		# export EAPI for helpers (especially since we unset it above)
 		export EAPI

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 912782914..848e44b04 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -61,7 +61,7 @@ __dump_trace() {
 	(( n = ${#FUNCNAME[@]} - 1 ))
 	(( p = ${#BASH_ARGV[@]} ))
 	while (( n > 0 )) ; do
-		[ "${FUNCNAME[${n}]}" == "__qa_call" ] && break
+		[[ "${FUNCNAME[${n}]}" == "__qa_call" ]] && break
 		(( p -= ${BASH_ARGC[${n}]} ))
 		(( n-- ))
 	done
@@ -132,7 +132,7 @@ die() {
 	fi
 
 	set +e
-	if [ -n "${QA_INTERCEPTORS}" ] ; then
+	if [[ -n "${QA_INTERCEPTORS}" ]]; then
 		# die was called from inside inherit. We need to clean up
 		# QA_INTERCEPTORS since sed is called below.
 		unset -f ${QA_INTERCEPTORS}
@@ -142,7 +142,7 @@ die() {
 	# setup spacing to make output easier to read
 	(( n = ${#FUNCNAME[@]} - 1 ))
 	while (( n > 0 )) ; do
-		[ "${FUNCNAME[${n}]}" == "__qa_call" ] && break
+		[[ "${FUNCNAME[${n}]}" == "__qa_call" ]] && break
 		(( n-- ))
 	done
 	(( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 ))
@@ -217,9 +217,9 @@ die() {
 			eerror "For convenience, a symlink to the build log is located at '${T}/build.${log_ext}'."
 		fi
 	fi
-	if [ -f "${T}/environment" ] ; then
+	if [[ -f "${T}/environment" ]]; then
 		eerror "The ebuild environment file is located at '${T}/environment'."
-	elif [ -d "${T}" ] ; then
+	elif [[ -d "${T}" ]]; then
 		{
 			set
 			export
@@ -250,7 +250,7 @@ __vecho() {
 # Internal logging function, don't use this in ebuilds
 __elog_base() {
 	local messagetype
-	[ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1
+	[[ -z "${1}" || -z "${T}" || ! -d "${T}/logging" ]] && return 1
 	case "${1}" in
 		INFO|WARN|ERROR|LOG|QA)
 			messagetype="${1}"
@@ -429,7 +429,7 @@ __set_colors() {
 	# Now, ${ENDCOL} will move us to the end of the
 	# column;  irregardless of character width
 	ENDCOL=$'\e[A\e['$(( COLS - 8 ))'C'
-	if [ -n "${PORTAGE_COLORMAP}" ] ; then
+	if [[ -n "${PORTAGE_COLORMAP}" ]]; then
 		eval ${PORTAGE_COLORMAP}
 	else
 		PORTAGE_COLOR_BAD=$'\e[31;01m'
@@ -531,7 +531,7 @@ has() {
 
 	local x
 	for x in "$@"; do
-		[ "${x}" = "${needle}" ] && return 0
+		[[ "${x}" = "${needle}" ]] && return 0
 	done
 	return 1
 }

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index de7ebf4a2..41340e3f7 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -22,16 +22,16 @@ install_symlink_html_docs() {
 	fi
 	cd "${ED}" || die "cd failed"
 	# Symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
-	if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
+	if [[ -n "${DOC_SYMLINKS_DIR}" ]]; then
 		local mydocdir docdir
 		for docdir in "${HTMLDOC_DIR:-does/not/exist}" "${PF}/html" "${PF}/HTML" "${P}/html" "${P}/HTML" ; do
-			if [ -d "usr/share/doc/${docdir}" ] ; then
+			if [[ -d "usr/share/doc/${docdir}" ]]; then
 				mydocdir="/usr/share/doc/${docdir}"
 			fi
 		done
-		if [ -n "${mydocdir}" ] ; then
+		if [[ -n "${mydocdir}" ]]; then
 			local mysympath
-			if [ -z "${SLOT}" -o "${SLOT%/*}" = "0" ] ; then
+			if [[ -z "${SLOT}" || "${SLOT%/*}" = "0" ]]; then
 				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}"
 			else
 				mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}-${SLOT%/*}"
@@ -206,7 +206,7 @@ install_qa_check() {
 				arch=${l%%;*}; l=${l#*;}
 				obj="/${l%%;*}"; l=${l#*;}
 				soname=${l%%;*}; l=${l#*;}
-				rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = "  -  " ] && rpath=""
+				rpath=${l%%;*}; l=${l#*;}; [[ "${rpath}" = "  -  " ]] && rpath=""
 				needed=${l%%;*}; l=${l#*;}
 
 				# Infer implicit soname from basename (bug 715162).
@@ -219,7 +219,7 @@ install_qa_check() {
 			done <<< ${scanelf_output}
 		fi
 
-		[ -n "${QA_SONAME_NO_SYMLINK}" ] && \
+		[[ -n "${QA_SONAME_NO_SYMLINK}" ]] && \
 			echo "${QA_SONAME_NO_SYMLINK}" > \
 			"${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
 
@@ -384,7 +384,7 @@ preinst_mask() {
 }
 
 preinst_sfperms() {
-	if [ -z "${D}" ]; then
+	if [[ -z "${D}" ]]; then
 		 eerror "${FUNCNAME}: D is unset"
 		 return 1
 	fi
@@ -398,7 +398,7 @@ preinst_sfperms() {
 		local i
 		find "${ED}" -type f -perm -4000 -print0 | \
 		while read -r -d $'\0' i ; do
-			if [ -n "$(find "$i" -perm -2000)" ] ; then
+			if [[ -n "$(find "$i" -perm -2000)" ]]; then
 				ebegin ">>> SetUID and SetGID: [chmod o-r] ${i#${ED%/}}"
 				chmod o-r "$i"
 				eend $?
@@ -410,7 +410,7 @@ preinst_sfperms() {
 		done
 		find "${ED}" -type f -perm -2000 -print0 | \
 		while read -r -d $'\0' i ; do
-			if [ -n "$(find "$i" -perm -4000)" ] ; then
+			if [[ -n "$(find "$i" -perm -4000)" ]]; then
 				# This case is already handled
 				# by the SetUID check above.
 				true
@@ -424,7 +424,7 @@ preinst_sfperms() {
 }
 
 preinst_suid_scan() {
-	if [ -z "${D}" ]; then
+	if [[ -z "${D}" ]]; then
 		 eerror "${FUNCNAME}: D is unset"
 		 return 1
 	fi
@@ -443,7 +443,7 @@ preinst_suid_scan() {
 		addwrite "${sfconf}"
 		__vecho ">>> Performing suid scan in ${ED}"
 		for i in $(find "${ED}" -type f \( -perm -4000 -o -perm -2000 \) ); do
-			if [ -s "${sfconf}" ]; then
+			if [[ -s "${sfconf}" ]]; then
 				install_path=${i#${ED%/}}
 				if grep -q "^${install_path}\$" "${sfconf}" ; then
 					__vecho "- ${install_path} is an approved suid file"
@@ -468,7 +468,7 @@ preinst_suid_scan() {
 }
 
 preinst_selinux_labels() {
-	if [ -z "${D}" ]; then
+	if [[ -z "${D}" ]]; then
 		 eerror "${FUNCNAME}: D is unset"
 		 return 1
 	fi
@@ -476,7 +476,7 @@ preinst_selinux_labels() {
 		# SELinux file labeling (needs to execute after preinst)
 		# only attempt to label if setfiles is executable
 		# and 'context' is available on selinuxfs.
-		if [ -f /sys/fs/selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
+		if [[ -f /sys/fs/selinux/context && -x /usr/sbin/setfiles && -x /usr/sbin/selinuxconfig ]]; then
 			__vecho ">>> Setting SELinux security labels"
 			(
 				eval "$(/usr/sbin/selinuxconfig)" || \
@@ -633,7 +633,7 @@ install_hooks() {
 	local ret=0
 	shopt -s nullglob
 	for fp in "${hooks_dir}"/*; do
-		if [ -x "$fp" ]; then
+		if [[ -x "$fp" ]]; then
 			"$fp"
 			ret=$(( $ret | $? ))
 		fi
@@ -646,9 +646,9 @@ eqatag() {
 	__eqatag "${@}"
 }
 
-if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
+if [[ -n "${MISC_FUNCTIONS_ARGS}" ]]; then
 	__source_all_bashrcs
-	[ "$PORTAGE_DEBUG" == "1" ] && set -x
+	[[ "$PORTAGE_DEBUG" == "1" ]] && set -x
 	for x in ${MISC_FUNCTIONS_ARGS}; do
 		${x}
 	done

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 6b48c2351..5aba2519c 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -136,7 +136,7 @@ __filter_readonly_variables() {
 			LC_NUMERIC LC_PAPER LC_TIME"
 	fi
 	if ! has --allow-extra-vars $* ; then
-		if [ "${EMERGE_FROM}" = binary ] ; then
+		if [[ "${EMERGE_FROM}" = binary ]]; then
 			# preserve additional variables from build time,
 			# while excluding untrusted variables
 			filtered_vars+=" ${binpkg_untrusted_vars}"
@@ -163,7 +163,7 @@ __preprocess_ebuild_env() {
 	# indicating that the environment may contain stale FEATURES and
 	# SANDBOX_{DENY,PREDICT,READ,WRITE} variables that should be filtered out.
 	# Otherwise, we don't need to filter the environment.
-	[ -f "${T}/environment.raw" ] || return 0
+	[[ -f "${T}/environment.raw" ]] || return 0
 
 	__filter_readonly_variables $_portage_filter_opts < "${T}"/environment \
 		>> "$T/environment.filtered" || return $?
@@ -195,7 +195,7 @@ __preprocess_ebuild_env() {
 		>> "$T/environment.success" || exit $?
 	) > "${T}/environment.filtered"
 	local retval
-	if [ -e "${T}/environment.success" ] ; then
+	if [[ -e "${T}/environment.success" ]]; then
 		__filter_readonly_variables --filter-features < \
 			"${T}/environment.filtered" > "${T}/environment"
 		retval=$?
@@ -248,7 +248,7 @@ __dyn_unpack() {
 		__vecho ">>> WORKDIR is up-to-date, keeping..."
 		return 0
 	fi
-	if [ ! -d "${WORKDIR}" ]; then
+	if [[ ! -d "${WORKDIR}" ]]; then
 		install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
 	fi
 	cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
@@ -262,10 +262,10 @@ __dyn_unpack() {
 }
 
 __dyn_clean() {
-	if [ -z "${PORTAGE_BUILDDIR}" ]; then
+	if [[ -z "${PORTAGE_BUILDDIR}" ]]; then
 		echo "Aborting clean phase because PORTAGE_BUILDDIR is unset!"
 		return 1
-	elif [ ! -d "${PORTAGE_BUILDDIR}" ] ; then
+	elif [[ ! -d "${PORTAGE_BUILDDIR}" ]]; then
 		return 0
 	fi
 	if has chflags $FEATURES ; then
@@ -299,7 +299,7 @@ __dyn_clean() {
 		rm -f "${PORTAGE_BUILDDIR}/files"
 	fi
 
-	if [ -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then
+	if [[ -f "${PORTAGE_BUILDDIR}/.unpacked" ]]; then
 		find "${PORTAGE_BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null
 	fi
 
@@ -314,7 +314,7 @@ __dyn_clean() {
 
 __abort_handler() {
 	local msg
-	if [ "$2" != "fail" ]; then
+	if [[ "$2" != "fail" ]]; then
 		msg="${EBUILD}: ${1} aborted; exiting."
 	else
 		msg="${EBUILD}: ${1} failed; exiting."
@@ -519,7 +519,7 @@ __dyn_test() {
 }
 
 __dyn_install() {
-	[ -z "$PORTAGE_BUILDDIR" ] && die "${FUNCNAME}: PORTAGE_BUILDDIR is unset"
+	[[ -z "$PORTAGE_BUILDDIR" ]] && die "${FUNCNAME}: PORTAGE_BUILDDIR is unset"
 	if has noauto $FEATURES ; then
 		rm -f "${PORTAGE_BUILDDIR}/.installed"
 	elif [[ -e $PORTAGE_BUILDDIR/.installed ]] ; then
@@ -703,7 +703,7 @@ __dyn_install() {
 	${PORTAGE_BZIP2_COMMAND} -f9 environment
 
 	cp "${EBUILD}" "${PF}.ebuild"
-	[ -n "${PORTAGE_REPO_NAME}" ]  && echo "${PORTAGE_REPO_NAME}" > repository
+	[[ -n "${PORTAGE_REPO_NAME}" ]]  && echo "${PORTAGE_REPO_NAME}" > repository
 	if has nostrip ${FEATURES} ${PORTAGE_RESTRICT} || has strip ${PORTAGE_RESTRICT}
 	then
 		>> DEBUGBUILD
@@ -767,7 +767,7 @@ __dyn_help() {
 	fi
 	echo "  merge to    : ${ROOT}"
 	echo
-	if [ -n "$USE" ]; then
+	if [[ -n "$USE" ]]; then
 		echo "Additionally, support for the following optional features will be enabled:"
 		echo
 		echo "  ${USE}"
@@ -780,7 +780,7 @@ __dyn_help() {
 # Translate a known ebuild(1) argument into the precise
 # name of it's corresponding ebuild phase.
 __ebuild_arg_to_phase() {
-	[ $# -ne 1 ] && die "expected exactly 1 arg, got $#: $*"
+	[[ $# -ne 1 ]] && die "expected exactly 1 arg, got $#: $*"
 	local arg=$1
 	local phase_func=""
 
@@ -835,7 +835,7 @@ __ebuild_arg_to_phase() {
 }
 
 __ebuild_phase_funcs() {
-	[ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
+	[[ $# -ne 2 ]] && die "expected exactly 2 args, got $#: $*"
 	local eapi=$1
 	local phase_func=$2
 	local all_phases="src_compile pkg_config src_configure pkg_info
@@ -988,7 +988,7 @@ __ebuild_main() {
 			ewarn  "pkg_${1}() is not defined: '${EBUILD##*/}'"
 		fi
 		export SANDBOX_ON="0"
-		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
+		if [[ "${PORTAGE_DEBUG}" != "1" ]] || [[ "${-/x/}" != "$-" ]]; then
 			__ebuild_phase_with_hooks pkg_${1}
 		else
 			set -x
@@ -1043,7 +1043,7 @@ __ebuild_main() {
 			fi
 
 			cd "$PORTAGE_BUILDDIR"
-			if [ ! -d build-info ] ; then
+			if [[ ! -d build-info ]]; then
 				mkdir build-info
 				cp "$EBUILD" "build-info/$PF.ebuild"
 			fi
@@ -1055,7 +1055,7 @@ __ebuild_main() {
 			;;
 		esac
 
-		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
+		if [[ "${PORTAGE_DEBUG}" != "1" ]] || [[ "${-/x/}" != "$-" ]]; then
 			__dyn_${1}
 		else
 			set -x
@@ -1069,7 +1069,7 @@ __ebuild_main() {
 		#for example, awking and piping a file in /tmp requires a temp file to be created
 		#in /etc.  If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
 		export SANDBOX_ON="0"
-		if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
+		if [[ "${PORTAGE_DEBUG}" != "1" ]] || [[ "${-/x/}" != "$-" ]]; then
 			__dyn_${1}
 		else
 			set -x

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index cbe0b825d..64c168627 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -25,14 +25,14 @@ has strip ${PORTAGE_RESTRICT} && PORTAGE_DOSTRIP=()
 declare -a PORTAGE_DOSTRIP_SKIP=()
 
 into() {
-	if [ "$1" == "/" ]; then
+	if [[ "$1" == "/" ]]; then
 		export _E_DESTTREE_=""
 	else
 		export _E_DESTTREE_=$1
 		if ! ___eapi_has_prefix_variables; then
 			local ED=${D}
 		fi
-		if [ ! -d "${ED%/}/${_E_DESTTREE_#/}" ]; then
+		if [[ ! -d "${ED%/}/${_E_DESTTREE_#/}" ]]; then
 			install -d "${ED%/}/${_E_DESTTREE_#/}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
@@ -48,14 +48,14 @@ into() {
 }
 
 insinto() {
-	if [ "$1" == "/" ]; then
+	if [[ "$1" == "/" ]]; then
 		export _E_INSDESTTREE_=""
 	else
 		export _E_INSDESTTREE_=$1
 		if ! ___eapi_has_prefix_variables; then
 			local ED=${D}
 		fi
-		if [ ! -d "${ED%/}/${_E_INSDESTTREE_#/}" ]; then
+		if [[ ! -d "${ED%/}/${_E_INSDESTTREE_#/}" ]]; then
 			install -d "${ED%/}/${_E_INSDESTTREE_#/}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
@@ -71,14 +71,14 @@ insinto() {
 }
 
 exeinto() {
-	if [ "$1" == "/" ]; then
+	if [[ "$1" == "/" ]]; then
 		export _E_EXEDESTTREE_=""
 	else
 		export _E_EXEDESTTREE_="$1"
 		if ! ___eapi_has_prefix_variables; then
 			local ED=${D}
 		fi
-		if [ ! -d "${ED%/}/${_E_EXEDESTTREE_#/}" ]; then
+		if [[ ! -d "${ED%/}/${_E_EXEDESTTREE_#/}" ]]; then
 			install -d "${ED%/}/${_E_EXEDESTTREE_#/}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
@@ -90,14 +90,14 @@ exeinto() {
 }
 
 docinto() {
-	if [ "$1" == "/" ]; then
+	if [[ "$1" == "/" ]]; then
 		export _E_DOCDESTTREE_=""
 	else
 		export _E_DOCDESTTREE_="$1"
 		if ! ___eapi_has_prefix_variables; then
 			local ED=${D}
 		fi
-		if [ ! -d "${ED%/}/usr/share/doc/${PF}/${_E_DOCDESTTREE_#/}" ]; then
+		if [[ ! -d "${ED%/}/usr/share/doc/${PF}/${_E_DOCDESTTREE_#/}" ]]; then
 			install -d "${ED%/}/usr/share/doc/${PF}/${_E_DOCDESTTREE_#/}"
 			local ret=$?
 			if [[ $ret -ne 0 ]] ; then
@@ -268,7 +268,7 @@ use() {
 }
 
 use_with() {
-	if [ -z "$1" ]; then
+	if [[ -z "$1" ]]; then
 		echo "!!! use_with() called without a parameter." >&2
 		echo "!!! use_with <USEFLAG> [<flagname> [value]]" >&2
 		return 1
@@ -290,7 +290,7 @@ use_with() {
 }
 
 use_enable() {
-	if [ -z "$1" ]; then
+	if [[ -z "$1" ]]; then
 		echo "!!! use_enable() called without a parameter." >&2
 		echo "!!! use_enable <USEFLAG> [<flagname> [value]]" >&2
 		return 1
@@ -318,7 +318,7 @@ unpack() {
 	local suffix suffix_insensitive
 	local myfail
 	local eapi=${EAPI:-0}
-	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
+	[[ -z "$*" ]] && die "Nothing passed to the 'unpack' command"
 
 	for x in "$@"; do
 		__vecho ">>> Unpacking ${x} to ${PWD}"
@@ -436,7 +436,7 @@ unpack() {
 				if ___eapi_unpack_supports_7z; then
 					local my_output
 					my_output="$(7z x -y "${srcdir}${x}")"
-					if [ $? -ne 0 ]; then
+					if [[ $? -ne 0 ]]; then
 						echo "${my_output}" >&2
 						die "$myfail"
 					fi
@@ -497,7 +497,7 @@ unpack() {
 					type -P deb2targz > /dev/null; then
 					y=${x##*/}
 					local created_symlink=0
-					if [ ! "$srcdir$x" -ef "$y" ] ; then
+					if [[ ! "$srcdir$x" -ef "$y" ]]; then
 						# deb2targz always extracts into the same directory as
 						# the source file, so create a symlink in the current
 						# working directory if necessary.
@@ -505,7 +505,7 @@ unpack() {
 						created_symlink=1
 					fi
 					deb2targz "$y" || die "$myfail"
-					if [ $created_symlink = 1 ] ; then
+					if [[ $created_symlink = 1 ]]; then
 						# Clean up the symlink so the ebuild
 						# doesn't inadvertently install it.
 						rm -f "$y"
@@ -594,7 +594,7 @@ econf() {
 	fi
 
 	: ${ECONF_SOURCE:=.}
-	if [ -x "${ECONF_SOURCE}/configure" ]; then
+	if [[ -x "${ECONF_SOURCE}/configure" ]]; then
 		if [[ -n $CONFIG_SHELL && \
 			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
 			cp -p "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die
@@ -606,7 +606,7 @@ econf() {
 			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
+		if [[ -e "${EPREFIX}"/usr/share/gnuconfig/ ]]; then
 			find "${WORKDIR}" -type f '(' \
 			-name config.guess -o -name config.sub ')' -print0 | \
 			while read -r -d $'\0' x ; do
@@ -701,7 +701,7 @@ econf() {
 
 		if ! "${ECONF_SOURCE}/configure" "$@" ; then
 
-			if [ -s config.log ]; then
+			if [[ -s config.log ]]; then
 				echo
 				echo "!!! Please attach the following file when seeking support:"
 				echo "!!! ${PWD}/config.log"
@@ -711,7 +711,7 @@ econf() {
 			__helpers_die "econf failed"
 			return 1
 		fi
-	elif [ -f "${ECONF_SOURCE}/configure" ]; then
+	elif [[ -f "${ECONF_SOURCE}/configure" ]]; then
 		die "configure is not executable"
 	else
 		die "no configure script found"
@@ -730,11 +730,11 @@ einstall() {
 		local ED=${D}
 	fi
 	LIBDIR_VAR="LIBDIR_${ABI}"
-	if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
+	if [[ -n "${ABI}" && -n "${!LIBDIR_VAR}" ]]; then
 		CONF_LIBDIR="${!LIBDIR_VAR}"
 	fi
 	unset LIBDIR_VAR
-	if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
+	if [[ -n "${CONF_LIBDIR}" && "${CONF_PREFIX:+set}" = set ]]; then
 		EI_DESTLIBDIR="${D%/}/${CONF_PREFIX}/${CONF_LIBDIR}"
 		EI_DESTLIBDIR="$(__strip_duplicate_slashes "${EI_DESTLIBDIR}")"
 		LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
@@ -742,7 +742,7 @@ einstall() {
 	fi
 
 	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
-		if [ "${PORTAGE_DEBUG}" == "1" ]; then
+		if [[ "${PORTAGE_DEBUG}" == "1" ]]; then
 			${MAKE:-make} -n prefix="${ED%/}/usr" \
 				datadir="${ED%/}/usr/share" \
 				infodir="${ED%/}/usr/share/info" \
@@ -786,7 +786,7 @@ __eapi0_src_unpack() {
 }
 
 __eapi0_src_compile() {
-	if [ -x ./configure ] ; then
+	if [[ -x ./configure ]]; then
 		econf
 	fi
 	__eapi2_src_compile
@@ -830,7 +830,7 @@ __eapi2_src_configure() {
 }
 
 __eapi2_src_compile() {
-	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
+	if [[ -f Makefile || -f GNUmakefile || -f makefile ]]; then
 		emake || die "emake failed"
 	fi
 }
@@ -892,7 +892,7 @@ ___best_version_and_has_version_common() {
 	esac
 	atom=$1
 	shift
-	[ $# -gt 0 ] && die "${FUNCNAME[1]}: unused argument(s): $*"
+	[[ $# -gt 0 ]] && die "${FUNCNAME[1]}: unused argument(s): $*"
 
 	case ${root_arg} in
 		"") if ___eapi_has_prefix_variables; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-06-24  2:20 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2022-06-24  2:20 UTC (permalink / raw
  To: gentoo-commits

commit:     8c0bcea15410ae81f2f157ba1b52d5c11cbf3966
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 24 02:16:31 2022 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 02:18:59 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8c0bcea1

bin/socks5-server.py: fix python3.10 DeprecationWarning

DeprecationWarning: There is no current event loop

Bug: https://bugs.gentoo.org/794115
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/socks5-server.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index a35d21ea0..442e96942 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 # SOCKSv5 proxy server for network-sandbox
-# Copyright 2015 Gentoo Foundation
+# Copyright 2015-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import asyncio
@@ -223,7 +223,7 @@ if __name__ == "__main__":
         print("Usage: %s <socket-path>" % sys.argv[0])
         sys.exit(1)
 
-    loop = asyncio.get_event_loop()
+    loop = asyncio.new_event_loop()
     s = Socks5Server()
     server = loop.run_until_complete(
         asyncio.start_unix_server(s.handle_proxy_conn, sys.argv[1])


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-07-03 19:36 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2022-07-03 19:36 UTC (permalink / raw
  To: gentoo-commits

commit:     eba088af8f335c0adb386461e6df1267e24800e7
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  3 18:52:09 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 18:58:37 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af

Revert "ebegin/eend: accept properly nested calls in different functions"

ebegin calls should not be nested: this will lead to strange looking
output in the log file. For example:

 * Doing task 1 ...
 * Doint task 2 ... [ ok ]
                    [ ok ]

Reverts: 605ad0d675a64eb39144122cf284100192cdfea0
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/isolated-functions.sh | 22 ++++------------------
 bin/phase-functions.sh    |  4 +---
 2 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 848e44b04..dea0d7f49 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -340,15 +340,9 @@ ebegin() {
 	LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
 	LAST_E_CMD="ebegin"
 	if [[ -v EBEGIN_EEND ]] ; then
-		# Already a call to ebegin
-		local prev="${EBEGIN_EEND[-1]}"
-		if [[ "${prev}" == "${FUNCNAME[1]}" ]] ; then
-			eqawarn "QA Notice: ebegin called in ${prev}, but missing call to eend (${FUNCNAME[1]})"
-		fi
-		EBEGIN_EEND+=( "${FUNCNAME[1]}" )
-	else
-		EBEGIN_EEND=( "${FUNCNAME[1]}" )
+		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})"
 	fi
+	EBEGIN_EEND=1
 	return 0
 }
 
@@ -378,17 +372,9 @@ __eend() {
 eend() {
 	[[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
 	if [[ -v EBEGIN_EEND ]] ; then
-		local caller="${FUNCNAME[1]}"
-		local tos="${EBEGIN_EEND[-1]}"
-		if [[ "${caller}" != "${tos}" ]] ; then
-			eqawarn "QA Notice: eend (in ${caller}) improperly matched with ebegin (called in ${tos})"
-		fi
-		unset EBEGIN_EEND[-1]
-		if [[ ${#EBEGIN_EEND[@]} -eq 0 ]] ; then
-			unset EBEGIN_EEND
-		fi
+		unset EBEGIN_EEND
 	else
-		eqawarn "QA Notice: eend called without preceding ebegin (phase: ${FUNCNAME[1]})"
+		eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})"
 	fi
 	local retval=${1:-0}
 	shift

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 0a36af297..25e25cc1e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1089,9 +1089,7 @@ __ebuild_main() {
 	esac
 
 	if [[ -v EBEGIN_EEND ]] ; then
-		for func in "${EBEGIN_EEND[@]}" ; do
-			eqawarn "QA Notice: ebegin called in ${func} but missing call to eend"
-		done
+		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})"
 	fi
 
 	# Save the env only for relevant phases.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-07-11 23:02 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-07-11 23:02 UTC (permalink / raw
  To: gentoo-commits

commit:     50ac4e2e3401be2410a01f7d5d7923672b57798f
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 19:48:48 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 23:01:04 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=50ac4e2e

Allow nested ebegin calls using a count variable

At the start of each phase, the count is set to 0.

The count is incremented each time ebegin is called.

If the count is equal to 0 when eend is called, a warning is output.
Otherwise, the count is decremented by 1.

At the end of each phase, if the count is greater than 0, a warning is
output.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/854
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/isolated-functions.sh | 12 ++++--------
 bin/phase-functions.sh    |  8 ++++----
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index dea0d7f49..55c38fbb0 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -339,10 +339,7 @@ ebegin() {
 	[[ ${RC_ENDCOL} == "yes" ]] && echo >&2
 	LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
 	LAST_E_CMD="ebegin"
-	if [[ -v EBEGIN_EEND ]] ; then
-		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})"
-	fi
-	EBEGIN_EEND=1
+	let ++__EBEGIN_EEND_COUNT
 	return 0
 }
 
@@ -371,10 +368,9 @@ __eend() {
 
 eend() {
 	[[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
-	if [[ -v EBEGIN_EEND ]] ; then
-		unset EBEGIN_EEND
-	else
-		eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})"
+	if (( --__EBEGIN_EEND_COUNT < 0 )); then
+		__EBEGIN_EEND_COUNT=0
+		eqawarn "QA Notice: eend called without preceding ebegin in ${FUNCNAME[1]}"
 	fi
 	local retval=${1:-0}
 	shift

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 25e25cc1e..84a5c1ec3 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -207,7 +207,11 @@ __preprocess_ebuild_env() {
 }
 
 __ebuild_phase() {
+	local __EBEGIN_EEND_COUNT=0
 	declare -F "$1" >/dev/null && __qa_call $1
+	if (( __EBEGIN_EEND_COUNT > 0 )); then
+		eqawarn "QA Notice: ebegin called without eend in $1"
+	fi
 }
 
 __ebuild_phase_with_hooks() {
@@ -1088,10 +1092,6 @@ __ebuild_main() {
 		;;
 	esac
 
-	if [[ -v EBEGIN_EEND ]] ; then
-		eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})"
-	fi
-
 	# Save the env only for relevant phases.
 	if ! has "${1}" clean help info nofetch ; then
 		umask 002


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-07-18 15:16 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-07-18 15:16 UTC (permalink / raw
  To: gentoo-commits

commit:     095d8c5b040eb399c245db1d3923d6a85747bbcf
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 18 15:04:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 18 15:16:46 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=095d8c5b

estrip: fix double prefix

The content of build-info/NEEDED is with EPREFIX, the following sed
should only prepend the paths with D.

Bug: https://bugs.gentoo.org/749624
Bug: https://bugs.gentoo.org/858818
Reference: https://github.com/gentoo/portage/pull/794
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 686afb763..1e3f21e73 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -412,7 +412,7 @@ done < <(
 	(
 		find "$@" -type f ! -type l -name '*.a'
 		cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \
-			| sed -e "s:^:${ED}:"
+			| sed -e "s:^:${D}:"
 	) | LC_ALL=C sort -u
 )
 else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-07-20 18:07 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2022-07-20 18:07 UTC (permalink / raw
  To: gentoo-commits

commit:     fbac6f89a046cbdcad5da7f34cc7b366c1017d88
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 20 08:36:26 2022 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jul 20 17:52:22 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fbac6f89

eapi.sh: Remove dead EAPI 5-hdepend from regex

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/eapi.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index a39513b1c..689e09b10 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2012-2021 Gentoo Authors
+# Copyright 2012-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # PHASES
@@ -43,7 +43,7 @@ ___eapi_has_BDEPEND() {
 }
 
 ___eapi_has_IDEPEND() {
-	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend|6|7)$ ]]
+	[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
 }
 
 ___eapi_has_RDEPEND_DEPEND_fallback() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-07-27 19:07 Fabian Groffen
  0 siblings, 0 replies; 881+ messages in thread
From: Fabian Groffen @ 2022-07-27 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     ac9aaac8fb264370a9447f3c0b0a0fce572c8d2a
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 26 18:52:29 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jul 27 19:07:20 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac9aaac8

bin/misc-functions.sh: some Prefix fixes

- ED needs not to exist, whereas D does, so ensure we check for that,
  and create ED if absent, necessary for further checks to succeed
- use EPREFIX in INSTALL_MASK

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 bin/misc-functions.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c8bac08e7..466d21dfd 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -19,6 +19,8 @@ source "${PORTAGE_BIN_PATH}/ebuild.sh" || exit 1
 install_symlink_html_docs() {
 	if ! ___eapi_has_prefix_variables; then
 		local ED=${D}
+	else
+		[[ ! -d ${ED} && -d ${D} ]] && dodir /
 	fi
 	cd "${ED}" || die "cd failed"
 	# Symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
@@ -83,7 +85,7 @@ install_qa_check() {
 		local EPREFIX= ED=${D}
 	fi
 
-	cd "${ED}" || die "cd failed"
+	cd "${D}" || die "cd failed"
 
 	# Collect the paths for QA checks, highest prio first.
 	paths=(
@@ -367,7 +369,7 @@ preinst_mask() {
 	local f x
 	for f in man info doc; do
 		if has no${f} ${FEATURES}; then
-			INSTALL_MASK+=" /usr/share/${f}"
+			INSTALL_MASK+=" ${EPREFIX}/usr/share/${f}"
 		fi
 	done
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-07-27 19:07 Fabian Groffen
  0 siblings, 0 replies; 881+ messages in thread
From: Fabian Groffen @ 2022-07-27 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     52187e6ff772d7e6180d0b3ce7256b001e1bdbab
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 26 18:53:11 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jul 27 19:07:21 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=52187e6f

bin/phase-functions.sh: make ED and EROOT read-only too

Like D, make ED and EROOT read-only vars.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 bin/phase-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ccf7eeea7..f615ba491 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -12,7 +12,7 @@ PORTAGE_READONLY_METADATA="BDEPEND DEFINED_PHASES DEPEND DESCRIPTION
 	PDEPEND RDEPEND REPOSITORY RESTRICT SLOT SRC_URI"
 
 PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
-	EBUILD_SH_ARGS EMERGE_FROM FILESDIR MERGE_TYPE \
+	EBUILD_SH_ARGS ED EMERGE_FROM EROOT FILESDIR MERGE_TYPE \
 	PM_EBUILD_HOOK_DIR \
 	PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC  \
 	PORTAGE_BINPKG_FILE PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-01  1:19 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-01  1:19 UTC (permalink / raw
  To: gentoo-commits

commit:     04f64dbe3cbd24abdb3efd2d1759530bdee551ec
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 31 21:42:34 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug  1 01:19:10 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=04f64dbe

estrip: fix double slash for < EAPI 7

Bug: https://bugs.gentoo.org/862600
Fixes: bb88e766897f5e7e0b0a10c48cf99a04edb73a40
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index fc2c3ef37..63bd46eb1 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -412,7 +412,7 @@ done < <(
 	(
 		find "$@" -type f ! -type l -name '*.a'
 		cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \
-			| sed -e "s:^:${D}:"
+			| sed -e "s:^:${D%/}:"
 	) | LC_ALL=C sort -u
 )
 else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-01 22:39 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-01 22:39 UTC (permalink / raw
  To: gentoo-commits

commit:     1bb1f5dc09f870558703fedbbb7d282830bf4251
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 28 01:19:41 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug  1 22:38:11 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1bb1f5dc

isolated-functions.sh: sync ___makeopts_jobs with multiprocessing.eclass

Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/871
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/isolated-functions.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 4542c6715..0efcd5a7d 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -470,10 +470,11 @@ if [[ -z ${XARGS} ]] ; then
 fi
 
 ___makeopts_jobs() {
-	# Copied from eutils.eclass:makeopts_jobs()
-	local jobs
-	jobs=$(echo " ${MAKEOPTS} " | \
-		sed -r -n 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p') || die
+	# Copied from multiprocessing.eclass:makeopts_jobs
+	# This assumes the first .* will be more greedy than the second .*
+	# since POSIX doesn't specify a non-greedy match (i.e. ".*?").
+	local jobs=$(echo " ${MAKEOPTS} " | sed -r -n \
+		-e 's:.*[[:space:]](-[a-z]*j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' || die)
 	echo ${jobs:-1}
 }
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-06 21:01 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-06 21:01 UTC (permalink / raw
  To: gentoo-commits

commit:     7f6e83707daf4a7d8231b968078a1ba94d80c697
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 00:05:47 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 21:00:28 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7f6e8370

estrip: avoid spurious NEEDED warning when no ELF installed (< EAPI 7)

If no ELF files are installed, then we're obviously
not going to have a NEEDED file.

The reason this didn't get hit sooner is because
apparently very few of us are actually testing
EAPI 6 actively - which figures.

We only take this path for < EAPI 7 (non-dostrip)
which means we're actually missing the estrip
optimisation in bug #749624 for newer EAPIs!

(Will be fixed in a followup).

Bug: https://bugs.gentoo.org/749624
Bug: https://bugs.gentoo.org/862606
Fixes: bb88e766897f5e7e0b0a10c48cf99a04edb73a40
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 6935470d3..f45211bdb 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -417,12 +417,20 @@ while read -r x ; do
 	inode_link=$(get_inode_number "${x}") || die "stat failed unexpectedly"
 	echo "${x}" >> "${inode_link}" || die "echo failed unexpectedly"
 done < <(
-	# Use sort -u to eliminate duplicates for bug #445336.
+	# NEEDED may not exist for some packages (bug #862606)
+	if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then
+		needed_contents=$(cat "${PORTAGE_BUILDDIR}"/build-info/NEEDED | cut -d ' ' -f1 | sed -e "s:^:${D%/}:")
+	else
+		needed_contents=""
+	fi
+
+	# Use sort -u to eliminate duplicates (bug #445336).
 	(
+		[[ -n ${needed_contents[@]} ]] && printf "%s\n" "${needed_contents[@]}"
 		find "$@" -type f ! -type l -name '*.a'
-		cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \
-			| sed -e "s:^:${D%/}:"
 	) | LC_ALL=C sort -u
+
+	unset needed_contents
 )
 else
 while IFS= read -d '' -r x ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-06 21:01 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-06 21:01 UTC (permalink / raw
  To: gentoo-commits

commit:     4af780be38037391751bccc6e15fc2561b8970e0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 01:40:44 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 21:00:28 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4af780be

estrip: use while/read for prepstrip (< EAPI 7)

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index f45211bdb..0ed35111d 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -419,9 +419,10 @@ while read -r x ; do
 done < <(
 	# NEEDED may not exist for some packages (bug #862606)
 	if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then
-		needed_contents=$(cat "${PORTAGE_BUILDDIR}"/build-info/NEEDED | cut -d ' ' -f1 | sed -e "s:^:${D%/}:")
-	else
-		needed_contents=""
+		while IFS= read -r needed_entry ; do
+			needed_entry="${needed_entry% *}"
+			needed_contents+=( "${D%/}${needed_entry}" )
+		done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
 	fi
 
 	# Use sort -u to eliminate duplicates (bug #445336).
@@ -429,8 +430,6 @@ done < <(
 		[[ -n ${needed_contents[@]} ]] && printf "%s\n" "${needed_contents[@]}"
 		find "$@" -type f ! -type l -name '*.a'
 	) | LC_ALL=C sort -u
-
-	unset needed_contents
 )
 else
 while IFS= read -d '' -r x ; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-06 21:01 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-06 21:01 UTC (permalink / raw
  To: gentoo-commits

commit:     0505c2e37bdfe3279bc4d1effcc4c1bb5148aa9e
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Thu Aug  4 22:45:01 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 21:00:12 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0505c2e3

dispatch-conf: respect (E)ROOT

Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/portage/pull/881
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/dispatch-conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 9490197d3..e7634eab6 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -116,7 +116,7 @@ class dispatch:
 
         perform_conf_update_session_hooks("pre-session")
 
-        config_root = portage.settings["EPREFIX"] or os.sep
+        config_root = portage.settings["EROOT"]
         self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
 
         if "log-file" in self.options:


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-06 21:01 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-06 21:01 UTC (permalink / raw
  To: gentoo-commits

commit:     e8f0e06784549fc4c8a06e0a43ff946d6a895683
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 01:44:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 21:00:28 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8f0e067

estrip: apply scanelf optimisation to EAPI 7+ / dostrip

(No need to do ${D%/} etc here as dostrip is in EAPI 7+ only.)

See: bb88e766897f5e7e0b0a10c48cf99a04edb73a40
Bug: https://bugs.gentoo.org/749624
Bug: https://bugs.gentoo.org/862606
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/879
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 41 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 0ed35111d..68ce8bd4d 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -64,12 +64,51 @@ while [[ $# -gt 0 ]] ; do
 		done
 
 		if [[ ${find_paths[@]} ]]; then
+			# We can avoid scanelf calls for binaries we already
+			# checked in install_qa_check (where we generate
+			# NEEDED for everything installed).
+			#
+			# EAPI 7+ has controlled stripping (dostrip) though
+			# which is why estrip has the queue/dequeue logic,
+			# so we need to take the intersection of:
+			# 1. files scanned earlier (all ELF installed)
+			#    (note that this should be a superset of 2., so we don't
+			#    need to worry about unknown files appearing)
+			#
+			# 2. the files we're interested in right now
+			scanelf_results=()
+			if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then
+				# The arguments may not be exact files (probably aren't), but search paths/directories
+				# which should then be searched recursively.
+				while IFS= read -r needed_entry ; do
+					for find_path in "${find_paths[@]}" ; do
+						# NEEDED has a bunch of entries like:
+						# /usr/lib64/libfoo.so libc.so
+						#
+						# find_path entries may be exact paths (like /usr/lib64/libfoo.so)
+						# or instead /usr/lib64, or ${ED}/usr, etc.
+						#
+						# We check if the beginning (i.e. first entry) of the NEEDED line
+						# matches the path given
+						# e.g. find_path="/usr/lib64" will match needed_entry="/usr/lib64/libfoo.so libc.so".
+						needed_entry_file="${needed_entry% *}"
+						if [[ "${needed_entry_file}" =~ ^${find_path##${D}} ]] ; then
+							scanelf_results+=( "${D}${needed_entry_file}" )
+						fi
+					done
+				done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+			else
+				scanelf_results=$(scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}")
+			fi
+
 			while IFS= read -r path; do
 				>> "${path}.estrip" || die
 			done < <(
-				scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}"
+				printf "%s\n" "${scanelf_results[@]}"
 				find "${find_paths[@]}" -type f ! -type l -name '*.a'
 			)
+
+			unset scanelf_results needed_entry needed_entry_file find_path
 		fi
 
 		exit 0


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-10  4:31 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-10  4:31 UTC (permalink / raw
  To: gentoo-commits

commit:     0459f86990ce4e130731dca4c89d73d607e5142e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 10 04:30:43 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 10 04:31:33 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0459f869

estrip: drop noisy strip banner if nothing to do

Fixes: e8f0e06784549fc4c8a06e0a43ff946d6a895683
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 68ce8bd4d..b8764039b 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -104,7 +104,7 @@ while [[ $# -gt 0 ]] ; do
 			while IFS= read -r path; do
 				>> "${path}.estrip" || die
 			done < <(
-				printf "%s\n" "${scanelf_results[@]}"
+				[[ -n ${scanelf_results[@]} ]] && printf "%s\n" "${scanelf_results[@]}"
 				find "${find_paths[@]}" -type f ! -type l -name '*.a'
 			)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-13 17:51 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-13 17:51 UTC (permalink / raw
  To: gentoo-commits

commit:     f35bf4828ac56b4ab4f7fb4ccc846ebdee33767d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 13 17:48:43 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 13 17:48:43 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f35bf482

estrip: tidy up size check for scanelf_results

Thanks-to: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index b8764039b..d7be51743 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -104,7 +104,7 @@ while [[ $# -gt 0 ]] ; do
 			while IFS= read -r path; do
 				>> "${path}.estrip" || die
 			done < <(
-				[[ -n ${scanelf_results[@]} ]] && printf "%s\n" "${scanelf_results[@]}"
+				(( ${#scanelf_results[@]} )) && printf "%s\n" "${scanelf_results[@]}"
 				find "${find_paths[@]}" -type f ! -type l -name '*.a'
 			)
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-08-17  3:26 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-08-17  3:26 UTC (permalink / raw
  To: gentoo-commits

commit:     36dbd3e4336fa199a35b4f74c1679511707138f5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 17 02:34:08 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 17 03:26:11 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=36dbd3e4

estrip: consistently use an array for scanelf results

Otherwise the new arithmetic-context test isn't going to work
if we're in the simpler scanelf-directly case (non-cache).

I should've spotted that we don't have an array in both
branches.

And while at it, adapt the find_paths test.

Fixes: f35bf4828ac56b4ab4f7fb4ccc846ebdee33767d
Thanks-to: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index d7be51743..6738fb4d3 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -63,7 +63,7 @@ while [[ $# -gt 0 ]] ; do
 			fi
 		done
 
-		if [[ ${find_paths[@]} ]]; then
+		if (( ${#find_paths[@]} )); then
 			# We can avoid scanelf calls for binaries we already
 			# checked in install_qa_check (where we generate
 			# NEEDED for everything installed).
@@ -98,7 +98,7 @@ while [[ $# -gt 0 ]] ; do
 					done
 				done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
 			else
-				scanelf_results=$(scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}")
+				mapfile -t scanelf_results < <(scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}")
 			fi
 
 			while IFS= read -r path; do


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-09-24 22:13 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-09-24 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     48d107e5c1a103d59a053aebeefa9a5aac5c32ff
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 24 07:23:36 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 24 22:12:57 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=48d107e5

bin: pass -j from MAKEOPTS to xz for parallel decompression

>= xz 5.3.3_alpha supports parallel decompression.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 0f8973f59..2217e5a0b 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -544,7 +544,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'xz'."
 				fi
 				if ___eapi_unpack_supports_xz; then
-					__unpack_tar "xz -d"
+					__unpack_tar "xz -T$(___makeopts_jobs) -d"
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
@@ -557,7 +557,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'txz'."
 				fi
 				if ___eapi_unpack_supports_txz; then
-					tar xof "${srcdir}${x}" || die "${myfail}"
+					XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-10-21  2:34 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-10-21  2:34 UTC (permalink / raw
  To: gentoo-commits

commit:     6834e464803b5ac98f8ab1bbca5379970b5bc6d9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 01:32:17 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 01:32:17 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6834e464

ecompress: don't set -9 for xz

From xz(1):
"""
The differences between the presets are more significant than with gzip(1) and bzip2(1).  The selected compression settings determine the memory requirements of the decompressor, thus  us‐
ing  a too high preset level might make it painful to decompress the file on an old system with little RAM.  Specifically, it's not a good idea to blindly use -9 for everything like it of‐
ten is with gzip(1) and bzip2(1).
[...]
-7 ... -9
     These are like -6 but with higher compressor and decompressor memory requirements.  These are useful only when compressing files bigger than 8 MiB, 16 MiB, and 32 MiB, respectively.
[...]
•  DictSize  is  the  LZMA2 dictionary size.  It is waste of memory to use a dictionary bigger than the size of the uncompressed file.  This is why it is good to avoid using the presets -7
... -9 when there's no real need for them.  At -6 and lower, the amount of memory wasted is usually low enough to not matter.
"""

Most things that ecompress touches are tiny (<32MB certainly). I made the
mistake the man page warngs about -- don't assume it's a good idea just
because of gzip & bzip2, and that's exactly what I did!

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ecompress | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/ecompress b/bin/ecompress
index 78a53ccac..609814cca 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -128,7 +128,7 @@ if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
 		# See: https://bugs.gentoo.org/672916
 		# Setting '--rm' will remove the source files after a successful compression.
 		lz4)  PORTAGE_COMPRESS_FLAGS="-m --rm";;
-		xz)   PORTAGE_COMPRESS_FLAGS="-9 -T$(___makeopts_jobs) --memlimit-compress=50% -q";;
+		xz)   PORTAGE_COMPRESS_FLAGS="-q -T$(___makeopts_jobs) --memlimit-compress=50%";;
 		zstd) PORTAGE_COMPRESS_FLAGS="-q --rm -T$(___makeopts_jobs)";;
 	esac
 fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-11-24  4:16 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-11-24  4:16 UTC (permalink / raw
  To: gentoo-commits

commit:     239c343e71315e9314670cfca5691b72881332a0
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Aug 13 09:03:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 24 04:15:56 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=239c343e

bin/ebuild.sh: Compare BASHOPTS rather than the output of the shopt builtin

Both the __qa_source() and __qa_call() functions capture the output of the shopt
builtin twice, for the purpose of comparing and warning in the case that
something being sourced or executed alters the global shell options without
later restoring them to their prior state.

The output of shopt is verbose in nature and it is somewhat aggravating to see
its output routinely appearing in bash execution traces. As of bash-4.1, a
BASHOPTS variable is available, which contains a colon-separated list of enabled
options, rendering it terse in nature, while still being suitable for the QA
test in question. So, let's use it and avoid incurring two subshells into the
bargain.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ebuild.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 417bca78a..c1fbcf75a 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -104,12 +104,12 @@ export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2}
 # when they are done.
 
 __qa_source() {
-	local shopts=$(shopt) OLDIFS="${IFS}"
+	local bashopts="${BASHOPTS:?}" OLDIFS="${IFS}"
 	local retval
 	source "$@"
 	retval=$?
 	set +e
-	[[ ${shopts} != $(shopt) ]] &&
+	[[ "${BASHOPTS}" != "${bashopts}" ]] &&
 		eqawarn "QA Notice: Global shell options changed and were not restored while sourcing '$*'"
 	[[ "${IFS}" != "${OLDIFS}" ]] &&
 		eqawarn "QA Notice: Global IFS changed and was not restored while sourcing '$*'"
@@ -117,12 +117,12 @@ __qa_source() {
 }
 
 __qa_call() {
-	local shopts=$(shopt) OLDIFS="${IFS}"
+	local bashopts="${BASHOPTS:?}" OLDIFS="${IFS}"
 	local retval
 	"$@"
 	retval=$?
 	set +e
-	[[ ${shopts} != $(shopt) ]] &&
+	[[ "${BASHOPTS}" != "${bashopts}" ]] &&
 		eqawarn "QA Notice: Global shell options changed and were not restored while calling '$*'"
 	[[ "${IFS}" != "${OLDIFS}" ]] &&
 		eqawarn "QA Notice: Global IFS changed and was not restored while calling '$*'"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2022-12-31 13:33 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2022-12-31 13:33 UTC (permalink / raw
  To: gentoo-commits

commit:     7141d7f0033bc7bf5bdf825271a0002657d4fb83
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 27 03:57:56 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 31 13:29:24 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7141d7f0

Rework signal handling in entry scripts

Introduce a new exception SignalInterrupt which inherits from
KeyboardInterrupt and adds a 'signum' member. When a signal is received,
raise SignalInterrupt.

At the end of the script, catch KeyboardInterrupt, and look for the
signum member. Reset the signal handler to SIG_DFL, and re-raise the
signal to kill the process.

This ensures that the invoking shell sees that we got killed by a signal
instead of calling exit.

Bug: https://bugs.gentoo.org/887817
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/965
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ebuild        |  781 +++++++--------
 bin/ebuild-ipc.py |  505 +++++-----
 bin/egencache     | 2473 +++++++++++++++++++++++-----------------------
 bin/emaint        |   86 +-
 bin/emerge        |   43 +-
 bin/portageq      | 2854 ++++++++++++++++++++++++++---------------------------
 6 files changed, 3381 insertions(+), 3361 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 112e14e3d..8f73b8684 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -2,434 +2,441 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-import argparse
+import os
 import signal
-import sys
-import textwrap
 
-# This block ensures that ^C interrupts are handled quietly.
-try:
+# For compatibility with Python < 3.8
+raise_signal = getattr(
+    signal, "raise_signal", lambda signum: os.kill(os.getpid(), signum)
+)
 
-    def exithandler(signum, _frame):
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
-        signal.signal(signal.SIGTERM, signal.SIG_IGN)
-        sys.exit(128 + signum)
+# Inherit from KeyboardInterrupt to avoid a traceback from asyncio.
+class SignalInterrupt(KeyboardInterrupt):
+    def __init__(self, signum):
+        self.signum = signum
 
-    signal.signal(signal.SIGINT, exithandler)
-    signal.signal(signal.SIGTERM, exithandler)
-    # Prevent "[Errno 32] Broken pipe" exceptions when
-    # writing to a pipe.
-    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
 
-except KeyboardInterrupt:
-    sys.exit(128 + signal.SIGINT)
+try:
 
+    def signal_interrupt(signum, _frame):
+        raise SignalInterrupt(signum)
 
-def debug_signal(_signum, _frame):
-    import pdb
+    def debug_signal(_signum, _frame):
+        import pdb
 
-    pdb.set_trace()
+        pdb.set_trace()
 
+    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    signal.signal(signal.SIGTERM, signal_interrupt)
+    signal.signal(signal.SIGUSR1, debug_signal)
 
-signal.signal(signal.SIGUSR1, debug_signal)
+    import argparse
+    from os import path as osp
+    import sys
+    import textwrap
 
-import os
-from os import path as osp
+    if osp.isfile(
+        osp.join(
+            osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed"
+        )
+    ):
+        sys.path.insert(
+            0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+        )
+    import portage
+
+    portage._internal_caller = True
+    from portage import os
+    from portage import _encodings
+    from portage import _shell_quote
+    from portage import _unicode_encode
+    from portage.const import VDB_PATH
+    from portage.exception import (
+        PermissionDenied,
+        PortageKeyError,
+        PortagePackageException,
+        UnsupportedAPIException,
+    )
+    from portage.localization import _
+    import portage.util
+    from portage.util._eventloop.global_event_loop import global_event_loop
+    from _emerge.actions import apply_priorities
+    from _emerge.Package import Package
+    from _emerge.RootConfig import RootConfig
+
+    portage.process.sanitize_fds()
+
+    description = "See the ebuild(1) man page for more info"
+    usage = "Usage: ebuild <ebuild file> <command> [command] ..."
+    parser = argparse.ArgumentParser(description=description, usage=usage)
+
+    force_help = (
+        "When used together with the digest or manifest "
+        + "command, this option forces regeneration of digests for all "
+        + "distfiles associated with the current ebuild. Any distfiles "
+        + "that do not already exist in ${DISTDIR} will be automatically fetched."
+    )
 
-if osp.isfile(
-    osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")
-):
-    sys.path.insert(
-        0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+    parser.add_argument("--force", help=force_help, action="store_true")
+    parser.add_argument(
+        "--color", help="enable or disable color output", choices=("y", "n")
+    )
+    parser.add_argument("--debug", help="show debug output", action="store_true")
+    parser.add_argument("--version", help="show version and exit", action="store_true")
+    parser.add_argument(
+        "--ignore-default-opts",
+        action="store_true",
+        help="do not use the EBUILD_DEFAULT_OPTS environment variable",
+    )
+    parser.add_argument(
+        "--skip-manifest", help="skip all manifest checks", action="store_true"
     )
-import portage
-
-portage._internal_caller = True
-from portage import os
-from portage import _encodings
-from portage import _shell_quote
-from portage import _unicode_encode
-from portage.const import VDB_PATH
-from portage.exception import (
-    PermissionDenied,
-    PortageKeyError,
-    PortagePackageException,
-    UnsupportedAPIException,
-)
-from portage.localization import _
-import portage.util
-from portage.util._eventloop.global_event_loop import global_event_loop
-from _emerge.actions import apply_priorities
-from _emerge.Package import Package
-from _emerge.RootConfig import RootConfig
-
-portage.process.sanitize_fds()
-
-description = "See the ebuild(1) man page for more info"
-usage = "Usage: ebuild <ebuild file> <command> [command] ..."
-parser = argparse.ArgumentParser(description=description, usage=usage)
-
-force_help = (
-    "When used together with the digest or manifest "
-    + "command, this option forces regeneration of digests for all "
-    + "distfiles associated with the current ebuild. Any distfiles "
-    + "that do not already exist in ${DISTDIR} will be automatically fetched."
-)
 
-parser.add_argument("--force", help=force_help, action="store_true")
-parser.add_argument(
-    "--color", help="enable or disable color output", choices=("y", "n")
-)
-parser.add_argument("--debug", help="show debug output", action="store_true")
-parser.add_argument("--version", help="show version and exit", action="store_true")
-parser.add_argument(
-    "--ignore-default-opts",
-    action="store_true",
-    help="do not use the EBUILD_DEFAULT_OPTS environment variable",
-)
-parser.add_argument(
-    "--skip-manifest", help="skip all manifest checks", action="store_true"
-)
+    opts, pargs = parser.parse_known_args(args=sys.argv[1:])
 
-opts, pargs = parser.parse_known_args(args=sys.argv[1:])
+    def err(txt):
+        portage.writemsg("ebuild: {}\n".format(txt), noiselevel=-1)
+        sys.exit(1)
 
+    if opts.version:
+        print("Portage", portage.VERSION)
+        sys.exit(os.EX_OK)
 
-def err(txt):
-    portage.writemsg("ebuild: {}\n".format(txt), noiselevel=-1)
-    sys.exit(1)
+    if len(pargs) < 2:
+        parser.error("missing required args")
 
+    if not opts.ignore_default_opts:
+        default_opts = portage.util.shlex_split(
+            portage.settings.get("EBUILD_DEFAULT_OPTS", "")
+        )
+        opts, pargs = parser.parse_known_args(default_opts + sys.argv[1:])
+
+    debug = opts.debug
+    force = opts.force
+
+    if debug:
+        # Ensure that all config instances have this setting,
+        # including the one that's used by portdbapi for aux_get.
+        os.environ["PORTAGE_DEBUG"] = "1"
+        portage._reset_legacy_globals()
+
+    # do this _after_ 'import portage' to prevent unnecessary tracing
+    if debug and "python-trace" in portage.features:
+        portage.debug.set_trace(True)
+
+    if not opts.color == "y" and (
+        opts.color == "n"
+        or portage.settings.get("NOCOLOR") in ("yes", "true")
+        or portage.settings.get("TERM") == "dumb"
+        or not sys.stdout.isatty()
+    ):
+        portage.output.nocolor()
+        portage.settings.unlock()
+        portage.settings["NOCOLOR"] = "true"
+        portage.settings.backup_changes("NOCOLOR")
+        portage.settings.lock()
+
+    apply_priorities(portage.settings)
+
+    ebuild = pargs.pop(0)
+
+    pf = None
+    if ebuild.endswith(".ebuild"):
+        pf = os.path.basename(ebuild)[:-7]
+
+    if pf is None:
+        err("{}: does not end with '.ebuild'".format(ebuild))
+
+    if not os.path.isabs(ebuild):
+        mycwd = os.getcwd()
+        # Try to get the non-canonical path from the PWD evironment variable, since
+        # the canonical path returned from os.getcwd() may may be unusable in
+        # cases where the directory stucture is built from symlinks.
+        pwd = os.environ.get("PWD", "")
+        if pwd and pwd != mycwd and os.path.realpath(pwd) == mycwd:
+            mycwd = portage.normalize_path(pwd)
+        ebuild = os.path.join(mycwd, ebuild)
+    ebuild = portage.normalize_path(ebuild)
+    # portdbapi uses the canonical path for the base of the ebuild repository, but
+    # subdirectories of the base can be built from symlinks (like crossdev does).
+    ebuild_portdir = os.path.realpath(
+        os.path.dirname(os.path.dirname(os.path.dirname(ebuild)))
+    )
+    ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
+    vdb_path = os.path.realpath(os.path.join(portage.settings["EROOT"], VDB_PATH))
+
+    # Make sure that portdb.findname() returns the correct ebuild.
+    if ebuild_portdir != vdb_path and ebuild_portdir not in portage.portdb.porttrees:
+        portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "")
+        os.environ["PORTDIR_OVERLAY"] = (
+            portdir_overlay + " " + _shell_quote(ebuild_portdir)
+        )
 
-if opts.version:
-    print("Portage", portage.VERSION)
-    sys.exit(os.EX_OK)
+        print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir)
+        portage._reset_legacy_globals()
 
-if len(pargs) < 2:
-    parser.error("missing required args")
+    myrepo = None
+    if ebuild_portdir != vdb_path:
+        myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
 
-if not opts.ignore_default_opts:
-    default_opts = portage.util.shlex_split(
-        portage.settings.get("EBUILD_DEFAULT_OPTS", "")
-    )
-    opts, pargs = parser.parse_known_args(default_opts + sys.argv[1:])
-
-debug = opts.debug
-force = opts.force
-
-if debug:
-    # Ensure that all config instances have this setting,
-    # including the one that's used by portdbapi for aux_get.
-    os.environ["PORTAGE_DEBUG"] = "1"
-    portage._reset_legacy_globals()
-
-# do this _after_ 'import portage' to prevent unnecessary tracing
-if debug and "python-trace" in portage.features:
-    portage.debug.set_trace(True)
-
-if not opts.color == "y" and (
-    opts.color == "n"
-    or portage.settings.get("NOCOLOR") in ("yes", "true")
-    or portage.settings.get("TERM") == "dumb"
-    or not sys.stdout.isatty()
-):
-    portage.output.nocolor()
-    portage.settings.unlock()
-    portage.settings["NOCOLOR"] = "true"
-    portage.settings.backup_changes("NOCOLOR")
-    portage.settings.lock()
-
-apply_priorities(portage.settings)
-
-ebuild = pargs.pop(0)
-
-pf = None
-if ebuild.endswith(".ebuild"):
-    pf = os.path.basename(ebuild)[:-7]
-
-if pf is None:
-    err("{}: does not end with '.ebuild'".format(ebuild))
-
-if not os.path.isabs(ebuild):
-    mycwd = os.getcwd()
-    # Try to get the non-canonical path from the PWD evironment variable, since
-    # the canonical path returned from os.getcwd() may may be unusable in
-    # cases where the directory stucture is built from symlinks.
-    pwd = os.environ.get("PWD", "")
-    if pwd and pwd != mycwd and os.path.realpath(pwd) == mycwd:
-        mycwd = portage.normalize_path(pwd)
-    ebuild = os.path.join(mycwd, ebuild)
-ebuild = portage.normalize_path(ebuild)
-# portdbapi uses the canonical path for the base of the ebuild repository, but
-# subdirectories of the base can be built from symlinks (like crossdev does).
-ebuild_portdir = os.path.realpath(
-    os.path.dirname(os.path.dirname(os.path.dirname(ebuild)))
-)
-ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
-vdb_path = os.path.realpath(os.path.join(portage.settings["EROOT"], VDB_PATH))
+    if not os.path.exists(ebuild):
+        err("{}: does not exist".format(ebuild))
 
-# Make sure that portdb.findname() returns the correct ebuild.
-if ebuild_portdir != vdb_path and ebuild_portdir not in portage.portdb.porttrees:
-    portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "")
-    os.environ["PORTDIR_OVERLAY"] = portdir_overlay + " " + _shell_quote(ebuild_portdir)
+    ebuild_split = ebuild.split("/")
+    cpv = "{}/{}".format(ebuild_split[-3], pf)
 
-    print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir)
-    portage._reset_legacy_globals()
+    with open(
+        _unicode_encode(ebuild, encoding=_encodings["fs"], errors="strict"),
+        encoding=_encodings["repo.content"],
+        errors="replace",
+    ) as f:
+        eapi = portage._parse_eapi_ebuild_head(f)[0]
+    if eapi is None:
+        eapi = "0"
+    if not portage.catpkgsplit(cpv, eapi=eapi):
+        err("{}: {}: does not follow correct package syntax".format(ebuild, cpv))
 
-myrepo = None
-if ebuild_portdir != vdb_path:
-    myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
+    if ebuild.startswith(vdb_path):
+        mytree = "vartree"
+        pkg_type = "installed"
 
-if not os.path.exists(ebuild):
-    err("{}: does not exist".format(ebuild))
+        portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(
+            cpv, myrepo=myrepo
+        )
 
-ebuild_split = ebuild.split("/")
-cpv = "{}/{}".format(ebuild_split[-3], pf)
+        if os.path.realpath(portage_ebuild) != ebuild:
+            err("Portage seems to think that {} is at {}".format(cpv, portage_ebuild))
+
+    else:
+        mytree = "porttree"
+        pkg_type = "ebuild"
+
+        portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
+
+        if not portage_ebuild or portage_ebuild != ebuild:
+            err("{}: does not seem to have a valid PORTDIR structure".format(ebuild))
+
+    if len(pargs) > 1 and "config" in pargs:
+        other_phases = set(pargs)
+        other_phases.difference_update(("clean", "config", "digest", "manifest"))
+        if other_phases:
+            err('"config" must not be called with any other phase')
+
+    def discard_digests(myebuild, mysettings, mydbapi):
+        """Discard all distfiles digests for the given ebuild.  This is useful when
+        upstream has changed the identity of the distfiles and the user would
+        otherwise have to manually remove the Manifest and files/digest-* files in
+        order to ensure correct results."""
+        try:
+            portage._doebuild_manifest_exempt_depend += 1
+            pkgdir = os.path.dirname(myebuild)
+            fetchlist_dict = portage.FetchlistDict(pkgdir, mysettings, mydbapi)
+            mf = mysettings.repositories.get_repo_for_location(
+                os.path.dirname(os.path.dirname(pkgdir))
+            )
+            mf = mf.load_manifest(
+                pkgdir, mysettings["DISTDIR"], fetchlist_dict=fetchlist_dict
+            )
+            mf.create(
+                requiredDistfiles=None,
+                assumeDistHashesSometimes=True,
+                assumeDistHashesAlways=True,
+            )
+            distfiles = fetchlist_dict[cpv]
+            for myfile in distfiles:
+                try:
+                    del mf.fhashdict["DIST"][myfile]
+                except KeyError:
+                    pass
+            mf.write()
+        finally:
+            portage._doebuild_manifest_exempt_depend -= 1
+
+    portage.settings.validate()  # generate warning messages if necessary
+
+    build_dir_phases = {
+        "setup",
+        "unpack",
+        "prepare",
+        "configure",
+        "compile",
+        "test",
+        "install",
+        "package",
+        "rpm",
+        "merge",
+        "qmerge",
+    }
+
+    # If the current metadata is invalid then force the ebuild to be
+    # sourced again even if ${T}/environment already exists.
+    ebuild_changed = False
+    if mytree == "porttree" and build_dir_phases.intersection(pargs):
+        ebuild_changed = (
+            portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None
+        )
 
-with open(
-    _unicode_encode(ebuild, encoding=_encodings["fs"], errors="strict"),
-    encoding=_encodings["repo.content"],
-    errors="replace",
-) as f:
-    eapi = portage._parse_eapi_ebuild_head(f)[0]
-if eapi is None:
-    eapi = "0"
-if not portage.catpkgsplit(cpv, eapi=eapi):
-    err("{}: {}: does not follow correct package syntax".format(ebuild, cpv))
+    # Make configuration adjustments to portage.portdb.doebuild_settings,
+    # in order to enforce consistency for EBUILD_FORCE_TEST support
+    # (see bug 601466).
+    tmpsettings = portage.portdb.doebuild_settings
 
-if ebuild.startswith(vdb_path):
-    mytree = "vartree"
-    pkg_type = "installed"
+    tmpsettings["PORTAGE_VERBOSE"] = "1"
+    tmpsettings.backup_changes("PORTAGE_VERBOSE")
 
-    portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
+    if opts.skip_manifest:
+        tmpsettings["EBUILD_SKIP_MANIFEST"] = "1"
+        tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
 
-    if os.path.realpath(portage_ebuild) != ebuild:
-        err("Portage seems to think that {} is at {}".format(cpv, portage_ebuild))
+    if (
+        opts.skip_manifest
+        or "digest" in tmpsettings.features
+        or "digest" in pargs
+        or "manifest" in pargs
+    ):
+        portage._doebuild_manifest_exempt_depend += 1
 
-else:
-    mytree = "porttree"
-    pkg_type = "ebuild"
+    if "test" in pargs:
+        # This variable is a signal to config.regenerate() to
+        # indicate that the test phase should be enabled regardless
+        # of problems such as masked "test" USE flag.
+        tmpsettings["EBUILD_FORCE_TEST"] = "1"
+        tmpsettings.backup_changes("EBUILD_FORCE_TEST")
+        tmpsettings.features.add("test")
+        portage.writemsg(_("Forcing test.\n"), noiselevel=-1)
 
-    portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
+    tmpsettings.features.discard("fail-clean")
 
-    if not portage_ebuild or portage_ebuild != ebuild:
-        err("{}: does not seem to have a valid PORTDIR structure".format(ebuild))
+    if "merge" in pargs and "noauto" in tmpsettings.features:
+        print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
+        tmpsettings.features.discard("noauto")
 
-if len(pargs) > 1 and "config" in pargs:
-    other_phases = set(pargs)
-    other_phases.difference_update(("clean", "config", "digest", "manifest"))
-    if other_phases:
-        err('"config" must not be called with any other phase')
+    if "digest" in tmpsettings.features:
+        if pargs and pargs[0] not in ("digest", "manifest"):
+            pargs = ["digest"] + pargs
+        # We only need to build digests on the first pass.
+        tmpsettings.features.discard("digest")
 
+    # Now that configuration adjustments are complete, create a clone of
+    # tmpsettings. The current instance refers to portdb.doebuild_settings,
+    # and we want to avoid the possibility of unintended side-effects.
+    tmpsettings = portage.config(clone=tmpsettings)
 
-def discard_digests(myebuild, mysettings, mydbapi):
-    """Discard all distfiles digests for the given ebuild.  This is useful when
-    upstream has changed the identity of the distfiles and the user would
-    otherwise have to manually remove the Manifest and files/digest-* files in
-    order to ensure correct results."""
     try:
-        portage._doebuild_manifest_exempt_depend += 1
-        pkgdir = os.path.dirname(myebuild)
-        fetchlist_dict = portage.FetchlistDict(pkgdir, mysettings, mydbapi)
-        mf = mysettings.repositories.get_repo_for_location(
-            os.path.dirname(os.path.dirname(pkgdir))
-        )
-        mf = mf.load_manifest(
-            pkgdir, mysettings["DISTDIR"], fetchlist_dict=fetchlist_dict
+        metadata = dict(
+            zip(
+                Package.metadata_keys,
+                portage.db[portage.settings["EROOT"]][mytree].dbapi.aux_get(
+                    cpv, Package.metadata_keys, myrepo=myrepo
+                ),
+            )
         )
-        mf.create(
-            requiredDistfiles=None,
-            assumeDistHashesSometimes=True,
-            assumeDistHashesAlways=True,
-        )
-        distfiles = fetchlist_dict[cpv]
-        for myfile in distfiles:
-            try:
-                del mf.fhashdict["DIST"][myfile]
-            except KeyError:
-                pass
-        mf.write()
-    finally:
-        portage._doebuild_manifest_exempt_depend -= 1
-
-
-portage.settings.validate()  # generate warning messages if necessary
-
-build_dir_phases = {
-    "setup",
-    "unpack",
-    "prepare",
-    "configure",
-    "compile",
-    "test",
-    "install",
-    "package",
-    "rpm",
-    "merge",
-    "qmerge",
-}
-
-# If the current metadata is invalid then force the ebuild to be
-# sourced again even if ${T}/environment already exists.
-ebuild_changed = False
-if mytree == "porttree" and build_dir_phases.intersection(pargs):
-    ebuild_changed = (
-        portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None
-    )
-
-# Make configuration adjustments to portage.portdb.doebuild_settings,
-# in order to enforce consistency for EBUILD_FORCE_TEST support
-# (see bug 601466).
-tmpsettings = portage.portdb.doebuild_settings
-
-tmpsettings["PORTAGE_VERBOSE"] = "1"
-tmpsettings.backup_changes("PORTAGE_VERBOSE")
-
-if opts.skip_manifest:
-    tmpsettings["EBUILD_SKIP_MANIFEST"] = "1"
-    tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
-
-if (
-    opts.skip_manifest
-    or "digest" in tmpsettings.features
-    or "digest" in pargs
-    or "manifest" in pargs
-):
-    portage._doebuild_manifest_exempt_depend += 1
-
-if "test" in pargs:
-    # This variable is a signal to config.regenerate() to
-    # indicate that the test phase should be enabled regardless
-    # of problems such as masked "test" USE flag.
-    tmpsettings["EBUILD_FORCE_TEST"] = "1"
-    tmpsettings.backup_changes("EBUILD_FORCE_TEST")
-    tmpsettings.features.add("test")
-    portage.writemsg(_("Forcing test.\n"), noiselevel=-1)
-
-tmpsettings.features.discard("fail-clean")
-
-if "merge" in pargs and "noauto" in tmpsettings.features:
-    print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
-    tmpsettings.features.discard("noauto")
-
-if "digest" in tmpsettings.features:
-    if pargs and pargs[0] not in ("digest", "manifest"):
-        pargs = ["digest"] + pargs
-    # We only need to build digests on the first pass.
-    tmpsettings.features.discard("digest")
-
-# Now that configuration adjustments are complete, create a clone of
-# tmpsettings. The current instance refers to portdb.doebuild_settings,
-# and we want to avoid the possibility of unintended side-effects.
-tmpsettings = portage.config(clone=tmpsettings)
+    except PortageKeyError:
+        # aux_get failure, message should have been shown on stderr.
+        sys.exit(1)
 
-try:
-    metadata = dict(
-        zip(
-            Package.metadata_keys,
-            portage.db[portage.settings["EROOT"]][mytree].dbapi.aux_get(
-                cpv, Package.metadata_keys, myrepo=myrepo
-            ),
-        )
+    root_config = RootConfig(
+        portage.settings, portage.db[portage.settings["EROOT"]], None
     )
-except PortageKeyError:
-    # aux_get failure, message should have been shown on stderr.
-    sys.exit(1)
-
-root_config = RootConfig(portage.settings, portage.db[portage.settings["EROOT"]], None)
 
-cpv = portage.versions._pkg_str(
-    cpv,
-    metadata=metadata,
-    settings=portage.settings,
-    db=portage.db[portage.settings["EROOT"]][mytree].dbapi,
-)
-
-pkg = Package(
-    built=(pkg_type != "ebuild"),
-    cpv=cpv,
-    installed=(pkg_type == "installed"),
-    metadata=metadata,
-    root_config=root_config,
-    type_name=pkg_type,
-)
-
-# Apply package.env and repo-level settings. This allows per-package
-# FEATURES and other variables (possibly PORTAGE_TMPDIR) to be
-# available as soon as possible. Also, note that the only way to ensure
-# that setcpv gets metadata from the correct repository is to pass in
-# a Package instance, as we do here (previously we had to modify
-# portdb.porttrees in order to accomplish this).
-tmpsettings.setcpv(pkg)
+    cpv = portage.versions._pkg_str(
+        cpv,
+        metadata=metadata,
+        settings=portage.settings,
+        db=portage.db[portage.settings["EROOT"]][mytree].dbapi,
+    )
 
+    pkg = Package(
+        built=(pkg_type != "ebuild"),
+        cpv=cpv,
+        installed=(pkg_type == "installed"),
+        metadata=metadata,
+        root_config=root_config,
+        type_name=pkg_type,
+    )
 
-def stale_env_warning():
-    if (
-        "clean" not in pargs
-        and "noauto" not in tmpsettings.features
-        and build_dir_phases.intersection(pargs)
-    ):
-        portage.doebuild_environment(
-            ebuild, "setup", portage.root, tmpsettings, debug, 1, portage.portdb
-        )
-        env_filename = os.path.join(tmpsettings["T"], "environment")
-        if os.path.exists(env_filename):
-            msg = (
-                "Existing ${T}/environment for '%s' will be sourced. "
-                + "Run 'clean' to start with a fresh environment."
-            ) % (tmpsettings["PF"],)
-            msg = textwrap.wrap(msg, 70)
+    # Apply package.env and repo-level settings. This allows per-package
+    # FEATURES and other variables (possibly PORTAGE_TMPDIR) to be
+    # available as soon as possible. Also, note that the only way to ensure
+    # that setcpv gets metadata from the correct repository is to pass in
+    # a Package instance, as we do here (previously we had to modify
+    # portdb.porttrees in order to accomplish this).
+    tmpsettings.setcpv(pkg)
+
+    def stale_env_warning():
+        if (
+            "clean" not in pargs
+            and "noauto" not in tmpsettings.features
+            and build_dir_phases.intersection(pargs)
+        ):
+            portage.doebuild_environment(
+                ebuild, "setup", portage.root, tmpsettings, debug, 1, portage.portdb
+            )
+            env_filename = os.path.join(tmpsettings["T"], "environment")
+            if os.path.exists(env_filename):
+                msg = (
+                    "Existing ${T}/environment for '%s' will be sourced. "
+                    + "Run 'clean' to start with a fresh environment."
+                ) % (tmpsettings["PF"],)
+                msg = textwrap.wrap(msg, 70)
+                for x in msg:
+                    portage.writemsg(">>> %s\n" % x)
+
+                if ebuild_changed:
+                    open(
+                        os.path.join(
+                            tmpsettings["PORTAGE_BUILDDIR"], ".ebuild_changed"
+                        ),
+                        "w",
+                    ).close()
+
+    checked_for_stale_env = False
+
+    for arg in pargs:
+        try:
+            if not checked_for_stale_env and arg not in ("digest", "manifest"):
+                # This has to go after manifest generation since otherwise
+                # aux_get() might fail due to invalid ebuild digests.
+                stale_env_warning()
+                checked_for_stale_env = True
+
+            if arg in ("digest", "manifest") and force:
+                discard_digests(ebuild, tmpsettings, portage.portdb)
+            a = portage.doebuild(
+                ebuild,
+                arg,
+                settings=tmpsettings,
+                debug=debug,
+                tree=mytree,
+                vartree=portage.db[portage.root]["vartree"],
+            )
+        except PortageKeyError:
+            # aux_get error
+            a = 1
+        except UnsupportedAPIException as e:
+            msg = textwrap.wrap(str(e), 70)
+            del e
             for x in msg:
-                portage.writemsg(">>> %s\n" % x)
-
-            if ebuild_changed:
-                open(
-                    os.path.join(tmpsettings["PORTAGE_BUILDDIR"], ".ebuild_changed"),
-                    "w",
-                ).close()
-
-
-checked_for_stale_env = False
-
-for arg in pargs:
-    try:
-        if not checked_for_stale_env and arg not in ("digest", "manifest"):
-            # This has to go after manifest generation since otherwise
-            # aux_get() might fail due to invalid ebuild digests.
-            stale_env_warning()
-            checked_for_stale_env = True
-
-        if arg in ("digest", "manifest") and force:
-            discard_digests(ebuild, tmpsettings, portage.portdb)
-        a = portage.doebuild(
-            ebuild,
-            arg,
-            settings=tmpsettings,
-            debug=debug,
-            tree=mytree,
-            vartree=portage.db[portage.root]["vartree"],
-        )
-    except KeyboardInterrupt:
-        print("Interrupted.")
-        a = 1
-    except PortageKeyError:
-        # aux_get error
-        a = 1
-    except UnsupportedAPIException as e:
-        msg = textwrap.wrap(str(e), 70)
-        del e
-        for x in msg:
-            portage.writemsg("!!! %s\n" % x, noiselevel=-1)
-        a = 1
-    except PortagePackageException as e:
-        portage.writemsg("!!! {}\n".format(e), noiselevel=-1)
-        a = 1
-    except PermissionDenied as e:
-        portage.writemsg("!!! Permission Denied: {}\n".format(e), noiselevel=-1)
-        a = 1
-    if a is None:
-        print("Could not run the required binary?")
-        a = 127
-    if a:
-        global_event_loop().close()
-        sys.exit(a)
-
-global_event_loop().close()
+                portage.writemsg("!!! %s\n" % x, noiselevel=-1)
+            a = 1
+        except PortagePackageException as e:
+            portage.writemsg("!!! {}\n".format(e), noiselevel=-1)
+            a = 1
+        except PermissionDenied as e:
+            portage.writemsg("!!! Permission Denied: {}\n".format(e), noiselevel=-1)
+            a = 1
+        if a is None:
+            print("Could not run the required binary?")
+            a = 127
+        if a:
+            global_event_loop().close()
+            sys.exit(a)
+
+    global_event_loop().close()
+
+except KeyboardInterrupt as e:
+    # Prevent traceback on ^C
+    signum = getattr(e, "signum", signal.SIGINT)
+    signal.signal(signum, signal.SIG_DFL)
+    raise_signal(signum)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index d0d902aff..fc632e015 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -5,316 +5,323 @@
 # This is a helper which ebuild processes can use
 # to communicate with portage's main python process.
 
-# This block ensures that ^C interrupts are handled quietly.
-try:
-    import os
-    import signal
+import os
+import signal
 
-    def exithandler(signum, _frame):
-        signal.signal(signum, signal.SIG_DFL)
-        os.kill(os.getpid(), signum)
+# For compatibility with Python < 3.8
+raise_signal = getattr(
+    signal, "raise_signal", lambda signum: os.kill(os.getpid(), signum)
+)
 
-    signal.signal(signal.SIGINT, exithandler)
-    signal.signal(signal.SIGTERM, exithandler)
-    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+# Inherit from KeyboardInterrupt to avoid a traceback from asyncio.
+class SignalInterrupt(KeyboardInterrupt):
+    def __init__(self, signum):
+        self.signum = signum
 
-except KeyboardInterrupt:
-    raise SystemExit(130)
 
-import errno
-import logging
-import pickle
-import sys
-import time
+try:
 
+    def signal_interrupt(signum, _frame):
+        raise SignalInterrupt(signum)
 
-def debug_signal(signum, frame):
-    import pdb
+    def debug_signal(_signum, _frame):
+        import pdb
 
-    pdb.set_trace()
+        pdb.set_trace()
 
+    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    signal.signal(signal.SIGTERM, signal_interrupt)
+    signal.signal(signal.SIGUSR1, debug_signal)
 
-signal.signal(signal.SIGUSR1, debug_signal)
+    import errno
+    import logging
+    import pickle
+    import sys
+    import time
 
-if os.path.isfile(
-    os.path.join(
-        os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
-        ".portage_not_installed",
-    )
-):
-    pym_paths = [
+    if os.path.isfile(
         os.path.join(
-            os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib"
+            os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
+            ".portage_not_installed",
         )
-    ]
-    sys.path.insert(0, pym_paths[0])
-else:
-    import sysconfig
-
-    pym_paths = [
-        os.path.join(sysconfig.get_path("purelib"), x) for x in ("_emerge", "portage")
-    ]
-# Avoid sandbox violations after Python upgrade.
-if os.environ.get("SANDBOX_ON") == "1":
-    sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
-    for pym_path in pym_paths:
-        if pym_path not in sandbox_write:
-            sandbox_write.append(pym_path)
-            os.environ["SANDBOX_WRITE"] = ":".join(filter(None, sandbox_write))
-    del pym_path, sandbox_write
-del pym_paths
+    ):
+        pym_paths = [
+            os.path.join(
+                os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib"
+            )
+        ]
+        sys.path.insert(0, pym_paths[0])
+    else:
+        import sysconfig
 
-import portage
+        pym_paths = [
+            os.path.join(sysconfig.get_path("purelib"), x)
+            for x in ("_emerge", "portage")
+        ]
+    # Avoid sandbox violations after Python upgrade.
+    if os.environ.get("SANDBOX_ON") == "1":
+        sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
+        for pym_path in pym_paths:
+            if pym_path not in sandbox_write:
+                sandbox_write.append(pym_path)
+                os.environ["SANDBOX_WRITE"] = ":".join(filter(None, sandbox_write))
+        del pym_path, sandbox_write
+    del pym_paths
 
-portage._internal_caller = True
-portage._disable_legacy_globals()
+    import portage
 
-from portage.util._eventloop.global_event_loop import global_event_loop
-from _emerge.AbstractPollTask import AbstractPollTask
-from _emerge.PipeReader import PipeReader
+    portage._internal_caller = True
+    portage._disable_legacy_globals()
 
-RETURNCODE_WRITE_FAILED = 2
+    from portage.util._eventloop.global_event_loop import global_event_loop
+    from _emerge.AbstractPollTask import AbstractPollTask
+    from _emerge.PipeReader import PipeReader
 
+    RETURNCODE_WRITE_FAILED = 2
 
-class FifoWriter(AbstractPollTask):
+    class FifoWriter(AbstractPollTask):
 
-    __slots__ = ("buf", "fifo", "_fd")
+        __slots__ = ("buf", "fifo", "_fd")
 
-    def _start(self):
-        try:
-            self._fd = os.open(self.fifo, os.O_WRONLY | os.O_NONBLOCK)
-        except OSError as e:
-            if e.errno == errno.ENXIO:
-                # This happens if the daemon has been killed.
-                self.returncode = RETURNCODE_WRITE_FAILED
-                self._unregister()
-                self._async_wait()
-                return
-            else:
-                raise
-        self.scheduler.add_writer(self._fd, self._output_handler)
-        self._registered = True
-
-    def _output_handler(self):
-        # The whole buf should be able to fit in the fifo with
-        # a single write call, so there's no valid reason for
-        # os.write to raise EAGAIN here.
-        fd = self._fd
-        buf = self.buf
-        while buf:
+        def _start(self):
             try:
-                buf = buf[os.write(fd, buf) :]
-            except OSError:
-                self.returncode = RETURNCODE_WRITE_FAILED
-                self._async_wait()
-                return
-
-        self.returncode = os.EX_OK
-        self._async_wait()
-
-    def _cancel(self):
-        self.returncode = self._cancelled_returncode
-        self._unregister()
-
-    def _unregister(self):
-        self._registered = False
-        if self._fd is not None:
-            self.scheduler.remove_writer(self._fd)
-            os.close(self._fd)
-            self._fd = None
-
+                self._fd = os.open(self.fifo, os.O_WRONLY | os.O_NONBLOCK)
+            except OSError as e:
+                if e.errno == errno.ENXIO:
+                    # This happens if the daemon has been killed.
+                    self.returncode = RETURNCODE_WRITE_FAILED
+                    self._unregister()
+                    self._async_wait()
+                    return
+                else:
+                    raise
+            self.scheduler.add_writer(self._fd, self._output_handler)
+            self._registered = True
+
+        def _output_handler(self):
+            # The whole buf should be able to fit in the fifo with
+            # a single write call, so there's no valid reason for
+            # os.write to raise EAGAIN here.
+            fd = self._fd
+            buf = self.buf
+            while buf:
+                try:
+                    buf = buf[os.write(fd, buf) :]
+                except OSError:
+                    self.returncode = RETURNCODE_WRITE_FAILED
+                    self._async_wait()
+                    return
+
+            self.returncode = os.EX_OK
+            self._async_wait()
+
+        def _cancel(self):
+            self.returncode = self._cancelled_returncode
+            self._unregister()
+
+        def _unregister(self):
+            self._registered = False
+            if self._fd is not None:
+                self.scheduler.remove_writer(self._fd)
+                os.close(self._fd)
+                self._fd = None
+
+    class EbuildIpc:
+
+        # Timeout for each individual communication attempt (we retry
+        # as long as the daemon process appears to be alive).
+        _COMMUNICATE_RETRY_TIMEOUT = 15  # seconds
+
+        def __init__(self):
+            self.fifo_dir = os.environ["PORTAGE_BUILDDIR"]
+            self.ipc_in_fifo = os.path.join(self.fifo_dir, ".ipc", "in")
+            self.ipc_out_fifo = os.path.join(self.fifo_dir, ".ipc", "out")
+            self.ipc_lock_file = os.path.join(self.fifo_dir, ".ipc", "lock")
+
+        def _daemon_is_alive(self):
+            try:
+                builddir_lock = portage.locks.lockfile(
+                    self.fifo_dir, wantnewlockfile=True, flags=os.O_NONBLOCK
+                )
+            except portage.exception.TryAgain:
+                return True
+            else:
+                portage.locks.unlockfile(builddir_lock)
+                return False
 
-class EbuildIpc:
+        def communicate(self, args):
 
-    # Timeout for each individual communication attempt (we retry
-    # as long as the daemon process appears to be alive).
-    _COMMUNICATE_RETRY_TIMEOUT = 15  # seconds
+            # Make locks quiet since unintended locking messages displayed on
+            # stdout could corrupt the intended output of this program.
+            portage.locks._quiet = True
+            lock_obj = portage.locks.lockfile(self.ipc_lock_file, unlinkfile=True)
 
-    def __init__(self):
-        self.fifo_dir = os.environ["PORTAGE_BUILDDIR"]
-        self.ipc_in_fifo = os.path.join(self.fifo_dir, ".ipc", "in")
-        self.ipc_out_fifo = os.path.join(self.fifo_dir, ".ipc", "out")
-        self.ipc_lock_file = os.path.join(self.fifo_dir, ".ipc", "lock")
+            try:
+                return self._communicate(args)
+            finally:
+                portage.locks.unlockfile(lock_obj)
 
-    def _daemon_is_alive(self):
-        try:
-            builddir_lock = portage.locks.lockfile(
-                self.fifo_dir, wantnewlockfile=True, flags=os.O_NONBLOCK
+        def _timeout_retry_msg(self, start_time, when):
+            time_elapsed = time.time() - start_time
+            portage.util.writemsg_level(
+                portage.localization._(
+                    "ebuild-ipc timed out %s after %d seconds," + " retrying...\n"
+                )
+                % (when, time_elapsed),
+                level=logging.ERROR,
+                noiselevel=-1,
             )
-        except portage.exception.TryAgain:
-            return True
-        else:
-            portage.locks.unlockfile(builddir_lock)
-            return False
-
-    def communicate(self, args):
-
-        # Make locks quiet since unintended locking messages displayed on
-        # stdout could corrupt the intended output of this program.
-        portage.locks._quiet = True
-        lock_obj = portage.locks.lockfile(self.ipc_lock_file, unlinkfile=True)
-
-        try:
-            return self._communicate(args)
-        finally:
-            portage.locks.unlockfile(lock_obj)
 
-    def _timeout_retry_msg(self, start_time, when):
-        time_elapsed = time.time() - start_time
-        portage.util.writemsg_level(
-            portage.localization._(
-                "ebuild-ipc timed out %s after %d seconds," + " retrying...\n"
+        def _no_daemon_msg(self):
+            portage.util.writemsg_level(
+                portage.localization._("ebuild-ipc: daemon process not detected\n"),
+                level=logging.ERROR,
+                noiselevel=-1,
             )
-            % (when, time_elapsed),
-            level=logging.ERROR,
-            noiselevel=-1,
-        )
-
-    def _no_daemon_msg(self):
-        portage.util.writemsg_level(
-            portage.localization._("ebuild-ipc: daemon process not detected\n"),
-            level=logging.ERROR,
-            noiselevel=-1,
-        )
-
-    def _run_writer(self, fifo_writer, msg):
-        """
-        Wait on pid and return an appropriate exit code. This
-        may return unsuccessfully due to timeout if the daemon
-        process does not appear to be alive.
-        """
-
-        start_time = time.time()
 
-        fifo_writer.start()
-        eof = fifo_writer.poll() is not None
+        def _run_writer(self, fifo_writer, msg):
+            """
+            Wait on pid and return an appropriate exit code. This
+            may return unsuccessfully due to timeout if the daemon
+            process does not appear to be alive.
+            """
 
-        while not eof:
-            fifo_writer._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT)
+            start_time = time.time()
 
+            fifo_writer.start()
             eof = fifo_writer.poll() is not None
-            if eof:
-                break
-            elif self._daemon_is_alive():
-                self._timeout_retry_msg(start_time, msg)
-            else:
-                fifo_writer.cancel()
-                self._no_daemon_msg()
-                fifo_writer.wait()
-                return 2
-
-        return fifo_writer.wait()
-
-    def _receive_reply(self, input_fd):
 
-        start_time = time.time()
+            while not eof:
+                fifo_writer._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT)
 
-        pipe_reader = PipeReader(
-            input_files={"input_fd": input_fd}, scheduler=global_event_loop()
-        )
-        pipe_reader.start()
-
-        eof = pipe_reader.poll() is not None
-
-        while not eof:
-            pipe_reader._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT)
-            eof = pipe_reader.poll() is not None
-            if not eof:
-                if self._daemon_is_alive():
-                    self._timeout_retry_msg(
-                        start_time, portage.localization._("during read")
-                    )
+                eof = fifo_writer.poll() is not None
+                if eof:
+                    break
+                elif self._daemon_is_alive():
+                    self._timeout_retry_msg(start_time, msg)
                 else:
-                    pipe_reader.cancel()
+                    fifo_writer.cancel()
                     self._no_daemon_msg()
+                    fifo_writer.wait()
                     return 2
 
-        buf = pipe_reader.getvalue()
+            return fifo_writer.wait()
 
-        retval = 2
+        def _receive_reply(self, input_fd):
 
-        if not buf:
+            start_time = time.time()
 
-            portage.util.writemsg_level(
-                "ebuild-ipc: {}\n".format(portage.localization._("read failed")),
-                level=logging.ERROR,
-                noiselevel=-1,
+            pipe_reader = PipeReader(
+                input_files={"input_fd": input_fd}, scheduler=global_event_loop()
             )
+            pipe_reader.start()
 
-        else:
+            eof = pipe_reader.poll() is not None
+
+            while not eof:
+                pipe_reader._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT)
+                eof = pipe_reader.poll() is not None
+                if not eof:
+                    if self._daemon_is_alive():
+                        self._timeout_retry_msg(
+                            start_time, portage.localization._("during read")
+                        )
+                    else:
+                        pipe_reader.cancel()
+                        self._no_daemon_msg()
+                        return 2
+
+            buf = pipe_reader.getvalue()
+
+            retval = 2
+
+            if not buf:
 
-            try:
-                reply = pickle.loads(buf)
-            except SystemExit:
-                raise
-            except Exception as e:
-                # The pickle module can raise practically
-                # any exception when given corrupt data.
                 portage.util.writemsg_level(
-                    "ebuild-ipc: {}\n".format(e), level=logging.ERROR, noiselevel=-1
+                    "ebuild-ipc: {}\n".format(portage.localization._("read failed")),
+                    level=logging.ERROR,
+                    noiselevel=-1,
                 )
 
             else:
 
-                (out, err, retval) = reply
+                try:
+                    reply = pickle.loads(buf)
+                except SystemExit:
+                    raise
+                except Exception as e:
+                    # The pickle module can raise practically
+                    # any exception when given corrupt data.
+                    portage.util.writemsg_level(
+                        "ebuild-ipc: {}\n".format(e), level=logging.ERROR, noiselevel=-1
+                    )
 
-                if out:
-                    portage.util.writemsg_stdout(out, noiselevel=-1)
+                else:
 
-                if err:
-                    portage.util.writemsg(err, noiselevel=-1)
+                    (out, err, retval) = reply
 
-        return retval
+                    if out:
+                        portage.util.writemsg_stdout(out, noiselevel=-1)
 
-    def _communicate(self, args):
+                    if err:
+                        portage.util.writemsg(err, noiselevel=-1)
 
-        if not self._daemon_is_alive():
-            self._no_daemon_msg()
-            return 2
+            return retval
 
-        # Open the input fifo before the output fifo, in order to make it
-        # possible for the daemon to send a reply without blocking. This
-        # improves performance, and also makes it possible for the daemon
-        # to do a non-blocking write without a race condition.
-        input_fd = os.open(self.ipc_out_fifo, os.O_RDONLY | os.O_NONBLOCK)
+        def _communicate(self, args):
 
-        # Use forks so that the child process can handle blocking IO
-        # un-interrupted, while the parent handles all timeout
-        # considerations. This helps to avoid possible race conditions
-        # from interference between timeouts and blocking IO operations.
-        msg = portage.localization._("during write")
-        retval = self._run_writer(
-            FifoWriter(
-                buf=pickle.dumps(args),
-                fifo=self.ipc_in_fifo,
-                scheduler=global_event_loop(),
-            ),
-            msg,
-        )
+            if not self._daemon_is_alive():
+                self._no_daemon_msg()
+                return 2
 
-        if retval != os.EX_OK:
-            portage.util.writemsg_level(
-                "ebuild-ipc: %s: %s\n"
-                % (msg, portage.localization._("subprocess failure: %s") % retval),
-                level=logging.ERROR,
-                noiselevel=-1,
+            # Open the input fifo before the output fifo, in order to make it
+            # possible for the daemon to send a reply without blocking. This
+            # improves performance, and also makes it possible for the daemon
+            # to do a non-blocking write without a race condition.
+            input_fd = os.open(self.ipc_out_fifo, os.O_RDONLY | os.O_NONBLOCK)
+
+            # Use forks so that the child process can handle blocking IO
+            # un-interrupted, while the parent handles all timeout
+            # considerations. This helps to avoid possible race conditions
+            # from interference between timeouts and blocking IO operations.
+            msg = portage.localization._("during write")
+            retval = self._run_writer(
+                FifoWriter(
+                    buf=pickle.dumps(args),
+                    fifo=self.ipc_in_fifo,
+                    scheduler=global_event_loop(),
+                ),
+                msg,
             )
-            return retval
 
-        if not self._daemon_is_alive():
-            self._no_daemon_msg()
-            return 2
+            if retval != os.EX_OK:
+                portage.util.writemsg_level(
+                    "ebuild-ipc: %s: %s\n"
+                    % (msg, portage.localization._("subprocess failure: %s") % retval),
+                    level=logging.ERROR,
+                    noiselevel=-1,
+                )
+                return retval
 
-        return self._receive_reply(input_fd)
+            if not self._daemon_is_alive():
+                self._no_daemon_msg()
+                return 2
 
+            return self._receive_reply(input_fd)
 
-def ebuild_ipc_main(args):
-    ebuild_ipc = EbuildIpc()
-    return ebuild_ipc.communicate(args)
+    def ebuild_ipc_main(args):
+        ebuild_ipc = EbuildIpc()
+        return ebuild_ipc.communicate(args)
 
+    if __name__ == "__main__":
+        try:
+            sys.exit(ebuild_ipc_main(sys.argv[1:]))
+        finally:
+            global_event_loop().close()
 
-if __name__ == "__main__":
-    try:
-        sys.exit(ebuild_ipc_main(sys.argv[1:]))
-    finally:
-        global_event_loop().close()
+except KeyboardInterrupt as e:
+    # Prevent traceback on ^C
+    signum = getattr(e, "signum", signal.SIGINT)
+    signal.signal(signum, signal.SIG_DFL)
+    raise_signal(signum)

diff --git a/bin/egencache b/bin/egencache
index 47c9dd340..5f5664131 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -2,797 +2,807 @@
 # Copyright 2009-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-import argparse
+import os
 import signal
-import stat
-import sys
 
-# This block ensures that ^C interrupts are handled quietly.
-try:
-
-    def exithandler(signum, _frame):
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
-        signal.signal(signal.SIGTERM, signal.SIG_IGN)
-        sys.exit(128 + signum)
+# For compatibility with Python < 3.8
+raise_signal = getattr(
+    signal, "raise_signal", lambda signum: os.kill(os.getpid(), signum)
+)
 
-    signal.signal(signal.SIGINT, exithandler)
-    signal.signal(signal.SIGTERM, exithandler)
+# Inherit from KeyboardInterrupt to avoid a traceback from asyncio.
+class SignalInterrupt(KeyboardInterrupt):
+    def __init__(self, signum):
+        self.signum = signum
 
-except KeyboardInterrupt:
-    sys.exit(128 + signal.SIGINT)
 
+try:
 
-def debug_signal(_signum, _frame):
-    import pdb
+    def signal_interrupt(signum, _frame):
+        raise SignalInterrupt(signum)
 
-    pdb.set_trace()
+    def debug_signal(_signum, _frame):
+        import pdb
 
+        pdb.set_trace()
 
-signal.signal(signal.SIGUSR1, debug_signal)
+    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    signal.signal(signal.SIGTERM, signal_interrupt)
+    signal.signal(signal.SIGUSR1, debug_signal)
 
-import functools
-import logging
-import subprocess
-import time
-import textwrap
-import re
+    import argparse
+    import stat
+    import sys
+    import functools
+    import logging
+    import subprocess
+    import time
+    import textwrap
+    import re
 
-from os import path as osp
+    from os import path as osp
 
-if osp.isfile(
-    osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")
-):
-    sys.path.insert(
-        0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+    if osp.isfile(
+        osp.join(
+            osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed"
+        )
+    ):
+        sys.path.insert(
+            0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+        )
+    import portage
+
+    portage._internal_caller = True
+    from portage import os, _encodings, _unicode_encode, _unicode_decode
+    from portage.cache.cache_errors import CacheError, StatCollision
+    from portage.cache.index.pkg_desc_index import (
+        pkg_desc_index_line_format,
+        pkg_desc_index_line_read,
     )
-import portage
-
-portage._internal_caller = True
-from portage import os, _encodings, _unicode_encode, _unicode_decode
-from portage.cache.cache_errors import CacheError, StatCollision
-from portage.cache.index.pkg_desc_index import (
-    pkg_desc_index_line_format,
-    pkg_desc_index_line_read,
-)
-from portage.const import TIMESTAMP_FORMAT
-from portage.dep import _repo_separator
-from portage.output import colorize, EOutput
-from portage.package.ebuild._parallel_manifest.ManifestScheduler import (
-    ManifestScheduler,
-)
-from portage.util import cmp_sort_key, writemsg_level
-from portage.util._async.AsyncFunction import AsyncFunction
-from portage.util._async.run_main_scheduler import run_main_scheduler
-from portage.util._async.TaskScheduler import TaskScheduler
-from portage.util._eventloop.global_event_loop import global_event_loop
-from portage.util.changelog import ChangeLogTypeSort
-from portage import cpv_getkey
-from portage.dep import Atom, isjustname
-from portage.versions import vercmp
-from _emerge.MetadataRegen import MetadataRegen
+    from portage.const import TIMESTAMP_FORMAT
+    from portage.dep import _repo_separator
+    from portage.output import colorize, EOutput
+    from portage.package.ebuild._parallel_manifest.ManifestScheduler import (
+        ManifestScheduler,
+    )
+    from portage.util import cmp_sort_key, writemsg_level
+    from portage.util._async.AsyncFunction import AsyncFunction
+    from portage.util._async.run_main_scheduler import run_main_scheduler
+    from portage.util._async.TaskScheduler import TaskScheduler
+    from portage.util._eventloop.global_event_loop import global_event_loop
+    from portage.util.changelog import ChangeLogTypeSort
+    from portage import cpv_getkey
+    from portage.dep import Atom, isjustname
+    from portage.versions import vercmp
+    from _emerge.MetadataRegen import MetadataRegen
 
-try:
-    from xml.etree import ElementTree
-except ImportError:
-    pass
-else:
     try:
-        from xml.parsers.expat import ExpatError
+        from xml.etree import ElementTree
     except ImportError:
         pass
     else:
-        from portage.xml.metadata import (  # pylint: disable=ungrouped-imports
-            parse_metadata_use,
-        )
-
-
-def parse_args(args):
-    usage = "egencache [options] <action> ... [atom] ..."
-    parser = argparse.ArgumentParser(usage=usage)
+        try:
+            from xml.parsers.expat import ExpatError
+        except ImportError:
+            pass
+        else:
+            from portage.xml.metadata import (  # pylint: disable=ungrouped-imports
+                parse_metadata_use,
+            )
 
-    actions = parser.add_argument_group("Actions")
-    actions.add_argument(
-        "--update",
-        action="store_true",
-        help="update metadata/md5-cache/ (generate as necessary)",
-    )
-    actions.add_argument(
-        "--update-use-local-desc",
-        action="store_true",
-        help="update the use.local.desc file from metadata.xml",
-    )
-    actions.add_argument(
-        "--update-changelogs",
-        action="store_true",
-        help="update the ChangeLog files from SCM logs",
-    )
-    actions.add_argument(
-        "--update-pkg-desc-index",
-        action="store_true",
-        help="update package description index",
-    )
-    actions.add_argument(
-        "--update-manifests", action="store_true", help="update manifests"
-    )
+    def parse_args(args):
+        usage = "egencache [options] <action> ... [atom] ..."
+        parser = argparse.ArgumentParser(usage=usage)
 
-    common = parser.add_argument_group("Common options")
-    common.add_argument("--repo", action="store", help="name of repo to operate on")
-    common.add_argument(
-        "--config-root",
-        help="location of portage config files",
-        dest="portage_configroot",
-    )
-    common.add_argument(
-        "--external-cache-only",
-        action="store_true",
-        help="Output only to the external cache (not the repository itself)",
-    )
-    common.add_argument(
-        "--gpg-dir", help="override the PORTAGE_GPG_DIR variable", dest="gpg_dir"
-    )
-    common.add_argument(
-        "--gpg-key", help="override the PORTAGE_GPG_KEY variable", dest="gpg_key"
-    )
-    common.add_argument(
-        "--repositories-configuration",
-        help="override configuration of repositories (in format of repos.conf)",
-        dest="repositories_configuration",
-    )
-    common.add_argument(
-        "--sign-manifests",
-        choices=("y", "n"),
-        metavar="<y|n>",
-        help="manually override layout.conf sign-manifests setting",
-    )
-    common.add_argument(
-        "--strict-manifests",
-        choices=("y", "n"),
-        metavar="<y|n>",
-        help='manually override "strict" FEATURES setting',
-    )
-    common.add_argument(
-        "--thin-manifests",
-        choices=("y", "n"),
-        metavar="<y|n>",
-        help="manually override layout.conf thin-manifests setting",
-    )
-    common.add_argument(
-        "--tolerant",
-        action="store_true",
-        help="exit successfully if only minor errors occurred",
-    )
-    common.add_argument(
-        "--ignore-default-opts",
-        action="store_true",
-        help="do not use the EGENCACHE_DEFAULT_OPTS environment variable",
-    )
-    common.add_argument(
-        "-v", "--verbose", action="count", default=0, help="increase verbosity"
-    )
-    common.add_argument(
-        "--write-timestamp",
-        action="store_true",
-        help="write metadata/timestamp.chk as required for rsync repositories",
-    )
+        actions = parser.add_argument_group("Actions")
+        actions.add_argument(
+            "--update",
+            action="store_true",
+            help="update metadata/md5-cache/ (generate as necessary)",
+        )
+        actions.add_argument(
+            "--update-use-local-desc",
+            action="store_true",
+            help="update the use.local.desc file from metadata.xml",
+        )
+        actions.add_argument(
+            "--update-changelogs",
+            action="store_true",
+            help="update the ChangeLog files from SCM logs",
+        )
+        actions.add_argument(
+            "--update-pkg-desc-index",
+            action="store_true",
+            help="update package description index",
+        )
+        actions.add_argument(
+            "--update-manifests", action="store_true", help="update manifests"
+        )
 
-    update = parser.add_argument_group("--update options")
-    update.add_argument(
-        "--cache-dir", help="location of the metadata cache", dest="cache_dir"
-    )
-    update.add_argument(
-        "-j", "--jobs", type=int, action="store", help="max ebuild processes to spawn"
-    )
-    update.add_argument(
-        "--load-average",
-        type=float,
-        action="store",
-        help="max load allowed when spawning multiple jobs",
-        dest="load_average",
-    )
-    update.add_argument(
-        "--rsync",
-        action="store_true",
-        help="enable rsync stat collision workaround "
-        + "for bug 139134 (use with --update)",
-    )
+        common = parser.add_argument_group("Common options")
+        common.add_argument("--repo", action="store", help="name of repo to operate on")
+        common.add_argument(
+            "--config-root",
+            help="location of portage config files",
+            dest="portage_configroot",
+        )
+        common.add_argument(
+            "--external-cache-only",
+            action="store_true",
+            help="Output only to the external cache (not the repository itself)",
+        )
+        common.add_argument(
+            "--gpg-dir", help="override the PORTAGE_GPG_DIR variable", dest="gpg_dir"
+        )
+        common.add_argument(
+            "--gpg-key", help="override the PORTAGE_GPG_KEY variable", dest="gpg_key"
+        )
+        common.add_argument(
+            "--repositories-configuration",
+            help="override configuration of repositories (in format of repos.conf)",
+            dest="repositories_configuration",
+        )
+        common.add_argument(
+            "--sign-manifests",
+            choices=("y", "n"),
+            metavar="<y|n>",
+            help="manually override layout.conf sign-manifests setting",
+        )
+        common.add_argument(
+            "--strict-manifests",
+            choices=("y", "n"),
+            metavar="<y|n>",
+            help='manually override "strict" FEATURES setting',
+        )
+        common.add_argument(
+            "--thin-manifests",
+            choices=("y", "n"),
+            metavar="<y|n>",
+            help="manually override layout.conf thin-manifests setting",
+        )
+        common.add_argument(
+            "--tolerant",
+            action="store_true",
+            help="exit successfully if only minor errors occurred",
+        )
+        common.add_argument(
+            "--ignore-default-opts",
+            action="store_true",
+            help="do not use the EGENCACHE_DEFAULT_OPTS environment variable",
+        )
+        common.add_argument(
+            "-v", "--verbose", action="count", default=0, help="increase verbosity"
+        )
+        common.add_argument(
+            "--write-timestamp",
+            action="store_true",
+            help="write metadata/timestamp.chk as required for rsync repositories",
+        )
 
-    uld = parser.add_argument_group("--update-use-local-desc options")
-    uld.add_argument(
-        "--preserve-comments",
-        action="store_true",
-        help="preserve the comments from the existing use.local.desc file",
-    )
-    uld.add_argument(
-        "--use-local-desc-output",
-        help="output file for use.local.desc data (or '-' for stdout)",
-        dest="uld_output",
-    )
+        update = parser.add_argument_group("--update options")
+        update.add_argument(
+            "--cache-dir", help="location of the metadata cache", dest="cache_dir"
+        )
+        update.add_argument(
+            "-j",
+            "--jobs",
+            type=int,
+            action="store",
+            help="max ebuild processes to spawn",
+        )
+        update.add_argument(
+            "--load-average",
+            type=float,
+            action="store",
+            help="max load allowed when spawning multiple jobs",
+            dest="load_average",
+        )
+        update.add_argument(
+            "--rsync",
+            action="store_true",
+            help="enable rsync stat collision workaround "
+            + "for bug 139134 (use with --update)",
+        )
 
-    uc = parser.add_argument_group("--update-changelogs options")
-    uc.add_argument(
-        "--changelog-reversed",
-        action="store_true",
-        help="log commits in reverse order (oldest first)",
-    )
-    uc.add_argument(
-        "--changelog-output",
-        help="output filename for change logs",
-        dest="changelog_output",
-        default="ChangeLog",
-    )
+        uld = parser.add_argument_group("--update-use-local-desc options")
+        uld.add_argument(
+            "--preserve-comments",
+            action="store_true",
+            help="preserve the comments from the existing use.local.desc file",
+        )
+        uld.add_argument(
+            "--use-local-desc-output",
+            help="output file for use.local.desc data (or '-' for stdout)",
+            dest="uld_output",
+        )
 
-    options, args = parser.parse_known_args(args)
+        uc = parser.add_argument_group("--update-changelogs options")
+        uc.add_argument(
+            "--changelog-reversed",
+            action="store_true",
+            help="log commits in reverse order (oldest first)",
+        )
+        uc.add_argument(
+            "--changelog-output",
+            help="output filename for change logs",
+            dest="changelog_output",
+            default="ChangeLog",
+        )
 
-    if options.jobs:
-        jobs = None
-        try:
-            jobs = int(options.jobs)
-        except ValueError:
-            jobs = -1
+        options, args = parser.parse_known_args(args)
 
-        if jobs < 1:
-            parser.error("Invalid: --jobs='{}'".format(options.jobs))
+        if options.jobs:
+            jobs = None
+            try:
+                jobs = int(options.jobs)
+            except ValueError:
+                jobs = -1
 
-        options.jobs = jobs
+            if jobs < 1:
+                parser.error("Invalid: --jobs='{}'".format(options.jobs))
 
-    else:
-        options.jobs = None
+            options.jobs = jobs
 
-    if options.load_average:
-        try:
-            load_average = float(options.load_average)
-        except ValueError:
-            load_average = 0.0
+        else:
+            options.jobs = None
 
-        if load_average <= 0.0:
-            parser.error("Invalid: --load-average='{}'".format(options.load_average))
+        if options.load_average:
+            try:
+                load_average = float(options.load_average)
+            except ValueError:
+                load_average = 0.0
 
-        options.load_average = load_average
+            if load_average <= 0.0:
+                parser.error(
+                    "Invalid: --load-average='{}'".format(options.load_average)
+                )
 
-    else:
-        options.load_average = None
+            options.load_average = load_average
 
-    options.config_root = options.portage_configroot
-    if options.config_root is not None and not os.path.isdir(options.config_root):
-        parser.error("Not a directory: --config-root='{}'".format(options.config_root))
+        else:
+            options.load_average = None
 
-    if options.cache_dir is not None:
-        if not os.path.isdir(options.cache_dir):
-            parser.error("Not a directory: --cache-dir='{}'".format(options.cache_dir))
-        if not os.access(options.cache_dir, os.W_OK):
+        options.config_root = options.portage_configroot
+        if options.config_root is not None and not os.path.isdir(options.config_root):
             parser.error(
-                "Write access denied: --cache-dir='{}'".format(options.cache_dir)
+                "Not a directory: --config-root='{}'".format(options.config_root)
             )
 
-    for atom in args:
-        try:
-            atom = portage.dep.Atom(atom)
-        except portage.exception.InvalidAtom:
-            parser.error("Invalid atom: {}".format(atom))
-
-        if not isjustname(atom):
-            parser.error("Atom is too specific: {}".format(atom))
-
-    if options.update_use_local_desc:
-        try:
-            ElementTree
-            ExpatError
-        except NameError:
-            parser.error("--update-use-local-desc requires python with USE=xml!")
-
-    if options.uld_output == "-" and options.preserve_comments:
-        parser.error("--preserve-comments can not be used when outputting to stdout")
-
-    return parser, options, args
-
-
-class GenCache:
-    def __init__(
-        self,
-        portdb,
-        cp_iter=None,
-        max_jobs=None,
-        max_load=None,
-        rsync=False,
-        external_cache_only=False,
-    ):
-        # The caller must set portdb.porttrees in order to constrain
-        # findname, cp_list, and cpv_list to the desired tree.
-        tree = portdb.porttrees[0]
-        self._portdb = portdb
-        self._eclass_db = portdb.repositories.get_repo_for_location(tree).eclass_db
-        self._auxdbkeys = portdb._known_keys
-        # We can globally cleanse stale cache only if we
-        # iterate over every single cp.
-        self._global_cleanse = cp_iter is None
-        if cp_iter is not None:
-            self._cp_set = set(cp_iter)
-            cp_iter = iter(self._cp_set)
-            self._cp_missing = self._cp_set.copy()
-        else:
-            self._cp_set = None
-            self._cp_missing = set()
-        write_auxdb = (
-            external_cache_only or "metadata-transfer" in portdb.settings.features
-        )
-        self._regen = MetadataRegen(
-            portdb,
-            cp_iter=cp_iter,
-            consumer=self._metadata_callback,
-            max_jobs=max_jobs,
-            max_load=max_load,
-            write_auxdb=write_auxdb,
-            main=True,
-        )
-        self.returncode = os.EX_OK
-        conf = portdb.repositories.get_repo_for_location(tree)
-        if external_cache_only:
-            self._trg_caches = ()
-        else:
-            self._trg_caches = tuple(
-                conf.iter_pregenerated_caches(
-                    self._auxdbkeys, force=True, readonly=False
+        if options.cache_dir is not None:
+            if not os.path.isdir(options.cache_dir):
+                parser.error(
+                    "Not a directory: --cache-dir='{}'".format(options.cache_dir)
                 )
-            )
-            if not self._trg_caches:
-                raise Exception(
-                    "cache formats '%s' aren't supported"
-                    % (" ".join(conf.cache_formats),)
+            if not os.access(options.cache_dir, os.W_OK):
+                parser.error(
+                    "Write access denied: --cache-dir='{}'".format(options.cache_dir)
                 )
 
-        if rsync:
-            for trg_cache in self._trg_caches:
-                if hasattr(trg_cache, "raise_stat_collision"):
-                    trg_cache.raise_stat_collision = True
-                    # Make _metadata_callback write this cache first, in case
-                    # it raises a StatCollision and triggers mtime
-                    # modification.
-                    self._trg_caches = tuple(
-                        [trg_cache]
-                        + [x for x in self._trg_caches if x is not trg_cache]
-                    )
+        for atom in args:
+            try:
+                atom = portage.dep.Atom(atom)
+            except portage.exception.InvalidAtom:
+                parser.error("Invalid atom: {}".format(atom))
 
-        self._existing_nodes = set()
+            if not isjustname(atom):
+                parser.error("Atom is too specific: {}".format(atom))
 
-    def _metadata_callback(self, cpv, repo_path, metadata, ebuild_hash, eapi_supported):
-        self._existing_nodes.add(cpv)
-        self._cp_missing.discard(cpv_getkey(cpv))
+        if options.update_use_local_desc:
+            try:
+                ElementTree
+                ExpatError
+            except NameError:
+                parser.error("--update-use-local-desc requires python with USE=xml!")
 
-        # Since we're supposed to be able to efficiently obtain the
-        # EAPI from _parse_eapi_ebuild_head, we don't write cache
-        # entries for unsupported EAPIs.
-        if metadata is not None and eapi_supported:
-            for trg_cache in self._trg_caches:
-                self._write_cache(trg_cache, cpv, repo_path, metadata, ebuild_hash)
+        if options.uld_output == "-" and options.preserve_comments:
+            parser.error(
+                "--preserve-comments can not be used when outputting to stdout"
+            )
 
-    def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
+        return parser, options, args
 
-        if not hasattr(trg_cache, "raise_stat_collision"):
-            # This cache does not avoid redundant writes automatically,
-            # so check for an identical existing entry before writing.
-            # This prevents unnecessary disk writes and can also prevent
-            # unnecessary rsync transfers.
-            try:
-                dest = trg_cache[cpv]
-            except (KeyError, CacheError):
-                pass
+    class GenCache:
+        def __init__(
+            self,
+            portdb,
+            cp_iter=None,
+            max_jobs=None,
+            max_load=None,
+            rsync=False,
+            external_cache_only=False,
+        ):
+            # The caller must set portdb.porttrees in order to constrain
+            # findname, cp_list, and cpv_list to the desired tree.
+            tree = portdb.porttrees[0]
+            self._portdb = portdb
+            self._eclass_db = portdb.repositories.get_repo_for_location(tree).eclass_db
+            self._auxdbkeys = portdb._known_keys
+            # We can globally cleanse stale cache only if we
+            # iterate over every single cp.
+            self._global_cleanse = cp_iter is None
+            if cp_iter is not None:
+                self._cp_set = set(cp_iter)
+                cp_iter = iter(self._cp_set)
+                self._cp_missing = self._cp_set.copy()
             else:
-                if trg_cache.validate_entry(dest, ebuild_hash, self._eclass_db):
-                    identical = True
-                    for k in self._auxdbkeys:
-                        if dest.get(k, "") != metadata.get(k, ""):
-                            identical = False
-                            break
-                    if identical:
-                        return
-
-        try:
-            chf = trg_cache.validation_chf
-            metadata["_%s_" % chf] = getattr(ebuild_hash, chf)
-            try:
-                trg_cache[cpv] = metadata
-            except StatCollision as sc:
-                # If the content of a cache entry changes and neither the
-                # file mtime nor size changes, it will prevent rsync from
-                # detecting changes. Cache backends may raise this
-                # exception from _setitem() if they detect this type of stat
-                # collision. These exceptions are handled by bumping the
-                # mtime on the ebuild (and the corresponding cache entry).
-                # See bug #139134. It is convenient to include checks for
-                # redundant writes along with the internal StatCollision
-                # detection code, so for caches with the
-                # raise_stat_collision attribute, we do not need to
-                # explicitly check for redundant writes like we do for the
-                # other cache types above.
-                max_mtime = sc.mtime
-                for _ec, ec_hash in metadata["_eclasses_"].items():
-                    if max_mtime < ec_hash.mtime:
-                        max_mtime = ec_hash.mtime
-                if max_mtime == sc.mtime:
-                    max_mtime += 1
-                max_mtime = int(max_mtime)
-                try:
-                    os.utime(ebuild_hash.location, (max_mtime, max_mtime))
-                except OSError as e:
-                    self.returncode |= 1
-                    writemsg_level(
-                        "{} writing target: {}\n".format(cpv, e),
-                        level=logging.ERROR,
-                        noiselevel=-1,
-                    )
-                else:
-                    ebuild_hash.mtime = max_mtime
-                    metadata["_mtime_"] = max_mtime
-                    trg_cache[cpv] = metadata
-                    self._portdb.auxdb[repo_path][cpv] = metadata
-
-        except CacheError as ce:
-            self.returncode |= 1
-            writemsg_level(
-                "{} writing target: {}\n".format(cpv, ce),
-                level=logging.ERROR,
-                noiselevel=-1,
+                self._cp_set = None
+                self._cp_missing = set()
+            write_auxdb = (
+                external_cache_only or "metadata-transfer" in portdb.settings.features
+            )
+            self._regen = MetadataRegen(
+                portdb,
+                cp_iter=cp_iter,
+                consumer=self._metadata_callback,
+                max_jobs=max_jobs,
+                max_load=max_load,
+                write_auxdb=write_auxdb,
+                main=True,
             )
+            self.returncode = os.EX_OK
+            conf = portdb.repositories.get_repo_for_location(tree)
+            if external_cache_only:
+                self._trg_caches = ()
+            else:
+                self._trg_caches = tuple(
+                    conf.iter_pregenerated_caches(
+                        self._auxdbkeys, force=True, readonly=False
+                    )
+                )
+                if not self._trg_caches:
+                    raise Exception(
+                        "cache formats '%s' aren't supported"
+                        % (" ".join(conf.cache_formats),)
+                    )
 
-    def run(self):
-        signum = run_main_scheduler(self._regen)
-        if signum is not None:
-            sys.exit(128 + signum)
+            if rsync:
+                for trg_cache in self._trg_caches:
+                    if hasattr(trg_cache, "raise_stat_collision"):
+                        trg_cache.raise_stat_collision = True
+                        # Make _metadata_callback write this cache first, in case
+                        # it raises a StatCollision and triggers mtime
+                        # modification.
+                        self._trg_caches = tuple(
+                            [trg_cache]
+                            + [x for x in self._trg_caches if x is not trg_cache]
+                        )
 
-        self.returncode |= self._regen.returncode
+            self._existing_nodes = set()
 
-        for trg_cache in self._trg_caches:
-            self._cleanse_cache(trg_cache)
+        def _metadata_callback(
+            self, cpv, repo_path, metadata, ebuild_hash, eapi_supported
+        ):
+            self._existing_nodes.add(cpv)
+            self._cp_missing.discard(cpv_getkey(cpv))
+
+            # Since we're supposed to be able to efficiently obtain the
+            # EAPI from _parse_eapi_ebuild_head, we don't write cache
+            # entries for unsupported EAPIs.
+            if metadata is not None and eapi_supported:
+                for trg_cache in self._trg_caches:
+                    self._write_cache(trg_cache, cpv, repo_path, metadata, ebuild_hash)
+
+        def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
+
+            if not hasattr(trg_cache, "raise_stat_collision"):
+                # This cache does not avoid redundant writes automatically,
+                # so check for an identical existing entry before writing.
+                # This prevents unnecessary disk writes and can also prevent
+                # unnecessary rsync transfers.
+                try:
+                    dest = trg_cache[cpv]
+                except (KeyError, CacheError):
+                    pass
+                else:
+                    if trg_cache.validate_entry(dest, ebuild_hash, self._eclass_db):
+                        identical = True
+                        for k in self._auxdbkeys:
+                            if dest.get(k, "") != metadata.get(k, ""):
+                                identical = False
+                                break
+                        if identical:
+                            return
 
-    def _cleanse_cache(self, trg_cache):
-        cp_missing = self._cp_missing
-        dead_nodes = set()
-        if self._global_cleanse:
             try:
-                for cpv in trg_cache:
-                    cp = cpv_getkey(cpv)
-                    if cp is None:
+                chf = trg_cache.validation_chf
+                metadata["_%s_" % chf] = getattr(ebuild_hash, chf)
+                try:
+                    trg_cache[cpv] = metadata
+                except StatCollision as sc:
+                    # If the content of a cache entry changes and neither the
+                    # file mtime nor size changes, it will prevent rsync from
+                    # detecting changes. Cache backends may raise this
+                    # exception from _setitem() if they detect this type of stat
+                    # collision. These exceptions are handled by bumping the
+                    # mtime on the ebuild (and the corresponding cache entry).
+                    # See bug #139134. It is convenient to include checks for
+                    # redundant writes along with the internal StatCollision
+                    # detection code, so for caches with the
+                    # raise_stat_collision attribute, we do not need to
+                    # explicitly check for redundant writes like we do for the
+                    # other cache types above.
+                    max_mtime = sc.mtime
+                    for _ec, ec_hash in metadata["_eclasses_"].items():
+                        if max_mtime < ec_hash.mtime:
+                            max_mtime = ec_hash.mtime
+                    if max_mtime == sc.mtime:
+                        max_mtime += 1
+                    max_mtime = int(max_mtime)
+                    try:
+                        os.utime(ebuild_hash.location, (max_mtime, max_mtime))
+                    except OSError as e:
                         self.returncode |= 1
                         writemsg_level(
-                            "Unable to parse cp for '{}'\n".format(cpv),
+                            "{} writing target: {}\n".format(cpv, e),
                             level=logging.ERROR,
                             noiselevel=-1,
                         )
                     else:
-                        dead_nodes.add(cpv)
+                        ebuild_hash.mtime = max_mtime
+                        metadata["_mtime_"] = max_mtime
+                        trg_cache[cpv] = metadata
+                        self._portdb.auxdb[repo_path][cpv] = metadata
+
             except CacheError as ce:
                 self.returncode |= 1
                 writemsg_level(
-                    "Error listing cache entries for "
-                    + "'{}': {}, continuing...\n".format(trg_cache.location, ce),
+                    "{} writing target: {}\n".format(cpv, ce),
                     level=logging.ERROR,
                     noiselevel=-1,
                 )
 
-        else:
-            cp_set = self._cp_set
-            try:
-                for cpv in trg_cache:
-                    cp = cpv_getkey(cpv)
-                    if cp is None:
+        def run(self):
+            signum = run_main_scheduler(self._regen)
+            if signum is not None:
+                sys.exit(128 + signum)
+
+            self.returncode |= self._regen.returncode
+
+            for trg_cache in self._trg_caches:
+                self._cleanse_cache(trg_cache)
+
+        def _cleanse_cache(self, trg_cache):
+            cp_missing = self._cp_missing
+            dead_nodes = set()
+            if self._global_cleanse:
+                try:
+                    for cpv in trg_cache:
+                        cp = cpv_getkey(cpv)
+                        if cp is None:
+                            self.returncode |= 1
+                            writemsg_level(
+                                "Unable to parse cp for '{}'\n".format(cpv),
+                                level=logging.ERROR,
+                                noiselevel=-1,
+                            )
+                        else:
+                            dead_nodes.add(cpv)
+                except CacheError as ce:
+                    self.returncode |= 1
+                    writemsg_level(
+                        "Error listing cache entries for "
+                        + "'{}': {}, continuing...\n".format(trg_cache.location, ce),
+                        level=logging.ERROR,
+                        noiselevel=-1,
+                    )
+
+            else:
+                cp_set = self._cp_set
+                try:
+                    for cpv in trg_cache:
+                        cp = cpv_getkey(cpv)
+                        if cp is None:
+                            self.returncode |= 1
+                            writemsg_level(
+                                "Unable to parse cp for '{}'\n".format(cpv),
+                                level=logging.ERROR,
+                                noiselevel=-1,
+                            )
+                        else:
+                            cp_missing.discard(cp)
+                            if cp in cp_set:
+                                dead_nodes.add(cpv)
+                except CacheError as ce:
+                    self.returncode |= 1
+                    writemsg_level(
+                        "Error listing cache entries for "
+                        + "'{}': {}, continuing...\n".format(trg_cache.location, ce),
+                        level=logging.ERROR,
+                        noiselevel=-1,
+                    )
+
+            if cp_missing:
+                self.returncode |= 1
+                for cp in sorted(cp_missing):
+                    writemsg_level(
+                        "No ebuilds or cache entries found for '{}'\n".format(cp),
+                        level=logging.ERROR,
+                        noiselevel=-1,
+                    )
+
+            if dead_nodes:
+                dead_nodes.difference_update(self._existing_nodes)
+                for k in dead_nodes:
+                    try:
+                        del trg_cache[k]
+                    except KeyError:
+                        pass
+                    except CacheError as ce:
                         self.returncode |= 1
                         writemsg_level(
-                            "Unable to parse cp for '{}'\n".format(cpv),
+                            "{} deleting stale cache: {}\n".format(k, ce),
                             level=logging.ERROR,
                             noiselevel=-1,
                         )
-                    else:
-                        cp_missing.discard(cp)
-                        if cp in cp_set:
-                            dead_nodes.add(cpv)
-            except CacheError as ce:
-                self.returncode |= 1
-                writemsg_level(
-                    "Error listing cache entries for "
-                    + "'{}': {}, continuing...\n".format(trg_cache.location, ce),
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
-
-        if cp_missing:
-            self.returncode |= 1
-            for cp in sorted(cp_missing):
-                writemsg_level(
-                    "No ebuilds or cache entries found for '{}'\n".format(cp),
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
 
-        if dead_nodes:
-            dead_nodes.difference_update(self._existing_nodes)
-            for k in dead_nodes:
+            if not trg_cache.autocommits:
                 try:
-                    del trg_cache[k]
-                except KeyError:
-                    pass
+                    trg_cache.commit()
                 except CacheError as ce:
                     self.returncode |= 1
                     writemsg_level(
-                        "{} deleting stale cache: {}\n".format(k, ce),
+                        "committing target: {}\n".format(ce),
                         level=logging.ERROR,
                         noiselevel=-1,
                     )
 
-        if not trg_cache.autocommits:
-            try:
-                trg_cache.commit()
-            except CacheError as ce:
-                self.returncode |= 1
-                writemsg_level(
-                    "committing target: {}\n".format(ce),
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
+            if hasattr(trg_cache, "_prune_empty_dirs"):
+                trg_cache._prune_empty_dirs()
 
-        if hasattr(trg_cache, "_prune_empty_dirs"):
-            trg_cache._prune_empty_dirs()
+    class GenPkgDescIndex:
+        def __init__(self, repo_config, portdb, output_file, verbose=False):
+            self.returncode = os.EX_OK
+            self._repo_config = repo_config
+            self._portdb = portdb
+            self._output_file = output_file
+            self._verbose = verbose
 
+        def run(self):
 
-class GenPkgDescIndex:
-    def __init__(self, repo_config, portdb, output_file, verbose=False):
-        self.returncode = os.EX_OK
-        self._repo_config = repo_config
-        self._portdb = portdb
-        self._output_file = output_file
-        self._verbose = verbose
+            display_updates = self._verbose > 0
+            old = {}
+            new = {}
+            if display_updates:
+                try:
+                    with open(
+                        self._output_file, encoding=_encodings["repo.content"]
+                    ) as f:
+                        for line in f:
+                            pkg_desc = pkg_desc_index_line_read(line)
+                            old[pkg_desc.cp] = pkg_desc
+                except FileNotFoundError:
+                    pass
 
-    def run(self):
+            portage.util.ensure_dirs(os.path.dirname(self._output_file))
+            f = portage.util.atomic_ofstream(
+                self._output_file, encoding=_encodings["repo.content"]
+            )
 
-        display_updates = self._verbose > 0
-        old = {}
-        new = {}
-        if display_updates:
-            try:
-                with open(self._output_file, encoding=_encodings["repo.content"]) as f:
-                    for line in f:
-                        pkg_desc = pkg_desc_index_line_read(line)
-                        old[pkg_desc.cp] = pkg_desc
-            except FileNotFoundError:
-                pass
+            portdb = self._portdb
+            for cp in portdb.cp_all():
+                pkgs = portdb.cp_list(cp)
+                if not pkgs:
+                    continue
+                (desc,) = portdb.aux_get(pkgs[-1], ["DESCRIPTION"])
 
-        portage.util.ensure_dirs(os.path.dirname(self._output_file))
-        f = portage.util.atomic_ofstream(
-            self._output_file, encoding=_encodings["repo.content"]
-        )
+                line = pkg_desc_index_line_format(cp, pkgs, desc)
+                f.write(line)
+                if display_updates:
+                    new[cp] = pkg_desc_index_line_read(line)
 
-        portdb = self._portdb
-        for cp in portdb.cp_all():
-            pkgs = portdb.cp_list(cp)
-            if not pkgs:
-                continue
-            (desc,) = portdb.aux_get(pkgs[-1], ["DESCRIPTION"])
+            f.close()
 
-            line = pkg_desc_index_line_format(cp, pkgs, desc)
-            f.write(line)
             if display_updates:
-                new[cp] = pkg_desc_index_line_read(line)
-
-        f.close()
-
-        if display_updates:
-            out = EOutput()
-            out.einfo("Searching for changes")
-            print("")
-            items = sorted(new.values(), key=lambda pkg_desc: pkg_desc.cp)
-            haspkgs = False
-            for pkg_desc in items:
-                masked = False
-                version = self._portdb.xmatch(
-                    "bestmatch-visible",
-                    Atom(
-                        "{}{}{}".format(
-                            pkg_desc.cp, _repo_separator, self._repo_config.name
-                        )
-                    ),
-                )
-                if not version:
-                    version = pkg_desc.cpv_list[-1]
-                    masked = True
-                old_versions = old.get(pkg_desc.cp)
-                if old_versions is None or version not in old_versions.cpv_list:
-                    prefix0 = " "
-                    prefix1 = " "
-
-                    if old_versions is None:
-                        color = functools.partial(colorize, "darkgreen")
-                        prefix1 = "N"
-                    else:
-                        color = functools.partial(colorize, "turquoise")
-                        prefix1 = "U"
-
-                    if masked:
-                        prefix0 = "M"
-
-                    print(
-                        " [%s%s] %s (%s):  %s"
-                        % (
-                            colorize("red", prefix0),
-                            color(prefix1),
-                            colorize("bold", pkg_desc.cp),
-                            color(version[len(pkg_desc.cp) + 1 :]),
-                            pkg_desc.desc,
-                        )
+                out = EOutput()
+                out.einfo("Searching for changes")
+                print("")
+                items = sorted(new.values(), key=lambda pkg_desc: pkg_desc.cp)
+                haspkgs = False
+                for pkg_desc in items:
+                    masked = False
+                    version = self._portdb.xmatch(
+                        "bestmatch-visible",
+                        Atom(
+                            "{}{}{}".format(
+                                pkg_desc.cp, _repo_separator, self._repo_config.name
+                            )
+                        ),
                     )
-                    haspkgs = True
-
-            if not haspkgs:
-                out.einfo("No updates found")
-
+                    if not version:
+                        version = pkg_desc.cpv_list[-1]
+                        masked = True
+                    old_versions = old.get(pkg_desc.cp)
+                    if old_versions is None or version not in old_versions.cpv_list:
+                        prefix0 = " "
+                        prefix1 = " "
+
+                        if old_versions is None:
+                            color = functools.partial(colorize, "darkgreen")
+                            prefix1 = "N"
+                        else:
+                            color = functools.partial(colorize, "turquoise")
+                            prefix1 = "U"
 
-class GenUseLocalDesc:
-    def __init__(self, portdb, output=None, preserve_comments=False):
-        self.returncode = os.EX_OK
-        self._portdb = portdb
-        self._output = output
-        self._preserve_comments = preserve_comments
+                        if masked:
+                            prefix0 = "M"
 
-    def run(self):
-        repo_path = self._portdb.porttrees[0]
-        ops = {"<": 0, "<=": 1, "=": 2, ">=": 3, ">": 4}
-        prev_mtime = None
-        prev_md5 = None
+                        print(
+                            " [%s%s] %s (%s):  %s"
+                            % (
+                                colorize("red", prefix0),
+                                color(prefix1),
+                                colorize("bold", pkg_desc.cp),
+                                color(version[len(pkg_desc.cp) + 1 :]),
+                                pkg_desc.desc,
+                            )
+                        )
+                        haspkgs = True
+
+                if not haspkgs:
+                    out.einfo("No updates found")
+
+    class GenUseLocalDesc:
+        def __init__(self, portdb, output=None, preserve_comments=False):
+            self.returncode = os.EX_OK
+            self._portdb = portdb
+            self._output = output
+            self._preserve_comments = preserve_comments
+
+        def run(self):
+            repo_path = self._portdb.porttrees[0]
+            ops = {"<": 0, "<=": 1, "=": 2, ">=": 3, ">": 4}
+            prev_mtime = None
+            prev_md5 = None
+
+            if self._output is None or self._output != "-":
+                if self._output is None:
+                    prof_path = os.path.join(repo_path, "profiles")
+                    desc_path = os.path.join(prof_path, "use.local.desc")
+                    try:
+                        os.mkdir(prof_path)
+                    except OSError:
+                        pass
+                else:
+                    desc_path = self._output
 
-        if self._output is None or self._output != "-":
-            if self._output is None:
-                prof_path = os.path.join(repo_path, "profiles")
-                desc_path = os.path.join(prof_path, "use.local.desc")
                 try:
-                    os.mkdir(prof_path)
-                except OSError:
+                    prev_md5 = portage.checksum.perform_md5(desc_path)
+                    prev_mtime = os.stat(desc_path)[stat.ST_MTIME]
+                except (portage.exception.FileNotFound, OSError):
                     pass
-            else:
-                desc_path = self._output
 
-            try:
-                prev_md5 = portage.checksum.perform_md5(desc_path)
-                prev_mtime = os.stat(desc_path)[stat.ST_MTIME]
-            except (portage.exception.FileNotFound, OSError):
-                pass
+                try:
+                    if self._preserve_comments:
+                        # Probe in binary mode, in order to avoid
+                        # potential character encoding issues.
+                        output = open(
+                            _unicode_encode(
+                                desc_path, encoding=_encodings["fs"], errors="strict"
+                            ),
+                            "r+b",
+                        )
+                    else:
+                        output = open(
+                            _unicode_encode(
+                                desc_path, encoding=_encodings["fs"], errors="strict"
+                            ),
+                            mode="w",
+                            encoding=_encodings["repo.content"],
+                            errors="backslashreplace",
+                        )
+                except OSError as e:
+                    if not self._preserve_comments or os.path.isfile(desc_path):
+                        writemsg_level(
+                            "ERROR: failed to open output file {}: {}\n".format(
+                                desc_path, e
+                            ),
+                            level=logging.ERROR,
+                            noiselevel=-1,
+                        )
+                        self.returncode |= 2
+                        return
 
-            try:
-                if self._preserve_comments:
-                    # Probe in binary mode, in order to avoid
-                    # potential character encoding issues.
-                    output = open(
-                        _unicode_encode(
-                            desc_path, encoding=_encodings["fs"], errors="strict"
-                        ),
-                        "r+b",
-                    )
-                else:
-                    output = open(
-                        _unicode_encode(
-                            desc_path, encoding=_encodings["fs"], errors="strict"
-                        ),
-                        mode="w",
-                        encoding=_encodings["repo.content"],
-                        errors="backslashreplace",
-                    )
-            except OSError as e:
-                if not self._preserve_comments or os.path.isfile(desc_path):
+                    # Open in r+b mode failed because the file doesn't
+                    # exist yet. We can probably recover if we disable
+                    # preserve_comments mode now.
                     writemsg_level(
-                        "ERROR: failed to open output file {}: {}\n".format(
-                            desc_path, e
-                        ),
-                        level=logging.ERROR,
+                        "WARNING: --preserve-comments enabled, but "
+                        + "output file not found: {}\n".format(desc_path),
+                        level=logging.WARNING,
                         noiselevel=-1,
                     )
-                    self.returncode |= 2
-                    return
-
-                # Open in r+b mode failed because the file doesn't
-                # exist yet. We can probably recover if we disable
-                # preserve_comments mode now.
-                writemsg_level(
-                    "WARNING: --preserve-comments enabled, but "
-                    + "output file not found: {}\n".format(desc_path),
-                    level=logging.WARNING,
-                    noiselevel=-1,
+                    self._preserve_comments = False
+                    try:
+                        output = open(
+                            _unicode_encode(
+                                desc_path, encoding=_encodings["fs"], errors="strict"
+                            ),
+                            mode="w",
+                            encoding=_encodings["repo.content"],
+                            errors="backslashreplace",
+                        )
+                    except OSError as e:
+                        writemsg_level(
+                            "ERROR: failed to open output file {}: {}\n".format(
+                                desc_path, e
+                            ),
+                            level=logging.ERROR,
+                            noiselevel=-1,
+                        )
+                        self.returncode |= 2
+                        return
+            else:
+                output = sys.stdout
+
+            if self._preserve_comments:
+                while True:
+                    pos = output.tell()
+                    if not output.readline().startswith(b"#"):
+                        break
+                output.seek(pos)
+                output.truncate()
+                output.close()
+
+                # Finished probing comments in binary mode, now append
+                # in text mode.
+                output = open(
+                    _unicode_encode(
+                        desc_path, encoding=_encodings["fs"], errors="strict"
+                    ),
+                    mode="a",
+                    encoding=_encodings["repo.content"],
+                    errors="backslashreplace",
                 )
-                self._preserve_comments = False
-                try:
-                    output = open(
-                        _unicode_encode(
-                            desc_path, encoding=_encodings["fs"], errors="strict"
-                        ),
-                        mode="w",
-                        encoding=_encodings["repo.content"],
-                        errors="backslashreplace",
-                    )
-                except OSError as e:
-                    writemsg_level(
-                        "ERROR: failed to open output file {}: {}\n".format(
-                            desc_path, e
-                        ),
-                        level=logging.ERROR,
-                        noiselevel=-1,
+                output.write("\n")
+            else:
+                output.write(
+                    textwrap.dedent(
+                        """\
+                    # This file is deprecated as per GLEP 56 in favor of metadata.xml. Please add
+                    # your descriptions to your package's metadata.xml ONLY.
+                    # * generated automatically using egencache *
+
+                    """
                     )
-                    self.returncode |= 2
-                    return
-        else:
-            output = sys.stdout
-
-        if self._preserve_comments:
-            while True:
-                pos = output.tell()
-                if not output.readline().startswith(b"#"):
-                    break
-            output.seek(pos)
-            output.truncate()
-            output.close()
-
-            # Finished probing comments in binary mode, now append
-            # in text mode.
-            output = open(
-                _unicode_encode(desc_path, encoding=_encodings["fs"], errors="strict"),
-                mode="a",
-                encoding=_encodings["repo.content"],
-                errors="backslashreplace",
-            )
-            output.write("\n")
-        else:
-            output.write(
-                textwrap.dedent(
-                    """\
-				# This file is deprecated as per GLEP 56 in favor of metadata.xml. Please add
-				# your descriptions to your package's metadata.xml ONLY.
-				# * generated automatically using egencache *
-
-				"""
                 )
-            )
 
-        # The cmp function no longer exists in python3, so we'll
-        # implement our own here under a slightly different name
-        # since we don't want any confusion given that we never
-        # want to rely on the builtin cmp function.
-        def cmp_func(a, b):
-            if a is None or b is None:
-                # None can't be compared with other types in python3.
-                if a is None and b is None:
-                    return 0
-                elif a is None:
-                    return -1
-                else:
-                    return 1
-            return (a > b) - (a < b)
+            # The cmp function no longer exists in python3, so we'll
+            # implement our own here under a slightly different name
+            # since we don't want any confusion given that we never
+            # want to rely on the builtin cmp function.
+            def cmp_func(a, b):
+                if a is None or b is None:
+                    # None can't be compared with other types in python3.
+                    if a is None and b is None:
+                        return 0
+                    elif a is None:
+                        return -1
+                    else:
+                        return 1
+                return (a > b) - (a < b)
 
-        class _MetadataTreeBuilder(ElementTree.TreeBuilder):
-            """
-            Implements doctype() as required to avoid deprecation warnings
-            since Python >=2.7
-            """
+            class _MetadataTreeBuilder(ElementTree.TreeBuilder):
+                """
+                Implements doctype() as required to avoid deprecation warnings
+                since Python >=2.7
+                """
 
-            def doctype(self, name, pubid, system):
-                pass
+                def doctype(self, name, pubid, system):
+                    pass
 
-        for cp in self._portdb.cp_all():
-            metadata_path = os.path.join(repo_path, cp, "metadata.xml")
-            try:
-                metadata = ElementTree.parse(
-                    _unicode_encode(
-                        metadata_path, encoding=_encodings["fs"], errors="strict"
-                    ),
-                    parser=ElementTree.XMLParser(target=_MetadataTreeBuilder()),
-                )
-            except OSError:
-                pass
-            except (ExpatError, OSError) as e:
-                writemsg_level(
-                    "ERROR: failed parsing {}/metadata.xml: {}\n".format(cp, e),
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
-                self.returncode |= 1
-            else:
+            for cp in self._portdb.cp_all():
+                metadata_path = os.path.join(repo_path, cp, "metadata.xml")
                 try:
-                    usedict = parse_metadata_use(metadata)
-                except portage.exception.ParseError as e:
+                    metadata = ElementTree.parse(
+                        _unicode_encode(
+                            metadata_path, encoding=_encodings["fs"], errors="strict"
+                        ),
+                        parser=ElementTree.XMLParser(target=_MetadataTreeBuilder()),
+                    )
+                except OSError:
+                    pass
+                except (ExpatError, OSError) as e:
                     writemsg_level(
                         "ERROR: failed parsing {}/metadata.xml: {}\n".format(cp, e),
                         level=logging.ERROR,
@@ -800,610 +810,635 @@ class GenUseLocalDesc:
                     )
                     self.returncode |= 1
                 else:
-                    for flag in sorted(usedict):
-
-                        def atomcmp(atoma, atomb):
-                            # None is better than an atom, that's why we reverse the args
-                            if atoma is None or atomb is None:
-                                return cmp_func(atomb, atoma)
-                            # Same for plain PNs (.operator is None then)
-                            elif atoma.operator is None or atomb.operator is None:
-                                return cmp_func(atomb.operator, atoma.operator)
-                            # Version matching
-                            elif atoma.cpv != atomb.cpv:
-                                return vercmp(atoma.version, atomb.version)
-                            # Versions match, let's fallback to operator matching
-                            else:
-                                return cmp_func(
-                                    ops.get(atoma.operator, -1),
-                                    ops.get(atomb.operator, -1),
-                                )
-
-                        def _Atom(key):
-                            if key is not None:
-                                return Atom(key)
-                            return None
-
-                        resdict = usedict[flag]
-                        if len(resdict) == 1:
-                            resdesc = next(iter(resdict.items()))[1]
-                        else:
-                            try:
-                                reskeys = {_Atom(k): k for k in resdict}
-                            except portage.exception.InvalidAtom as e:
-                                writemsg_level(
-                                    "ERROR: failed parsing %s/metadata.xml: %s\n"
-                                    % (cp, e),
-                                    level=logging.ERROR,
-                                    noiselevel=-1,
-                                )
-                                self.returncode |= 1
+                    try:
+                        usedict = parse_metadata_use(metadata)
+                    except portage.exception.ParseError as e:
+                        writemsg_level(
+                            "ERROR: failed parsing {}/metadata.xml: {}\n".format(cp, e),
+                            level=logging.ERROR,
+                            noiselevel=-1,
+                        )
+                        self.returncode |= 1
+                    else:
+                        for flag in sorted(usedict):
+
+                            def atomcmp(atoma, atomb):
+                                # None is better than an atom, that's why we reverse the args
+                                if atoma is None or atomb is None:
+                                    return cmp_func(atomb, atoma)
+                                # Same for plain PNs (.operator is None then)
+                                elif atoma.operator is None or atomb.operator is None:
+                                    return cmp_func(atomb.operator, atoma.operator)
+                                # Version matching
+                                elif atoma.cpv != atomb.cpv:
+                                    return vercmp(atoma.version, atomb.version)
+                                # Versions match, let's fallback to operator matching
+                                else:
+                                    return cmp_func(
+                                        ops.get(atoma.operator, -1),
+                                        ops.get(atomb.operator, -1),
+                                    )
+
+                            def _Atom(key):
+                                if key is not None:
+                                    return Atom(key)
+                                return None
+
+                            resdict = usedict[flag]
+                            if len(resdict) == 1:
                                 resdesc = next(iter(resdict.items()))[1]
                             else:
-                                resatoms = sorted(reskeys, key=cmp_sort_key(atomcmp))
-                                resdesc = resdict[reskeys[resatoms[-1]]]
+                                try:
+                                    reskeys = {_Atom(k): k for k in resdict}
+                                except portage.exception.InvalidAtom as e:
+                                    writemsg_level(
+                                        "ERROR: failed parsing %s/metadata.xml: %s\n"
+                                        % (cp, e),
+                                        level=logging.ERROR,
+                                        noiselevel=-1,
+                                    )
+                                    self.returncode |= 1
+                                    resdesc = next(iter(resdict.items()))[1]
+                                else:
+                                    resatoms = sorted(
+                                        reskeys, key=cmp_sort_key(atomcmp)
+                                    )
+                                    resdesc = resdict[reskeys[resatoms[-1]]]
+
+                            output.write("{}:{} - {}\n".format(cp, flag, resdesc))
 
-                        output.write("{}:{} - {}\n".format(cp, flag, resdesc))
+            output.close()
+            if prev_mtime is not None and prev_md5 == portage.checksum.perform_md5(
+                desc_path
+            ):
+                # Preserve mtime for rsync.
+                mtime = prev_mtime
+            else:
+                # For portability, and consistency with the mtime preservation
+                # code, set mtime to an exact integer value.
+                mtime = int(time.time())
 
-        output.close()
-        if prev_mtime is not None and prev_md5 == portage.checksum.perform_md5(
-            desc_path
-        ):
-            # Preserve mtime for rsync.
-            mtime = prev_mtime
-        else:
-            # For portability, and consistency with the mtime preservation
-            # code, set mtime to an exact integer value.
-            mtime = int(time.time())
+            os.utime(desc_path, (mtime, mtime))
 
-        os.utime(desc_path, (mtime, mtime))
+    class GenChangeLogs:
+        def __init__(
+            self,
+            portdb,
+            changelog_output,
+            changelog_reversed,
+            max_jobs=None,
+            max_load=None,
+        ):
+            self.returncode = os.EX_OK
+            self._portdb = portdb
+            self._wrapper = textwrap.TextWrapper(
+                width=78, initial_indent="  ", subsequent_indent="  "
+            )
+            self._changelog_output = changelog_output
+            self._changelog_reversed = changelog_reversed
+            self._max_jobs = max_jobs
+            self._max_load = max_load
+            self._repo_path = self._portdb.porttrees[0]
+            # --work-tree=... must be passed to Git if GIT_DIR is used
+            # and GIT_DIR is not a child of the root of the checkout
+            # eg:
+            # GIT_DIR=${parent}/work/.git/
+            # work-tree=${parent}/staging/
+            # If work-tree is not passed, Git tries to use the shared
+            # parent of the current directory and the ${GIT_DIR}, which can
+            # be outside the root of the checkout.
+            self._work_tree = "--work-tree=%s" % self._repo_path
+
+        @staticmethod
+        def grab(cmd):
+            p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+            return _unicode_decode(
+                p.communicate()[0], encoding=_encodings["stdio"], errors="strict"
+            )
 
+        def generate_changelog(self, cp):
 
-class GenChangeLogs:
-    def __init__(
-        self, portdb, changelog_output, changelog_reversed, max_jobs=None, max_load=None
-    ):
-        self.returncode = os.EX_OK
-        self._portdb = portdb
-        self._wrapper = textwrap.TextWrapper(
-            width=78, initial_indent="  ", subsequent_indent="  "
-        )
-        self._changelog_output = changelog_output
-        self._changelog_reversed = changelog_reversed
-        self._max_jobs = max_jobs
-        self._max_load = max_load
-        self._repo_path = self._portdb.porttrees[0]
-        # --work-tree=... must be passed to Git if GIT_DIR is used
-        # and GIT_DIR is not a child of the root of the checkout
-        # eg:
-        # GIT_DIR=${parent}/work/.git/
-        # work-tree=${parent}/staging/
-        # If work-tree is not passed, Git tries to use the shared
-        # parent of the current directory and the ${GIT_DIR}, which can
-        # be outside the root of the checkout.
-        self._work_tree = "--work-tree=%s" % self._repo_path
-
-    @staticmethod
-    def grab(cmd):
-        p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
-        return _unicode_decode(
-            p.communicate()[0], encoding=_encodings["stdio"], errors="strict"
-        )
+            os.chdir(os.path.join(self._repo_path, cp))
+            # Determine whether ChangeLog is up-to-date by comparing
+            # the newest commit timestamp with the ChangeLog timestamp.
+            lmod = self.grab(["git", self._work_tree, "log", "--format=%ct", "-1", "."])
+            if not lmod:
+                # This cp has not been added to the repo.
+                return
 
-    def generate_changelog(self, cp):
+            lmod = int(lmod)
 
-        os.chdir(os.path.join(self._repo_path, cp))
-        # Determine whether ChangeLog is up-to-date by comparing
-        # the newest commit timestamp with the ChangeLog timestamp.
-        lmod = self.grab(["git", self._work_tree, "log", "--format=%ct", "-1", "."])
-        if not lmod:
-            # This cp has not been added to the repo.
-            return
+            try:
+                cmod = os.stat("ChangeLog")[stat.ST_MTIME]
+            except OSError:
+                cmod = 0
 
-        lmod = int(lmod)
+            # Use exact comparison, since commit times are
+            # not necessarily ordered.
+            if cmod == lmod:
+                return
 
-        try:
-            cmod = os.stat("ChangeLog")[stat.ST_MTIME]
-        except OSError:
-            cmod = 0
+            try:
+                output = open(
+                    self._changelog_output,
+                    mode="w",
+                    encoding=_encodings["repo.content"],
+                    errors="backslashreplace",
+                )
+            except OSError as e:
+                writemsg_level(
+                    "ERROR: failed to open ChangeLog for %s: %s\n"
+                    % (
+                        cp,
+                        e,
+                    ),
+                    level=logging.ERROR,
+                    noiselevel=-1,
+                )
+                self.returncode |= 2
+                return
 
-        # Use exact comparison, since commit times are
-        # not necessarily ordered.
-        if cmod == lmod:
-            return
+            output.write(
+                textwrap.dedent(
+                    """\
+                # ChangeLog for %s
+                # Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
+                # (auto-generated from git log)
 
-        try:
-            output = open(
-                self._changelog_output,
-                mode="w",
-                encoding=_encodings["repo.content"],
-                errors="backslashreplace",
-            )
-        except OSError as e:
-            writemsg_level(
-                "ERROR: failed to open ChangeLog for %s: %s\n"
-                % (
-                    cp,
-                    e,
-                ),
-                level=logging.ERROR,
-                noiselevel=-1,
-            )
-            self.returncode |= 2
-            return
-
-        output.write(
-            textwrap.dedent(
-                """\
-			# ChangeLog for %s
-			# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
-			# (auto-generated from git log)
-
-			"""
-                % (cp, time.strftime("%Y"))
+                """
+                    % (cp, time.strftime("%Y"))
+                )
             )
-        )
 
-        # now grab all the commits
-        revlist_cmd = ["git", self._work_tree, "rev-list"]
-        if self._changelog_reversed:
-            revlist_cmd.append("--reverse")
-        revlist_cmd.extend(["HEAD", "--", "."])
-        commits = self.grab(revlist_cmd).split()
-
-        for c in commits:
-            # Explaining the arguments:
-            # --name-status to get a list of added/removed files
-            # --no-renames to avoid getting more complex records on the list
-            # --format to get the timestamp, author and commit description
-            # --root to make it work fine even with the initial commit
-            # --relative=${cp} to get paths relative to ebuilddir
-            # -r (recursive) to get per-file changes
-            # then the commit-id and path.
-
-            cinfo = (
-                self.grab(
-                    [
-                        "git",
-                        self._work_tree,
-                        "diff-tree",
-                        "--name-status",
-                        "--no-renames",
-                        "--format=%ct %cN <%cE>%n%B",
-                        "--root",
-                        "--relative={}".format(cp),
-                        "-r",
-                        c,
-                        "--",
-                        ".",
-                    ]
+            # now grab all the commits
+            revlist_cmd = ["git", self._work_tree, "rev-list"]
+            if self._changelog_reversed:
+                revlist_cmd.append("--reverse")
+            revlist_cmd.extend(["HEAD", "--", "."])
+            commits = self.grab(revlist_cmd).split()
+
+            for c in commits:
+                # Explaining the arguments:
+                # --name-status to get a list of added/removed files
+                # --no-renames to avoid getting more complex records on the list
+                # --format to get the timestamp, author and commit description
+                # --root to make it work fine even with the initial commit
+                # --relative=${cp} to get paths relative to ebuilddir
+                # -r (recursive) to get per-file changes
+                # then the commit-id and path.
+
+                cinfo = (
+                    self.grab(
+                        [
+                            "git",
+                            self._work_tree,
+                            "diff-tree",
+                            "--name-status",
+                            "--no-renames",
+                            "--format=%ct %cN <%cE>%n%B",
+                            "--root",
+                            "--relative={}".format(cp),
+                            "-r",
+                            c,
+                            "--",
+                            ".",
+                        ]
+                    )
+                    .rstrip("\n")
+                    .split("\n")
                 )
-                .rstrip("\n")
-                .split("\n")
-            )
 
-            # Expected output:
-            # timestamp Author Name <author@email>
-            # commit message l1
-            # ...
-            # commit message ln
-            #
-            # status1	filename1
-            # ...
-            # statusn	filenamen
-
-            changed = []
-            for n, l in enumerate(reversed(cinfo)):
-                if not l:
-                    body = cinfo[1 : -n - 1]
-                    break
-                else:
-                    f = l.split()
-                    if f[1] == "Manifest":
-                        pass  # XXX: remanifest commits?
-                    elif f[1].startswith("ChangeLog"):
-                        pass
-                    elif f[0].startswith("A"):
-                        changed.append(ChangeLogTypeSort("+", f[1]))
-                    elif f[0].startswith("D"):
-                        changed.append(ChangeLogTypeSort("-", f[1]))
-                    elif f[0].startswith("M"):
-                        changed.append(ChangeLogTypeSort("", f[1]))
+                # Expected output:
+                # timestamp Author Name <author@email>
+                # commit message l1
+                # ...
+                # commit message ln
+                #
+                # status1	filename1
+                # ...
+                # statusn	filenamen
+
+                changed = []
+                for n, l in enumerate(reversed(cinfo)):
+                    if not l:
+                        body = cinfo[1 : -n - 1]
+                        break
                     else:
-                        writemsg_level(
-                            "ERROR: unexpected git file status for %s: %s\n"
-                            % (
-                                cp,
-                                f,
-                            ),
-                            level=logging.ERROR,
-                            noiselevel=-1,
-                        )
-                        self.returncode |= 1
-
-            if not changed:
-                continue
-
-            (ts, author) = cinfo[0].split(" ", 1)
-            date = time.strftime("%d %b %Y", time.gmtime(float(ts)))
-
-            changed = [str(x) for x in sorted(changed)]
-
-            wroteheader = False
-            # Reverse the sort order for headers.
-            for c in reversed(changed):
-                if c.startswith("+") and c.endswith(".ebuild"):
-                    output.write("*{} ({})\n".format(c[1:-7], date))
-                    wroteheader = True
-            if wroteheader:
-                output.write("\n")
-
-            # strip '<cp>: ', '[<cp>] ', and similar
-            body[0] = re.sub(r"^\W*" + re.escape(cp) + r"\W+", "", body[0])
-            # strip trailing newline
-            if not body[-1]:
-                body = body[:-1]
-            # strip git-svn id
-            if body[-1].startswith("git-svn-id:") and not body[-2]:
-                body = body[:-2]
-            # strip the repoman version/manifest note
-            if (
-                body[-1] == " (Signed Manifest commit)"
-                or body[-1] == " (Unsigned Manifest commit)"
-            ):
-                body = body[:-1]
-            if body[-1].startswith("(Portage version:") and body[-1].endswith(")"):
-                body = body[:-1]
+                        f = l.split()
+                        if f[1] == "Manifest":
+                            pass  # XXX: remanifest commits?
+                        elif f[1].startswith("ChangeLog"):
+                            pass
+                        elif f[0].startswith("A"):
+                            changed.append(ChangeLogTypeSort("+", f[1]))
+                        elif f[0].startswith("D"):
+                            changed.append(ChangeLogTypeSort("-", f[1]))
+                        elif f[0].startswith("M"):
+                            changed.append(ChangeLogTypeSort("", f[1]))
+                        else:
+                            writemsg_level(
+                                "ERROR: unexpected git file status for %s: %s\n"
+                                % (
+                                    cp,
+                                    f,
+                                ),
+                                level=logging.ERROR,
+                                noiselevel=-1,
+                            )
+                            self.returncode |= 1
+
+                if not changed:
+                    continue
+
+                (ts, author) = cinfo[0].split(" ", 1)
+                date = time.strftime("%d %b %Y", time.gmtime(float(ts)))
+
+                changed = [str(x) for x in sorted(changed)]
+
+                wroteheader = False
+                # Reverse the sort order for headers.
+                for c in reversed(changed):
+                    if c.startswith("+") and c.endswith(".ebuild"):
+                        output.write("*{} ({})\n".format(c[1:-7], date))
+                        wroteheader = True
+                if wroteheader:
+                    output.write("\n")
+
+                # strip '<cp>: ', '[<cp>] ', and similar
+                body[0] = re.sub(r"^\W*" + re.escape(cp) + r"\W+", "", body[0])
+                # strip trailing newline
                 if not body[-1]:
                     body = body[:-1]
-
-            # don't break filenames on hyphens
-            self._wrapper.break_on_hyphens = False
-            output.write(
-                self._wrapper.fill(
-                    "{}; {} {}:".format(date, author, ", ".join(changed))
+                # strip git-svn id
+                if body[-1].startswith("git-svn-id:") and not body[-2]:
+                    body = body[:-2]
+                # strip the repoman version/manifest note
+                if (
+                    body[-1] == " (Signed Manifest commit)"
+                    or body[-1] == " (Unsigned Manifest commit)"
+                ):
+                    body = body[:-1]
+                if body[-1].startswith("(Portage version:") and body[-1].endswith(")"):
+                    body = body[:-1]
+                    if not body[-1]:
+                        body = body[:-1]
+
+                # don't break filenames on hyphens
+                self._wrapper.break_on_hyphens = False
+                output.write(
+                    self._wrapper.fill(
+                        "{}; {} {}:".format(date, author, ", ".join(changed))
+                    )
+                )
+                # but feel free to break commit messages there
+                self._wrapper.break_on_hyphens = True
+                output.write(
+                    "\n%s\n\n" % "\n".join(self._wrapper.fill(x) for x in body)
                 )
-            )
-            # but feel free to break commit messages there
-            self._wrapper.break_on_hyphens = True
-            output.write("\n%s\n\n" % "\n".join(self._wrapper.fill(x) for x in body))
 
-        output.close()
-        os.utime(self._changelog_output, (lmod, lmod))
+            output.close()
+            os.utime(self._changelog_output, (lmod, lmod))
 
-    def _task_iter(self):
-        if not os.path.isdir(
-            os.environ.get("GIT_DIR", os.path.join(self._repo_path, ".git"))
-        ):
-            writemsg_level(
-                "ERROR: --update-changelogs supported only in git repos\n",
-                level=logging.ERROR,
-                noiselevel=-1,
-            )
-            self.returncode = 127
-            return
-
-        for cp in self._portdb.cp_all():
-            yield AsyncFunction(target=self.generate_changelog, args=[cp])
-
-    def run(self):
-        return run_main_scheduler(
-            TaskScheduler(
-                self._task_iter(),
-                event_loop=global_event_loop(),
-                max_jobs=self._max_jobs,
-                max_load=self._max_load,
+        def _task_iter(self):
+            if not os.path.isdir(
+                os.environ.get("GIT_DIR", os.path.join(self._repo_path, ".git"))
+            ):
+                writemsg_level(
+                    "ERROR: --update-changelogs supported only in git repos\n",
+                    level=logging.ERROR,
+                    noiselevel=-1,
+                )
+                self.returncode = 127
+                return
+
+            for cp in self._portdb.cp_all():
+                yield AsyncFunction(target=self.generate_changelog, args=[cp])
+
+        def run(self):
+            return run_main_scheduler(
+                TaskScheduler(
+                    self._task_iter(),
+                    event_loop=global_event_loop(),
+                    max_jobs=self._max_jobs,
+                    max_load=self._max_load,
+                )
             )
-        )
-
-
-def egencache_main(args):
-
-    # The calling environment is ignored, so the program is
-    # completely controlled by commandline arguments.
-    env = {}
-
-    if not sys.stdout.isatty() or os.environ.get("NOCOLOR", "").lower() in (
-        "yes",
-        "true",
-    ):
-        portage.output.nocolor()
-        env["NOCOLOR"] = "true"
 
-    parser, options, atoms = parse_args(args)
+    def egencache_main(args):
 
-    config_root = options.config_root
+        # The calling environment is ignored, so the program is
+        # completely controlled by commandline arguments.
+        env = {}
 
-    if options.repositories_configuration is not None:
-        env["PORTAGE_REPOSITORIES"] = options.repositories_configuration
-
-    if options.cache_dir is not None:
-        env["PORTAGE_DEPCACHEDIR"] = options.cache_dir
+        if not sys.stdout.isatty() or os.environ.get("NOCOLOR", "").lower() in (
+            "yes",
+            "true",
+        ):
+            portage.output.nocolor()
+            env["NOCOLOR"] = "true"
 
-    settings = portage.config(config_root=config_root, local_config=False, env=env)
+        parser, options, atoms = parse_args(args)
 
-    default_opts = None
-    if not options.ignore_default_opts:
-        default_opts = portage.util.shlex_split(
-            settings.get("EGENCACHE_DEFAULT_OPTS", "")
-        )
+        config_root = options.config_root
 
-    if default_opts:
-        parser, options, args = parse_args(default_opts + args)
+        if options.repositories_configuration is not None:
+            env["PORTAGE_REPOSITORIES"] = options.repositories_configuration
 
         if options.cache_dir is not None:
             env["PORTAGE_DEPCACHEDIR"] = options.cache_dir
 
         settings = portage.config(config_root=config_root, local_config=False, env=env)
 
-    if not (
-        options.update
-        or options.update_use_local_desc
-        or options.update_changelogs
-        or options.update_manifests
-        or options.update_pkg_desc_index
-    ):
-        parser.error("No action specified")
-        return 1
-
-    if options.repo is None:
-        if len(settings.repositories.prepos) == 2:
-            for repo in settings.repositories:
-                if repo.name != "DEFAULT":
-                    options.repo = repo.name
-                    break
+        default_opts = None
+        if not options.ignore_default_opts:
+            default_opts = portage.util.shlex_split(
+                settings.get("EGENCACHE_DEFAULT_OPTS", "")
+            )
 
-        if options.repo is None:
-            parser.error("--repo option is required")
+        if default_opts:
+            parser, options, args = parse_args(default_opts + args)
 
-    repo_path = settings.repositories.treemap.get(options.repo)
-    if repo_path is None:
-        parser.error("Unable to locate repository named '{}'".format(options.repo))
-        return 1
+            if options.cache_dir is not None:
+                env["PORTAGE_DEPCACHEDIR"] = options.cache_dir
 
-    repo_config = settings.repositories.get_repo_for_location(repo_path)
+            settings = portage.config(
+                config_root=config_root, local_config=False, env=env
+            )
 
-    if options.strict_manifests is not None:
-        if options.strict_manifests == "y":
-            settings.features.add("strict")
-        else:
-            settings.features.discard("strict")
+        if not (
+            options.update
+            or options.update_use_local_desc
+            or options.update_changelogs
+            or options.update_manifests
+            or options.update_pkg_desc_index
+        ):
+            parser.error("No action specified")
+            return 1
 
-    if options.update and "metadata-transfer" not in settings.features:
-        # Forcibly enable metadata-transfer if portdbapi has a pregenerated
-        # cache that does not support eclass validation.
-        cache = repo_config.get_pregenerated_cache(
-            portage.dbapi.dbapi._known_keys, readonly=True
-        )
-        if cache is not None and not cache.complete_eclass_entries:
-            settings.features.add("metadata-transfer")
-        cache = None
+        if options.repo is None:
+            if len(settings.repositories.prepos) == 2:
+                for repo in settings.repositories:
+                    if repo.name != "DEFAULT":
+                        options.repo = repo.name
+                        break
 
-    settings.lock()
+            if options.repo is None:
+                parser.error("--repo option is required")
 
-    portdb = portage.portdbapi(mysettings=settings)
+        repo_path = settings.repositories.treemap.get(options.repo)
+        if repo_path is None:
+            parser.error("Unable to locate repository named '{}'".format(options.repo))
+            return 1
 
-    # Limit ebuilds to the specified repo.
-    portdb.porttrees = [repo_path]
+        repo_config = settings.repositories.get_repo_for_location(repo_path)
 
-    if options.update:
-        if options.cache_dir is not None:
-            # already validated earlier
-            pass
-        else:
-            # We check write access after the portdbapi constructor
-            # has had an opportunity to create it. This ensures that
-            # we don't use the cache in the "volatile" mode which is
-            # undesirable for egencache.
-            if not os.access(settings["PORTAGE_DEPCACHEDIR"], os.W_OK):
-                writemsg_level(
-                    "ecachegen: error: "
-                    + "write access denied: {}\n".format(
-                        settings["PORTAGE_DEPCACHEDIR"]
-                    ),
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
-                return 1
+        if options.strict_manifests is not None:
+            if options.strict_manifests == "y":
+                settings.features.add("strict")
+            else:
+                settings.features.discard("strict")
 
-    if options.sign_manifests is not None:
-        repo_config.sign_manifest = options.sign_manifests == "y"
+        if options.update and "metadata-transfer" not in settings.features:
+            # Forcibly enable metadata-transfer if portdbapi has a pregenerated
+            # cache that does not support eclass validation.
+            cache = repo_config.get_pregenerated_cache(
+                portage.dbapi.dbapi._known_keys, readonly=True
+            )
+            if cache is not None and not cache.complete_eclass_entries:
+                settings.features.add("metadata-transfer")
+            cache = None
 
-    if options.thin_manifests is not None:
-        repo_config.thin_manifest = options.thin_manifests == "y"
+        settings.lock()
 
-    gpg_cmd = None
-    gpg_vars = None
-    force_sign_key = None
+        portdb = portage.portdbapi(mysettings=settings)
 
-    if options.update_manifests:
-        if repo_config.sign_manifest:
+        # Limit ebuilds to the specified repo.
+        portdb.porttrees = [repo_path]
 
-            sign_problem = False
-            gpg_dir = None
-            gpg_cmd = settings.get("PORTAGE_GPG_SIGNING_COMMAND")
-            if gpg_cmd is None:
-                writemsg_level(
-                    "egencache: error: "
-                    "PORTAGE_GPG_SIGNING_COMMAND is unset! "
-                    "Is make.globals missing?\n",
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
-                sign_problem = True
-            elif (
-                "${PORTAGE_GPG_KEY}" in gpg_cmd
-                and options.gpg_key is None
-                and "PORTAGE_GPG_KEY" not in settings
-            ):
-                writemsg_level(
-                    "egencache: error: " "PORTAGE_GPG_KEY is unset!\n",
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
-                sign_problem = True
-            elif "${PORTAGE_GPG_DIR}" in gpg_cmd:
-                if options.gpg_dir is not None:
-                    gpg_dir = options.gpg_dir
-                elif "PORTAGE_GPG_DIR" not in settings:
-                    gpg_dir = os.path.expanduser("~/.gnupg")
-                else:
-                    gpg_dir = os.path.expanduser(settings["PORTAGE_GPG_DIR"])
-                if not os.access(gpg_dir, os.X_OK):
+        if options.update:
+            if options.cache_dir is not None:
+                # already validated earlier
+                pass
+            else:
+                # We check write access after the portdbapi constructor
+                # has had an opportunity to create it. This ensures that
+                # we don't use the cache in the "volatile" mode which is
+                # undesirable for egencache.
+                if not os.access(settings["PORTAGE_DEPCACHEDIR"], os.W_OK):
                     writemsg_level(
-                        (
-                            "egencache: error: "
-                            "Unable to access directory: "
-                            "PORTAGE_GPG_DIR='%s'\n"
-                        )
-                        % gpg_dir,
+                        "ecachegen: error: "
+                        + "write access denied: {}\n".format(
+                            settings["PORTAGE_DEPCACHEDIR"]
+                        ),
                         level=logging.ERROR,
                         noiselevel=-1,
                     )
-                    sign_problem = True
-
-            if sign_problem:
-                writemsg_level(
-                    "egencache: You may disable manifest "
-                    "signatures with --sign-manifests=n or by setting "
-                    '"sign-manifests = false" in metadata/layout.conf\n',
-                    level=logging.ERROR,
-                    noiselevel=-1,
-                )
-                return 1
-
-            gpg_vars = {}
-            if gpg_dir is not None:
-                gpg_vars["PORTAGE_GPG_DIR"] = gpg_dir
-            gpg_var_names = []
-            if options.gpg_key is None:
-                gpg_var_names.append("PORTAGE_GPG_KEY")
-            else:
-                gpg_vars["PORTAGE_GPG_KEY"] = options.gpg_key
+                    return 1
 
-            for k in gpg_var_names:
-                v = settings.get(k)
-                if v is not None:
-                    gpg_vars[k] = v
+        if options.sign_manifests is not None:
+            repo_config.sign_manifest = options.sign_manifests == "y"
 
-            force_sign_key = gpg_vars.get("PORTAGE_GPG_KEY")
+        if options.thin_manifests is not None:
+            repo_config.thin_manifest = options.thin_manifests == "y"
 
-    ret = [os.EX_OK]
+        gpg_cmd = None
+        gpg_vars = None
+        force_sign_key = None
 
-    if options.update:
-        cp_iter = None
-        if atoms:
-            cp_iter = iter(atoms)
+        if options.update_manifests:
+            if repo_config.sign_manifest:
 
-        gen_cache = GenCache(
-            portdb,
-            cp_iter=cp_iter,
-            max_jobs=options.jobs,
-            max_load=options.load_average,
-            rsync=options.rsync,
-            external_cache_only=options.external_cache_only,
-        )
-        gen_cache.run()
-        if options.tolerant:
-            ret.append(os.EX_OK)
-        else:
-            ret.append(gen_cache.returncode)
+                sign_problem = False
+                gpg_dir = None
+                gpg_cmd = settings.get("PORTAGE_GPG_SIGNING_COMMAND")
+                if gpg_cmd is None:
+                    writemsg_level(
+                        "egencache: error: "
+                        "PORTAGE_GPG_SIGNING_COMMAND is unset! "
+                        "Is make.globals missing?\n",
+                        level=logging.ERROR,
+                        noiselevel=-1,
+                    )
+                    sign_problem = True
+                elif (
+                    "${PORTAGE_GPG_KEY}" in gpg_cmd
+                    and options.gpg_key is None
+                    and "PORTAGE_GPG_KEY" not in settings
+                ):
+                    writemsg_level(
+                        "egencache: error: " "PORTAGE_GPG_KEY is unset!\n",
+                        level=logging.ERROR,
+                        noiselevel=-1,
+                    )
+                    sign_problem = True
+                elif "${PORTAGE_GPG_DIR}" in gpg_cmd:
+                    if options.gpg_dir is not None:
+                        gpg_dir = options.gpg_dir
+                    elif "PORTAGE_GPG_DIR" not in settings:
+                        gpg_dir = os.path.expanduser("~/.gnupg")
+                    else:
+                        gpg_dir = os.path.expanduser(settings["PORTAGE_GPG_DIR"])
+                    if not os.access(gpg_dir, os.X_OK):
+                        writemsg_level(
+                            (
+                                "egencache: error: "
+                                "Unable to access directory: "
+                                "PORTAGE_GPG_DIR='%s'\n"
+                            )
+                            % gpg_dir,
+                            level=logging.ERROR,
+                            noiselevel=-1,
+                        )
+                        sign_problem = True
 
-    if options.update_pkg_desc_index:
-        if not options.external_cache_only and repo_config.writable:
-            writable_location = repo_config.location
-        else:
-            writable_location = os.path.join(
-                portdb.depcachedir, repo_config.location.lstrip(os.sep)
-            )
-            if not options.external_cache_only:
-                msg = [
-                    "WARNING: Repository is not writable: {}".format(
-                        repo_config.location
-                    ),
-                    "         Using cache directory instead: {}".format(
-                        writable_location
-                    ),
-                ]
-                msg = "".join(line + "\n" for line in msg)
-                writemsg_level(msg, level=logging.WARNING, noiselevel=-1)
+                if sign_problem:
+                    writemsg_level(
+                        "egencache: You may disable manifest "
+                        "signatures with --sign-manifests=n or by setting "
+                        '"sign-manifests = false" in metadata/layout.conf\n',
+                        level=logging.ERROR,
+                        noiselevel=-1,
+                    )
+                    return 1
 
-        gen_index = GenPkgDescIndex(
-            repo_config,
-            portdb,
-            os.path.join(writable_location, "metadata", "pkg_desc_index"),
-            verbose=options.verbose,
-        )
-        gen_index.run()
-        ret.append(gen_index.returncode)
+                gpg_vars = {}
+                if gpg_dir is not None:
+                    gpg_vars["PORTAGE_GPG_DIR"] = gpg_dir
+                gpg_var_names = []
+                if options.gpg_key is None:
+                    gpg_var_names.append("PORTAGE_GPG_KEY")
+                else:
+                    gpg_vars["PORTAGE_GPG_KEY"] = options.gpg_key
 
-    if options.update_use_local_desc:
-        gen_desc = GenUseLocalDesc(
-            portdb,
-            output=options.uld_output,
-            preserve_comments=options.preserve_comments,
-        )
-        gen_desc.run()
-        ret.append(gen_desc.returncode)
+                for k in gpg_var_names:
+                    v = settings.get(k)
+                    if v is not None:
+                        gpg_vars[k] = v
 
-    if options.update_changelogs:
-        gen_clogs = GenChangeLogs(
-            portdb,
-            changelog_output=options.changelog_output,
-            changelog_reversed=options.changelog_reversed,
-            max_jobs=options.jobs,
-            max_load=options.load_average,
-        )
-        signum = gen_clogs.run()
-        if signum is not None:
-            sys.exit(128 + signum)
-        ret.append(gen_clogs.returncode)
+                force_sign_key = gpg_vars.get("PORTAGE_GPG_KEY")
 
-    if options.update_manifests:
+        ret = [os.EX_OK]
 
-        cp_iter = None
-        if atoms:
-            cp_iter = iter(atoms)
+        if options.update:
+            cp_iter = None
+            if atoms:
+                cp_iter = iter(atoms)
 
-        event_loop = global_event_loop()
-        scheduler = ManifestScheduler(
-            portdb,
-            cp_iter=cp_iter,
-            gpg_cmd=gpg_cmd,
-            gpg_vars=gpg_vars,
-            force_sign_key=force_sign_key,
-            max_jobs=options.jobs,
-            max_load=options.load_average,
-            event_loop=event_loop,
-        )
+            gen_cache = GenCache(
+                portdb,
+                cp_iter=cp_iter,
+                max_jobs=options.jobs,
+                max_load=options.load_average,
+                rsync=options.rsync,
+                external_cache_only=options.external_cache_only,
+            )
+            gen_cache.run()
+            if options.tolerant:
+                ret.append(os.EX_OK)
+            else:
+                ret.append(gen_cache.returncode)
 
-        signum = run_main_scheduler(scheduler)
-        if signum is not None:
-            sys.exit(128 + signum)
+        if options.update_pkg_desc_index:
+            if not options.external_cache_only and repo_config.writable:
+                writable_location = repo_config.location
+            else:
+                writable_location = os.path.join(
+                    portdb.depcachedir, repo_config.location.lstrip(os.sep)
+                )
+                if not options.external_cache_only:
+                    msg = [
+                        "WARNING: Repository is not writable: {}".format(
+                            repo_config.location
+                        ),
+                        "         Using cache directory instead: {}".format(
+                            writable_location
+                        ),
+                    ]
+                    msg = "".join(line + "\n" for line in msg)
+                    writemsg_level(msg, level=logging.WARNING, noiselevel=-1)
+
+            gen_index = GenPkgDescIndex(
+                repo_config,
+                portdb,
+                os.path.join(writable_location, "metadata", "pkg_desc_index"),
+                verbose=options.verbose,
+            )
+            gen_index.run()
+            ret.append(gen_index.returncode)
+
+        if options.update_use_local_desc:
+            gen_desc = GenUseLocalDesc(
+                portdb,
+                output=options.uld_output,
+                preserve_comments=options.preserve_comments,
+            )
+            gen_desc.run()
+            ret.append(gen_desc.returncode)
+
+        if options.update_changelogs:
+            gen_clogs = GenChangeLogs(
+                portdb,
+                changelog_output=options.changelog_output,
+                changelog_reversed=options.changelog_reversed,
+                max_jobs=options.jobs,
+                max_load=options.load_average,
+            )
+            signum = gen_clogs.run()
+            if signum is not None:
+                sys.exit(128 + signum)
+            ret.append(gen_clogs.returncode)
+
+        if options.update_manifests:
+
+            cp_iter = None
+            if atoms:
+                cp_iter = iter(atoms)
+
+            event_loop = global_event_loop()
+            scheduler = ManifestScheduler(
+                portdb,
+                cp_iter=cp_iter,
+                gpg_cmd=gpg_cmd,
+                gpg_vars=gpg_vars,
+                force_sign_key=force_sign_key,
+                max_jobs=options.jobs,
+                max_load=options.load_average,
+                event_loop=event_loop,
+            )
 
-        if options.tolerant:
-            ret.append(os.EX_OK)
-        else:
-            ret.append(scheduler.returncode)
+            signum = run_main_scheduler(scheduler)
+            if signum is not None:
+                sys.exit(128 + signum)
 
-    if options.write_timestamp:
-        timestamp_path = os.path.join(repo_path, "metadata", "timestamp.chk")
-        try:
-            portage.util.write_atomic(
-                timestamp_path, time.strftime("%s\n" % TIMESTAMP_FORMAT, time.gmtime())
-            )
-        except (OSError, portage.exception.PortageException):
-            ret.append(os.EX_IOERR)
-        else:
-            ret.append(os.EX_OK)
+            if options.tolerant:
+                ret.append(os.EX_OK)
+            else:
+                ret.append(scheduler.returncode)
 
-    return max(ret)
+        if options.write_timestamp:
+            timestamp_path = os.path.join(repo_path, "metadata", "timestamp.chk")
+            try:
+                portage.util.write_atomic(
+                    timestamp_path,
+                    time.strftime("%s\n" % TIMESTAMP_FORMAT, time.gmtime()),
+                )
+            except (OSError, portage.exception.PortageException):
+                ret.append(os.EX_IOERR)
+            else:
+                ret.append(os.EX_OK)
 
+        return max(ret)
 
-if __name__ == "__main__":
-    portage._disable_legacy_globals()
-    portage.util.noiselimit = -1
-    try:
-        sys.exit(egencache_main(sys.argv[1:]))
-    finally:
-        global_event_loop().close()
+    if __name__ == "__main__":
+        portage._disable_legacy_globals()
+        portage.util.noiselimit = -1
+        try:
+            sys.exit(egencache_main(sys.argv[1:]))
+        finally:
+            global_event_loop().close()
+
+except KeyboardInterrupt as e:
+    # Prevent traceback on ^C
+    signum = getattr(e, "signum", signal.SIGINT)
+    signal.signal(signum, signal.SIG_DFL)
+    raise_signal(signum)

diff --git a/bin/emaint b/bin/emaint
index 103dc2571..7fb38f5e3 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -5,46 +5,66 @@
 """System health checks and maintenance utilities.
 """
 
-import sys
-import errno
+import os
+import signal
+
+# For compatibility with Python < 3.8
+raise_signal = getattr(
+    signal, "raise_signal", lambda signum: os.kill(os.getpid(), signum)
+)
+
+# Inherit from KeyboardInterrupt to avoid a traceback from asyncio.
+class SignalInterrupt(KeyboardInterrupt):
+    def __init__(self, signum):
+        self.signum = signum
+
 
-# This block ensures that ^C interrupts are handled quietly.
 try:
-    import signal
 
-    def exithandler(signum, _frame):
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
-        signal.signal(signal.SIGTERM, signal.SIG_IGN)
-        sys.exit(128 + signum)
+    def signal_interrupt(signum, _frame):
+        raise SignalInterrupt(signum)
 
-    signal.signal(signal.SIGINT, exithandler)
-    signal.signal(signal.SIGTERM, exithandler)
+    def debug_signal(_signum, _frame):
+        import pdb
+
+        pdb.set_trace()
+
+    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
     signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    signal.signal(signal.SIGTERM, signal_interrupt)
+    signal.signal(signal.SIGUSR1, debug_signal)
 
-except KeyboardInterrupt:
-    sys.exit(1)
+    import sys
+    import errno
+    from os import path as osp
 
-from os import path as osp
+    if osp.isfile(
+        osp.join(
+            osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed"
+        )
+    ):
+        sys.path.insert(
+            0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+        )
+    import portage
 
-if osp.isfile(
-    osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")
-):
-    sys.path.insert(
-        0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
-    )
-import portage
+    portage._internal_caller = True
+    from portage.emaint.main import emaint_main
+    from portage.util._eventloop.global_event_loop import global_event_loop
 
-portage._internal_caller = True
-from portage.emaint.main import emaint_main
-from portage.util._eventloop.global_event_loop import global_event_loop
+    try:
+        emaint_main(sys.argv[1:])
+    except OSError as e:
+        if e.errno == errno.EACCES:
+            print("\nemaint: Need superuser access")
+            sys.exit(1)
+        else:
+            raise
+    finally:
+        global_event_loop().close()
 
-try:
-    emaint_main(sys.argv[1:])
-except OSError as e:
-    if e.errno == errno.EACCES:
-        print("\nemaint: Need superuser access")
-        sys.exit(1)
-    else:
-        raise
-finally:
-    global_event_loop().close()
+except KeyboardInterrupt as e:
+    # Prevent traceback on ^C
+    signum = getattr(e, "signum", signal.SIGINT)
+    signal.signal(signum, signal.SIG_DFL)
+    raise_signal(signum)

diff --git a/bin/emerge b/bin/emerge
index d90a73c34..a16c5039a 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2,31 +2,35 @@
 # Copyright 2006-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import os
 import signal
 import sys
 
-# This block ensures that ^C interrupts are handled quietly. We handle
-# KeyboardInterrupt instead of installing a SIGINT handler, since
-# exiting from signal handlers intermittently causes python to ignore
-# the SystemExit exception with a message like this:
-# Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
+# For compatibility with Python < 3.8
+raise_signal = getattr(
+    signal, "raise_signal", lambda signum: os.kill(os.getpid(), signum)
+)
+
+# Inherit from KeyboardInterrupt to avoid a traceback from asyncio.
+class SignalInterrupt(KeyboardInterrupt):
+    def __init__(self, signum):
+        self.signum = signum
+
+
 global_event_loop = None
 try:
 
-    def exithandler(signum, _frame):
-        signal.signal(signal.SIGTERM, signal.SIG_IGN)
-        sys.exit(128 + signum)
-
-    signal.signal(signal.SIGTERM, exithandler)
-    # Prevent "[Errno 32] Broken pipe" exceptions when
-    # writing to a pipe.
-    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    def signal_interrupt(signum, _frame):
+        raise SignalInterrupt(signum)
 
     def debug_signal(_signum, _frame):
         import pdb
 
         pdb.set_trace()
 
+    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    signal.signal(signal.SIGTERM, signal_interrupt)
     signal.signal(signal.SIGUSR1, debug_signal)
 
     from os import path as osp
@@ -79,10 +83,17 @@ try:
             sys.exit(1)
         sys.exit(retval)
 
-except KeyboardInterrupt:
-    sys.stderr.write("\n\nExiting on signal {signal}\n".format(signal=signal.SIGINT))
+except KeyboardInterrupt as e:
+    # This block ensures that ^C interrupts are handled quietly. We handle
+    # KeyboardInterrupt instead of installing a SIGINT handler, since
+    # exiting from signal handlers intermittently causes python to ignore
+    # the SystemExit exception with a message like this:
+    # Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
+    signum = getattr(e, "signum", signal.SIGINT)
+    signal.signal(signum, signal.SIG_DFL)
+    sys.stderr.write(f"\n\nExiting on signal {signum}\n")
     sys.stderr.flush()
-    sys.exit(128 + signal.SIGINT)
+    raise_signal(signum)
 finally:
     if global_event_loop is not None:
         global_event_loop().close()

diff --git a/bin/portageq b/bin/portageq
index dca249a7b..20a2f6646 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -2,1644 +2,1584 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-import argparse
+import os
 import signal
-import sys
 
-# This block ensures that ^C interrupts are handled quietly.
+# For compatibility with Python < 3.8
+raise_signal = getattr(
+    signal, "raise_signal", lambda signum: os.kill(os.getpid(), signum)
+)
+
+# Inherit from KeyboardInterrupt to avoid a traceback from asyncio.
+class SignalInterrupt(KeyboardInterrupt):
+    def __init__(self, signum):
+        self.signum = signum
+
+
 try:
 
-    def exithandler(signum, _frame):
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
-        signal.signal(signal.SIGTERM, signal.SIG_IGN)
-        sys.exit(128 + signum)
+    def signal_interrupt(signum, _frame):
+        raise SignalInterrupt(signum)
 
-    signal.signal(signal.SIGINT, exithandler)
-    signal.signal(signal.SIGTERM, exithandler)
+    def debug_signal(_signum, _frame):
+        import pdb
 
-except KeyboardInterrupt:
-    sys.exit(128 + signal.SIGINT)
+        pdb.set_trace()
 
-import os
-import types
+    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+    signal.signal(signal.SIGTERM, signal_interrupt)
+    signal.signal(signal.SIGUSR1, debug_signal)
 
-if os.path.isfile(
-    os.path.join(
-        os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
-        ".portage_not_installed",
-    )
-):
-    pym_paths = [
+    import argparse
+    import sys
+    import types
+
+    if os.path.isfile(
         os.path.join(
-            os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib"
+            os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
+            ".portage_not_installed",
         )
-    ]
-    sys.path.insert(0, pym_paths[0])
-else:
-    import sysconfig
-
-    pym_paths = [
-        os.path.join(sysconfig.get_path("purelib"), x) for x in ("_emerge", "portage")
-    ]
-# Avoid sandbox violations after Python upgrade.
-if os.environ.get("SANDBOX_ON") == "1":
-    sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
-    for pym_path in pym_paths:
-        if pym_path not in sandbox_write:
-            sandbox_write.append(pym_path)
-            os.environ["SANDBOX_WRITE"] = ":".join(filter(None, sandbox_write))
-    del pym_path, sandbox_write
-del pym_paths
-
-import portage
-
-portage._internal_caller = True
-from portage import os
-from portage.eapi import eapi_has_repo_deps
-from portage.util import writemsg, writemsg_stdout
-
-portage.proxy.lazyimport.lazyimport(
-    globals(),
-    "re",
-    "subprocess",
-    "_emerge.Package:Package",
-    "_emerge.RootConfig:RootConfig",
-    "_emerge.is_valid_package_atom:insert_category_into_atom",
-    "portage.dbapi._expand_new_virt:expand_new_virt",
-    "portage._sets.base:InternalPackageSet",
-    "portage.util._eventloop.global_event_loop:global_event_loop",
-    "portage.xml.metadata:MetaDataXML",
-)
+    ):
+        pym_paths = [
+            os.path.join(
+                os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib"
+            )
+        ]
+        sys.path.insert(0, pym_paths[0])
+    else:
+        import sysconfig
+
+        pym_paths = [
+            os.path.join(sysconfig.get_path("purelib"), x)
+            for x in ("_emerge", "portage")
+        ]
+    # Avoid sandbox violations after Python upgrade.
+    if os.environ.get("SANDBOX_ON") == "1":
+        sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
+        for pym_path in pym_paths:
+            if pym_path not in sandbox_write:
+                sandbox_write.append(pym_path)
+                os.environ["SANDBOX_WRITE"] = ":".join(filter(None, sandbox_write))
+        del pym_path, sandbox_write
+    del pym_paths
+
+    import portage
+
+    portage._internal_caller = True
+    from portage import os
+    from portage.eapi import eapi_has_repo_deps
+    from portage.util import writemsg, writemsg_stdout
+
+    portage.proxy.lazyimport.lazyimport(
+        globals(),
+        "re",
+        "subprocess",
+        "_emerge.Package:Package",
+        "_emerge.RootConfig:RootConfig",
+        "_emerge.is_valid_package_atom:insert_category_into_atom",
+        "portage.dbapi._expand_new_virt:expand_new_virt",
+        "portage._sets.base:InternalPackageSet",
+        "portage.util._eventloop.global_event_loop:global_event_loop",
+        "portage.xml.metadata:MetaDataXML",
+    )
 
+    def eval_atom_use(atom):
+        if "USE" in os.environ:
+            use = frozenset(os.environ["USE"].split())
+            atom = atom.evaluate_conditionals(use)
+        return atom
 
-def eval_atom_use(atom):
-    if "USE" in os.environ:
-        use = frozenset(os.environ["USE"].split())
-        atom = atom.evaluate_conditionals(use)
-    return atom
-
-
-def uses_configroot(function):
-    function.uses_configroot = True
-    return function
-
-
-def uses_eroot(function):
-    function.uses_eroot = True
-    return function
-
-
-# global to hold all function docstrings to be used for argparse help.
-# Avoids python compilation level 2 optimization troubles.
-docstrings = {}
-
-# -----------------------------------------------------------------------------
-#
-# To add functionality to this tool, add a function below.
-#
-# The format for functions is:
-#
-#   def function(argv):
-#       <code>
-#
-#   docstrings['function'] = """<list of options for this function>
-#       <description of the function>
-#       """
-#   function.__doc__ = docstrings['function']
-#
-# "argv" is an array of the command line parameters provided after the command.
-#
-# Make sure you document the function in the right format.  The documentation
-# is used to display help on the function.
-#
-# You do not need to add the function to any lists, this tool is introspective,
-# and will automaticly add a command by the same name as the function!
-#
-
-
-@uses_eroot
-def has_version(argv):
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!")
-        return 3
-
-    warnings = []
-
-    allow_repo = atom_validate_strict is False or eapi_has_repo_deps(eapi)
-    try:
-        atom = portage.dep.Atom(argv[1], allow_repo=allow_repo)
-    except portage.exception.InvalidAtom:
-        if atom_validate_strict:
-            portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1], noiselevel=-1)
-            return 2
-        else:
-            atom = argv[1]
-    else:
-        if atom_validate_strict:
-            try:
-                atom = portage.dep.Atom(argv[1], allow_repo=allow_repo, eapi=eapi)
-            except portage.exception.InvalidAtom as e:
-                warnings.append("QA Notice: {}: {}".format("has_version", e))
-        atom = eval_atom_use(atom)
+    def uses_configroot(function):
+        function.uses_configroot = True
+        return function
 
-    if warnings:
-        elog("eqawarn", warnings)
+    def uses_eroot(function):
+        function.uses_eroot = True
+        return function
 
-    try:
-        mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
-        if mylist:
-            return 0
-        else:
-            return 1
-    except KeyError:
-        return 1
-    except portage.exception.InvalidAtom:
-        portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1], noiselevel=-1)
-        return 2
+    # global to hold all function docstrings to be used for argparse help.
+    # Avoids python compilation level 2 optimization troubles.
+    docstrings = {}
 
+    # -----------------------------------------------------------------------------
+    #
+    # To add functionality to this tool, add a function below.
+    #
+    # The format for functions is:
+    #
+    #   def function(argv):
+    #       <code>
+    #
+    #   docstrings['function'] = """<list of options for this function>
+    #       <description of the function>
+    #       """
+    #   function.__doc__ = docstrings['function']
+    #
+    # "argv" is an array of the command line parameters provided after the command.
+    #
+    # Make sure you document the function in the right format.  The documentation
+    # is used to display help on the function.
+    #
+    # You do not need to add the function to any lists, this tool is introspective,
+    # and will automaticly add a command by the same name as the function!
+    #
 
-docstrings[
-    "has_version"
-] = """<eroot> <category/package>
-	Return code 0 if it's available, 1 otherwise.
-	"""
-has_version.__doc__ = docstrings["has_version"]
+    @uses_eroot
+    def has_version(argv):
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!")
+            return 3
 
+        warnings = []
 
-@uses_eroot
-def best_version(argv):
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!")
-        return 3
+        allow_repo = atom_validate_strict is False or eapi_has_repo_deps(eapi)
+        try:
+            atom = portage.dep.Atom(argv[1], allow_repo=allow_repo)
+        except portage.exception.InvalidAtom:
+            if atom_validate_strict:
+                portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1], noiselevel=-1)
+                return 2
+            else:
+                atom = argv[1]
+        else:
+            if atom_validate_strict:
+                try:
+                    atom = portage.dep.Atom(argv[1], allow_repo=allow_repo, eapi=eapi)
+                except portage.exception.InvalidAtom as e:
+                    warnings.append("QA Notice: {}: {}".format("has_version", e))
+            atom = eval_atom_use(atom)
 
-    warnings = []
+        if warnings:
+            elog("eqawarn", warnings)
 
-    allow_repo = atom_validate_strict is False or eapi_has_repo_deps(eapi)
-    try:
-        atom = portage.dep.Atom(argv[1], allow_repo=allow_repo)
-    except portage.exception.InvalidAtom:
-        if atom_validate_strict:
+        try:
+            mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
+            if mylist:
+                return 0
+            else:
+                return 1
+        except KeyError:
+            return 1
+        except portage.exception.InvalidAtom:
             portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1], noiselevel=-1)
             return 2
-        else:
-            atom = argv[1]
-    else:
-        if atom_validate_strict:
-            try:
-                atom = portage.dep.Atom(argv[1], allow_repo=allow_repo, eapi=eapi)
-            except portage.exception.InvalidAtom as e:
-                warnings.append("QA Notice: {}: {}".format("best_version", e))
-        atom = eval_atom_use(atom)
-
-    if warnings:
-        elog("eqawarn", warnings)
-
-    try:
-        mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
-        print(portage.best(mylist))
-    except KeyError:
-        return 1
 
+    docstrings[
+        "has_version"
+    ] = """<eroot> <category/package>
+		Return code 0 if it's available, 1 otherwise.
+		"""
+    has_version.__doc__ = docstrings["has_version"]
 
-docstrings[
-    "best_version"
-] = """<eroot> <category/package>
-	Returns highest installed matching category/package-version (without .ebuild).
-	"""
-best_version.__doc__ = docstrings["best_version"]
-
-
-@uses_eroot
-def mass_best_version(argv):
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!")
-        return 2
-    try:
-        for pack in argv[1:]:
-            mylist = portage.db[argv[0]]["vartree"].dbapi.match(pack)
-            print("{}:{}".format(pack, portage.best(mylist)))
-    except KeyError:
-        return 1
+    @uses_eroot
+    def best_version(argv):
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!")
+            return 3
+
+        warnings = []
 
+        allow_repo = atom_validate_strict is False or eapi_has_repo_deps(eapi)
+        try:
+            atom = portage.dep.Atom(argv[1], allow_repo=allow_repo)
+        except portage.exception.InvalidAtom:
+            if atom_validate_strict:
+                portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1], noiselevel=-1)
+                return 2
+            else:
+                atom = argv[1]
+        else:
+            if atom_validate_strict:
+                try:
+                    atom = portage.dep.Atom(argv[1], allow_repo=allow_repo, eapi=eapi)
+                except portage.exception.InvalidAtom as e:
+                    warnings.append("QA Notice: {}: {}".format("best_version", e))
+            atom = eval_atom_use(atom)
 
-docstrings[
-    "mass_best_version"
-] = """<eroot> [<category/package>]+
-	Returns category/package-version (without .ebuild).
-	"""
-mass_best_version.__doc__ = docstrings["mass_best_version"]
+        if warnings:
+            elog("eqawarn", warnings)
 
+        try:
+            mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
+            print(portage.best(mylist))
+        except KeyError:
+            return 1
 
-@uses_eroot
-def metadata(argv):
-    if len(argv) < 4:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 2
+    docstrings[
+        "best_version"
+    ] = """<eroot> <category/package>
+		Returns highest installed matching category/package-version (without .ebuild).
+		"""
+    best_version.__doc__ = docstrings["best_version"]
+
+    @uses_eroot
+    def mass_best_version(argv):
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!")
+            return 2
+        try:
+            for pack in argv[1:]:
+                mylist = portage.db[argv[0]]["vartree"].dbapi.match(pack)
+                print("{}:{}".format(pack, portage.best(mylist)))
+        except KeyError:
+            return 1
 
-    eroot, pkgtype, pkgspec = argv[0:3]
-    metakeys = argv[3:]
-    type_map = {"ebuild": "porttree", "binary": "bintree", "installed": "vartree"}
-    if pkgtype not in type_map:
-        print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
-        return 1
-    trees = portage.db
-    repo = portage.dep.dep_getrepo(pkgspec)
-    pkgspec = portage.dep.remove_slot(pkgspec)
-    try:
-        values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
-            pkgspec, metakeys, myrepo=repo
-        )
-        writemsg_stdout("".join("%s\n" % x for x in values), noiselevel=-1)
-    except KeyError:
-        print("Package not found: '%s'" % pkgspec, file=sys.stderr)
-        return 1
+    docstrings[
+        "mass_best_version"
+    ] = """<eroot> [<category/package>]+
+		Returns category/package-version (without .ebuild).
+		"""
+    mass_best_version.__doc__ = docstrings["mass_best_version"]
+
+    @uses_eroot
+    def metadata(argv):
+        if len(argv) < 4:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 2
 
+        eroot, pkgtype, pkgspec = argv[0:3]
+        metakeys = argv[3:]
+        type_map = {"ebuild": "porttree", "binary": "bintree", "installed": "vartree"}
+        if pkgtype not in type_map:
+            print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
+            return 1
+        trees = portage.db
+        repo = portage.dep.dep_getrepo(pkgspec)
+        pkgspec = portage.dep.remove_slot(pkgspec)
+        try:
+            values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
+                pkgspec, metakeys, myrepo=repo
+            )
+            writemsg_stdout("".join("%s\n" % x for x in values), noiselevel=-1)
+        except KeyError:
+            print("Package not found: '%s'" % pkgspec, file=sys.stderr)
+            return 1
 
-docstrings[
-    "metadata"
-] = """
-<eroot> <pkgtype> <category/package> [<key>]+
-Returns metadata values for the specified package.
-Available keys: %s
-""" % ",".join(
-    sorted(x for x in portage.auxdbkeys)
-)
-metadata.__doc__ = docstrings["metadata"]
+    docstrings[
+        "metadata"
+    ] = """
+	<eroot> <pkgtype> <category/package> [<key>]+
+	Returns metadata values for the specified package.
+	Available keys: %s
+	""" % ",".join(
+        sorted(x for x in portage.auxdbkeys)
+    )
+    metadata.__doc__ = docstrings["metadata"]
 
+    @uses_eroot
+    def contents(argv):
+        if len(argv) != 2:
+            print("ERROR: expected 2 parameters, got %d!" % len(argv))
+            return 2
 
-@uses_eroot
-def contents(argv):
-    if len(argv) != 2:
-        print("ERROR: expected 2 parameters, got %d!" % len(argv))
-        return 2
+        root, cpv = argv
+        vartree = portage.db[root]["vartree"]
+        if not vartree.dbapi.cpv_exists(cpv):
+            sys.stderr.write("Package not found: '%s'\n" % cpv)
+            return 1
+        cat, pkg = portage.catsplit(cpv)
+        db = portage.dblink(
+            cat, pkg, root, vartree.settings, treetype="vartree", vartree=vartree
+        )
+        writemsg_stdout(
+            "".join("%s\n" % x for x in sorted(db.getcontents())), noiselevel=-1
+        )
 
-    root, cpv = argv
-    vartree = portage.db[root]["vartree"]
-    if not vartree.dbapi.cpv_exists(cpv):
-        sys.stderr.write("Package not found: '%s'\n" % cpv)
-        return 1
-    cat, pkg = portage.catsplit(cpv)
-    db = portage.dblink(
-        cat, pkg, root, vartree.settings, treetype="vartree", vartree=vartree
-    )
-    writemsg_stdout(
-        "".join("%s\n" % x for x in sorted(db.getcontents())), noiselevel=-1
-    )
+    docstrings[
+        "contents"
+    ] = """<eroot> <category/package>
+		List the files that are installed for a given package, with
+		one file listed on each line. All file names will begin with
+		<eroot>.
+		"""
+    contents.__doc__ = docstrings["contents"]
+
+    @uses_eroot
+    def owners(argv):
+        if len(argv) < 2:
+            sys.stderr.write("ERROR: insufficient parameters!\n")
+            sys.stderr.flush()
+            return 2
 
+        eroot = argv[0]
+        vardb = portage.db[eroot]["vartree"].dbapi
+        root = portage.settings["ROOT"]
 
-docstrings[
-    "contents"
-] = """<eroot> <category/package>
-	List the files that are installed for a given package, with
-	one file listed on each line. All file names will begin with
-	<eroot>.
-	"""
-contents.__doc__ = docstrings["contents"]
-
-
-@uses_eroot
-def owners(argv):
-    if len(argv) < 2:
-        sys.stderr.write("ERROR: insufficient parameters!\n")
-        sys.stderr.flush()
-        return 2
-
-    eroot = argv[0]
-    vardb = portage.db[eroot]["vartree"].dbapi
-    root = portage.settings["ROOT"]
-
-    cwd = None
-    try:
-        cwd = os.getcwd()
-    except OSError:
-        pass
-
-    files = []
-    orphan_abs_paths = set()
-    orphan_basenames = set()
-    for f in argv[1:]:
-        f = portage.normalize_path(f)
-        is_basename = os.sep not in f
-        if not is_basename and f[:1] != os.sep:
-            if cwd is None:
-                sys.stderr.write("ERROR: cwd does not exist!\n")
+        cwd = None
+        try:
+            cwd = os.getcwd()
+        except OSError:
+            pass
+
+        files = []
+        orphan_abs_paths = set()
+        orphan_basenames = set()
+        for f in argv[1:]:
+            f = portage.normalize_path(f)
+            is_basename = os.sep not in f
+            if not is_basename and f[:1] != os.sep:
+                if cwd is None:
+                    sys.stderr.write("ERROR: cwd does not exist!\n")
+                    sys.stderr.flush()
+                    return 2
+                f = os.path.join(cwd, f)
+                f = portage.normalize_path(f)
+            if not is_basename and not f.startswith(eroot):
+                sys.stderr.write("ERROR: file paths must begin with <eroot>!\n")
                 sys.stderr.flush()
                 return 2
-            f = os.path.join(cwd, f)
-            f = portage.normalize_path(f)
-        if not is_basename and not f.startswith(eroot):
-            sys.stderr.write("ERROR: file paths must begin with <eroot>!\n")
-            sys.stderr.flush()
-            return 2
-        if is_basename:
-            files.append(f)
-            orphan_basenames.add(f)
-        else:
-            files.append(f[len(root) - 1 :])
-            orphan_abs_paths.add(f)
-
-    owners = vardb._owners.get_owners(files)
-
-    msg = []
-    for pkg, owned_files in owners.items():
-        cpv = pkg.mycpv
-        msg.append("%s\n" % cpv)
-        for f in sorted(owned_files):
-            f_abs = os.path.join(root, f.lstrip(os.path.sep))
-            msg.append("\t{}\n".format(f_abs))
-            orphan_abs_paths.discard(f_abs)
-            if orphan_basenames:
-                orphan_basenames.discard(os.path.basename(f_abs))
-
-    writemsg_stdout("".join(msg), noiselevel=-1)
-
-    if orphan_abs_paths or orphan_basenames:
-        orphans = []
-        orphans.extend(orphan_abs_paths)
-        orphans.extend(orphan_basenames)
-        orphans.sort()
+            if is_basename:
+                files.append(f)
+                orphan_basenames.add(f)
+            else:
+                files.append(f[len(root) - 1 :])
+                orphan_abs_paths.add(f)
+
+        owners = vardb._owners.get_owners(files)
+
         msg = []
-        msg.append("None of the installed packages claim these files:\n")
-        for f in orphans:
-            msg.append("\t{}\n".format(f))
-        sys.stderr.write("".join(msg))
-        sys.stderr.flush()
+        for pkg, owned_files in owners.items():
+            cpv = pkg.mycpv
+            msg.append("%s\n" % cpv)
+            for f in sorted(owned_files):
+                f_abs = os.path.join(root, f.lstrip(os.path.sep))
+                msg.append("\t{}\n".format(f_abs))
+                orphan_abs_paths.discard(f_abs)
+                if orphan_basenames:
+                    orphan_basenames.discard(os.path.basename(f_abs))
+
+        writemsg_stdout("".join(msg), noiselevel=-1)
+
+        if orphan_abs_paths or orphan_basenames:
+            orphans = []
+            orphans.extend(orphan_abs_paths)
+            orphans.extend(orphan_basenames)
+            orphans.sort()
+            msg = []
+            msg.append("None of the installed packages claim these files:\n")
+            for f in orphans:
+                msg.append("\t{}\n".format(f))
+            sys.stderr.write("".join(msg))
+            sys.stderr.flush()
 
-    if owners:
-        return 0
-    return 1
-
-
-docstrings[
-    "owners"
-] = """<eroot> [<filename>]+
-	Given a list of files, print the packages that own the files and which
-	files belong to each package. Files owned by a package are listed on
-	the lines below it, indented by a single tab character (\\t). All file
-	paths must either start with <eroot> or be a basename alone.
-	Returns 1 if no owners could be found, and 0 otherwise.
-	"""
-owners.__doc__ = docstrings["owners"]
-
-
-@uses_eroot
-def is_protected(argv):
-    if len(argv) != 2:
-        sys.stderr.write("ERROR: expected 2 parameters, got %d!\n" % len(argv))
-        sys.stderr.flush()
-        return 2
-
-    root, filename = argv
-
-    err = sys.stderr
-    cwd = None
-    try:
-        cwd = os.getcwd()
-    except OSError:
-        pass
-
-    f = portage.normalize_path(filename)
-    if not f.startswith(os.path.sep):
-        if cwd is None:
-            err.write("ERROR: cwd does not exist!\n")
-            err.flush()
+        if owners:
+            return 0
+        return 1
+
+    docstrings[
+        "owners"
+    ] = """<eroot> [<filename>]+
+		Given a list of files, print the packages that own the files and which
+		files belong to each package. Files owned by a package are listed on
+		the lines below it, indented by a single tab character (\\t). All file
+		paths must either start with <eroot> or be a basename alone.
+		Returns 1 if no owners could be found, and 0 otherwise.
+		"""
+    owners.__doc__ = docstrings["owners"]
+
+    @uses_eroot
+    def is_protected(argv):
+        if len(argv) != 2:
+            sys.stderr.write("ERROR: expected 2 parameters, got %d!\n" % len(argv))
+            sys.stderr.flush()
             return 2
-        f = os.path.join(cwd, f)
-        f = portage.normalize_path(f)
-
-    if not f.startswith(root):
-        err.write("ERROR: file paths must begin with <eroot>!\n")
-        err.flush()
-        return 2
-
-    from portage.util import ConfigProtect
-
-    settings = portage.settings
-    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,
-        case_insensitive=("case-insensitive-fs" in settings.features),
-    )
-    if protect_obj.isprotected(f):
-        return 0
-    return 1
-
-
-docstrings[
-    "is_protected"
-] = """<eroot> <filename>
-	Given a single filename, return code 0 if it's protected, 1 otherwise.
-	The filename must begin with <eroot>.
-	"""
-is_protected.__doc__ = docstrings["is_protected"]
-
-
-@uses_eroot
-def filter_protected(argv):
-    if len(argv) != 1:
-        sys.stderr.write("ERROR: expected 1 parameter, got %d!\n" % len(argv))
-        sys.stderr.flush()
-        return 2
-
-    (root,) = argv
-    out = sys.stdout
-    err = sys.stderr
-    cwd = None
-    try:
-        cwd = os.getcwd()
-    except OSError:
-        pass
-
-    from portage.util import ConfigProtect
-
-    settings = portage.settings
-    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,
-        case_insensitive=("case-insensitive-fs" in settings.features),
-    )
 
-    errors = 0
+        root, filename = argv
+
+        err = sys.stderr
+        cwd = None
+        try:
+            cwd = os.getcwd()
+        except OSError:
+            pass
 
-    for line in sys.stdin:
-        filename = line.rstrip("\n")
         f = portage.normalize_path(filename)
         if not f.startswith(os.path.sep):
             if cwd is None:
                 err.write("ERROR: cwd does not exist!\n")
                 err.flush()
-                errors += 1
-                continue
+                return 2
             f = os.path.join(cwd, f)
             f = portage.normalize_path(f)
 
         if not f.startswith(root):
             err.write("ERROR: file paths must begin with <eroot>!\n")
             err.flush()
-            errors += 1
-            continue
-
-        if protect_obj.isprotected(f):
-            out.write("%s\n" % filename)
-    out.flush()
-
-    if errors:
-        return 2
+            return 2
 
-    return 0
+        from portage.util import ConfigProtect
 
+        settings = portage.settings
+        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,
+            case_insensitive=("case-insensitive-fs" in settings.features),
+        )
+        if protect_obj.isprotected(f):
+            return 0
+        return 1
 
-docstrings[
-    "filter_protected"
-] = """<eroot>
-	Read filenames from stdin and write them to stdout if they are protected.
-	All filenames are delimited by \\n and must begin with <eroot>.
-	"""
-filter_protected.__doc__ = docstrings["filter_protected"]
+    docstrings[
+        "is_protected"
+    ] = """<eroot> <filename>
+		Given a single filename, return code 0 if it's protected, 1 otherwise.
+		The filename must begin with <eroot>.
+		"""
+    is_protected.__doc__ = docstrings["is_protected"]
+
+    @uses_eroot
+    def filter_protected(argv):
+        if len(argv) != 1:
+            sys.stderr.write("ERROR: expected 1 parameter, got %d!\n" % len(argv))
+            sys.stderr.flush()
+            return 2
 
+        (root,) = argv
+        out = sys.stdout
+        err = sys.stderr
+        cwd = None
+        try:
+            cwd = os.getcwd()
+        except OSError:
+            pass
+
+        from portage.util import ConfigProtect
+
+        settings = portage.settings
+        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,
+            case_insensitive=("case-insensitive-fs" in settings.features),
+        )
 
-@uses_eroot
-def best_visible(argv):
-    if len(argv) < 2:
-        writemsg("ERROR: insufficient parameters!\n", noiselevel=-1)
-        return 2
+        errors = 0
 
-    pkgtype = "ebuild"
-    if len(argv) > 2:
-        pkgtype = argv[1]
-        atom = argv[2]
-    else:
-        atom = argv[1]
+        for line in sys.stdin:
+            filename = line.rstrip("\n")
+            f = portage.normalize_path(filename)
+            if not f.startswith(os.path.sep):
+                if cwd is None:
+                    err.write("ERROR: cwd does not exist!\n")
+                    err.flush()
+                    errors += 1
+                    continue
+                f = os.path.join(cwd, f)
+                f = portage.normalize_path(f)
 
-    type_map = {"ebuild": "porttree", "binary": "bintree", "installed": "vartree"}
+            if not f.startswith(root):
+                err.write("ERROR: file paths must begin with <eroot>!\n")
+                err.flush()
+                errors += 1
+                continue
 
-    if pkgtype not in type_map:
-        writemsg("Unrecognized package type: '%s'\n" % pkgtype, noiselevel=-1)
-        return 2
+            if protect_obj.isprotected(f):
+                out.write("%s\n" % filename)
+        out.flush()
 
-    eroot = argv[0]
-    db = portage.db[eroot][type_map[pkgtype]].dbapi
+        if errors:
+            return 2
 
-    try:
-        atom = portage.dep_expand(atom, mydb=db, settings=portage.settings)
-    except portage.exception.InvalidAtom:
-        writemsg("ERROR: Invalid atom: '%s'\n" % atom, noiselevel=-1)
-        return 2
+        return 0
 
-    root_config = RootConfig(portage.settings, portage.db[eroot], None)
+    docstrings[
+        "filter_protected"
+    ] = """<eroot>
+		Read filenames from stdin and write them to stdout if they are protected.
+		All filenames are delimited by \\n and must begin with <eroot>.
+		"""
+    filter_protected.__doc__ = docstrings["filter_protected"]
+
+    @uses_eroot
+    def best_visible(argv):
+        if len(argv) < 2:
+            writemsg("ERROR: insufficient parameters!\n", noiselevel=-1)
+            return 2
 
-    if hasattr(db, "xmatch"):
-        cpv_list = db.xmatch("match-all-cpv-only", atom)
-    else:
-        cpv_list = db.match(atom)
-
-    if cpv_list:
-        # reversed, for descending order
-        cpv_list.reverse()
-        # verify match, since the atom may match the package
-        # for a given cpv from one repo but not another, and
-        # we can use match-all-cpv-only to avoid redundant
-        # metadata access.
-        atom_set = InternalPackageSet(initial_atoms=(atom,))
-
-        if atom.repo is None and hasattr(db, "getRepositories"):
-            repo_list = db.getRepositories()
+        pkgtype = "ebuild"
+        if len(argv) > 2:
+            pkgtype = argv[1]
+            atom = argv[2]
         else:
-            repo_list = [atom.repo]
-
-        for cpv in cpv_list:
-            for repo in repo_list:
-                try:
-                    metadata = dict(
-                        zip(
-                            Package.metadata_keys,
-                            db.aux_get(cpv, Package.metadata_keys, myrepo=repo),
-                        )
-                    )
-                except KeyError:
-                    continue
-                pkg = Package(
-                    built=(pkgtype != "ebuild"),
-                    cpv=cpv,
-                    installed=(pkgtype == "installed"),
-                    metadata=metadata,
-                    root_config=root_config,
-                    type_name=pkgtype,
-                )
-                if not atom_set.findAtomForPackage(pkg):
-                    continue
-
-                if pkg.visible:
-                    writemsg_stdout("{}\n".format(pkg.cpv), noiselevel=-1)
-                    return os.EX_OK
-
-    # No package found, write out an empty line.
-    writemsg_stdout("\n", noiselevel=-1)
-
-    return 1
-
+            atom = argv[1]
 
-docstrings[
-    "best_visible"
-] = """<eroot> [pkgtype] <atom>
-	Returns category/package-version (without .ebuild).
-	The pkgtype argument defaults to "ebuild" if unspecified,
-	otherwise it must be one of ebuild, binary, or installed.
-	"""
-best_visible.__doc__ = docstrings["best_visible"]
+        type_map = {"ebuild": "porttree", "binary": "bintree", "installed": "vartree"}
 
+        if pkgtype not in type_map:
+            writemsg("Unrecognized package type: '%s'\n" % pkgtype, noiselevel=-1)
+            return 2
 
-@uses_eroot
-def mass_best_visible(argv):
-    type_map = {"ebuild": "porttree", "binary": "bintree", "installed": "vartree"}
+        eroot = argv[0]
+        db = portage.db[eroot][type_map[pkgtype]].dbapi
 
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!")
-        return 2
-    try:
-        root = argv.pop(0)
-        pkgtype = "ebuild"
-        if argv[0] in type_map:
-            pkgtype = argv.pop(0)
-        for pack in argv:
-            writemsg_stdout("%s:" % pack, noiselevel=-1)
-            best_visible([root, pkgtype, pack])
-    except KeyError:
-        return 1
+        try:
+            atom = portage.dep_expand(atom, mydb=db, settings=portage.settings)
+        except portage.exception.InvalidAtom:
+            writemsg("ERROR: Invalid atom: '%s'\n" % atom, noiselevel=-1)
+            return 2
 
+        root_config = RootConfig(portage.settings, portage.db[eroot], None)
 
-docstrings[
-    "mass_best_visible"
-] = """<eroot> [<type>] [<category/package>]+
-	Returns category/package-version (without .ebuild).
-	The pkgtype argument defaults to "ebuild" if unspecified,
-	otherwise it must be one of ebuild, binary, or installed.
-	"""
-mass_best_visible.__doc__ = docstrings["mass_best_visible"]
-
-
-@uses_eroot
-def all_best_visible(argv):
-    if len(argv) < 1:
-        sys.stderr.write("ERROR: insufficient parameters!\n")
-        sys.stderr.flush()
-        return 2
-
-    # print portage.db[argv[0]]["porttree"].dbapi.cp_all()
-    for pkg in portage.db[argv[0]]["porttree"].dbapi.cp_all():
-        mybest = portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg))
-        if mybest:
-            print(mybest)
-
-
-docstrings[
-    "all_best_visible"
-] = """<eroot>
-	Returns all best_visible packages (without .ebuild).
-	"""
-all_best_visible.__doc__ = docstrings["all_best_visible"]
-
-
-@uses_eroot
-def match(argv):
-    if len(argv) != 2:
-        print("ERROR: expected 2 parameters, got %d!" % len(argv))
-        return 2
-    root, atom = argv
-    if not atom:
-        atom = "*/*"
-
-    vardb = portage.db[root]["vartree"].dbapi
-    try:
-        atom = portage.dep.Atom(atom, allow_wildcard=True, allow_repo=True)
-    except portage.exception.InvalidAtom:
-        # maybe it's valid but missing category
-        atom = portage.dep_expand(atom, mydb=vardb, settings=vardb.settings)
-
-    if atom.extended_syntax:
-        if atom == "*/*":
-            results = vardb.cpv_all()
+        if hasattr(db, "xmatch"):
+            cpv_list = db.xmatch("match-all-cpv-only", atom)
         else:
-            results = []
-            require_metadata = atom.slot or atom.repo
-            for cpv in vardb.cpv_all():
-
-                if not portage.match_from_list(atom, [cpv]):
-                    continue
+            cpv_list = db.match(atom)
+
+        if cpv_list:
+            # reversed, for descending order
+            cpv_list.reverse()
+            # verify match, since the atom may match the package
+            # for a given cpv from one repo but not another, and
+            # we can use match-all-cpv-only to avoid redundant
+            # metadata access.
+            atom_set = InternalPackageSet(initial_atoms=(atom,))
+
+            if atom.repo is None and hasattr(db, "getRepositories"):
+                repo_list = db.getRepositories()
+            else:
+                repo_list = [atom.repo]
 
-                if require_metadata:
+            for cpv in cpv_list:
+                for repo in repo_list:
                     try:
-                        cpv = vardb._pkg_str(cpv, atom.repo)
-                    except (KeyError, portage.exception.InvalidData):
+                        metadata = dict(
+                            zip(
+                                Package.metadata_keys,
+                                db.aux_get(cpv, Package.metadata_keys, myrepo=repo),
+                            )
+                        )
+                    except KeyError:
                         continue
-                    if not portage.match_from_list(atom, [cpv]):
+                    pkg = Package(
+                        built=(pkgtype != "ebuild"),
+                        cpv=cpv,
+                        installed=(pkgtype == "installed"),
+                        metadata=metadata,
+                        root_config=root_config,
+                        type_name=pkgtype,
+                    )
+                    if not atom_set.findAtomForPackage(pkg):
                         continue
 
-                results.append(cpv)
-
-        results.sort()
-    else:
-        results = vardb.match(atom)
-    for cpv in results:
-        print(cpv)
-
-
-docstrings[
-    "match"
-] = """<eroot> <atom>
-	Returns a \\n separated list of category/package-version.
-	When given an empty string, all installed packages will
-	be listed.
-	"""
-match.__doc__ = docstrings["match"]
-
-
-@uses_eroot
-def expand_virtual(argv):
-    if len(argv) != 2:
-        writemsg("ERROR: expected 2 parameters, got %d!\n" % len(argv), noiselevel=-1)
-        return 2
-
-    root, atom = argv
-
-    try:
-        results = list(expand_new_virt(portage.db[root]["vartree"].dbapi, atom))
-    except portage.exception.InvalidAtom:
-        writemsg("ERROR: Invalid atom: '%s'\n" % atom, noiselevel=-1)
-        return 2
-
-    results.sort()
-    for x in results:
-        if not x.blocker:
-            writemsg_stdout("{}\n".format(x))
-
-    return os.EX_OK
-
-
-docstrings[
-    "expand_virtual"
-] = """<eroot> <atom>
-	Returns a \\n separated list of atoms expanded from a
-	given virtual atom (GLEP 37 virtuals only),
-	excluding blocker atoms. Satisfied
-	virtual atoms are not included in the output, since
-	they are expanded to real atoms which are displayed.
-	Unsatisfied virtual atoms are displayed without
-	any expansion. The "match" command can be used to
-	resolve the returned atoms to specific installed
-	packages.
-	"""
-expand_virtual.__doc__ = docstrings["expand_virtual"]
-
-
-def vdb_path(_argv):
-    out = sys.stdout
-    out.write(os.path.join(portage.settings["EROOT"], portage.VDB_PATH) + "\n")
-    out.flush()
-    return os.EX_OK
-
-
-docstrings[
-    "vdb_path"
-] = """
-	Returns the path used for the var(installed) package database for the
-	set environment/configuration options.
-	"""
-vdb_path.__doc__ = docstrings["vdb_path"]
-
-
-def gentoo_mirrors(_argv):
-    print(portage.settings["GENTOO_MIRRORS"])
-
-
-docstrings[
-    "gentoo_mirrors"
-] = """
-	Returns the mirrors set to use in the portage configuration.
-	"""
-gentoo_mirrors.__doc__ = docstrings["gentoo_mirrors"]
-
-
-@uses_configroot
-@uses_eroot
-def repositories_configuration(argv):
-    if len(argv) < 1:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 3
-    sys.stdout.write(
-        portage.db[argv[0]]["vartree"].settings.repositories.config_string()
-    )
-    sys.stdout.flush()
-
-
-docstrings[
-    "repositories_configuration"
-] = """<eroot>
-	Returns the configuration of repositories.
-	"""
-repositories_configuration.__doc__ = docstrings["repositories_configuration"]
-
-
-@uses_configroot
-@uses_eroot
-def repos_config(argv):
-    return repositories_configuration(argv)
-
-
-docstrings[
-    "repos_config"
-] = """
-	<eroot>
-	This is an alias for the repositories_configuration command.
-	"""
-repos_config.__doc__ = docstrings["repos_config"]
-
-
-def portdir(_argv):
-    print(
-        "WARNING: 'portageq portdir' is deprecated. Use the get_repo_path "
-        "command instead. eg: "
-        "'portageq get_repo_path / gentoo' instead.",
-        file=sys.stderr,
-    )
-    print(portage.settings["PORTDIR"])
-
+                    if pkg.visible:
+                        writemsg_stdout("{}\n".format(pkg.cpv), noiselevel=-1)
+                        return os.EX_OK
 
-docstrings[
-    "portdir"
-] = """
-	Returns the PORTDIR path.
-	Deprecated in favor of get_repo_path command.
-	"""
-portdir.__doc__ = docstrings["portdir"]
+        # No package found, write out an empty line.
+        writemsg_stdout("\n", noiselevel=-1)
 
+        return 1
 
-def config_protect(_argv):
-    print(portage.settings["CONFIG_PROTECT"])
-
-
-docstrings[
-    "config_protect"
-] = """
-	Returns the CONFIG_PROTECT paths.
-	"""
-config_protect.__doc__ = docstrings["config_protect"]
-
-
-def config_protect_mask(_argv):
-    print(portage.settings["CONFIG_PROTECT_MASK"])
-
-
-docstrings[
-    "config_protect_mask"
-] = """
-	Returns the CONFIG_PROTECT_MASK paths.
-	"""
-config_protect_mask.__doc__ = docstrings["config_protect_mask"]
-
-
-def portdir_overlay(_argv):
-    print(
-        "WARNING: 'portageq portdir_overlay' is deprecated. Use the get_repos"
-        " and get_repo_path commands or the repos_config command instead. eg: "
-        "'portageq repos_config /'",
-        file=sys.stderr,
-    )
-    print(portage.settings["PORTDIR_OVERLAY"])
-
-
-docstrings[
-    "portdir_overlay"
-] = """
-	Returns the PORTDIR_OVERLAY path.
-	Deprecated in favor of get_repos & get_repo_path or repos_config commands.
-	"""
-portdir_overlay.__doc__ = docstrings["portdir_overlay"]
-
-
-def pkgdir(_argv):
-    print(portage.settings["PKGDIR"])
-
-
-docstrings[
-    "pkgdir"
-] = """
-	Returns the PKGDIR path.
-	"""
-pkgdir.__doc__ = docstrings["pkgdir"]
-
+    docstrings[
+        "best_visible"
+    ] = """<eroot> [pkgtype] <atom>
+		Returns category/package-version (without .ebuild).
+		The pkgtype argument defaults to "ebuild" if unspecified,
+		otherwise it must be one of ebuild, binary, or installed.
+		"""
+    best_visible.__doc__ = docstrings["best_visible"]
+
+    @uses_eroot
+    def mass_best_visible(argv):
+        type_map = {"ebuild": "porttree", "binary": "bintree", "installed": "vartree"}
+
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!")
+            return 2
+        try:
+            root = argv.pop(0)
+            pkgtype = "ebuild"
+            if argv[0] in type_map:
+                pkgtype = argv.pop(0)
+            for pack in argv:
+                writemsg_stdout("%s:" % pack, noiselevel=-1)
+                best_visible([root, pkgtype, pack])
+        except KeyError:
+            return 1
 
-def distdir(_argv):
-    print(portage.settings["DISTDIR"])
+    docstrings[
+        "mass_best_visible"
+    ] = """<eroot> [<type>] [<category/package>]+
+		Returns category/package-version (without .ebuild).
+		The pkgtype argument defaults to "ebuild" if unspecified,
+		otherwise it must be one of ebuild, binary, or installed.
+		"""
+    mass_best_visible.__doc__ = docstrings["mass_best_visible"]
+
+    @uses_eroot
+    def all_best_visible(argv):
+        if len(argv) < 1:
+            sys.stderr.write("ERROR: insufficient parameters!\n")
+            sys.stderr.flush()
+            return 2
 
+        # print portage.db[argv[0]]["porttree"].dbapi.cp_all()
+        for pkg in portage.db[argv[0]]["porttree"].dbapi.cp_all():
+            mybest = portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg))
+            if mybest:
+                print(mybest)
+
+    docstrings[
+        "all_best_visible"
+    ] = """<eroot>
+		Returns all best_visible packages (without .ebuild).
+		"""
+    all_best_visible.__doc__ = docstrings["all_best_visible"]
+
+    @uses_eroot
+    def match(argv):
+        if len(argv) != 2:
+            print("ERROR: expected 2 parameters, got %d!" % len(argv))
+            return 2
+        root, atom = argv
+        if not atom:
+            atom = "*/*"
 
-docstrings[
-    "distdir"
-] = """
-	Returns the DISTDIR path.
-	"""
-distdir.__doc__ = docstrings["distdir"]
+        vardb = portage.db[root]["vartree"].dbapi
+        try:
+            atom = portage.dep.Atom(atom, allow_wildcard=True, allow_repo=True)
+        except portage.exception.InvalidAtom:
+            # maybe it's valid but missing category
+            atom = portage.dep_expand(atom, mydb=vardb, settings=vardb.settings)
 
+        if atom.extended_syntax:
+            if atom == "*/*":
+                results = vardb.cpv_all()
+            else:
+                results = []
+                require_metadata = atom.slot or atom.repo
+                for cpv in vardb.cpv_all():
 
-def colormap(_argv):
-    print(portage.output.colormap())
+                    if not portage.match_from_list(atom, [cpv]):
+                        continue
 
+                    if require_metadata:
+                        try:
+                            cpv = vardb._pkg_str(cpv, atom.repo)
+                        except (KeyError, portage.exception.InvalidData):
+                            continue
+                        if not portage.match_from_list(atom, [cpv]):
+                            continue
 
-docstrings[
-    "colormap"
-] = """
-	Display the color.map as environment variables.
-	"""
-colormap.__doc__ = docstrings["colormap"]
+                    results.append(cpv)
 
+            results.sort()
+        else:
+            results = vardb.match(atom)
+        for cpv in results:
+            print(cpv)
+
+    docstrings[
+        "match"
+    ] = """<eroot> <atom>
+		Returns a \\n separated list of category/package-version.
+		When given an empty string, all installed packages will
+		be listed.
+		"""
+    match.__doc__ = docstrings["match"]
+
+    @uses_eroot
+    def expand_virtual(argv):
+        if len(argv) != 2:
+            writemsg(
+                "ERROR: expected 2 parameters, got %d!\n" % len(argv), noiselevel=-1
+            )
+            return 2
 
-def envvar(argv):
-    verbose = "-v" in argv
-    if verbose:
-        argv.pop(argv.index("-v"))
+        root, atom = argv
 
-    if len(argv) == 0:
-        print("ERROR: insufficient parameters!")
-        return 2
+        try:
+            results = list(expand_new_virt(portage.db[root]["vartree"].dbapi, atom))
+        except portage.exception.InvalidAtom:
+            writemsg("ERROR: Invalid atom: '%s'\n" % atom, noiselevel=-1)
+            return 2
 
-    exit_status = 0
+        results.sort()
+        for x in results:
+            if not x.blocker:
+                writemsg_stdout("{}\n".format(x))
 
-    for arg in argv:
-        if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
-            print(
-                "WARNING: 'portageq envvar %s' is deprecated. Use any of "
-                "'get_repos, get_repo_path, repos_config' instead." % arg,
-                file=sys.stderr,
-            )
+        return os.EX_OK
 
-        value = portage.settings.get(arg)
-        if value is None:
-            value = ""
-            exit_status = 1
+    docstrings[
+        "expand_virtual"
+    ] = """<eroot> <atom>
+		Returns a \\n separated list of atoms expanded from a
+		given virtual atom (GLEP 37 virtuals only),
+		excluding blocker atoms. Satisfied
+		virtual atoms are not included in the output, since
+		they are expanded to real atoms which are displayed.
+		Unsatisfied virtual atoms are displayed without
+		any expansion. The "match" command can be used to
+		resolve the returned atoms to specific installed
+		packages.
+		"""
+    expand_virtual.__doc__ = docstrings["expand_virtual"]
+
+    def vdb_path(_argv):
+        out = sys.stdout
+        out.write(os.path.join(portage.settings["EROOT"], portage.VDB_PATH) + "\n")
+        out.flush()
+        return os.EX_OK
 
+    docstrings[
+        "vdb_path"
+    ] = """
+		Returns the path used for the var(installed) package database for the
+		set environment/configuration options.
+		"""
+    vdb_path.__doc__ = docstrings["vdb_path"]
+
+    def gentoo_mirrors(_argv):
+        print(portage.settings["GENTOO_MIRRORS"])
+
+    docstrings[
+        "gentoo_mirrors"
+    ] = """
+		Returns the mirrors set to use in the portage configuration.
+		"""
+    gentoo_mirrors.__doc__ = docstrings["gentoo_mirrors"]
+
+    @uses_configroot
+    @uses_eroot
+    def repositories_configuration(argv):
+        if len(argv) < 1:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 3
+        sys.stdout.write(
+            portage.db[argv[0]]["vartree"].settings.repositories.config_string()
+        )
+        sys.stdout.flush()
+
+    docstrings[
+        "repositories_configuration"
+    ] = """<eroot>
+		Returns the configuration of repositories.
+		"""
+    repositories_configuration.__doc__ = docstrings["repositories_configuration"]
+
+    @uses_configroot
+    @uses_eroot
+    def repos_config(argv):
+        return repositories_configuration(argv)
+
+    docstrings[
+        "repos_config"
+    ] = """
+		<eroot>
+		This is an alias for the repositories_configuration command.
+		"""
+    repos_config.__doc__ = docstrings["repos_config"]
+
+    def portdir(_argv):
+        print(
+            "WARNING: 'portageq portdir' is deprecated. Use the get_repo_path "
+            "command instead. eg: "
+            "'portageq get_repo_path / gentoo' instead.",
+            file=sys.stderr,
+        )
+        print(portage.settings["PORTDIR"])
+
+    docstrings[
+        "portdir"
+    ] = """
+		Returns the PORTDIR path.
+		Deprecated in favor of get_repo_path command.
+		"""
+    portdir.__doc__ = docstrings["portdir"]
+
+    def config_protect(_argv):
+        print(portage.settings["CONFIG_PROTECT"])
+
+    docstrings[
+        "config_protect"
+    ] = """
+		Returns the CONFIG_PROTECT paths.
+		"""
+    config_protect.__doc__ = docstrings["config_protect"]
+
+    def config_protect_mask(_argv):
+        print(portage.settings["CONFIG_PROTECT_MASK"])
+
+    docstrings[
+        "config_protect_mask"
+    ] = """
+		Returns the CONFIG_PROTECT_MASK paths.
+		"""
+    config_protect_mask.__doc__ = docstrings["config_protect_mask"]
+
+    def portdir_overlay(_argv):
+        print(
+            "WARNING: 'portageq portdir_overlay' is deprecated. Use the get_repos"
+            " and get_repo_path commands or the repos_config command instead. eg: "
+            "'portageq repos_config /'",
+            file=sys.stderr,
+        )
+        print(portage.settings["PORTDIR_OVERLAY"])
+
+    docstrings[
+        "portdir_overlay"
+    ] = """
+		Returns the PORTDIR_OVERLAY path.
+		Deprecated in favor of get_repos & get_repo_path or repos_config commands.
+		"""
+    portdir_overlay.__doc__ = docstrings["portdir_overlay"]
+
+    def pkgdir(_argv):
+        print(portage.settings["PKGDIR"])
+
+    docstrings[
+        "pkgdir"
+    ] = """
+		Returns the PKGDIR path.
+		"""
+    pkgdir.__doc__ = docstrings["pkgdir"]
+
+    def distdir(_argv):
+        print(portage.settings["DISTDIR"])
+
+    docstrings[
+        "distdir"
+    ] = """
+		Returns the DISTDIR path.
+		"""
+    distdir.__doc__ = docstrings["distdir"]
+
+    def colormap(_argv):
+        print(portage.output.colormap())
+
+    docstrings[
+        "colormap"
+    ] = """
+		Display the color.map as environment variables.
+		"""
+    colormap.__doc__ = docstrings["colormap"]
+
+    def envvar(argv):
+        verbose = "-v" in argv
         if verbose:
-            print(arg + "=" + portage._shell_quote(value))
-        else:
-            print(value)
+            argv.pop(argv.index("-v"))
 
-    return exit_status
+        if len(argv) == 0:
+            print("ERROR: insufficient parameters!")
+            return 2
 
+        exit_status = 0
 
-docstrings[
-    "envvar"
-] = """<variable>+
-	Returns a specific environment variable as exists prior to ebuild.sh.
-	Similar to: emerge --verbose --info | grep -E '^<variable>='
-	"""
-envvar.__doc__ = docstrings["envvar"]
+        for arg in argv:
+            if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
+                print(
+                    "WARNING: 'portageq envvar %s' is deprecated. Use any of "
+                    "'get_repos, get_repo_path, repos_config' instead." % arg,
+                    file=sys.stderr,
+                )
 
+            value = portage.settings.get(arg)
+            if value is None:
+                value = ""
+                exit_status = 1
 
-@uses_configroot
-@uses_eroot
-def get_repos(argv):
-    if len(argv) < 1:
-        print("ERROR: insufficient parameters!")
-        return 2
-    print(
-        " ".join(
-            reversed(portage.db[argv[0]]["vartree"].settings.repositories.prepos_order)
+            if verbose:
+                print(arg + "=" + portage._shell_quote(value))
+            else:
+                print(value)
+
+        return exit_status
+
+    docstrings[
+        "envvar"
+    ] = """<variable>+
+		Returns a specific environment variable as exists prior to ebuild.sh.
+		Similar to: emerge --verbose --info | grep -E '^<variable>='
+		"""
+    envvar.__doc__ = docstrings["envvar"]
+
+    @uses_configroot
+    @uses_eroot
+    def get_repos(argv):
+        if len(argv) < 1:
+            print("ERROR: insufficient parameters!")
+            return 2
+        print(
+            " ".join(
+                reversed(
+                    portage.db[argv[0]]["vartree"].settings.repositories.prepos_order
+                )
+            )
         )
-    )
 
-
-docstrings[
-    "get_repos"
-] = """<eroot>
-	Returns all repos with names (repo_name file) argv[0] = ${EROOT}
-	"""
-get_repos.__doc__ = docstrings["get_repos"]
-
-
-@uses_configroot
-@uses_eroot
-def master_repositories(argv):
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 3
-    for arg in argv[1:]:
-        if portage.dep._repo_name_re.match(arg) is None:
-            print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
+    docstrings[
+        "get_repos"
+    ] = """<eroot>
+		Returns all repos with names (repo_name file) argv[0] = ${EROOT}
+		"""
+    get_repos.__doc__ = docstrings["get_repos"]
+
+    @uses_configroot
+    @uses_eroot
+    def master_repositories(argv):
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 3
+        for arg in argv[1:]:
+            if portage.dep._repo_name_re.match(arg) is None:
+                print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
+                return 2
+            try:
+                repo = portage.db[argv[0]]["vartree"].settings.repositories[arg]
+            except KeyError:
+                print("")
+                return 1
+            else:
+                print(" ".join(x.name for x in repo.masters))
+
+    docstrings[
+        "master_repositories"
+    ] = """<eroot> <repo_id>+
+		Returns space-separated list of master repositories for specified repository.
+		"""
+    master_repositories.__doc__ = docstrings["master_repositories"]
+
+    @uses_configroot
+    @uses_eroot
+    def master_repos(argv):
+        return master_repositories(argv)
+
+    docstrings[
+        "master_repos"
+    ] = """<eroot> <repo_id>+
+		This is an alias for the master_repositories command.
+		"""
+    master_repos.__doc__ = docstrings["master_repos"]
+
+    @uses_configroot
+    @uses_eroot
+    def get_repo_path(argv):
+
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 3
+        for arg in argv[1:]:
+            if portage.dep._repo_name_re.match(arg) is None:
+                print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
+                return 2
+            path = portage.db[argv[0]]["vartree"].settings.repositories.treemap.get(arg)
+            if path is None:
+                print("")
+                return 1
+            print(path)
+
+    docstrings[
+        "get_repo_path"
+    ] = """<eroot> <repo_id>+
+		Returns the path to the repo named argv[1], argv[0] = ${EROOT}
+		"""
+    get_repo_path.__doc__ = docstrings["get_repo_path"]
+
+    @uses_eroot
+    def available_eclasses(argv):
+        if len(argv) < 2:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 3
+        for arg in argv[1:]:
+            if portage.dep._repo_name_re.match(arg) is None:
+                print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
+                return 2
+            try:
+                repo = portage.db[argv[0]]["vartree"].settings.repositories[arg]
+            except KeyError:
+                print("")
+                return 1
+            else:
+                print(" ".join(sorted(repo.eclass_db.eclasses)))
+
+    docstrings[
+        "available_eclasses"
+    ] = """<eroot> <repo_id>+
+		Returns space-separated list of available eclasses for specified repository.
+		"""
+    available_eclasses.__doc__ = docstrings["available_eclasses"]
+
+    @uses_eroot
+    def eclass_path(argv):
+        if len(argv) < 3:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 3
+        if portage.dep._repo_name_re.match(argv[1]) is None:
+            print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr)
             return 2
         try:
-            repo = portage.db[argv[0]]["vartree"].settings.repositories[arg]
+            repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]]
         except KeyError:
             print("")
             return 1
         else:
-            print(" ".join(x.name for x in repo.masters))
-
-
-docstrings[
-    "master_repositories"
-] = """<eroot> <repo_id>+
-	Returns space-separated list of master repositories for specified repository.
-	"""
-master_repositories.__doc__ = docstrings["master_repositories"]
-
-
-@uses_configroot
-@uses_eroot
-def master_repos(argv):
-    return master_repositories(argv)
-
-
-docstrings[
-    "master_repos"
-] = """<eroot> <repo_id>+
-	This is an alias for the master_repositories command.
-	"""
-master_repos.__doc__ = docstrings["master_repos"]
-
-
-@uses_configroot
-@uses_eroot
-def get_repo_path(argv):
-
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 3
-    for arg in argv[1:]:
-        if portage.dep._repo_name_re.match(arg) is None:
-            print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
-            return 2
-        path = portage.db[argv[0]]["vartree"].settings.repositories.treemap.get(arg)
-        if path is None:
-            print("")
-            return 1
-        print(path)
-
-
-docstrings[
-    "get_repo_path"
-] = """<eroot> <repo_id>+
-	Returns the path to the repo named argv[1], argv[0] = ${EROOT}
-	"""
-get_repo_path.__doc__ = docstrings["get_repo_path"]
-
-
-@uses_eroot
-def available_eclasses(argv):
-    if len(argv) < 2:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 3
-    for arg in argv[1:]:
-        if portage.dep._repo_name_re.match(arg) is None:
-            print("ERROR: invalid repository: %s" % arg, file=sys.stderr)
+            retval = 0
+            for arg in argv[2:]:
+                try:
+                    eclass = repo.eclass_db.eclasses[arg]
+                except KeyError:
+                    print("")
+                    retval = 1
+                else:
+                    print(eclass.location)
+            return retval
+
+    docstrings[
+        "eclass_path"
+    ] = """<eroot> <repo_id> <eclass>+
+		Returns the path to specified eclass for specified repository.
+		"""
+    eclass_path.__doc__ = docstrings["eclass_path"]
+
+    @uses_eroot
+    def license_path(argv):
+        if len(argv) < 3:
+            print("ERROR: insufficient parameters!", file=sys.stderr)
+            return 3
+        if portage.dep._repo_name_re.match(argv[1]) is None:
+            print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr)
             return 2
         try:
-            repo = portage.db[argv[0]]["vartree"].settings.repositories[arg]
+            repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]]
         except KeyError:
             print("")
             return 1
         else:
-            print(" ".join(sorted(repo.eclass_db.eclasses)))
-
-
-docstrings[
-    "available_eclasses"
-] = """<eroot> <repo_id>+
-	Returns space-separated list of available eclasses for specified repository.
-	"""
-available_eclasses.__doc__ = docstrings["available_eclasses"]
-
-
-@uses_eroot
-def eclass_path(argv):
-    if len(argv) < 3:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 3
-    if portage.dep._repo_name_re.match(argv[1]) is None:
-        print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr)
-        return 2
-    try:
-        repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]]
-    except KeyError:
-        print("")
-        return 1
-    else:
-        retval = 0
-        for arg in argv[2:]:
-            try:
-                eclass = repo.eclass_db.eclasses[arg]
-            except KeyError:
-                print("")
-                retval = 1
-            else:
-                print(eclass.location)
-        return retval
-
-
-docstrings[
-    "eclass_path"
-] = """<eroot> <repo_id> <eclass>+
-	Returns the path to specified eclass for specified repository.
-	"""
-eclass_path.__doc__ = docstrings["eclass_path"]
-
-
-@uses_eroot
-def license_path(argv):
-    if len(argv) < 3:
-        print("ERROR: insufficient parameters!", file=sys.stderr)
-        return 3
-    if portage.dep._repo_name_re.match(argv[1]) is None:
-        print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr)
-        return 2
-    try:
-        repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]]
-    except KeyError:
-        print("")
-        return 1
-    else:
-        retval = 0
-        for arg in argv[2:]:
-            eclass_path = ""
-            paths = reversed(
-                [
-                    os.path.join(x.location, "licenses", arg)
-                    for x in list(repo.masters) + [repo]
-                ]
-            )
-            for path in paths:
-                if os.path.exists(path):
-                    eclass_path = path
+            retval = 0
+            for arg in argv[2:]:
+                eclass_path = ""
+                paths = reversed(
+                    [
+                        os.path.join(x.location, "licenses", arg)
+                        for x in list(repo.masters) + [repo]
+                    ]
+                )
+                for path in paths:
+                    if os.path.exists(path):
+                        eclass_path = path
+                        break
+                if eclass_path == "":
+                    retval = 1
+                print(eclass_path)
+            return retval
+
+    docstrings[
+        "license_path"
+    ] = """<eroot> <repo_id> <license>+
+		Returns the path to specified license for specified repository.
+		"""
+    license_path.__doc__ = docstrings["license_path"]
+
+    @uses_eroot
+    def list_preserved_libs(argv):
+        if len(argv) != 1:
+            print("ERROR: wrong number of arguments")
+            return 2
+        mylibs = portage.db[argv[0]]["vartree"].dbapi._plib_registry.getPreservedLibs()
+        rValue = 1
+        msg = []
+        for cpv in sorted(mylibs):
+            msg.append(cpv)
+            for path in mylibs[cpv]:
+                msg.append(" " + path)
+                rValue = 0
+            msg.append("\n")
+        writemsg_stdout("".join(msg), noiselevel=-1)
+        return rValue
+
+    docstrings[
+        "list_preserved_libs"
+    ] = """<eroot>
+		Print a list of libraries preserved during a package update in the form
+		package: path. Returns 1 if no preserved libraries could be found,
+		0 otherwise.
+		"""
+    list_preserved_libs.__doc__ = docstrings["list_preserved_libs"]
+
+    class MaintainerEmailMatcher:
+        def __init__(self, maintainer_emails):
+            self._re = re.compile("^(%s)$" % "|".join(maintainer_emails), re.I)
+
+        def __call__(self, metadata_xml):
+            match = False
+            matcher = self._re.match
+            for x in metadata_xml.maintainers():
+                if x.email is not None and matcher(x.email) is not None:
+                    match = True
                     break
-            if eclass_path == "":
-                retval = 1
-            print(eclass_path)
-        return retval
-
-
-docstrings[
-    "license_path"
-] = """<eroot> <repo_id> <license>+
-	Returns the path to specified license for specified repository.
-	"""
-license_path.__doc__ = docstrings["license_path"]
-
-
-@uses_eroot
-def list_preserved_libs(argv):
-    if len(argv) != 1:
-        print("ERROR: wrong number of arguments")
-        return 2
-    mylibs = portage.db[argv[0]]["vartree"].dbapi._plib_registry.getPreservedLibs()
-    rValue = 1
-    msg = []
-    for cpv in sorted(mylibs):
-        msg.append(cpv)
-        for path in mylibs[cpv]:
-            msg.append(" " + path)
-            rValue = 0
-        msg.append("\n")
-    writemsg_stdout("".join(msg), noiselevel=-1)
-    return rValue
-
-
-docstrings[
-    "list_preserved_libs"
-] = """<eroot>
-	Print a list of libraries preserved during a package update in the form
-	package: path. Returns 1 if no preserved libraries could be found,
-	0 otherwise.
-	"""
-list_preserved_libs.__doc__ = docstrings["list_preserved_libs"]
-
-
-class MaintainerEmailMatcher:
-    def __init__(self, maintainer_emails):
-        self._re = re.compile("^(%s)$" % "|".join(maintainer_emails), re.I)
-
-    def __call__(self, metadata_xml):
-        match = False
-        matcher = self._re.match
-        for x in metadata_xml.maintainers():
-            if x.email is not None and matcher(x.email) is not None:
-                match = True
-                break
-        return match
-
-
-# Match if metadata.xml contains no maintainer (orphaned package)
-def match_orphaned(metadata_xml):
-    if not metadata_xml.maintainers():
-        return True
-    else:
-        return False
+            return match
 
+    # Match if metadata.xml contains no maintainer (orphaned package)
+    def match_orphaned(metadata_xml):
+        if not metadata_xml.maintainers():
+            return True
+        else:
+            return False
 
-def pquery(parser, opts, args):
-    portdb = portage.db[portage.root]["porttree"].dbapi
-    root_config = RootConfig(portdb.settings, portage.db[portage.root], None)
+    def pquery(parser, opts, args):
+        portdb = portage.db[portage.root]["porttree"].dbapi
+        root_config = RootConfig(portdb.settings, portage.db[portage.root], None)
 
-    def _pkg(cpv, repo_name):
-        try:
-            metadata = dict(
-                zip(
-                    Package.metadata_keys,
-                    portdb.aux_get(cpv, Package.metadata_keys, myrepo=repo_name),
+        def _pkg(cpv, repo_name):
+            try:
+                metadata = dict(
+                    zip(
+                        Package.metadata_keys,
+                        portdb.aux_get(cpv, Package.metadata_keys, myrepo=repo_name),
+                    )
                 )
+            except KeyError:
+                raise portage.exception.PackageNotFound(cpv)
+            return Package(
+                built=False,
+                cpv=cpv,
+                installed=False,
+                metadata=metadata,
+                root_config=root_config,
+                type_name="ebuild",
             )
-        except KeyError:
-            raise portage.exception.PackageNotFound(cpv)
-        return Package(
-            built=False,
-            cpv=cpv,
-            installed=False,
-            metadata=metadata,
-            root_config=root_config,
-            type_name="ebuild",
-        )
 
-    need_metadata = False
-    atoms = []
-    for arg in args:
-        if "/" not in arg.split(":")[0]:
-            atom = insert_category_into_atom(arg, "*")
-            if atom is None:
+        need_metadata = False
+        atoms = []
+        for arg in args:
+            if "/" not in arg.split(":")[0]:
+                atom = insert_category_into_atom(arg, "*")
+                if atom is None:
+                    writemsg("ERROR: Invalid atom: '%s'\n" % arg, noiselevel=-1)
+                    return 2
+            else:
+                atom = arg
+
+            try:
+                atom = portage.dep.Atom(atom, allow_wildcard=True, allow_repo=True)
+            except portage.exception.InvalidAtom:
                 writemsg("ERROR: Invalid atom: '%s'\n" % arg, noiselevel=-1)
                 return 2
-        else:
-            atom = arg
 
-        try:
-            atom = portage.dep.Atom(atom, allow_wildcard=True, allow_repo=True)
-        except portage.exception.InvalidAtom:
-            writemsg("ERROR: Invalid atom: '%s'\n" % arg, noiselevel=-1)
-            return 2
+            if atom.slot is not None:
+                need_metadata = True
 
-        if atom.slot is not None:
-            need_metadata = True
+            atoms.append(atom)
 
-        atoms.append(atom)
+        if "*/*" in atoms:
+            del atoms[:]
+            need_metadata = False
 
-    if "*/*" in atoms:
-        del atoms[:]
-        need_metadata = False
-
-    if not opts.no_filters:
-        need_metadata = True
-
-    xml_matchers = []
-    if opts.maintainer_email:
-        maintainer_emails = []
-        for x in opts.maintainer_email:
-            maintainer_emails.extend(x.split(","))
-        if opts.no_regex:  # Escape regex-special characters for an exact match
-            maintainer_emails = [re.escape(x) for x in maintainer_emails]
-        xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
-    if opts.orphaned:
-        xml_matchers.append(match_orphaned)
-
-    if opts.repo is not None:
-        repos = [portdb.repositories[opts.repo]]
-    else:
-        repos = list(portdb.repositories)
+        if not opts.no_filters:
+            need_metadata = True
 
-    if not atoms:
-        names = None
-        categories = list(portdb.categories)
-    else:
-        category_wildcard = False
-        name_wildcard = False
-        categories = []
-        names = []
-        for atom in atoms:
-            category, name = portage.catsplit(atom.cp)
-            categories.append(category)
-            names.append(name)
-            if "*" in category:
-                category_wildcard = True
-            if "*" in name:
-                name_wildcard = True
-
-        if category_wildcard:
-            categories = list(portdb.categories)
+        xml_matchers = []
+        if opts.maintainer_email:
+            maintainer_emails = []
+            for x in opts.maintainer_email:
+                maintainer_emails.extend(x.split(","))
+            if opts.no_regex:  # Escape regex-special characters for an exact match
+                maintainer_emails = [re.escape(x) for x in maintainer_emails]
+            xml_matchers.append(MaintainerEmailMatcher(maintainer_emails))
+        if opts.orphaned:
+            xml_matchers.append(match_orphaned)
+
+        if opts.repo is not None:
+            repos = [portdb.repositories[opts.repo]]
         else:
-            categories = list(set(categories))
+            repos = list(portdb.repositories)
 
-        if name_wildcard:
+        if not atoms:
             names = None
+            categories = list(portdb.categories)
         else:
-            names = sorted(set(names))
+            category_wildcard = False
+            name_wildcard = False
+            categories = []
+            names = []
+            for atom in atoms:
+                category, name = portage.catsplit(atom.cp)
+                categories.append(category)
+                names.append(name)
+                if "*" in category:
+                    category_wildcard = True
+                if "*" in name:
+                    name_wildcard = True
+
+            if category_wildcard:
+                categories = list(portdb.categories)
+            else:
+                categories = list(set(categories))
 
-    no_version = opts.no_version
-    categories.sort()
+            if name_wildcard:
+                names = None
+            else:
+                names = sorted(set(names))
 
-    for category in categories:
-        if names is None:
-            cp_list = portdb.cp_all(categories=(category,))
-        else:
-            cp_list = [category + "/" + name for name in names]
-        for cp in cp_list:
-            matches = []
-            for repo in repos:
-                match = True
-                if xml_matchers:
-                    metadata_xml_path = os.path.join(repo.location, cp, "metadata.xml")
-                    try:
-                        metadata_xml = MetaDataXML(metadata_xml_path, None)
-                    except (OSError, SyntaxError):
-                        match = False
-                    else:
-                        for matcher in xml_matchers:
-                            if not matcher(metadata_xml):
-                                match = False
-                                break
-                if not match:
-                    continue
-                cpv_list = portdb.cp_list(cp, mytree=[repo.location])
-                if atoms:
-                    for cpv in cpv_list:
-                        pkg = None
-                        for atom in atoms:
-                            if atom.repo is not None and atom.repo != repo.name:
-                                continue
-                            if not portage.match_from_list(atom, [cpv]):
-                                continue
-                            if need_metadata:
-                                if pkg is None:
-                                    try:
-                                        pkg = _pkg(cpv, repo.name)
-                                    except portage.exception.PackageNotFound:
-                                        continue
+        no_version = opts.no_version
+        categories.sort()
 
-                                if not (opts.no_filters or pkg.visible):
-                                    continue
-                                if not portage.match_from_list(atom, [pkg]):
-                                    continue
-                            matches.append(cpv)
-                            break
-                        if no_version and matches:
-                            break
-                elif opts.no_filters:
-                    matches.extend(cpv_list)
-                else:
-                    for cpv in cpv_list:
+        for category in categories:
+            if names is None:
+                cp_list = portdb.cp_all(categories=(category,))
+            else:
+                cp_list = [category + "/" + name for name in names]
+            for cp in cp_list:
+                matches = []
+                for repo in repos:
+                    match = True
+                    if xml_matchers:
+                        metadata_xml_path = os.path.join(
+                            repo.location, cp, "metadata.xml"
+                        )
                         try:
-                            pkg = _pkg(cpv, repo.name)
-                        except portage.exception.PackageNotFound:
-                            continue
+                            metadata_xml = MetaDataXML(metadata_xml_path, None)
+                        except (OSError, SyntaxError):
+                            match = False
                         else:
-                            if pkg.visible:
-                                matches.append(cpv)
-                                if no_version:
+                            for matcher in xml_matchers:
+                                if not matcher(metadata_xml):
+                                    match = False
                                     break
+                    if not match:
+                        continue
+                    cpv_list = portdb.cp_list(cp, mytree=[repo.location])
+                    if atoms:
+                        for cpv in cpv_list:
+                            pkg = None
+                            for atom in atoms:
+                                if atom.repo is not None and atom.repo != repo.name:
+                                    continue
+                                if not portage.match_from_list(atom, [cpv]):
+                                    continue
+                                if need_metadata:
+                                    if pkg is None:
+                                        try:
+                                            pkg = _pkg(cpv, repo.name)
+                                        except portage.exception.PackageNotFound:
+                                            continue
+
+                                    if not (opts.no_filters or pkg.visible):
+                                        continue
+                                    if not portage.match_from_list(atom, [pkg]):
+                                        continue
+                                matches.append(cpv)
+                                break
+                            if no_version and matches:
+                                break
+                    elif opts.no_filters:
+                        matches.extend(cpv_list)
+                    else:
+                        for cpv in cpv_list:
+                            try:
+                                pkg = _pkg(cpv, repo.name)
+                            except portage.exception.PackageNotFound:
+                                continue
+                            else:
+                                if pkg.visible:
+                                    matches.append(cpv)
+                                    if no_version:
+                                        break
 
-                if no_version and matches:
-                    break
+                    if no_version and matches:
+                        break
 
-            if not matches:
-                continue
+                if not matches:
+                    continue
 
-            if no_version:
-                writemsg_stdout("{}\n".format(cp), noiselevel=-1)
-            else:
-                matches = list(set(matches))
-                portdb._cpv_sort_ascending(matches)
-                for cpv in matches:
-                    writemsg_stdout("{}\n".format(cpv), noiselevel=-1)
-
-    return os.EX_OK
-
-
-docstrings[
-    "pquery"
-] = """[options] [atom]+
-	Emulates a subset of Pkgcore's pquery tool.
-	"""
-pquery.__doc__ = docstrings["pquery"]
-
-
-# -----------------------------------------------------------------------------
-#
-# DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
-#
-
-non_commands = frozenset(
-    [
-        "elog",
-        "eval_atom_use",
-        "exithandler",
-        "match_orphaned",
-        "main",
-        "usage",
-        "uses_eroot",
-    ]
-)
-commands = sorted(
-    k
-    for k, v in globals().items()
-    if k not in non_commands
-    and isinstance(v, types.FunctionType)
-    and v.__module__ == "__main__"
-)
+                if no_version:
+                    writemsg_stdout("{}\n".format(cp), noiselevel=-1)
+                else:
+                    matches = list(set(matches))
+                    portdb._cpv_sort_ascending(matches)
+                    for cpv in matches:
+                        writemsg_stdout("{}\n".format(cpv), noiselevel=-1)
+
+        return os.EX_OK
 
+    docstrings[
+        "pquery"
+    ] = """[options] [atom]+
+		Emulates a subset of Pkgcore's pquery tool.
+		"""
+    pquery.__doc__ = docstrings["pquery"]
+
+    non_commands = frozenset(
+        [
+            "elog",
+            "eval_atom_use",
+            "exithandler",
+            "match_orphaned",
+            "main",
+            "usage",
+            "uses_eroot",
+        ]
+    )
+    commands = sorted(
+        k
+        for k, v in globals().items()
+        if k not in non_commands
+        and isinstance(v, types.FunctionType)
+        and v.__module__ == "__main__"
+    )
 
-def add_pquery_arguments(parser):
-    pquery_option_groups = (
-        (
-            "Repository matching options",
+    def add_pquery_arguments(parser):
+        pquery_option_groups = (
             (
-                {
-                    "longopt": "--no-filters",
-                    "action": "store_true",
-                    "help": "no visibility filters (ACCEPT_KEYWORDS, package masking, etc)",
-                },
-                {
-                    "longopt": "--repo",
-                    "help": "repository to use (all repositories are used by default)",
-                },
+                "Repository matching options",
+                (
+                    {
+                        "longopt": "--no-filters",
+                        "action": "store_true",
+                        "help": "no visibility filters (ACCEPT_KEYWORDS, package masking, etc)",
+                    },
+                    {
+                        "longopt": "--repo",
+                        "help": "repository to use (all repositories are used by default)",
+                    },
+                ),
             ),
-        ),
-        (
-            "Package matching options",
             (
-                {
-                    "longopt": "--maintainer-email",
-                    "action": "append",
-                    "help": "comma-separated list of maintainer email regexes to search for",
-                },
-                {
-                    "longopt": "--no-regex",
-                    "action": "store_true",
-                    "help": "Use exact matching instead of regex matching for --maintainer-email",
-                },
-                {
-                    "longopt": "--orphaned",
-                    "action": "store_true",
-                    "help": "match only orphaned (maintainer-needed) packages",
-                },
+                "Package matching options",
+                (
+                    {
+                        "longopt": "--maintainer-email",
+                        "action": "append",
+                        "help": "comma-separated list of maintainer email regexes to search for",
+                    },
+                    {
+                        "longopt": "--no-regex",
+                        "action": "store_true",
+                        "help": "Use exact matching instead of regex matching for --maintainer-email",
+                    },
+                    {
+                        "longopt": "--orphaned",
+                        "action": "store_true",
+                        "help": "match only orphaned (maintainer-needed) packages",
+                    },
+                ),
             ),
-        ),
-        (
-            "Output formatting",
             (
-                {
-                    "shortopt": "-n",
-                    "longopt": "--no-version",
-                    "action": "store_true",
-                    "help": "collapse multiple matching versions together",
-                },
+                "Output formatting",
+                (
+                    {
+                        "shortopt": "-n",
+                        "longopt": "--no-version",
+                        "action": "store_true",
+                        "help": "collapse multiple matching versions together",
+                    },
+                ),
             ),
-        ),
-    )
-
-    for group_title, opt_data in pquery_option_groups:
-        arg_group = parser.add_argument_group(group_title)
-        for opt_info in opt_data:
-            pargs = []
-            try:
-                pargs.append(opt_info["shortopt"])
-            except KeyError:
-                pass
-            try:
-                pargs.append(opt_info["longopt"])
-            except KeyError:
-                pass
-
-            kwargs = {}
-            try:
-                kwargs["action"] = opt_info["action"]
-            except KeyError:
-                pass
-            try:
-                kwargs["help"] = opt_info["help"]
-            except KeyError:
-                pass
-            arg_group.add_argument(*pargs, **kwargs)
-
-
-def usage(argv):
-    print(">>> Portage information query tool")
-    print(">>> %s" % portage.VERSION)
-    print(">>> Usage: portageq <command> [<option> ...]")
-    print("")
-    print("Available commands:")
+        )
 
-    #
-    # Show our commands -- we do this by scanning the functions in this
-    # file, and formatting each functions documentation.
-    #
-    help_mode = "--help" in argv
-    for name in commands:
-        doc = docstrings.get(name)
-        if doc is None:
-            print("   " + name)
-            print("      MISSING DOCUMENTATION!")
-            print("")
-            continue
-
-        lines = doc.lstrip("\n").split("\n")
-        print("   " + name + " " + lines[0].strip())
-        if len(argv) > 1:
-            if not help_mode:
-                lines = lines[:-1]
-            for line in lines[1:]:
-                print("      " + line.strip())
-
-    print()
-    print("Pkgcore pquery compatible options:")
-    print()
-    parser = argparse.ArgumentParser(
-        add_help=False, usage="portageq pquery [options] [atom ...]"
-    )
-    add_pquery_arguments(parser)
-    parser.print_help()
+        for group_title, opt_data in pquery_option_groups:
+            arg_group = parser.add_argument_group(group_title)
+            for opt_info in opt_data:
+                pargs = []
+                try:
+                    pargs.append(opt_info["shortopt"])
+                except KeyError:
+                    pass
+                try:
+                    pargs.append(opt_info["longopt"])
+                except KeyError:
+                    pass
 
-    if len(argv) == 1:
-        print("\nRun portageq with --help for info")
+                kwargs = {}
+                try:
+                    kwargs["action"] = opt_info["action"]
+                except KeyError:
+                    pass
+                try:
+                    kwargs["help"] = opt_info["help"]
+                except KeyError:
+                    pass
+                arg_group.add_argument(*pargs, **kwargs)
 
+    def usage(argv):
+        print(">>> Portage information query tool")
+        print(">>> %s" % portage.VERSION)
+        print(">>> Usage: portageq <command> [<option> ...]")
+        print("")
+        print("Available commands:")
+
+        #
+        # Show our commands -- we do this by scanning the functions in this
+        # file, and formatting each functions documentation.
+        #
+        help_mode = "--help" in argv
+        for name in commands:
+            doc = docstrings.get(name)
+            if doc is None:
+                print("   " + name)
+                print("      MISSING DOCUMENTATION!")
+                print("")
+                continue
 
-atom_validate_strict = "EBUILD_PHASE" in os.environ
-eapi = None
-if atom_validate_strict:
-    eapi = os.environ.get("EAPI")
+            lines = doc.lstrip("\n").split("\n")
+            print("   " + name + " " + lines[0].strip())
+            if len(argv) > 1:
+                if not help_mode:
+                    lines = lines[:-1]
+                for line in lines[1:]:
+                    print("      " + line.strip())
+
+        print()
+        print("Pkgcore pquery compatible options:")
+        print()
+        parser = argparse.ArgumentParser(
+            add_help=False, usage="portageq pquery [options] [atom ...]"
+        )
+        add_pquery_arguments(parser)
+        parser.print_help()
 
-    def elog(elog_funcname, lines):
-        cmd = "source '%s/isolated-functions.sh' ; " % os.environ["PORTAGE_BIN_PATH"]
-        for line in lines:
-            cmd += "{} {} ; ".format(elog_funcname, portage._shell_quote(line))
-        subprocess.call([portage.const.BASH_BINARY, "-c", cmd])
+        if len(argv) == 1:
+            print("\nRun portageq with --help for info")
 
-else:
+    atom_validate_strict = "EBUILD_PHASE" in os.environ
+    eapi = None
+    if atom_validate_strict:
+        eapi = os.environ.get("EAPI")
 
-    def elog(elog_funcname, lines):
-        pass
+        def elog(elog_funcname, lines):
+            cmd = (
+                "source '%s/isolated-functions.sh' ; " % os.environ["PORTAGE_BIN_PATH"]
+            )
+            for line in lines:
+                cmd += "{} {} ; ".format(elog_funcname, portage._shell_quote(line))
+            subprocess.call([portage.const.BASH_BINARY, "-c", cmd])
 
+    else:
 
-def main(argv):
+        def elog(elog_funcname, lines):
+            pass
 
-    argv = portage._decode_argv(argv)
+    def main(argv):
 
-    nocolor = os.environ.get("NOCOLOR")
-    if nocolor in ("yes", "true"):
-        portage.output.nocolor()
+        argv = portage._decode_argv(argv)
 
-    parser = argparse.ArgumentParser(add_help=False)
+        nocolor = os.environ.get("NOCOLOR")
+        if nocolor in ("yes", "true"):
+            portage.output.nocolor()
 
-    # used by envvar
-    parser.add_argument("-v", dest="verbose", action="store_true")
+        parser = argparse.ArgumentParser(add_help=False)
 
-    actions = parser.add_argument_group("Actions")
-    actions.add_argument("-h", "--help", action="store_true")
-    actions.add_argument("--version", action="store_true")
+        # used by envvar
+        parser.add_argument("-v", dest="verbose", action="store_true")
 
-    add_pquery_arguments(parser)
+        actions = parser.add_argument_group("Actions")
+        actions.add_argument("-h", "--help", action="store_true")
+        actions.add_argument("--version", action="store_true")
 
-    opts, args = parser.parse_known_args(argv[1:])
+        add_pquery_arguments(parser)
 
-    if opts.help:
-        usage(argv)
-        return os.EX_OK
-    elif opts.version:
-        print("Portage", portage.VERSION)
-        return os.EX_OK
+        opts, args = parser.parse_known_args(argv[1:])
 
-    cmd = None
-    if args and args[0] in commands:
-        cmd = args[0]
+        if opts.help:
+            usage(argv)
+            return os.EX_OK
+        elif opts.version:
+            print("Portage", portage.VERSION)
+            return os.EX_OK
 
-    if cmd == "pquery":
         cmd = None
-        args = args[1:]
+        if args and args[0] in commands:
+            cmd = args[0]
 
-    if cmd is None:
-        return pquery(parser, opts, args)
+        if cmd == "pquery":
+            cmd = None
+            args = args[1:]
 
-    if opts.verbose:
-        # used by envvar
-        args.append("-v")
+        if cmd is None:
+            return pquery(parser, opts, args)
 
-    argv = argv[:1] + args
+        if opts.verbose:
+            # used by envvar
+            args.append("-v")
 
-    if len(argv) < 2:
-        usage(argv)
-        sys.exit(os.EX_USAGE)
+        argv = argv[:1] + args
 
-    function = globals()[cmd]
-    uses_eroot = getattr(function, "uses_eroot", False) and len(argv) > 2
-    if uses_eroot:
-        if not os.path.isdir(argv[2]):
-            sys.stderr.write("Not a directory: '%s'\n" % argv[2])
-            sys.stderr.write("Run portageq with --help for info\n")
-            sys.stderr.flush()
+        if len(argv) < 2:
+            usage(argv)
             sys.exit(os.EX_USAGE)
-        # Calculate EPREFIX and ROOT that will be used to construct
-        # portage.settings later. It's tempting to use
-        # portage.settings["EPREFIX"] here, but that would force
-        # instantiation of portage.settings, which we don't want to do
-        # until after we've calculated ROOT (see bug #529200).
-        eprefix = portage.data._target_eprefix()
-        eroot = portage.util.normalize_path(argv[2])
-
-        if eprefix:
-            if not eroot.endswith(eprefix):
-                sys.stderr.write(
-                    "ERROR: This version of portageq"
-                    " only supports <eroot>s ending in"
-                    " '%s'. The provided <eroot>, '%s',"
-                    " doesn't.\n" % (eprefix, eroot)
-                )
+
+        function = globals()[cmd]
+        uses_eroot = getattr(function, "uses_eroot", False) and len(argv) > 2
+        if uses_eroot:
+            if not os.path.isdir(argv[2]):
+                sys.stderr.write("Not a directory: '%s'\n" % argv[2])
+                sys.stderr.write("Run portageq with --help for info\n")
                 sys.stderr.flush()
                 sys.exit(os.EX_USAGE)
-            root = eroot[: 1 - len(eprefix)]
-        else:
-            root = eroot
+            # Calculate EPREFIX and ROOT that will be used to construct
+            # portage.settings later. It's tempting to use
+            # portage.settings["EPREFIX"] here, but that would force
+            # instantiation of portage.settings, which we don't want to do
+            # until after we've calculated ROOT (see bug #529200).
+            eprefix = portage.data._target_eprefix()
+            eroot = portage.util.normalize_path(argv[2])
+
+            if eprefix:
+                if not eroot.endswith(eprefix):
+                    sys.stderr.write(
+                        "ERROR: This version of portageq"
+                        " only supports <eroot>s ending in"
+                        " '%s'. The provided <eroot>, '%s',"
+                        " doesn't.\n" % (eprefix, eroot)
+                    )
+                    sys.stderr.flush()
+                    sys.exit(os.EX_USAGE)
+                root = eroot[: 1 - len(eprefix)]
+            else:
+                root = eroot
 
-        os.environ["ROOT"] = root
+            os.environ["ROOT"] = root
 
-        if getattr(function, "uses_configroot", False):
-            os.environ["PORTAGE_CONFIGROOT"] = eroot
-            # Disable RepoConfigLoader location validation, allowing raw
-            # configuration to pass through, since repo locations are not
-            # necessarily expected to exist if the configuration comes
-            # from a chroot.
-            portage._sync_mode = True
+            if getattr(function, "uses_configroot", False):
+                os.environ["PORTAGE_CONFIGROOT"] = eroot
+                # Disable RepoConfigLoader location validation, allowing raw
+                # configuration to pass through, since repo locations are not
+                # necessarily expected to exist if the configuration comes
+                # from a chroot.
+                portage._sync_mode = True
 
-    args = argv[2:]
+        args = argv[2:]
 
-    try:
-        if uses_eroot:
-            args[0] = portage.settings["EROOT"]
-        retval = function(args)
-        if retval:
-            sys.exit(retval)
-    except portage.exception.PermissionDenied as e:
-        sys.stderr.write("Permission denied: '%s'\n" % str(e))
-        sys.exit(e.errno)
-    except portage.exception.ParseError as e:
-        sys.stderr.write("%s\n" % str(e))
-        sys.exit(1)
-    except portage.exception.AmbiguousPackageName as e:
-        # Multiple matches thrown from cpv_expand
-        pkgs = e.args[0]
-        # An error has occurred so we writemsg to stderr and exit nonzero.
-        portage.writemsg(
-            "You specified an unqualified atom that matched multiple packages:\n",
-            noiselevel=-1,
-        )
-        for pkg in pkgs:
-            portage.writemsg("* %s\n" % pkg, noiselevel=-1)
-        portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
-        sys.exit(1)
-
-
-if __name__ == "__main__":
-    try:
-        sys.exit(main(sys.argv))
-    finally:
-        global_event_loop().close()
+        try:
+            if uses_eroot:
+                args[0] = portage.settings["EROOT"]
+            retval = function(args)
+            if retval:
+                sys.exit(retval)
+        except portage.exception.PermissionDenied as e:
+            sys.stderr.write("Permission denied: '%s'\n" % str(e))
+            sys.exit(e.errno)
+        except portage.exception.ParseError as e:
+            sys.stderr.write("%s\n" % str(e))
+            sys.exit(1)
+        except portage.exception.AmbiguousPackageName as e:
+            # Multiple matches thrown from cpv_expand
+            pkgs = e.args[0]
+            # An error has occurred so we writemsg to stderr and exit nonzero.
+            portage.writemsg(
+                "You specified an unqualified atom that matched multiple packages:\n",
+                noiselevel=-1,
+            )
+            for pkg in pkgs:
+                portage.writemsg("* %s\n" % pkg, noiselevel=-1)
+            portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
+            sys.exit(1)
 
-# -----------------------------------------------------------------------------
+    if __name__ == "__main__":
+        try:
+            sys.exit(main(sys.argv))
+        finally:
+            global_event_loop().close()
+
+except KeyboardInterrupt as e:
+    # Prevent traceback on ^C
+    signum = getattr(e, "signum", signal.SIGINT)
+    signal.signal(signum, signal.SIG_DFL)
+    raise_signal(signum)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-01-02 20:45 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2023-01-02 20:45 UTC (permalink / raw
  To: gentoo-commits

commit:     46ae35f6a5aaffff1358dfed369be82569fce786
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  1 00:03:34 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan  2 20:35:30 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=46ae35f6

egencache: pass through PATH to fix tests with empty profile.env

portage.tests.emerge.test_simple.SimpleEmergeTestCase was failing.

  /usr/bin/env: 'bash': No such file or directory

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/egencache | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/egencache b/bin/egencache
index 5f5664131..8c18edaeb 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1130,6 +1130,10 @@ try:
         # completely controlled by commandline arguments.
         env = {}
 
+        # Pass through PATH to allow testing with an empty profile.env.
+        if "PATH" in os.environ:
+            env["PATH"] = os.environ["PATH"]
+
         if not sys.stdout.isatty() or os.environ.get("NOCOLOR", "").lower() in (
             "yes",
             "true",


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-03-21 23:52 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-03-21 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     7cd4343393b97ae8684ab53bbdd283e4788bd3b1
Author:     Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com>
AuthorDate: Mon Mar 20 02:01:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 23:52:40 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7cd43433

Convert %-formats to fstrings

Files under bin/

Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/archive-conf     | 10 +++-------
 bin/binhost-snapshot | 10 ++++------
 bin/dispatch-conf    | 36 ++++++++++++++++++++----------------
 bin/ebuild           |  6 +++---
 bin/ebuild-ipc.py    |  8 ++------
 bin/egencache        | 37 ++++++++++++-------------------------
 bin/emerge           |  4 ++--
 bin/glsa-check       |  5 ++---
 bin/install.py       |  3 +--
 bin/portageq         |  8 ++++----
 bin/quickpkg         |  5 ++---
 bin/xattr-helper.py  |  4 ++--
 12 files changed, 57 insertions(+), 79 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index b2c381bc6..a11677753 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -27,8 +27,6 @@ import portage.dispatch_conf
 from portage import os
 from portage.checksum import perform_md5
 
-FIND_EXTANT_CONTENTS = "find %s -name CONTENTS"
-
 MANDATORY_OPTS = ["archive-dir"]
 
 
@@ -45,11 +43,9 @@ def archive_conf():
         args += [conf]
         md5_match_hash[conf] = ""
 
-    # Find all the CONTENT files in VDB_PATH.
-    with os.popen(
-        FIND_EXTANT_CONTENTS
-        % (os.path.join(portage.settings["EROOT"], portage.VDB_PATH))
-    ) as f:
+    # Find all the CONTENTS files in VDB_PATH.
+    eroot_vdb_path = os.path.join(portage.settings["EROOT"], portage.VDB_PATH)
+    with os.popen(f"find {eroot_vdb_path} -type f -name CONTENTS") as f:
         content_files += f.readlines()
 
     # Search for the saved md5 checksum of all the specified config files

diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index 05d2f514b..e0ac7c9b9 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -92,15 +92,13 @@ def main(argv):
     if os.path.isdir(snapshot_dir):
         parser.error(f"snapshot_dir already exists: '{snapshot_dir}'")
 
+    dirname_ss_dir = os.path.dirname(snapshot_dir)
     try:
-        os.makedirs(os.path.dirname(snapshot_dir))
+        os.makedirs(dirname_ss_dir)
     except OSError:
         pass
-    if not os.path.isdir(os.path.dirname(snapshot_dir)):
-        parser.error(
-            "snapshot_dir parent could not be created: '%s'"
-            % os.path.dirname(snapshot_dir)
-        )
+    if not os.path.isdir(dirname_ss_dir):
+        parser.error(f"snapshot_dir parent could not be created: '{dirname_ss_dir}'")
 
     try:
         os.makedirs(binhost_dir)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index e0069d007..3dbfb0ed6 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -48,14 +48,8 @@ from portage.dispatch_conf import (
 from portage.process import find_binary, spawn
 from portage.util import writemsg, writemsg_stdout
 
-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
@@ -160,18 +154,29 @@ class dispatch:
                 continue
 
             basename = "*"
-            find_opts = "-name '.*' -type d -prune -o"
+            find_opts = ["-name", ".*", "-type", "d", "-prune", "-o"]
             if not os.path.isdir(path):
                 path, basename = os.path.split(path)
-                find_opts = "-maxdepth 1"
+                find_opts = ["-maxdepth", "1"]
+            if "case-insensitive-fs" in portage.settings.features:
+                find_opts += ["-iname"]
+            else:
+                find_opts += ["-name"]
+            find_opts += [
+                f"._cfg????_{basename}",
+                "!",
+                "-name",
+                ".*~",
+                "!",
+                "-iname",
+                ".*.bak",
+                "-print",
+            ]
 
             try:
+                # Find existing configs
                 path_list = _unicode_decode(
-                    subprocess.check_output(
-                        portage.util.shlex_split(
-                            FIND_EXTANT_CONFIGS % (path, find_opts, basename)
-                        )
-                    ),
+                    subprocess.check_output(["find", path] + find_opts),
                     errors="strict",
                 ).splitlines()
             except subprocess.CalledProcessError:
@@ -340,7 +345,7 @@ class dispatch:
 
                 print()
                 writemsg_stdout(
-                    ">> (%i of %i) -- %s\n" % (count, len(confs), conf["current"]),
+                    f">> ({count} of {len(confs)}) -- {conf['current']}\n",
                     noiselevel=-1,
                 )
                 print(
@@ -444,8 +449,7 @@ class dispatch:
             os.rename(newconf, curconf)
         except (OSError, os.error) as why:
             writemsg(
-                "dispatch-conf: Error renaming %s to %s: %s; fatal\n"
-                % (newconf, curconf, str(why)),
+                f"dispatch-conf: Error renaming {newconf} to {curconf}: {str(why)}; fatal\n",
                 noiselevel=-1,
             )
             return

diff --git a/bin/ebuild b/bin/ebuild
index 8fccbea89..2fa4e7974 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -376,9 +376,9 @@ try:
             env_filename = os.path.join(tmpsettings["T"], "environment")
             if os.path.exists(env_filename):
                 msg = (
-                    "Existing ${T}/environment for '%s' will be sourced. "
-                    + "Run 'clean' to start with a fresh environment."
-                ) % (tmpsettings["PF"],)
+                    f"Existing ${{T}}/environment for '{tmpsettings['PF']}' will be sourced. "
+                    "Run 'clean' to start with a fresh environment."
+                )
                 msg = textwrap.wrap(msg, 70)
                 for x in msg:
                     portage.writemsg(f">>> {x}\n")

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index df70850c0..059732eaf 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -163,10 +163,7 @@ try:
         def _timeout_retry_msg(self, start_time, when):
             time_elapsed = time.time() - start_time
             portage.util.writemsg_level(
-                portage.localization._(
-                    "ebuild-ipc timed out %s after %d seconds," + " retrying...\n"
-                )
-                % (when, time_elapsed),
+                f"ebuild-ipc timed out {when} after {time_elapsed} seconds, retrying...\n",
                 level=logging.ERROR,
                 noiselevel=-1,
             )
@@ -290,8 +287,7 @@ try:
 
             if retval != os.EX_OK:
                 portage.util.writemsg_level(
-                    "ebuild-ipc: %s: %s\n"
-                    % (msg, portage.localization._("subprocess failure: %s") % retval),
+                    f"ebuild-ipc: {msg}: subprocess failure: {retval}\n",
                     level=logging.ERROR,
                     noiselevel=-1,
                 )

diff --git a/bin/egencache b/bin/egencache
index 671df3014..dbe8d27fe 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -345,8 +345,7 @@ try:
                 )
                 if not self._trg_caches:
                     raise Exception(
-                        "cache formats '%s' aren't supported"
-                        % (" ".join(conf.cache_formats),)
+                        f"cache formats '{' '.join(conf.cache_formats)}' aren't supported"
                     )
 
             if rsync:
@@ -615,14 +614,7 @@ try:
                             prefix0 = "M"
 
                         print(
-                            " [%s%s] %s (%s):  %s"
-                            % (
-                                colorize("red", prefix0),
-                                color(prefix1),
-                                colorize("bold", pkg_desc.cp),
-                                color(version[len(pkg_desc.cp) + 1 :]),
-                                pkg_desc.desc,
-                            )
+                            f" [{colorize('red', prefix0)}{color(prefix1)}] {colorize('bold', pkg_desc.cp)} ({color(version[len(pkg_desc.cp) + 1 :])}):  {pkg_desc.desc}"
                         )
                         haspkgs = True
 
@@ -835,8 +827,7 @@ try:
                                     reskeys = {_Atom(k): k for k in resdict}
                                 except portage.exception.InvalidAtom as e:
                                     writemsg_level(
-                                        "ERROR: failed parsing %s/metadata.xml: %s\n"
-                                        % (cp, e),
+                                        f"ERROR: failed parsing {cp}/metadata.xml: {e}\n",
                                         level=logging.ERROR,
                                         noiselevel=-1,
                                     )
@@ -938,13 +929,12 @@ try:
 
             output.write(
                 textwrap.dedent(
-                    """\
-                # ChangeLog for %s
-                # Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2
+                    f"""\
+                # ChangeLog for {cp}
+                # Copyright 1999-{time.strftime("%Y")} Gentoo Foundation; Distributed under the GPL v2
                 # (auto-generated from git log)
 
                 """
-                    % (cp, time.strftime("%Y"))
                 )
             )
 
@@ -1064,9 +1054,10 @@ try:
                 )
                 # but feel free to break commit messages there
                 self._wrapper.break_on_hyphens = True
-                output.write(
-                    "\n%s\n\n" % "\n".join(self._wrapper.fill(x) for x in body)
-                )
+                # temp var needed because fstrings can not have backslashes in
+                # the expression part...
+                temp_joined = "\n".join(self._wrapper.fill(x) for x in body)
+                output.write(f"\n{temp_joined}\n\n")
 
             output.close()
             os.utime(self._changelog_output, (lmod, lmod))
@@ -1249,12 +1240,8 @@ try:
                         gpg_dir = os.path.expanduser(settings["PORTAGE_GPG_DIR"])
                     if not os.access(gpg_dir, os.X_OK):
                         writemsg_level(
-                            (
-                                "egencache: error: "
-                                "Unable to access directory: "
-                                "PORTAGE_GPG_DIR='%s'\n"
-                            )
-                            % gpg_dir,
+                            "egencache: error: Unable to access directory: "
+                            f"PORTAGE_GPG_DIR='{gpg_dir}'\n",
                             level=logging.ERROR,
                             noiselevel=-1,
                         )

diff --git a/bin/emerge b/bin/emerge
index 804dc0371..f5dbc3106 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -62,9 +62,9 @@ try:
             sys.exit(e.errno)
         except IsADirectory as e:
             sys.stderr.write(
-                "'%s' is a directory, but should be a file!\n"
+                f"'{str(e)}' is a directory, but should be a file!\n"
                 "See portage man page for information on "
-                "which files may be directories.\n" % str(e)
+                "which files may be directories.\n"
             )
             sys.exit(e.errno)
         except ParseError as e:

diff --git a/bin/glsa-check b/bin/glsa-check
index b18ffdc08..f9b2bf022 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -220,8 +220,7 @@ if "affected" in params:
 for p in params[:]:
     if not (p in completelist or os.path.exists(p)):
         sys.stderr.write(
-            "(removing %s from parameter list as it isn't a valid GLSA specification)\n"
-            % p
+            f"(removing {p} from parameter list as it isn't a valid GLSA specification)\n"
         )
         params.remove(p)
 
@@ -261,7 +260,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
             color = green
 
         if verbose:
-            access = "[%-8s] " % myglsa.access
+            access = f"[{myglsa.access:8}] "
         else:
             access = ""
 

diff --git a/bin/install.py b/bin/install.py
index 4bdffd255..3c78dae91 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -174,8 +174,7 @@ def main(args):
         if returncode != os.EX_OK:
             portage.util.writemsg(
                 "!!! install: copy_xattrs failed with the "
-                "following arguments: %s\n"
-                % " ".join(portage._shell_quote(x) for x in args),
+                f"following arguments: {' '.join(portage._shell_quote(x) for x in args)}\n",
                 noiselevel=-1,
             )
     return returncode

diff --git a/bin/portageq b/bin/portageq
index df2b1a872..93fa4edeb 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -871,8 +871,8 @@ try:
         for arg in argv:
             if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
                 print(
-                    "WARNING: 'portageq envvar %s' is deprecated. Use any of "
-                    "'get_repos, get_repo_path, repos_config' instead." % arg,
+                    f"WARNING: 'portageq envvar {arg}' is deprecated. Use any of "
+                    "'get_repos, get_repo_path, repos_config' instead.",
                     file=sys.stderr,
                 )
 
@@ -1516,8 +1516,8 @@ try:
                     sys.stderr.write(
                         "ERROR: This version of portageq"
                         " only supports <eroot>s ending in"
-                        " '%s'. The provided <eroot>, '%s',"
-                        " doesn't.\n" % (eprefix, eroot)
+                        f" '{eprefix}'. The provided <eroot>, '{eroot}',"
+                        " doesn't.\n"
                     )
                     sys.stderr.flush()
                     sys.exit(os.EX_USAGE)

diff --git a/bin/quickpkg b/bin/quickpkg
index 1ecc079fe..8443a00e6 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -176,8 +176,7 @@ def quickpkg_atom(options, infos, arg, eout):
                 if find_binary(compression_binary) is None:
                     missing_package = compression["package"]
                     eout.eerror(
-                        "File compression unsupported %s. Missing package: %s"
-                        % (binpkg_compression, missing_package)
+                        f"File compression unsupported {binpkg_compression} (missing package: {missing_package})"
                     )
                     return 1
 
@@ -391,7 +390,7 @@ def quickpkg_main(options, args, eout):
         eout.einfo(f"{cpv}: {size_str}")
     if infos["config_files_excluded"]:
         print()
-        eout.ewarn("Excluded config files: %d" % infos["config_files_excluded"])
+        eout.ewarn(f"Excluded config files: {infos['config_files_excluded']}")
         eout.ewarn("See --help if you would like to include config files.")
     if infos["missing"]:
         print()

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index 94c2f6816..acab4920e 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -120,13 +120,13 @@ def restore_xattrs(file_in):
             parts = line.split(b"=", 1)
             if len(parts) == 2:
                 if pathname is None:
-                    raise ValueError("line %d: missing pathname" % (i + 1,))
+                    raise ValueError(f"line {i + 1}: missing pathname")
                 attr = unquote(parts[0])
                 # strip trailing newline and quotes
                 value = unquote(parts[1].rstrip(b"\n")[1:-1])
                 xattr.set(pathname, attr, value)
             elif line.strip():
-                raise ValueError("line %d: malformed entry" % (i + 1,))
+                raise ValueError(f"line {i + 1}: malformed entry")
 
 
 def main(argv):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-03-21 23:52 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-03-21 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     d2dc5a816c2ececad408bfbf6205ec8a4a01a5b5
Author:     Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com>
AuthorDate: Tue Mar 21 03:00:31 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 23:52:40 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d2dc5a81

archive-conf: switch from os.popen() to subprocess.run()

Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com>
Closes: https://github.com/gentoo/portage/pull/1008
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/archive-conf | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index a11677753..a6de29da6 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -9,6 +9,7 @@
 #  Jeremy Wohl's dispatch-conf script and the portage chkcontents script.
 #
 
+import subprocess
 import sys
 
 from os import path as osp
@@ -45,8 +46,12 @@ def archive_conf():
 
     # Find all the CONTENTS files in VDB_PATH.
     eroot_vdb_path = os.path.join(portage.settings["EROOT"], portage.VDB_PATH)
-    with os.popen(f"find {eroot_vdb_path} -type f -name CONTENTS") as f:
-        content_files += f.readlines()
+    find = subprocess.run(
+        ["find", eroot_vdb_path, "-type", "f", "-name", "CONTENTS"],
+        capture_output=True,
+        text=True,
+    )
+    content_files += find.stdout.splitlines()
 
     # Search for the saved md5 checksum of all the specified config files
     # and see if the current file is unmodified or not.


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-04-06  8:08 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2023-04-06  8:08 UTC (permalink / raw
  To: gentoo-commits

commit:     14fffea2fefa05e84bb1c5b10888031c6b598dfc
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  5 16:35:01 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Apr  5 16:35:01 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=14fffea2

misc-functions.sh: Inline prepinfo code in install_qa_check()

Add a deprecation warning. Presumably, subdirs of /usr/share/info have
never been used by any package except app-editors/emacs.

Remove duplicate rm statement at the end of the function.

Bug: https://bugs.gentoo.org/899898
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/misc-functions.sh | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 55c4afe73..235823afc 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -143,7 +143,24 @@ install_qa_check() {
 		chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
 	fi
 
-	[[ -d ${ED%/}/usr/share/info ]] && prepinfo
+	if [[ -d ${ED%/}/usr/share/info ]]; then
+		# Portage regenerates this on the installed system.
+		rm -f "${ED%/}"/usr/share/info/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} \
+			|| die "rm failed"
+		# Recurse into subdirs. Remove this code after 2023-12-31. #899898
+		while read -r -d '' x; do
+			( shopt -s failglob; : "${x}"/.keepinfodir* ) 2>/dev/null \
+				&& continue
+			for f in "${x}"/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst}; do
+				if [[ -e ${f} ]]; then
+					eqawarn "QA Notice: Removing Info directory file '${f}'."
+					eqawarn "Relying on this behavior is deprecated and may"
+					eqawarn "cause file collisions in future."
+					rm -f "${f}" || die "rm failed"
+				fi
+			done
+		done < <(find "${ED%/}"/usr/share/info -mindepth 1 -type d -print0)
+	fi
 
 	# If binpkg-docompress is enabled, apply compression before creating
 	# the binary package.
@@ -251,9 +268,6 @@ install_qa_check() {
 			prepallstrip
 		fi
 	fi
-
-	# Portage regenerates this on the installed system.
-	rm -f "${ED%/}"/usr/share/info/dir{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} || die "rm failed!"
 }
 
 __dyn_instprep() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-04-09  6:52 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-04-09  6:52 UTC (permalink / raw
  To: gentoo-commits

commit:     63e1382127d5448f39771e22d0ab0a4e2f8b6d38
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 29 20:11:24 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  9 06:51:34 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=63e13821

emerge-webrsync: use bash tests; expand conditionals

We're using bash, so let's use proper bash tests with all of the
behaviour we know & love. Expand conditionals too to make things
a bit easier to read.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 63 +++++++++++++++++++++++++++--------------------------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 7fb98900d..4b982a1c1 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
 # Rewritten from the old, Perl-based emerge-webrsync script
@@ -38,7 +38,7 @@ argv0=$0
 # Use portageq from the same directory/prefix as the current script, so
 # that we don't have to rely on PATH including the current EPREFIX.
 scriptpath=${BASH_SOURCE[0]}
-if [ -x "${scriptpath%/*}/portageq" ]; then
+if [[ -x "${scriptpath%/*}/portageq" ]]; then
 	portageq=${scriptpath%/*}/portageq
 elif type -P portageq > /dev/null ; then
 	portageq=portageq
@@ -67,7 +67,7 @@ repo_sync_type=$(__repo_attr "${repo_name}" sync-type)
 
 # If PORTAGE_NICENESS is overriden via the env then it will
 # still pass through the portageq call and override properly.
-if [ -n "${PORTAGE_NICENESS}" ]; then
+if [[ -n "${PORTAGE_NICENESS}" ]]; then
 	renice ${PORTAGE_NICENESS} $$ > /dev/null
 fi
 
@@ -81,10 +81,11 @@ if [[ ${webrsync_gpg} -eq 1 ]]; then
 	wecho "FEATURES=webrsync-gpg is deprecated, see the make.conf(5) man page."
 fi
 
-if [[ -n ${PORTAGE_TEMP_GPG_DIR} ]] ||
-	has $(__repo_attr "${repo_name}" sync-webrsync-verify-signature |
-	LC_ALL=C tr '[:upper:]' '[:lower:]') true yes; then
+repo_has_webrsync_verify=$(
+	has $(__repo_attr "${repo_name}" sync-webrsync-verify-signature	| LC_ALL=C tr '[:upper:]' '[:lower:]') true yes
+)
 
+if [[ -n ${PORTAGE_TEMP_GPG_DIR} ]] || [[ ${repo_has_webrsync_verify} -eq 1 ]]; then
 	# If FEATURES=webrsync-gpg is enabled then allow direct emerge-webrsync
 	# calls for backward compatibility (this triggers a deprecation warning
 	# above). Since direct emerge-webrsync calls do not use gemato for secure
@@ -103,8 +104,8 @@ else
 fi
 
 [[ -n ${PORTAGE_TEMP_GPG_DIR} ]] && PORTAGE_GPG_DIR=${PORTAGE_TEMP_GPG_DIR}
-if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then
-	eecho "please set PORTAGE_GPG_DIR in make.conf"
+if [[ ${WEBSYNC_VERIFY_SIGNATURE} != 0 && -z "${PORTAGE_GPG_DIR}" ]]; then
+	eecho "Please set PORTAGE_GPG_DIR in make.conf!"
 	exit 1
 fi
 
@@ -154,7 +155,7 @@ get_utc_second_from_string() {
 get_portage_timestamp() {
 	local portage_current_timestamp=0
 
-	if [ -f "${repo_location}/metadata/timestamp.x" ]; then
+	if [[ -f "${repo_location}/metadata/timestamp.x" ]]; then
 		portage_current_timestamp=$(cut -f 1 -d " " "${repo_location}/metadata/timestamp.x" )
 	fi
 
@@ -166,9 +167,9 @@ fetch_file() {
 	local FILE="$2"
 	local opts
 
-	if [ "${FETCHCOMMAND/wget/}" != "${FETCHCOMMAND}" ]; then
+	if [[ "${FETCHCOMMAND/wget/}" != "${FETCHCOMMAND}" ]]; then
 		opts="--continue $(nvecho -q)"
-	elif [ "${FETCHCOMMAND/curl/}" != "${FETCHCOMMAND}" ]; then
+	elif [[ "${FETCHCOMMAND/curl/}" != "${FETCHCOMMAND}" ]]; then
 		opts="--continue-at - $(nvecho -s -f)"
 	else
 		rm -f "${DISTDIR}/${FILE}"
@@ -196,9 +197,9 @@ check_file_digest() {
 	if type -P md5sum > /dev/null; then
 		local md5sum_output=$(md5sum "${file}")
 		local digest_content=$(< "${digest}")
-		[ "${md5sum_output%%[[:space:]]*}" = "${digest_content%%[[:space:]]*}" ] && r=0
+		[[ "${md5sum_output%%[[:space:]]*}" = "${digest_content%%[[:space:]]*}" ]] && r=0
 	elif type -P md5 > /dev/null; then
-		[ "$(md5 -q "${file}")" == "$(cut -d ' ' -f 1 "${digest}")" ] && r=0
+		[[ "$(md5 -q "${file}")" == "$(cut -d ' ' -f 1 "${digest}")" ]] && r=0
 	else
 		eecho "cannot check digest: no suitable md5/md5sum binaries found"
 	fi
@@ -212,7 +213,7 @@ check_file_signature() {
 	local r=1
 	local gnupg_status line
 
-	if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
+	if [[ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]]; then
 		__vecho "Checking signature ..."
 
 		if type -P gpg > /dev/null; then
@@ -304,7 +305,7 @@ sync_local() {
 	fi
 
 	local post_sync=${PORTAGE_CONFIGROOT}etc/portage/bin/post_sync
-	[ -x "${post_sync}" ] && "${post_sync}"
+	[[ -x "${post_sync}" ]] && "${post_sync}"
 
 	# --quiet suppresses output if there are no relevant news items
 	has news ${FEATURES} && emerge --check-news --quiet
@@ -344,13 +345,13 @@ do_snapshot() {
 			local digest="${file}.md5sum"
 			local signature="${file}.gpgsig"
 
-			if [ -s "${DISTDIR}/${file}" -a -s "${DISTDIR}/${digest}" -a -s "${DISTDIR}/${signature}" ] ; then
+			if [[ -s "${DISTDIR}/${file}" && -s "${DISTDIR}/${digest}" && -s "${DISTDIR}/${signature}" ]] ; then
 				check_file_digest "${DISTDIR}/${digest}" "${DISTDIR}/${file}" && \
 				check_file_signature "${DISTDIR}/${signature}" "${DISTDIR}/${file}" && \
 				have_files=1
 			fi
 
-			if [ ${have_files} -eq 0 ] ; then
+			if [[ ${have_files} -eq 0 ]] ; then
 				fetch_file "${mirror}/snapshots/${digest}" "${digest}" && \
 				fetch_file "${mirror}/snapshots/${signature}" "${signature}" && \
 				fetch_file "${mirror}/snapshots/${file}" "${file}" && \
@@ -364,12 +365,12 @@ do_snapshot() {
 			# we want to try and retrieve
 			# from a different mirror
 			#
-			if [ ${have_files} -eq 1 ]; then
+			if [[ ${have_files} -eq 1 ]]; then
 				__vecho "Getting snapshot timestamp ..."
 				local snapshot_timestamp=$(get_snapshot_timestamp "${DISTDIR}/${file}")
 
-				if [ ${ignore_timestamp} == 0 ]; then
-					if [ ${snapshot_timestamp} -lt $(get_portage_timestamp) ]; then
+				if [[ ${ignore_timestamp} == 0 ]]; then
+					if [[ ${snapshot_timestamp} -lt $(get_portage_timestamp) ]]; then
 						wecho "portage is newer than snapshot"
 						have_files=0
 					fi
@@ -380,8 +381,8 @@ do_snapshot() {
 					# Check that this snapshot
 					# is what it claims to be ...
 					#
-					if [ ${snapshot_timestamp} -lt ${utc_seconds} ] || \
-						[ ${snapshot_timestamp} -gt $((${utc_seconds}+ 2*86400)) ]; then
+					if [[ ${snapshot_timestamp} -lt ${utc_seconds} || \
+						${snapshot_timestamp} -gt $((${utc_seconds}+ 2*86400)) ]]; then
 
 						wecho "snapshot timestamp is not in acceptable period"
 						have_files=0
@@ -389,7 +390,7 @@ do_snapshot() {
 				fi
 			fi
 
-			if [ ${have_files} -eq 1 ]; then
+			if [[ ${have_files} -eq 1 ]]; then
 				break
 			else
 				#
@@ -399,10 +400,10 @@ do_snapshot() {
 			fi
 		done
 
-		[ ${have_files} -eq 1 ] && break
+		[[ ${have_files} -eq 1 ]] && break
 	done
 
-	if [ ${have_files} -eq 1 ]; then
+	if [[ ${have_files} -eq 1 ]]; then
 		sync_local "${DISTDIR}/${file}" && r=0
 	else
 		__vecho "${date} snapshot was not found"
@@ -437,7 +438,7 @@ do_latest_snapshot() {
 	# Daily snapshots are created at 00:45 and are not
 	# available until after 01:00. Don't waste time trying
 	# to fetch a snapshot before it's been created.
-	if [ ${start_hour} -lt 1 ] ; then
+	if [[ ${start_hour} -lt 1 ]] ; then
 		(( start_time -= 86400 ))
 	fi
 	local snapshot_date=$(get_date_part ${start_time} "%Y%m%d")
@@ -453,15 +454,15 @@ do_latest_snapshot() {
 		snapshot_date=$(get_date_part ${snapshot_date_seconds} "%Y%m%d")
 
 		timestamp_problem=""
-		if [ ${timestamp_difference} -eq 0 ]; then
+		if [[ ${timestamp_difference} -eq 0 ]]; then
 			timestamp_problem="is identical to"
-		elif [ ${timestamp_difference} -lt ${min_time_diff} ]; then
+		elif [[ ${timestamp_difference} -lt ${min_time_diff} ]]; then
 			timestamp_problem="is possibly identical to"
-		elif [ ${approx_snapshot_time} -lt ${existing_timestamp} ] ; then
+		elif [[ ${approx_snapshot_time} -lt ${existing_timestamp} ]] ; then
 			timestamp_problem="is newer than"
 		fi
 
-		if [ -n "${timestamp_problem}" ]; then
+		if [[ -n "${timestamp_problem}" ]]; then
 			ewarn "Latest snapshot date: ${snapshot_date}"
 			ewarn
 			ewarn "Approximate snapshot timestamp: ${approx_snapshot_time}"
@@ -543,7 +544,7 @@ main() {
 	cd "${TMPDIR}" || exit 1
 
 	${keep} || DISTDIR=${TMPDIR}
-	[ ! -d "${DISTDIR}" ] && mkdir -p "${DISTDIR}"
+	[[ ! -d "${DISTDIR}" ]] && mkdir -p "${DISTDIR}"
 
 	if ${keep} && [[ ! -w ${DISTDIR} ]] ; then
 		eecho "DISTDIR is not writable: ${DISTDIR}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-04-09  7:19 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-04-09  7:19 UTC (permalink / raw
  To: gentoo-commits

commit:     3f57310291642f87717c94cae142fb03bcf0fcc0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  9 07:18:23 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  9 07:18:23 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f573102

bin/emerge-webrsync: use set -u in trap

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 43ac18f46..83bb3ca1a 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -648,7 +648,7 @@ main() {
 	if [[ ! -w ${TMPDIR} ]] ; then
 		die "TMPDIR is not writable: ${TMPDIR}"
 	fi
-	trap 'cd / ; rm -rf "${TMPDIR}"' EXIT
+	trap 'set -u ; cd / ; rm -rf "${TMPDIR}"' EXIT
 	cd "${TMPDIR}" || exit 1
 
 	${keep} || DISTDIR=${TMPDIR}


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-04-09  7:26 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-04-09  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c5e725e4d50f13e68a7e2ff127607d225b221eee
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  9 07:25:54 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  9 07:25:54 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5e725e4

emerge-webrsync: always exit 1 in die()

eerror doesn't necessarily always return 1, so not necessarily going to hit
the && .. case.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 83bb3ca1a..8ef22cbe9 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -65,7 +65,8 @@ nvecho() { [[ ${PORTAGE_QUIET} == 1 ]] && echo "$@" ; }
 
 # Unfortunately, gentoo-functions doesn't yet have a die() (bug #878505)
 die() {
-	eerror "$@" && exit 1
+	eerror "$@"
+	exit 1
 }
 
 argv0=$0


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-04-29  4:44 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-04-29  4:44 UTC (permalink / raw
  To: gentoo-commits

commit:     4cc3e2d39a39b422074de49e88261cdf717292d5
Author:     Hanno Böck <hanno <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 24 14:03:28 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 29 04:41:18 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4cc3e2d3

dispatch-conf: Avoid race when accessing log file

First creating the file and then running chmod creates a security
risk where a user could access the file. Avoid this by enforcing
the file permissions via umask.

Signed-off-by: Hanno Böck <hanno <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1025
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/dispatch-conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 3dbfb0ed6..154b26ff5 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -119,8 +119,9 @@ class dispatch:
             if os.path.isfile(self.options["log-file"]) or not os.path.exists(
                 self.options["log-file"]
             ):
+                old_umask = os.umask(0o077)
                 open(self.options["log-file"], "w").close()  # Truncate it
-                os.chmod(self.options["log-file"], 0o600)
+                os.umask(old_umask)
 
         pager = self.options.get("pager")
         if pager is None or not cmd_var_is_valid(pager):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-01  7:21 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-01  7:21 UTC (permalink / raw
  To: gentoo-commits

commit:     197799592b34c2c8e31dee25c61f0ca6dc7b2f11
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 30 05:36:15 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 07:20:57 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=19779959

emerge-webrsync: don't refresh keys again if Portage-caller

Portage has configuration options for this and its own logic,
it doesn't make sense for us to repeat it (and ignore user configuration).

Bug: https://bugs.gentoo.org/905358
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index b59b728c6..4686d7b5f 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -283,6 +283,10 @@ check_file_signature_gemato() {
 			-K "${key}"
 		)
 
+		# Portage is calling us so it'll handle refreshing if configured to do so.
+		# Don't repeat its work.
+		[[ -n ${PORTAGE_TEMP_GPG_DIR} ]] && gemato_args+=( --no-refresh-keys --no-wkd )
+
 		[[ ${PORTAGE_QUIET} == 1 ]] && gemato_args+=( --quiet )
 		[[ ${do_debug} == 1 ]] && gemato_args+=( --debug )
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-01  7:21 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-01  7:21 UTC (permalink / raw
  To: gentoo-commits

commit:     47abd292da1f2b0bded9f7d4ad21130d18d4a719
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 30 05:30:13 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 07:20:57 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=47abd292

emerge-webrsync: respect PORTAGE_GPG_KEY

This will allow us to switch the Portage-caller cases to the
gemato path because we now respect 'sync-openpgp-key-path'.

Bug: https://bugs.gentoo.org/905358
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 11d6937cd..b59b728c6 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -272,9 +272,15 @@ check_file_signature_gemato() {
 	local r=1
 
 	if type -P gemato > /dev/null; then
+		if [[ -n ${PORTAGE_GPG_KEY} ]] ; then
+			local key="${PORTAGE_GPG_KEY}"
+		else
+			local key="${EPREFIX:-/}"/usr/share/openpgp-keys/gentoo-release.asc
+		fi
+
 		local gemato_args=(
 			openpgp-verify-detached
-			-K "${EPREFIX:-/}"/usr/share/openpgp-keys/gentoo-release.asc
+			-K "${key}"
 		)
 
 		[[ ${PORTAGE_QUIET} == 1 ]] && gemato_args+=( --quiet )


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-01  7:21 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-01  7:21 UTC (permalink / raw
  To: gentoo-commits

commit:     1af922156c439fff5e9ebb1eb296ad66d857f5e7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 30 05:18:47 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 07:20:57 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1af92215

emerge-webrsync: use EPREFIX for gemato keyring path

Bug: https://bugs.gentoo.org/905358
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index faf7bb752..11d6937cd 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -274,7 +274,7 @@ check_file_signature_gemato() {
 	if type -P gemato > /dev/null; then
 		local gemato_args=(
 			openpgp-verify-detached
-			-K /usr/share/openpgp-keys/gentoo-release.asc
+			-K "${EPREFIX:-/}"/usr/share/openpgp-keys/gentoo-release.asc
 		)
 
 		[[ ${PORTAGE_QUIET} == 1 ]] && gemato_args+=( --quiet )


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-01  7:21 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-01  7:21 UTC (permalink / raw
  To: gentoo-commits

commit:     df797d3dd66cdacf58eb672f40f877f3870b9ae9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May  1 06:50:59 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 07:20:58 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=df797d3d

emerge-webrsync: respect PORTAGE_GPG_KEY_SERVER

This will allow us to switch the Portage-caller cases to the
gemato path because we now respect 'sync-openpgp-keyserver'.

Bug: https://bugs.gentoo.org/905358
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 4546f510c..f1fb012c2 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -279,11 +279,17 @@ check_file_signature_gemato() {
 			local key="${EPREFIX:-/}"/usr/share/openpgp-keys/gentoo-release.asc
 		fi
 
+		local keyserver
+		if [[ -n ${PORTAGE_GPG_KEY_SERVER} ]] ; then
+			keyserver="--keyserver ${PORTAGE_GPG_KEY_SERVER}"
+		fi
+
 		local gemato_args=(
 			openpgp-verify-detached
 			-K "${key}"
 		)
 
+		[[ -n ${PORTAGE_GPG_KEY_SERVER} ]] && gemato_args+=( --keyserver "${PORTAGE_GPG_KEY_SERVER}" )
 		# Portage is calling us so it'll handle refreshing if configured to do so.
 		# Don't repeat its work.
 		[[ -n ${PORTAGE_TEMP_GPG_DIR} ]] && gemato_args+=( --no-refresh-keys --no-wkd )
@@ -291,7 +297,7 @@ check_file_signature_gemato() {
 		[[ ${PORTAGE_QUIET} == 1 ]] && gemato_args+=( --quiet )
 		[[ ${do_debug} == 1 ]] && gemato_args+=( --debug )
 
-		gemato "${gemato_args[@]}" "${signature}" "${file}"
+		gemato "${gemato_args[@]}" -- "${signature}" "${file}"
 		r=$?
 
 		if [[ ${r} -ne 0 ]]; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-10  1:28 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-10  1:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ec88652cbefa9ce7fffaa1f5ab48ec6b772be106
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue May  9 20:34:39 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 10 01:28:35 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ec88652c

einstall: Make EI_DESTLIBDIR a local variable and rename it

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1033
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/phase-helpers.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e3fca6757..af96b73e4 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -757,10 +757,9 @@ einstall() {
 	fi
 
 	if [[ -n "${libdir}" && "${CONF_PREFIX:+set}" = set ]]; then
-		EI_DESTLIBDIR="${D%/}/${CONF_PREFIX}/${libdir}"
-		EI_DESTLIBDIR="$(__strip_duplicate_slashes "${EI_DESTLIBDIR}")"
-		LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
-		unset EI_DESTLIBDIR
+		local destlibdir="${D%/}/${CONF_PREFIX}/${libdir}"
+		destlibdir="$(__strip_duplicate_slashes "${destlibdir}")"
+		LOCAL_EXTRA_EINSTALL="libdir=${destlibdir} ${LOCAL_EXTRA_EINSTALL}"
 	fi
 
 	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-12 17:23 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2023-05-12 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     0127623435c2a4c8270a39333485ba1d829926a6
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri May 12 08:01:53 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri May 12 11:04:44 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=01276234

misc-functions.sh: Don't call the prepallstrip helper

Otherwise it will output a deprecation warning. Instead, call estrip
directly with the new --prepallstrip option.

This affects only EAPI 6 and earlier and does not change functionality.

Fixes: 63d6f2e8985de480c21a5c2f09bba1547c7de6b8
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/estrip            | 7 ++++++-
 bin/misc-functions.sh | 4 ++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index cb4caca3e..6026c7f76 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1
@@ -117,6 +117,11 @@ while [[ $# -gt 0 ]] ; do
 		[[ -n ${2} ]] && die "${0##*/}: --dequeue takes no additional arguments"
 		break
 		;;
+	--prepallstrip)
+		[[ $# -eq 1 ]] || die "${0##*/}: $1 takes no additional arguments"
+		prepstrip=true
+		break
+		;;
 	*)
 		die "${0##*/}: unknown arguments '$*'"
 		exit 1

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 235823afc..d9319d5af 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -265,7 +265,7 @@ install_qa_check() {
 			"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
 			"${PORTAGE_BIN_PATH}"/estrip --dequeue
 		else
-			prepallstrip
+			"${PORTAGE_BIN_PATH}"/estrip --prepallstrip
 		fi
 	fi
 }
@@ -302,7 +302,7 @@ __dyn_instprep() {
 			"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
 			"${PORTAGE_BIN_PATH}"/estrip --dequeue
 		else
-			prepallstrip
+			"${PORTAGE_BIN_PATH}"/estrip --prepallstrip
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-12 17:23 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2023-05-12 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     bf7e5ccf3f804db70cabf0c15a2945463853ecb9
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri May 12 17:19:09 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri May 12 17:19:09 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bf7e5ccf

estrip: Style tweak

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/estrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/estrip b/bin/estrip
index 6026c7f76..8a2f5adc1 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -114,7 +114,7 @@ while [[ $# -gt 0 ]] ; do
 		exit 0
 		;;
 	--dequeue)
-		[[ -n ${2} ]] && die "${0##*/}: --dequeue takes no additional arguments"
+		[[ $# -eq 1 ]] || die "${0##*/}: $1 takes no additional arguments"
 		break
 		;;
 	--prepallstrip)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-13 20:29 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2023-05-13 20:29 UTC (permalink / raw
  To: gentoo-commits

commit:     965dcfa448c38570cf9ac28d7c6232d1df615871
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat May 13 11:49:24 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat May 13 20:13:25 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=965dcfa4

portageq-wrapper: Look for portageq also in PORTAGE_BIN_PATH

Suggested-by: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/portageq-wrapper | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/portageq-wrapper b/bin/portageq-wrapper
index 2ca4052c4..afa2defe1 100755
--- a/bin/portageq-wrapper
+++ b/bin/portageq-wrapper
@@ -8,7 +8,7 @@ cd "${PORTAGE_PYM_PATH}" || exit 1
 IFS=":"
 set -f # in case ${PATH} contains any shell glob characters
 
-for path in ${PATH}; do
+for path in "${PORTAGE_BIN_PATH}" ${PATH}; do
 	[[ ${path} == */portage/*/ebuild-helpers* ]] && continue
 	[[ -x ${path}/portageq ]] || continue
 	PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-17  6:20 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-17  6:20 UTC (permalink / raw
  To: gentoo-commits

commit:     66c00b2e3d72bc8947fc802b0403687853e16e13
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed May 17 06:18:25 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 17 06:20:16 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=66c00b2e

emerge-webrsync: add fallback error case

This would've helped avoid a loop where we keep trying old snapshots
if gemato wasn't installed. We already have a fix for that separately
with a more specific error, but a fallback is good for unexpected ones.

Bug: https://bugs.gentoo.org/905868
Closes: https://github.com/gentoo/portage/pull/1039
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index e707f8b9b..7fed4e790 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -361,6 +361,11 @@ check_file_signature() {
 				r=$?
 				;;
 		esac
+
+		if [[ ${r} != 0 ]] ; then
+			eerror "Error occurred in check_file_signature: ${r}. Aborting."
+			die "Verification error occured."
+		fi
 	else
 		r=0
 	fi


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-18  7:23 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2023-05-18  7:23 UTC (permalink / raw
  To: gentoo-commits

commit:     0181746a36f8ed9aa6610ab5ebdd0764c119c0df
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed May 17 22:45:46 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed May 17 22:45:46 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0181746a

ebuild-pyhelper: Exit with status 127 if the command was not found

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/ebuild-pyhelper | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild-pyhelper b/bin/ebuild-pyhelper
index 3c77a0304..901277c96 100755
--- a/bin/ebuild-pyhelper
+++ b/bin/ebuild-pyhelper
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 2010-2021 Gentoo Authors
+# Copyright 2010-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 export __PORTAGE_HELPER_CWD=${PWD}
@@ -18,4 +18,4 @@ for path in "${PORTAGE_BIN_PATH}/${0##*/}"{.py,}; do
 	fi
 done
 echo "File not found: ${path}" >&2
-exit 1
+exit 127


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-26  1:33 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-26  1:33 UTC (permalink / raw
  To: gentoo-commits

commit:     2eef717c4b630f359235f2801fafdc9e63c546fb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May 20 08:17:38 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 01:33:03 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2eef717c

emerge-webrsync: handle early hours correctly

One of the perils of only doing development late...

We would error out on '08' etc as the hour. Strip the 0.

Bug: https://bugs.gentoo.org/905868
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 7fed4e790..a84f68aa1 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -574,7 +574,7 @@ do_latest_snapshot() {
 	# Daily snapshots are created at 00:45 and are not
 	# available until after 01:00. Don't waste time trying
 	# to fetch a snapshot before it's been created.
-	if [[ ${start_hour} -lt 1 ]] ; then
+	if [[ ${start_hour#0} -lt 1 ]] ; then
 		(( start_time -= 86400 ))
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-05-26  1:33 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-05-26  1:33 UTC (permalink / raw
  To: gentoo-commits

commit:     b8ab8e1c850b773dd17e503a22902b52a2d3a868
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May 20 08:13:29 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 01:33:03 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b8ab8e1c

emerge-webrsync: create a new temporary dir for legacy gpg verification

It's possible that we can't read /root/.gnupg and we shouldn't
be poking around in there anyway.

However, if the user is setting PORTAGE_GPG_DIR by themselves,
it's their responsibility to handle the directory being in the
right state (e.g. has the right keys imported).

- If PORTAGE_GPG_DIR is unset, make a tmpdir w/ mktemp.
- If we're using that temporary directory we just created, import PORTAGE_GPG_KEY,
as before defaulting to /usr/share/openpgp-keys/gentoo-release.asc.

Bug: https://bugs.gentoo.org/905868
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1042
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index a84f68aa1..956e00e1f 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -314,7 +314,26 @@ check_file_signature_gpg_unwrapped() {
 	local file="$2"
 
 	if type -P gpg > /dev/null; then
-		if gnupg_status=$(gpg --homedir "${PORTAGE_GPG_DIR}" --batch \
+		if [[ -n ${PORTAGE_GPG_KEY} ]] ; then
+			local key="${PORTAGE_GPG_KEY}"
+		else
+			local key="${EPREFIX:-/}"/usr/share/openpgp-keys/gentoo-release.asc
+		fi
+
+		local gpgdir="${PORTAGE_GPG_DIR}"
+		if [[ -z ${gpgdir} ]] ; then
+			gpgdir=$(mktemp -d "${PORTAGE_TMPDIR}/portage/webrsync-XXXXXX")
+			if [[ ! -w ${gpgdir} ]] ; then
+				die "gpgdir is not writable: ${gpgdir}"
+			fi
+
+			# If we're created our own temporary directory, it's okay for us
+			# to import the keyring by ourselves. But we'll avoid doing it
+			# if the user has set PORTAGE_GPG_DIR by themselves.
+			gpg --no-default-keyring --homedir "${gpgdir}" --batch --import "${key}"
+		fi
+
+		if gnupg_status=$(gpg --no-default-keyring --homedir "${gpgdir}" --batch \
 			--status-fd 1 --verify "${signature}" "${file}"); then
 			while read -r line; do
 				if [[ ${line} == "[GNUPG:] GOODSIG"* ]]; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-07-03 20:19 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-07-03 20:19 UTC (permalink / raw
  To: gentoo-commits

commit:     f24dd0d9808559571509add2c8c69c1bcb2bfec6
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jun 25 20:03:04 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul  3 20:18:37 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f24dd0d9

bin/save-ebuild-env.sh: refrain from using the compgen builtin

For the compgen builtin to be available requires that bash be compiled
with --enable-readline. Rather than rely on compgen to generate a list
of function names, parse their names out of declare -F instead.

Specify -v for the following unset command, so that bash is coerced into
unsetting only variables, as is intended.

Expand the applicable variable names with "${!___@}". Owing to the
constraints placed on identifiers, it's not particularly important that
it be done this way, but I think it better expresses the intent.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Bug: https://bugs.gentoo.org/909148
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/save-ebuild-env.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index bba468da1..20cd86866 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -83,8 +83,12 @@ __save_ebuild_env() {
 	___eapi_has_usex && unset -f usex
 
 	# Clear out the triple underscore namespace as it is reserved by the PM.
-	unset -f $(compgen -A function ___)
-	unset ${!___*}
+	while IFS=' ' read -r _ _ REPLY; do
+		if [[ ${REPLY} == ___* ]]; then
+			unset -f "${REPLY}"
+		fi
+	done < <(declare -F)
+	unset -v REPLY "${!___@}"
 
 	# portage config variables and variables set directly by portage
 	unset ACCEPT_LICENSE BUILD_PREFIX COLS \


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-08-19 14:49 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-08-19 14:49 UTC (permalink / raw
  To: gentoo-commits

commit:     aa37e3993866f1d75e855f8c7300749fadd846af
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 19 13:49:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 14:49:33 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=aa37e399

emerge-webrsync: pass --proxy to gemato if http_proxy or https_proxy is set

Make sure we pass proxy settings down into gemato.

We include a fallback w/ https_proxy, but note that gnupg doesn't actually use
https_proxy but we've had cases reported where users only have https_proxy and
not http_proxy set, so include this to help them out too.

Bug: https://bugs.gentoo.org/691434
Bug: https://bugs.gentoo.org/835927
Bug: https://bugs.gentoo.org/911629
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 7ef6d0d5a9..fea0085682 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -290,6 +290,13 @@ check_file_signature_gemato() {
 			-K "${key}"
 		)
 
+
+		if [[ -n ${http_proxy} || -n ${https_proxy} ]] ; then
+			gemato_args+=(
+				--proxy "${http_proxy:-${https_proxy}}"
+			)
+		fi
+
 		[[ -n ${PORTAGE_GPG_KEY_SERVER} ]] && gemato_args+=( --keyserver "${PORTAGE_GPG_KEY_SERVER}" )
 		[[ ${PORTAGE_QUIET} == 1 ]] && gemato_args+=( --quiet )
 		[[ ${do_debug} == 1 ]] && gemato_args+=( --debug )


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-08-19 14:49 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-08-19 14:49 UTC (permalink / raw
  To: gentoo-commits

commit:     f0b44fc1cc67114662b84905bc1e0cd9ce1bba28
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 19 13:49:19 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 14:49:33 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0b44fc1

emerge-webrsync: handle https_proxy too

If `https_proxy` is also set in make.conf, pick that up so it's passed down to
wget.

Bug: https://bugs.gentoo.org/691434
Bug: https://bugs.gentoo.org/835927
Bug: https://bugs.gentoo.org/911629
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 7b3163b813..7ef6d0d5a9 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -83,8 +83,8 @@ eval "$("${portageq}" envvar -v DISTDIR EPREFIX FEATURES \
 	PORTAGE_BIN_PATH PORTAGE_CONFIGROOT PORTAGE_GPG_DIR \
 	PORTAGE_NICENESS PORTAGE_REPOSITORIES PORTAGE_RSYNC_EXTRA_OPTS \
 	PORTAGE_RSYNC_OPTS PORTAGE_TEMP_GPG_DIR PORTAGE_TMPDIR \
-	USERLAND http_proxy ftp_proxy)"
-export http_proxy ftp_proxy
+	USERLAND http_proxy https_proxy ftp_proxy)"
+export http_proxy https_proxy ftp_proxy
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-08-19 15:03 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-08-19 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     a6e8b05152e2c815ed66e3a576fe7a3c06f6b1f6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 19 15:03:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 15:03:06 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6e8b051

emerge-webrsync: drop dead --keyserver code

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index fea0085682..782a6052eb 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -280,17 +280,11 @@ check_file_signature_gemato() {
 			die "Needed keys unavailable! Install its package or set PORTAGE_GPG_KEY to the right path."
 		fi
 
-		local keyserver
-		if [[ -n ${PORTAGE_GPG_KEY_SERVER} ]] ; then
-			keyserver="--keyserver ${PORTAGE_GPG_KEY_SERVER}"
-		fi
-
 		local gemato_args=(
 			openpgp-verify-detached
 			-K "${key}"
 		)
 
-
 		if [[ -n ${http_proxy} || -n ${https_proxy} ]] ; then
 			gemato_args+=(
 				--proxy "${http_proxy:-${https_proxy}}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-09-08 21:43 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-09-08 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     6eaa4b55ed75e36ac19d9083dfb9f6c040c415fa
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  8 21:42:47 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep  8 21:42:47 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6eaa4b55

bin: drop cgroup-release-agent

Left over from FEATURES="cgroup".

Fixes: f8e3b11496bd6d602a690535c4a3bb32bb8e9744
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/cgroup-release-agent | 2 --
 1 file changed, 2 deletions(-)

diff --git a/bin/cgroup-release-agent b/bin/cgroup-release-agent
deleted file mode 100755
index b024e08300..0000000000
--- a/bin/cgroup-release-agent
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec rmdir "/sys/fs/cgroup/portage/${1}"


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-09-26 20:54 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-09-26 20:54 UTC (permalink / raw
  To: gentoo-commits

commit:     0c324425b7c6151a59fe85577b74c895c3c85aed
Author:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 20:28:02 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 26 20:54:12 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0c324425

dispatch-conf: copy SELinux labels to merged files

Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1099
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/dispatch-conf | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 154b26ff56..849be562ee 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -12,6 +12,7 @@
 #
 
 import atexit
+import errno
 import re
 import subprocess
 import sys
@@ -398,6 +399,8 @@ class dispatch:
                     mystat = os.lstat(conf["new"])
                     os.chmod(mrgconf, mystat[ST_MODE])
                     os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
+                    if "selinux" in portage.settings.features:
+                        self.copy_selinux_label(conf["current"], mrgconf)
                     newconf = mrgconf
                     continue
                 elif c == "l":
@@ -434,6 +437,30 @@ class dispatch:
 
         perform_conf_update_session_hooks("post-session")
 
+    def copy_selinux_label(self, curconf, newconf):
+        """Copy the SELinux security label from the current config file to
+        the new/merged config file."""
+        try:
+            label = os.getxattr(curconf, "security.selinux")
+        except OSError as e:
+            if e.errno == errno.ENOTSUP:
+                # Filesystem does not support xattrs
+                return
+            writemsg(
+                f"dispatch-conf: Failed getting SELinux label on {curconf}; ignoring...\n",
+                noiselevel=-1,
+            )
+            return
+
+        if label:
+            try:
+                os.setxattr(newconf, "security.selinux", label)
+            except OSError:
+                writemsg(
+                    f"dispatch-conf: Failed setting SELinux label on {newconf}; ignoring...\n",
+                    noiselevel=-1,
+                )
+
     def replace(self, newconf, curconf):
         """Replace current config with the new/merged version.  Also logs
         the diff of what changed into the configured log file."""


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-09-26 20:54 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-09-26 20:54 UTC (permalink / raw
  To: gentoo-commits

commit:     2034dc76fb15f1389c4e0c6c0ac1f2052e757b5e
Author:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 14:31:27 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 26 20:54:12 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2034dc76

etc-update: set SELinux security labels on merged files

For files merged with etc-update, also set their SELinux security labels.
Without this, merged files will have the type user_tmp_t and cause issues on
enforcing SELinux systems.

Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/etc-update | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/etc-update b/bin/etc-update
index 97c1634203..274bc6f7be 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -631,6 +631,7 @@ do_merge() {
 					else
 						chown --reference="${ofile}" "${mfile}"
 						chmod --reference="${ofile}" "${mfile}"
+						${selinux} && chcon --reference="${ofile}" "${mfile}"
 					fi
 					do_mv_ln ${mv_opts} "${mfile}" "${ofile}"
 					rm ${rm_opts} "${file}"
@@ -815,6 +816,8 @@ export PORTAGE_TMPDIR
 SCAN_PATHS=${*:-${CONFIG_PROTECT}}
 [[ " ${FEATURES} " == *" case-insensitive-fs "* ]] && \
 	case_insensitive=true || case_insensitive=false
+[[ " ${FEATURES} " == *" selinux "* ]] && \
+	selinux=true || selinux=false
 
 TMP="${PORTAGE_TMPDIR}/etc-update-$$"
 trap "die terminated" SIGTERM


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-13 10:19 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2023-10-13 10:19 UTC (permalink / raw
  To: gentoo-commits

commit:     463af696914237bc6e210306fbc2f09f3a1005ce
Author:     Raul E Rangel <rrangel <AT> chromium <DOT> org>
AuthorDate: Thu Nov 10 04:26:18 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 13 10:19:00 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=463af696

bin/phase-functions: Move du stats into subshell

These variables are only used inside this subshell. This avoids
polluting the environment.

Apparently this calculation isn't hermetic. I'm not sure why:

@@ -268,10 +268,10 @@
 declare -x cros_setup_hooks_run="booya"
 declare -a exclude_hermetic=([0]="--exclude-non-hermetic")
 declare -- f
-declare -a isz=([0]="264" [1]="/var/tmp/portage/dev-libs/libffi-3.1-r8/image/")
-declare -a nsz=([0]="2803" [1]="/var/tmp/portage/dev-libs/libffi-3.1-r8/work")
+declare -a isz=([0]="16" [1]="/var/tmp/portage/dev-libs/libffi-3.1-r8/image/")
+declare -a nsz=([0]="2599" [1]="/var/tmp/portage/dev-libs/libffi-3.1-r8/work")
 declare -- phase_func
 __eapi6_src_install ()

Bug: https://bugs.gentoo.org/914441
Signed-off-by: Raul E Rangel <rrangel <AT> chromium.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/phase-functions.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 071941ff72..cd672a878c 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -620,12 +620,11 @@ __dyn_install() {
 
 	# record build & installed size in build log
 	if type -P du &>/dev/null; then
-		local nsz=( $(du -ks "${WORKDIR}") )
-		local isz=( $(du -ks "${D}") )
-
 		# subshell to avoid polluting the caller env with the helper
 		# functions below
 		(
+			local nsz=( $(du -ks "${WORKDIR}") )
+			local isz=( $(du -ks "${D}") )
 			# align $1 to the right to the width of the widest of $1 and $2
 			padl() {
 				local s1=$1


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-24  2:10 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2023-10-24  2:10 UTC (permalink / raw
  To: gentoo-commits

commit:     986b59bd7443b23146217f581e7b3b82a5d4912f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 24 01:43:03 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 02:09:53 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=986b59bd

bin/emaint: Use __main__ for spawn compat

If the event loop is closed outside of __main__
then it closes the event loop in child processes
for the multiprocessing spawn start method.

Bug: https://bugs.gentoo.org/916142
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emaint | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/bin/emaint b/bin/emaint
index a1b726b183..da925e1dad 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 2005-2020 Gentoo Authors
+# Copyright 2005-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """System health checks and maintenance utilities.
@@ -53,16 +53,21 @@ try:
     from portage.emaint.main import emaint_main
     from portage.util._eventloop.global_event_loop import global_event_loop
 
-    try:
-        emaint_main(sys.argv[1:])
-    except OSError as e:
-        if e.errno == errno.EACCES:
-            print("\nemaint: Need superuser access")
-            sys.exit(1)
-        else:
-            raise
-    finally:
-        global_event_loop().close()
+    if __name__ == "__main__":
+        try:
+            emaint_main(sys.argv[1:])
+        except OSError as e:
+            if e.errno == errno.EACCES:
+                print("\nemaint: Need superuser access")
+                sys.exit(1)
+            else:
+                raise
+        finally:
+            # Only close the event loop for __main__,
+            # since outside of __main__ it would close the
+            # event loop for child processes when using
+            # the multiprocessing spawn start method.
+            global_event_loop().close()
 
 except KeyboardInterrupt as e:
     # Prevent traceback on ^C


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-24  2:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2023-10-24  2:21 UTC (permalink / raw
  To: gentoo-commits

commit:     4ec75ab8717787d5f24f35685cfc138f5a77901f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 24 01:05:57 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 02:14:29 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4ec75ab8

bin/ebuild: Use __main__ for spawn compat

If the event loop is closed outside of __main__
then it closes the event loop in child processes
for the multiprocessing spawn start method.

Bug: https://bugs.gentoo.org/916142
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 2fa4e7974a..09457b2940 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import os
@@ -17,8 +17,7 @@ class SignalInterrupt(KeyboardInterrupt):
         self.signum = signum
 
 
-try:
-
+def main():
     def signal_interrupt(signum, _frame):
         raise SignalInterrupt(signum)
 
@@ -433,10 +432,18 @@ try:
             global_event_loop().close()
             sys.exit(a)
 
+    # Only close the event loop for __main__,
+    # since outside of __main__ it would close the
+    # event loop for child processes when using
+    # the multiprocessing spawn start method.
     global_event_loop().close()
 
-except KeyboardInterrupt as e:
-    # Prevent traceback on ^C
-    signum = getattr(e, "signum", signal.SIGINT)
-    signal.signal(signum, signal.SIG_DFL)
-    raise_signal(signum)
+
+if __name__ == "__main__":
+    try:
+        main()
+    except KeyboardInterrupt as e:
+        # Prevent traceback on ^C
+        signum = getattr(e, "signum", signal.SIGINT)
+        signal.signal(signum, signal.SIG_DFL)
+        raise_signal(signum)


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-24  2:21 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2023-10-24  2:21 UTC (permalink / raw
  To: gentoo-commits

commit:     9dab01175ae28bb93e41f7fb20a4b8205bf7c511
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 24 01:19:28 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 02:15:14 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9dab0117

bin/ebuild: Move imports before main

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild | 83 +++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 09457b2940..cbefb58161 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -17,54 +17,55 @@ class SignalInterrupt(KeyboardInterrupt):
         self.signum = signum
 
 
-def main():
-    def signal_interrupt(signum, _frame):
-        raise SignalInterrupt(signum)
+def signal_interrupt(signum, _frame):
+    raise SignalInterrupt(signum)
 
-    def debug_signal(_signum, _frame):
-        import pdb
 
-        pdb.set_trace()
+def debug_signal(_signum, _frame):
+    import pdb
 
-    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
-    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-    signal.signal(signal.SIGTERM, signal_interrupt)
-    signal.signal(signal.SIGUSR1, debug_signal)
+    pdb.set_trace()
 
-    import argparse
-    from os import path as osp
-    import sys
-    import textwrap
 
-    if osp.isfile(
-        osp.join(
-            osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed"
-        )
-    ):
-        sys.path.insert(
-            0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
-        )
-    import portage
-
-    portage._internal_caller = True
-    from portage import os
-    from portage import _encodings
-    from portage import _shell_quote
-    from portage import _unicode_encode
-    from portage.const import VDB_PATH
-    from portage.exception import (
-        PermissionDenied,
-        PortageKeyError,
-        PortagePackageException,
-        UnsupportedAPIException,
+# Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+signal.signal(signal.SIGTERM, signal_interrupt)
+signal.signal(signal.SIGUSR1, debug_signal)
+
+import argparse
+from os import path as osp
+import sys
+import textwrap
+
+if osp.isfile(
+    osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")
+):
+    sys.path.insert(
+        0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
     )
-    from portage.localization import _
-    import portage.util
-    from portage.util._eventloop.global_event_loop import global_event_loop
-    from _emerge.actions import apply_priorities
-    from _emerge.Package import Package
-    from _emerge.RootConfig import RootConfig
+import portage
+
+portage._internal_caller = True
+from portage import os
+from portage import _encodings
+from portage import _shell_quote
+from portage import _unicode_encode
+from portage.const import VDB_PATH
+from portage.exception import (
+    PermissionDenied,
+    PortageKeyError,
+    PortagePackageException,
+    UnsupportedAPIException,
+)
+from portage.localization import _
+import portage.util
+from portage.util._eventloop.global_event_loop import global_event_loop
+from _emerge.actions import apply_priorities
+from _emerge.Package import Package
+from _emerge.RootConfig import RootConfig
 
+
+def main():
     portage.process.sanitize_fds()
     description = "See the ebuild(1) man page for more info"
     usage = "Usage: ebuild <ebuild file> <command> [command] ..."


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-24  2:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2023-10-24  2:27 UTC (permalink / raw
  To: gentoo-commits

commit:     0071f7ce44f7c7ea40a5e277acc016ab508f63b0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 24 01:32:06 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 02:25:43 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0071f7ce

bin/emerge: Move imports before main

Also remove __main__ conditional inside main.

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emerge | 118 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 58 insertions(+), 60 deletions(-)

diff --git a/bin/emerge b/bin/emerge
index 6bd3d2166f..bdc587d37e 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -18,73 +18,72 @@ class SignalInterrupt(KeyboardInterrupt):
         self.signum = signum
 
 
-def main():
-    def signal_interrupt(signum, _frame):
-        raise SignalInterrupt(signum)
+def signal_interrupt(signum, _frame):
+    raise SignalInterrupt(signum)
 
-    def debug_signal(_signum, _frame):
-        import pdb
 
-        pdb.set_trace()
+def debug_signal(_signum, _frame):
+    import pdb
 
-    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
-    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-    signal.signal(signal.SIGTERM, signal_interrupt)
-    signal.signal(signal.SIGUSR1, debug_signal)
+    pdb.set_trace()
 
-    from os import path as osp
 
-    if osp.isfile(
-        osp.join(
-            osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed"
-        )
-    ):
-        sys.path.insert(
-            0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+# Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+signal.signal(signal.SIGTERM, signal_interrupt)
+signal.signal(signal.SIGUSR1, debug_signal)
+
+from os import path as osp
+
+if osp.isfile(
+    osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")
+):
+    sys.path.insert(
+        0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "lib")
+    )
+import portage
+
+portage._internal_caller = True
+portage._disable_legacy_globals()
+from portage.elog import mod_echo
+from portage.exception import IsADirectory, ParseError, PermissionDenied
+from portage.util._eventloop.global_event_loop import global_event_loop
+from _emerge.main import emerge_main
+
+
+def main():
+    portage.process.sanitize_fds()
+    try:
+        retval = emerge_main()
+    except PermissionDenied as e:
+        sys.stderr.write(f"Permission denied: '{str(e)}'\n")
+        sys.exit(e.errno)
+    except IsADirectory as e:
+        sys.stderr.write(
+            f"'{str(e)}' is a directory, but should be a file!\n"
+            "See portage man page for information on "
+            "which files may be directories.\n"
         )
-    import portage
-
-    portage._internal_caller = True
-    portage._disable_legacy_globals()
-    from portage.elog import mod_echo
-    from portage.exception import IsADirectory, ParseError, PermissionDenied
-    from portage.util._eventloop.global_event_loop import global_event_loop
-    from _emerge.main import emerge_main
-
-    if __name__ == "__main__":
-        portage.process.sanitize_fds()
-        try:
-            retval = emerge_main()
-        except PermissionDenied as e:
-            sys.stderr.write(f"Permission denied: '{str(e)}'\n")
-            sys.exit(e.errno)
-        except IsADirectory as e:
-            sys.stderr.write(
-                f"'{str(e)}' is a directory, but should be a file!\n"
-                "See portage man page for information on "
-                "which files may be directories.\n"
-            )
-            sys.exit(e.errno)
-        except ParseError as e:
-            sys.stderr.write(f"{str(e)}\n")
-            sys.exit(1)
-        except (KeyboardInterrupt, SystemExit):
-            raise
-        except Exception:
-            # If an unexpected exception occurs then we don't want the
-            # mod_echo output to obscure the traceback, so dump the
-            # mod_echo output before showing the traceback.
-            import traceback
-
-            tb_str = traceback.format_exc()
-            mod_echo.finalize()
-            sys.stderr.write(tb_str)
-            sys.exit(1)
-        sys.exit(retval)
+        sys.exit(e.errno)
+    except ParseError as e:
+        sys.stderr.write(f"{str(e)}\n")
+        sys.exit(1)
+    except (KeyboardInterrupt, SystemExit):
+        raise
+    except Exception:
+        # If an unexpected exception occurs then we don't want the
+        # mod_echo output to obscure the traceback, so dump the
+        # mod_echo output before showing the traceback.
+        import traceback
+
+        tb_str = traceback.format_exc()
+        mod_echo.finalize()
+        sys.stderr.write(tb_str)
+        sys.exit(1)
+    sys.exit(retval)
 
 
 if __name__ == "__main__":
-    global_event_loop = None
     try:
         main()
     except KeyboardInterrupt as e:
@@ -103,5 +102,4 @@ if __name__ == "__main__":
         # since outside of __main__ it would close the
         # event loop for child processes when using
         # the multiprocessing spawn start method.
-        if global_event_loop is not None:
-            global_event_loop().close()
+        global_event_loop().close()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-24  2:27 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2023-10-24  2:27 UTC (permalink / raw
  To: gentoo-commits

commit:     b089dd5bed1b7d2a5d4edd447d9df38ae12093b6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 24 01:26:26 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 02:24:34 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b089dd5b

bin/emerge: Use __main__ for spawn compat

If the event loop is closed outside of __main__
then it closes the event loop in child processes
for the multiprocessing spawn start method.

Bug: https://bugs.gentoo.org/916142
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/emerge | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/bin/emerge b/bin/emerge
index f5dbc31066..6bd3d2166f 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 2006-2022 Gentoo Authors
+# Copyright 2006-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import os
@@ -18,9 +18,7 @@ class SignalInterrupt(KeyboardInterrupt):
         self.signum = signum
 
 
-global_event_loop = None
-try:
-
+def main():
     def signal_interrupt(signum, _frame):
         raise SignalInterrupt(signum)
 
@@ -84,17 +82,26 @@ try:
             sys.exit(1)
         sys.exit(retval)
 
-except KeyboardInterrupt as e:
-    # This block ensures that ^C interrupts are handled quietly. We handle
-    # KeyboardInterrupt instead of installing a SIGINT handler, since
-    # exiting from signal handlers intermittently causes python to ignore
-    # the SystemExit exception with a message like this:
-    # Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
-    signum = getattr(e, "signum", signal.SIGINT)
-    signal.signal(signum, signal.SIG_DFL)
-    sys.stderr.write(f"\n\nExiting on signal {signum}\n")
-    sys.stderr.flush()
-    raise_signal(signum)
-finally:
-    if global_event_loop is not None:
-        global_event_loop().close()
+
+if __name__ == "__main__":
+    global_event_loop = None
+    try:
+        main()
+    except KeyboardInterrupt as e:
+        # This block ensures that ^C interrupts are handled quietly. We handle
+        # KeyboardInterrupt instead of installing a SIGINT handler, since
+        # exiting from signal handlers intermittently causes python to ignore
+        # the SystemExit exception with a message like this:
+        # Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
+        signum = getattr(e, "signum", signal.SIGINT)
+        signal.signal(signum, signal.SIG_DFL)
+        sys.stderr.write(f"\n\nExiting on signal {signum}\n")
+        sys.stderr.flush()
+        raise_signal(signum)
+    finally:
+        # Only close the event loop for __main__,
+        # since outside of __main__ it would close the
+        # event loop for child processes when using
+        # the multiprocessing spawn start method.
+        if global_event_loop is not None:
+            global_event_loop().close()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-24 17:49 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2023-10-24 17:49 UTC (permalink / raw
  To: gentoo-commits

commit:     0706d3d3fe6268560efbe4f422b07f2155923168
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 24 17:48:15 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 17:48:39 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0706d3d3

env-update: multiprocessing spawn compat

Bug: https://bugs.gentoo.org/916240
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/env-update | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/bin/env-update b/bin/env-update
index 6ba80c3ef9..487bd80e48 100755
--- a/bin/env-update
+++ b/bin/env-update
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -37,11 +37,12 @@ import portage
 
 portage._internal_caller = True
 
-try:
-    portage.env_update(makelinks)
-except OSError as e:
-    if e.errno == errno.EACCES:
-        print("env-update: Need superuser access")
-        sys.exit(1)
-    else:
-        raise
+if __name__ == "__main__":
+    try:
+        portage.env_update(makelinks)
+    except OSError as e:
+        if e.errno == errno.EACCES:
+            print("env-update: Need superuser access")
+            sys.exit(1)
+        else:
+            raise


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2023-10-26 18:44 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2023-10-26 18:44 UTC (permalink / raw
  To: gentoo-commits

commit:     f69f5cb8f6f94e60b7541b10c8bc1fbfdb0350e6
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 26 18:43:39 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Oct 26 18:43:39 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f69f5cb8

bin/phase-helpers.sh: Whitespace

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6c2ecf0bc2..ec634e536d 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1007,7 +1007,7 @@ best_version() {
 }
 
 portageq() {
-    die "portageq is not allowed in ebuild scope"
+	die "portageq is not allowed in ebuild scope"
 }
 
 if ___eapi_has_get_libdir; then


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-02-05  6:44 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2024-02-05  6:44 UTC (permalink / raw
  To: gentoo-commits

commit:     cba5d579f170ee9616b1903dedc3597eafb1aee7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  5 06:38:52 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  5 06:43:11 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cba5d579

bin/fixpackages: multiprocessing spawn compat

Use __main__ to avoid this RuntimeError:

RuntimeError:
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

Bug: https://bugs.gentoo.org/914876
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/fixpackages | 71 ++++++++++++++++++++++++++++++---------------------------
 1 file changed, 38 insertions(+), 33 deletions(-)

diff --git a/bin/fixpackages b/bin/fixpackages
index 6f88bea7c3..76c8f6d388 100755
--- a/bin/fixpackages
+++ b/bin/fixpackages
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import argparse
@@ -17,44 +17,49 @@ if osp.isfile(
 import portage
 
 portage._internal_caller = True
-from portage import os
 from portage.output import EOutput
 from textwrap import wrap
 from portage._global_updates import _global_updates
 
-mysettings = portage.settings
-mytrees = portage.db
-mtimedb = portage.mtimedb
 
-description = """The fixpackages program performs package move updates on
-	configuration files, installed packages, and binary packages."""
-description = " ".join(description.split())
+def main():
+    mysettings = portage.settings
+    mytrees = portage.db
+    mtimedb = portage.mtimedb
 
-parser = argparse.ArgumentParser(description=description)
-parser.parse_args()
+    description = """The fixpackages program performs package move updates on
+        configuration files, installed packages, and binary packages."""
+    description = " ".join(description.split())
 
-if mysettings["ROOT"] != "/":
-    out = EOutput()
-    msg = (
-        "The fixpackages program is not intended for use with "
-        + 'ROOT != "/". Instead use `emaint --fix movebin` and/or '
-        + "`emaint --fix moveinst."
-    )
-    for line in wrap(msg, 72):
-        out.eerror(line)
-    sys.exit(1)
-
-try:
-    os.nice(int(mysettings.get("PORTAGE_NICENESS", "0")))
-except (OSError, ValueError) as e:
-    portage.writemsg(
-        f"!!! Failed to change nice value to '{mysettings['PORTAGE_NICENESS']}'\n"
-    )
-    portage.writemsg(f"!!! {str(e)}\n")
-    del e
+    parser = argparse.ArgumentParser(description=description)
+    parser.parse_args()
+
+    if mysettings["ROOT"] != "/":
+        out = EOutput()
+        msg = (
+            "The fixpackages program is not intended for use with "
+            + 'ROOT != "/". Instead use `emaint --fix movebin` and/or '
+            + "`emaint --fix moveinst."
+        )
+        for line in wrap(msg, 72):
+            out.eerror(line)
+        sys.exit(1)
+
+    try:
+        os.nice(int(mysettings.get("PORTAGE_NICENESS", "0")))
+    except (OSError, ValueError) as e:
+        portage.writemsg(
+            f"!!! Failed to change nice value to '{mysettings['PORTAGE_NICENESS']}'\n"
+        )
+        portage.writemsg(f"!!! {str(e)}\n")
+        del e
+
+    _global_updates(mytrees, mtimedb["updates"], if_mtime_changed=False)
+
+    print()
+    print("Done.")
+    print()
 
-_global_updates(mytrees, mtimedb["updates"], if_mtime_changed=False)
 
-print()
-print("Done.")
-print()
+if __name__ == "__main__":
+    main()


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-02-22 15:36 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2024-02-22 15:36 UTC (permalink / raw
  To: gentoo-commits

commit:     f76452e0760653482afbd4144d60332d4284b67d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 22 02:58:07 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 22 07:28:38 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f76452e0

bin/socks5-server.py: Migrate to asyncio.run()

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/socks5-server.py | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/bin/socks5-server.py b/bin/socks5-server.py
index e898835ffa..640c89d5a8 100644
--- a/bin/socks5-server.py
+++ b/bin/socks5-server.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 # SOCKSv5 proxy server for network-sandbox
-# Copyright 2015-2022 Gentoo Authors
+# Copyright 2015-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import asyncio
@@ -218,27 +218,21 @@ class Socks5Server:
             return
 
 
-if __name__ == "__main__":
-    if len(sys.argv) != 2:
-        print(f"Usage: {sys.argv[0]} <socket-path>")
-        sys.exit(1)
-
-    loop = asyncio.new_event_loop()
+async def run_socks5_server(socket_path):
     s = Socks5Server()
-    server = loop.run_until_complete(
-        asyncio.start_unix_server(s.handle_proxy_conn, sys.argv[1])
-    )
+    server = await asyncio.start_unix_server(s.handle_proxy_conn, socket_path)
 
-    ret = 0
     try:
-        try:
-            loop.run_forever()
-        except KeyboardInterrupt:
-            pass
-        except:
-            ret = 1
+        await asyncio.get_running_loop().create_future()
     finally:
         server.close()
-        loop.run_until_complete(server.wait_closed())
-        loop.close()
-        os.unlink(sys.argv[1])
+        await server.wait_closed()
+        os.unlink(socket_path)
+
+
+if __name__ == "__main__":
+    if len(sys.argv) != 2:
+        print(f"Usage: {sys.argv[0]} <socket-path>")
+        sys.exit(1)
+
+    asyncio.run(run_socks5_server(sys.argv[1]))


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-03-09 18:46 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2024-03-09 18:46 UTC (permalink / raw
  To: gentoo-commits

commit:     8eb2502bf264d54dfbf180222f162f7a593b947d
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  6 20:52:08 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  9 18:46:00 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8eb2502b

phase-functions: prematurely delete WORKDIR if FEATURES=merge-wait

Using the merge-wait feature together with many parallel emerge jobs
potentially leads to a high disk space usage due to the created
portage build directories waiting for their packages to be merged into
the live filesystem prior portage will clean them. This can easily
lead to out-of-space errors.

Prematurely deleting WORKDIR at the end of src_install() helps
reducing the temporarily used disk space. All that portage need to
merge a package into the live filesystem are the files in the image/
directory (D). (At least in theory)

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1302
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/phase-functions.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ebcf5f242a..ab130a3be5 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -723,6 +723,13 @@ __dyn_install() {
 		>> DEBUGBUILD
 	fi
 	trap - SIGINT SIGQUIT
+
+	# Prematurely delete WORKDIR in case merge-wait is enabled to
+	# decrease the space used by portage build directories until the
+	# packages are merged and cleaned.
+	if has merge-wait ${FEATURES} && ! has keepwork ${FEATURES}; then
+		rm -rf "${WORKDIR}"
+	fi
 }
 
 __dyn_help() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-03-10 20:14 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2024-03-10 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     8ac72ee300c1e9a55f9c1ee96438e8f12d64dd20
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 20:12:22 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 20:12:22 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8ac72ee3

install_qa_check: prematurely delete WORKDIR if FEATURES=merge-wait

Delay this until after the install qa hooks so that WORKDIR is
accessible to these hooks:

* bin/install-qa-check.d/90config-impl-decl
* gentoo/metadata/install-qa-check.d/60python-tests

Bug: https://github.com/gentoo/portage/pull/1302#issuecomment-1987303879
Fixes: 8eb2502bf264 ("phase-functions: prematurely delete WORKDIR if FEATURES=merge-wait")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/misc-functions.sh  | 7 +++++++
 bin/phase-functions.sh | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 696f2a6133..e7ca2a8a92 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -255,6 +255,13 @@ install_qa_check() {
 			"${PORTAGE_BIN_PATH}"/estrip --prepallstrip
 		fi
 	fi
+
+	# Prematurely delete WORKDIR in case merge-wait is enabled to
+	# decrease the space used by portage build directories until the
+	# packages are merged and cleaned.
+	if has merge-wait ${FEATURES} && ! has keepwork ${FEATURES}; then
+		rm -rf "${WORKDIR}"
+	fi
 }
 
 __dyn_instprep() {

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 9ff5554405..d037cf6776 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -724,13 +724,6 @@ __dyn_install() {
 		>> DEBUGBUILD
 	fi
 	trap - SIGINT SIGQUIT
-
-	# Prematurely delete WORKDIR in case merge-wait is enabled to
-	# decrease the space used by portage build directories until the
-	# packages are merged and cleaned.
-	if has merge-wait ${FEATURES} && ! has keepwork ${FEATURES}; then
-		rm -rf "${WORKDIR}"
-	fi
 }
 
 __dyn_help() {


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-03-15 14:55 Zac Medico
  0 siblings, 0 replies; 881+ messages in thread
From: Zac Medico @ 2024-03-15 14:55 UTC (permalink / raw
  To: gentoo-commits

commit:     1223086a043483c15700dd7781f1710b05c4c86c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 15 04:20:01 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 15 04:22:02 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1223086a

bin/ebuild: Discard merge-wait from FEATURES

We don't implement merge-wait for the ebuild command, so discard
it from FEATURES. This prevents premature WORKDIR removal.

Fixes: 8eb2502bf264 ("phase-functions: prematurely delete WORKDIR if FEATURES=merge-wait")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/ebuild b/bin/ebuild
index 69db474c0b..043e5bc476 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -304,6 +304,10 @@ def main():
 
     tmpsettings.features.discard("fail-clean")
 
+    # We don't implement merge-wait for the ebuild command, so discard
+    # it from FEATURES. This prevents premature WORKDIR removal.
+    tmpsettings.features.discard("merge-wait")
+
     if "merge" in pargs and "noauto" in tmpsettings.features:
         print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
         tmpsettings.features.discard("noauto")


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-05-04  1:32 Sam James
  0 siblings, 0 replies; 881+ messages in thread
From: Sam James @ 2024-05-04  1:32 UTC (permalink / raw
  To: gentoo-commits

commit:     51f6ad158fc3de14df3f87d1242ff950b2189f05
Author:     Alex Xu (Hello71) <alex_y_xu <AT> yahoo <DOT> ca>
AuthorDate: Sat Mar 11 17:27:23 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May  4 01:32:47 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=51f6ad15

estrip: Don't use splitdebug for .o files

As the process_ar comment explained, object files cannot be splitdebug.

Bug: https://bugs.gentoo.org/787623 ("www-client/firefox[clang]: .gnu_debuglink is busted when using LLD")
Fixes: 51579fb34c19 ("prepstrip: add support for elfutils strip")
Signed-off-by: Alex Xu (Hello71) <alex_y_xu <AT> yahoo.ca>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index 2d9d50922a..640645be63 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -280,9 +280,6 @@ dedup_elf_debug() {
 
 # Usage: save_elf_debug <src> <inode_debug> [splitdebug]
 save_elf_debug() {
-	${FEATURES_splitdebug} || return 0
-	${PORTAGE_RESTRICT_splitdebug} && return 0
-
 	debug-print-function "${FUNCNAME}" "$@"
 
 	# NOTE: Debug files must be installed in
@@ -390,7 +387,7 @@ process_elf() {
 
 	if ${strip_this} ; then
 		# See if we can split & strip at the same time
-		if [[ -n ${SPLIT_STRIP_FLAGS} ]] ; then
+		if ${splitdebug} && [[ -n ${SPLIT_STRIP_FLAGS} ]] ; then
 			local shortname="${x##*/}.debug"
 			local splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID:-$(__bashpid)}"
 
@@ -401,7 +398,9 @@ process_elf() {
 				"${x}"
 			save_elf_debug "${x}" "${inode_link}_debug" "${splitdebug}"
 		else
-			save_elf_debug "${x}" "${inode_link}_debug"
+			if ${splitdebug} ; then
+				save_elf_debug "${x}" "${inode_link}_debug"
+			fi
 			${already_stripped} || ${STRIP} ${strip_flags} "${x}"
 		fi
 	fi
@@ -431,7 +430,7 @@ process_ar() {
 		# There is no concept of splitdebug for objects not yet
 		# linked in (only for finally linked ELFs), so we have to
 		# retain the debug info in the archive itself.
-		if ! ${FEATURES_splitdebug} || ${PORTAGE_RESTRICT_splitdebug} ; then
+		if ! ${splitdebug} ; then
 			${STRIP} -g "${x}" && ${RANLIB} "${x}"
 		fi
 	fi
@@ -542,6 +541,12 @@ do
 		set +o noglob
 	fi
 
+	if ${FEATURES_splitdebug} && ! ${PORTAGE_RESTRICT_splitdebug} ; then
+		splitdebug=true
+	else
+		splitdebug=false
+	fi
+
 	# In Prefix we are usually an unprivileged user, so we can't strip
 	# unwritable objects.  Make them temporarily writable for the
 	# stripping.
@@ -564,6 +569,7 @@ do
 		${f} == *"SB shared object"* ]] ; then
 		process_elf "${x}" "${inode_link}" ${PORTAGE_STRIP_FLAGS}
 	elif [[ ${f} == *"SB relocatable"* ]] ; then
+		[[ ${x} == *.ko ]] || splitdebug=false
 		process_elf "${x}" "${inode_link}" ${SAFE_STRIP_FLAGS}
 	fi
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-05-22 16:35 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2024-05-22 16:35 UTC (permalink / raw
  To: gentoo-commits

commit:     7fa294b66c78b9a9000d161f3b4bacbad158489b
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed May 22 15:35:07 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed May 22 15:35:07 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7fa294b6

unpack: skip unrecognized file formats *silently*

See PMS section 12.3.15.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/phase-helpers.sh | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 45a1639c42..77132eb066 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -446,8 +446,6 @@ unpack() {
 						echo "${my_output}" >&2
 						die "${myfail}"
 					fi
-				else
-					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
 			rar)
@@ -459,8 +457,6 @@ unpack() {
 				fi
 				if ___eapi_unpack_supports_rar; then
 					unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
-				else
-					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
 			lha|lzh)
@@ -473,8 +469,6 @@ unpack() {
 				fi
 				if ___eapi_unpack_supports_lha; then
 					lha xfq "${srcdir}${x}" || die "${myfail}"
-				else
-					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
 			a)
@@ -545,8 +539,6 @@ unpack() {
 				fi
 				if ___eapi_unpack_supports_xz; then
 					__unpack_tar "xz -T$(___makeopts_jobs) -d"
-				else
-					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
 			txz)
@@ -558,13 +550,8 @@ unpack() {
 				fi
 				if ___eapi_unpack_supports_txz; then
 					XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
-				else
-					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
-			*)
-				__vecho "unpack ${x}: file format not recognized. Ignoring."
-				;;
 		esac
 	done
 


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-08-14 14:44 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2024-08-14 14:44 UTC (permalink / raw
  To: gentoo-commits

commit:     892f5408a6ff1aa899cc62a10ec07af57001f5d0
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 13 01:14:14 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 14:43:09 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=892f5408

dispatch-conf: ignore SHELL in spawn_shell

There is no need to use SHELL here, and this can actually cause problems
when SHELL is set to "nologin" or "false".

Look for sh in PATH instead.

Bug: https://bugs.gentoo.org/910560
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/dispatch-conf | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 93164d909e..2e72562439 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -574,26 +574,18 @@ def clear_screen():
     os.system("clear 2>/dev/null")
 
 
-shell = os.environ.get("SHELL")
-if not shell or not os.access(shell, os.EX_OK):
-    shell = find_binary("sh")
-
-
 def spawn_shell(cmd):
-    if shell:
-        sys.__stdout__.flush()
-        sys.__stderr__.flush()
-        spawn(
-            [shell, "-c", cmd],
-            env=os.environ,
-            fd_pipes={
-                0: portage._get_stdin().fileno(),
-                1: sys.__stdout__.fileno(),
-                2: sys.__stderr__.fileno(),
-            },
-        )
-    else:
-        os.system(cmd)
+    sys.__stdout__.flush()
+    sys.__stderr__.flush()
+    spawn(
+        ["sh", "-c", cmd],
+        env=os.environ,
+        fd_pipes={
+            0: portage._get_stdin().fileno(),
+            1: sys.__stdout__.fileno(),
+            2: sys.__stderr__.fileno(),
+        },
+    )
 
 
 def usage(argv):


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-08-15 17:28 Mike Gilbert
  0 siblings, 0 replies; 881+ messages in thread
From: Mike Gilbert @ 2024-08-15 17:28 UTC (permalink / raw
  To: gentoo-commits

commit:     70b0f876ed56a684054089a6af31a7484b5be190
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Thu Aug  8 23:08:57 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Aug 15 17:25:31 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=70b0f876

phase-functions: extend QA_PREBUILT handling to QA_SONAME_NO_SYMLINK

This behavior is implied by the ordering of QA variables in the man page
since the introduction of QA_SONAME_NO_SYMLINK.

Bug: https://bugs.gentoo.org/924953
Fixes: dcb42a417355510284a35c08a4bf849047122a5c
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 bin/phase-functions.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 2c3f2d389f..5257101cf4 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -555,7 +555,8 @@ __dyn_install() {
 
 		# These ones support regular expressions, so translate
 		# fnmatch patterns to regular expressions
-		for x in QA_DT_NEEDED QA_FLAGS_IGNORED QA_PRESTRIPPED QA_SONAME ; do
+		for x in QA_DT_NEEDED QA_FLAGS_IGNORED QA_PRESTRIPPED \
+			QA_SONAME QA_SONAME_NO_SYMLINK; do
 			if [[ $(declare -p ${x} 2>/dev/null) = declare\ -a* ]] ; then
 				eval "${x}=(\"\${${x}[@]}\" ${QA_PREBUILT//\*/.*})"
 			else


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-09-10 10:29 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2024-09-10 10:29 UTC (permalink / raw
  To: gentoo-commits

commit:     6e454ea3b8e5e1aa0f4d9efcb42759dc5ec0ec99
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  9 15:30:25 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 10:29:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e454ea3

unpack: Don't display "Unpacking ..." for skipped files

PMS says that "Any unrecognised file format shall be skipped silently."
This wording was added with the draft of what later became EAPI 4:
https://gitweb.gentoo.org/proj/pms.git/commit/?id=634c32f231e1bc94d64588e2b2edf0ad1ca60f1f

The commit message doesn't give any rationale for "silently".
It may well be that the wording is a remnant of the rejected
"unpack --if-compressed" item.

See the discussion in the 2009-04-23 council meeting:
https://projects.gentoo.org/council/meeting-logs/20090423.txt
(starting at 21:35).

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 49 ++++++++++++++++++++++++++++---------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 77132eb066..164f62143d 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -321,13 +321,13 @@ unpack() {
 	local x
 	local y y_insensitive
 	local suffix suffix_insensitive
+	local suffix_known
 	local myfail
 	local eapi=${EAPI:-0}
 
 	[[ -z "$*" ]] && die "Nothing passed to the 'unpack' command"
 
 	for x in "$@"; do
-		__vecho ">>> Unpacking ${x} to ${PWD}"
 		suffix=${x##*.}
 		suffix_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
 		y=${x%.*}
@@ -360,6 +360,23 @@ unpack() {
 		fi
 		[[ ! -s ${srcdir}${x} ]] && die "unpack: ${x} does not exist"
 
+		suffix_known=""
+		case ${suffix_insensitive} in
+			tar|tgz|tbz2|tbz|zip|jar|gz|z|bz2|bz|a|deb|lzma) suffix_known=1 ;;
+			7z)      ___eapi_unpack_supports_7z  && suffix_known=1 ;;
+			rar)     ___eapi_unpack_supports_rar && suffix_known=1 ;;
+			lha|lzh) ___eapi_unpack_supports_lha && suffix_known=1 ;;
+			xz)      ___eapi_unpack_supports_xz  && suffix_known=1 ;;
+			txz)     ___eapi_unpack_supports_txz && suffix_known=1 ;;
+		esac
+
+		if [[ -n ${suffix_known} ]]; then
+			__vecho ">>> Unpacking ${x} to ${PWD}"
+		else
+			__vecho "=== Skipping unpack of ${x}"
+			continue
+		fi
+
 		__unpack_tar() {
 			if [[ ${y_insensitive} == tar ]] ; then
 				if ___eapi_unpack_is_case_sensitive && \
@@ -439,13 +456,11 @@ unpack() {
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
-				if ___eapi_unpack_supports_7z; then
-					local my_output
-					my_output="$(7z x -y "${srcdir}${x}")"
-					if [[ $? -ne 0 ]]; then
-						echo "${my_output}" >&2
-						die "${myfail}"
-					fi
+				local my_output
+				my_output="$(7z x -y "${srcdir}${x}")"
+				if [[ $? -ne 0 ]]; then
+					echo "${my_output}" >&2
+					die "${myfail}"
 				fi
 				;;
 			rar)
@@ -455,9 +470,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
 				fi
-				if ___eapi_unpack_supports_rar; then
-					unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
-				fi
+				unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
 				;;
 			lha|lzh)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -467,9 +480,7 @@ unpack() {
 						"with EAPI '${EAPI}'." \
 						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
 				fi
-				if ___eapi_unpack_supports_lha; then
-					lha xfq "${srcdir}${x}" || die "${myfail}"
-				fi
+				lha xfq "${srcdir}${x}" || die "${myfail}"
 				;;
 			a)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -537,9 +548,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'xz'."
 				fi
-				if ___eapi_unpack_supports_xz; then
-					__unpack_tar "xz -T$(___makeopts_jobs) -d"
-				fi
+				__unpack_tar "xz -T$(___makeopts_jobs) -d"
 				;;
 			txz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -548,9 +557,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'txz'."
 				fi
-				if ___eapi_unpack_supports_txz; then
-					XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
-				fi
+				XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
 				;;
 		esac
 	done


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-09-10 10:29 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2024-09-10 10:29 UTC (permalink / raw
  To: gentoo-commits

commit:     e1db307d107f5010057a4e3495e08b1f51820add
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  9 15:31:42 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 10:29:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e1db307d

unpack: Match file extensions case-sensitively in old EAPIs

This fixes PMS compliance and at the same time simplifies the code.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 97 +++++-----------------------------------------------
 1 file changed, 9 insertions(+), 88 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 164f62143d..4e23d10a8b 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -370,6 +370,12 @@ unpack() {
 			txz)     ___eapi_unpack_supports_txz && suffix_known=1 ;;
 		esac
 
+		if ___eapi_unpack_is_case_sensitive \
+				&& ! has "${suffix}" "${suffix_insensitive}" \
+					ZIP Z 7Z RAR LHA LHa; then
+			suffix_known=""
+		fi
+
 		if [[ -n ${suffix_known} ]]; then
 			__vecho ">>> Unpacking ${x} to ${PWD}"
 		else
@@ -378,13 +384,9 @@ unpack() {
 		fi
 
 		__unpack_tar() {
-			if [[ ${y_insensitive} == tar ]] ; then
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ tar != ${y} ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"secondary suffix '${y}' which is unofficially" \
-						"supported with EAPI '${EAPI}'. Instead use 'tar'."
-				fi
+			if [[ ${y_insensitive} == tar ]] \
+					&& ! ___eapi_unpack_is_case_sensitive \
+					|| [[ ${y} == tar ]]; then
 				$1 -c -- "${srcdir}${x}" | tar xof -
 				__assert_sigpipe_ok "${myfail}"
 			else
@@ -397,62 +399,25 @@ unpack() {
 		myfail="unpack: failure unpacking ${x}"
 		case "${suffix_insensitive}" in
 			tar)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ tar != ${suffix} ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'tar'."
-				fi
 				tar xof "${srcdir}${x}" || die "${myfail}"
 				;;
 			tgz)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ tgz != ${suffix} ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'tgz'."
-				fi
 				tar xozf "${srcdir}${x}" || die "${myfail}"
 				;;
 			tbz|tbz2)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " tbz tbz2 " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
-				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "${srcdir}${x}" | tar xof -
 				__assert_sigpipe_ok "${myfail}"
 				;;
 			zip|jar)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " ZIP zip jar " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'." \
-						"Instead use 'ZIP', 'zip', or 'jar'."
-				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
 				( set +x ; while true ; do echo n || break ; done ) | \
 				unzip -qo "${srcdir}${x}" || die "${myfail}"
 				;;
 			gz|z)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " gz z Z " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
-				fi
 				__unpack_tar "gzip -d"
 				;;
 			bz2|bz)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " bz bz2 " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
-				fi
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
@@ -464,41 +429,15 @@ unpack() {
 				fi
 				;;
 			rar)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " rar RAR " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
-				fi
 				unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
 				;;
 			lha|lzh)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " LHA LHa lha lzh " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'." \
-						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
-				fi
 				lha xfq "${srcdir}${x}" || die "${myfail}"
 				;;
 			a)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " a " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'a'."
-				fi
 				ar x "${srcdir}${x}" || die "${myfail}"
 				;;
 			deb)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " deb " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'deb'."
-				fi
-
 				# Unpacking .deb archives can not always be done with
 				# `ar`.  For instance on AIX this doesn't work out.
 				# If `ar` is not the GNU binutils version and we have
@@ -533,30 +472,12 @@ unpack() {
 				fi
 				;;
 			lzma)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " lzma " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'lzma'."
-				fi
 				__unpack_tar "lzma -d"
 				;;
 			xz)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " xz " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'xz'."
-				fi
 				__unpack_tar "xz -T$(___makeopts_jobs) -d"
 				;;
 			txz)
-				if ___eapi_unpack_is_case_sensitive && \
-					[[ " txz " != *" ${suffix} "* ]] ; then
-					eqawarn "QA Notice: unpack called with" \
-						"suffix '${suffix}' which is unofficially supported" \
-						"with EAPI '${EAPI}'. Instead use 'txz'."
-				fi
 				XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
 				;;
 		esac


^ permalink raw reply related	[flat|nested] 881+ messages in thread

* [gentoo-commits] proj/portage:master commit in: bin/
@ 2024-09-10 10:29 Ulrich Müller
  0 siblings, 0 replies; 881+ messages in thread
From: Ulrich Müller @ 2024-09-10 10:29 UTC (permalink / raw
  To: gentoo-commits

commit:     a2e9578af3f3e8e8a02e6a11d22b23acb50dfcac
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  9 16:20:30 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 10:29:11 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a2e9578a

unpack: Update a comment

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 4e23d10a8b..5a35130191 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -334,7 +334,7 @@ unpack() {
 		y=${y##*.}
 		y_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
 
-		# wrt PMS 11.3.3.13 Misc Commands
+		# wrt PMS 12.3.15 Misc Commands
 		if [[ ${x} != */* ]]; then
 			# filename without path of any kind
 			srcdir=${DISTDIR}/


^ permalink raw reply related	[flat|nested] 881+ messages in thread

end of thread, other threads:[~2024-09-10 10:29 UTC | newest]

Thread overview: 881+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14 19:26 [gentoo-commits] proj/portage:master commit in: bin/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2024-09-10 10:29 Ulrich Müller
2024-09-10 10:29 Ulrich Müller
2024-09-10 10:29 Ulrich Müller
2024-08-15 17:28 Mike Gilbert
2024-08-14 14:44 Mike Gilbert
2024-05-22 16:35 Mike Gilbert
2024-05-04  1:32 Sam James
2024-03-15 14:55 Zac Medico
2024-03-10 20:14 Zac Medico
2024-03-09 18:46 Sam James
2024-02-22 15:36 Zac Medico
2024-02-05  6:44 Zac Medico
2023-10-26 18:44 Ulrich Müller
2023-10-24 17:49 Zac Medico
2023-10-24  2:27 Zac Medico
2023-10-24  2:27 Zac Medico
2023-10-24  2:21 Zac Medico
2023-10-24  2:21 Zac Medico
2023-10-24  2:10 Zac Medico
2023-10-13 10:19 Sam James
2023-09-26 20:54 Sam James
2023-09-26 20:54 Sam James
2023-09-08 21:43 Sam James
2023-08-19 15:03 Sam James
2023-08-19 14:49 Sam James
2023-08-19 14:49 Sam James
2023-07-03 20:19 Sam James
2023-05-26  1:33 Sam James
2023-05-26  1:33 Sam James
2023-05-18  7:23 Ulrich Müller
2023-05-17  6:20 Sam James
2023-05-13 20:29 Ulrich Müller
2023-05-12 17:23 Ulrich Müller
2023-05-12 17:23 Ulrich Müller
2023-05-10  1:28 Sam James
2023-05-01  7:21 Sam James
2023-05-01  7:21 Sam James
2023-05-01  7:21 Sam James
2023-05-01  7:21 Sam James
2023-04-29  4:44 Sam James
2023-04-09  7:26 Sam James
2023-04-09  7:19 Sam James
2023-04-09  6:52 Sam James
2023-04-06  8:08 Ulrich Müller
2023-03-21 23:52 Sam James
2023-03-21 23:52 Sam James
2023-01-02 20:45 Mike Gilbert
2022-12-31 13:33 Sam James
2022-11-24  4:16 Sam James
2022-10-21  2:34 Sam James
2022-09-24 22:13 Sam James
2022-08-17  3:26 Sam James
2022-08-13 17:51 Sam James
2022-08-10  4:31 Sam James
2022-08-06 21:01 Sam James
2022-08-06 21:01 Sam James
2022-08-06 21:01 Sam James
2022-08-06 21:01 Sam James
2022-08-01 22:39 Sam James
2022-08-01  1:19 Sam James
2022-07-27 19:07 Fabian Groffen
2022-07-27 19:07 Fabian Groffen
2022-07-20 18:07 Ulrich Müller
2022-07-18 15:16 Sam James
2022-07-11 23:02 Sam James
2022-07-03 19:36 Mike Gilbert
2022-06-24  2:20 Zac Medico
2022-05-22 14:51 Mike Gilbert
2022-05-22 14:51 Mike Gilbert
2022-05-15  1:02 Sam James
2022-04-28 15:50 Sam James
2022-04-15  4:47 Sam James
2022-04-14  2:36 Sam James
2022-04-13  4:02 Sam James
2022-04-12  2:00 Sam James
2022-03-28  6:20 Sam James
2022-02-15 21:30 Mike Frysinger
2022-02-15 21:30 Mike Frysinger
2022-02-15 21:30 Mike Frysinger
2022-02-04 17:32 Mike Gilbert
2022-01-24  2:07 Sam James
2021-11-19 23:59 Zac Medico
2021-11-19 16:17 Mike Gilbert
2021-11-19 16:17 Mike Gilbert
2021-11-19 16:17 Mike Gilbert
2021-11-01 17:32 Mike Gilbert
2021-11-01 17:32 Mike Gilbert
2021-10-20  7:02 Sam James
2021-09-27 11:19 Ulrich Müller
2021-09-21 17:27 Sam James
2021-09-03 11:34 Michał Górny
2021-09-03 11:34 Michał Górny
2021-07-17 22:16 Zac Medico
2021-06-20 20:21 Michał Górny
2021-06-18  6:59 Zac Medico
2021-06-13 21:48 Zac Medico
2021-06-05 18:47 Zac Medico
2021-06-02 21:47 Michał Górny
2021-05-31 16:35 Michał Górny
2021-05-24  4:55 Zac Medico
2021-05-24  4:37 Zac Medico
2021-05-24  4:37 Zac Medico
2021-05-24  4:37 Zac Medico
2021-05-24  4:34 Zac Medico
2021-05-12 11:28 Michał Górny
2021-05-12 11:28 Michał Górny
2021-05-01 23:25 Zac Medico
2021-03-29  0:30 Zac Medico
2021-03-04  9:14 Zac Medico
2021-02-24 18:51 Zac Medico
2020-12-24 17:55 Mike Gilbert
2020-11-01 21:46 Zac Medico
2020-10-18  9:32 Ulrich Müller
2020-08-03 19:30 Zac Medico
2020-07-13  5:22 Zac Medico
2020-06-24 23:09 Zac Medico
2020-06-24  3:01 Zac Medico
2020-06-14 19:12 Zac Medico
2020-05-24 23:49 Zac Medico
2020-05-03 21:42 Mike Gilbert
2020-03-21 22:08 Zac Medico
2020-03-02  6:13 Zac Medico
2020-02-21  6:35 Ulrich Müller
2020-02-08 18:19 Mike Gilbert
2019-12-30 21:30 Zac Medico
2019-12-26 20:36 Ulrich Müller
2019-12-15 22:01 Zac Medico
2019-12-15  7:40 Zac Medico
2019-12-09  9:19 Zac Medico
2019-11-27 19:39 Michał Górny
2019-11-25 16:59 Ulrich Müller
2019-11-08 16:02 Mike Gilbert
2019-10-18  3:47 Zac Medico
2019-09-15  3:08 Zac Medico
2019-09-15  3:08 Zac Medico
2019-09-15  1:51 Zac Medico
2019-09-15  1:50 Zac Medico
2019-09-01 19:03 Zac Medico
2019-09-01 18:26 Zac Medico
2019-08-31  3:44 Zac Medico
2019-08-31  3:42 Zac Medico
2019-08-31  3:42 Zac Medico
2019-08-31  3:42 Zac Medico
2019-08-30 17:05 Zac Medico
2019-08-26 18:13 Zac Medico
2019-08-23 17:58 Zac Medico
2019-08-18 19:27 Ulrich Müller
2019-08-16  1:09 Zac Medico
2019-08-14  2:19 Zac Medico
2019-08-14  2:08 Zac Medico
2019-08-10 19:12 Zac Medico
2019-08-03 17:38 Zac Medico
2019-07-21  4:12 Zac Medico
2019-07-03 21:27 Zac Medico
2019-06-05 20:33 Zac Medico
2019-05-20  5:09 Zac Medico
2019-05-20  4:21 Zac Medico
2019-05-20  4:21 Zac Medico
2019-05-20  0:35 Zac Medico
2019-04-30 18:56 Zac Medico
2019-03-19  1:20 Ulrich Müller
2019-01-28 19:45 Zac Medico
2019-01-28  6:41 Zac Medico
2019-01-23  5:33 Zac Medico
2019-01-23  4:35 Zac Medico
2019-01-23  1:08 Zac Medico
2019-01-17 18:30 Zac Medico
2019-01-16  8:33 Zac Medico
2019-01-06 19:07 Zac Medico
2018-11-19 21:40 Zac Medico
2018-11-19  7:29 Zac Medico
2018-11-18  8:13 Michał Górny
2018-11-05 22:10 Ulrich Müller
2018-11-05 18:48 Michał Górny
2018-11-02 19:14 Zac Medico
2018-10-31 16:37 Michał Górny
2018-10-20  4:08 Zac Medico
2018-10-08 21:47 Zac Medico
2018-10-06  1:35 Zac Medico
2018-09-28 20:33 Michał Górny
2018-09-28 20:33 Michał Górny
2018-09-28 20:33 Michał Górny
2018-09-28 20:33 Michał Górny
2018-09-26 22:53 Zac Medico
2018-09-25 21:04 Zac Medico
2018-09-24 20:24 Zac Medico
2018-09-20 18:49 Michał Górny
2018-09-17 18:18 Michał Górny
2018-09-03 18:25 Zac Medico
2018-08-16 17:15 Zac Medico
2018-08-11  8:14 Zac Medico
2018-08-08 21:45 Zac Medico
2018-08-01 20:51 Zac Medico
2018-07-28  6:12 Zac Medico
2018-06-15 23:56 Zac Medico
2018-05-26  6:36 Zac Medico
2018-05-18 16:08 Zac Medico
2018-05-18 16:08 Zac Medico
2018-05-16 20:58 Zac Medico
2018-05-16 20:46 Zac Medico
2018-05-16 17:32 Zac Medico
2018-05-16 16:53 Zac Medico
2018-05-03  1:15 Zac Medico
2018-05-01 16:26 Zac Medico
2018-05-01 16:26 Zac Medico
2018-04-30 18:28 Zac Medico
2018-04-30  6:29 Zac Medico
2018-04-26 18:04 Zac Medico
2018-04-26 17:57 Zac Medico
2018-04-26 10:08 Zac Medico
2018-04-26 10:08 Zac Medico
2018-04-26  9:06 Zac Medico
2018-04-26  9:06 Zac Medico
2018-04-24 20:20 Zac Medico
2018-04-07 17:12 Zac Medico
2018-03-28 15:42 Zac Medico
2018-03-28  6:52 Zac Medico
2018-03-28  5:47 Zac Medico
2018-03-26 17:43 Zac Medico
2018-03-15 20:43 Zac Medico
2018-03-04 21:05 Michał Górny
2018-03-04 21:05 Michał Górny
2018-03-04 18:35 Zac Medico
2018-03-04 18:22 Zac Medico
2018-02-07  5:24 Zac Medico
2018-02-07  5:08 Zac Medico
2018-02-07  4:58 Zac Medico
2018-02-05  4:22 Zac Medico
2018-02-05  3:34 Zac Medico
2018-02-05  1:03 Zac Medico
2018-02-01  6:18 Zac Medico
2018-01-17 19:39 Zac Medico
2017-12-10  8:55 Zac Medico
2017-12-10  8:51 Zac Medico
2017-12-08  3:30 Zac Medico
2017-12-02 21:33 Zac Medico
2017-11-16 23:47 Zac Medico
2017-11-16 23:22 Zac Medico
2017-09-19  7:00 Zac Medico
2017-09-11 20:32 Michał Górny
2017-08-31 18:10 Michał Górny
2017-08-31 14:07 Michał Górny
2017-08-28 13:23 Fabian Groffen
2017-08-28  6:24 Fabian Groffen
2017-08-16 23:06 Zac Medico
2017-08-16 23:06 Zac Medico
2017-08-16 23:03 Zac Medico
2017-08-11 16:06 Zac Medico
2017-07-02 16:31 Zac Medico
2017-03-26  8:44 Ulrich Müller
2017-03-26  7:43 Michał Górny
2017-03-24 20:33 Zac Medico
2017-02-22 22:28 Zac Medico
2017-01-18 16:29 Zac Medico
2017-01-17 17:52 Zac Medico
2017-01-14  0:19 Zac Medico
2017-01-12 23:52 Zac Medico
2017-01-12 23:45 Zac Medico
2016-12-31 22:08 Zac Medico
2016-11-25 19:46 Zac Medico
2016-10-04 16:41 Zac Medico
2016-09-26 17:19 Zac Medico
2016-06-26 23:40 Zac Medico
2016-06-19  5:51 Zac Medico
2016-05-20 21:14 Michał Górny
2016-05-18 16:49 Zac Medico
2016-05-18 16:29 Zac Medico
2016-05-18 16:20 Zac Medico
2016-04-22  8:21 Alexander Berntsen
2016-03-12 18:47 Zac Medico
2016-03-08 22:52 Zac Medico
2016-03-06 18:05 Brian Dolbec
2016-03-06 18:05 Brian Dolbec
2016-03-06  2:11 Brian Dolbec
2016-02-24 21:40 Zac Medico
2016-01-29 23:04 Brian Dolbec
2016-01-28 12:10 Alexander Berntsen
2016-01-29 11:17 ` Alexander Berntsen
2016-01-15 13:43 Michał Górny
2016-01-02  5:18 Zac Medico
2015-12-20 17:37 Michał Górny
2015-12-13 12:57 Michał Górny
2015-12-13 12:57 Michał Górny
2015-12-08 20:57 Arfrever Frehtes Taifersar Arahesis
2015-12-08 10:32 Arfrever Frehtes Taifersar Arahesis
2015-12-08  7:23 Arfrever Frehtes Taifersar Arahesis
2015-12-01  0:27 Arfrever Frehtes Taifersar Arahesis
2015-11-25 12:51 Arfrever Frehtes Taifersar Arahesis
2015-11-24  1:08 Zac Medico
2015-11-22 21:07 Robin H. Johnson
2015-11-22 20:57 Robin H. Johnson
2015-11-18 16:57 Zac Medico
2015-11-18 16:50 Michał Górny
2015-11-18  5:12 Michał Górny
2015-11-14 22:13 Michał Górny
2015-11-14 22:13 Michał Górny
2015-11-14 22:13 Michał Górny
2015-11-14 22:13 Michał Górny
2015-11-13 17:52 Zac Medico
2015-11-13  2:55 Mike Frysinger
2015-11-13  2:55 Mike Frysinger
2015-11-13  1:42 Mike Frysinger
2015-11-12 21:43 Michał Górny
2015-11-12 21:19 Robin H. Johnson
2015-11-12 19:32 Michał Górny
2015-11-12 19:32 Michał Górny
2015-11-12 19:32 Michał Górny
2015-11-12 19:32 Michał Górny
2015-11-12 19:32 Michał Górny
2015-11-12 19:32 Michał Górny
2015-11-12 18:56 Michał Górny
2015-11-11 22:43 Zac Medico
2015-10-04 21:29 Zac Medico
2015-09-28 19:10 Brian Dolbec
2015-08-26  1:52 Zac Medico
2015-08-11 19:57 Michał Górny
2015-07-20 21:48 Brian Dolbec
2015-07-17 20:53 Zac Medico
2015-07-07 18:10 Brian Dolbec
2015-05-18 23:19 Brian Dolbec
2015-05-09 23:10 Brian Dolbec
2015-05-09 15:22 Brian Dolbec
2015-05-06 18:26 Zac Medico
2015-04-28 23:47 Zac Medico
2015-04-22  0:23 Brian Dolbec
2015-04-20 23:34 Zac Medico
2015-04-20 23:34 Zac Medico
2015-04-13 17:27 Brian Dolbec
2015-04-11 15:57 Zac Medico
2015-04-10 16:58 Zac Medico
2015-03-31 16:52 Michał Górny
2015-02-21 20:24 Zac Medico
2015-02-16 18:54 Ulrich Müller
2015-02-09 20:32 Zac Medico
2015-02-09  0:45 Zac Medico
2015-02-03 21:39 Brian Dolbec
2015-01-19 20:47 Zac Medico
2015-01-18  5:06 Zac Medico
2014-12-15 16:28 Arfrever Frehtes Taifersar Arahesis
2014-12-07 23:53 Zac Medico
2014-12-07 23:23 Brian Dolbec
2014-12-07 18:51 Ulrich Müller
2014-12-07  6:02 Zac Medico
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-04 14:01 Michał Górny
2014-12-02 23:06 Michał Górny
2014-11-29 22:48 Michał Górny
2014-11-26  8:40 Zac Medico
2014-11-19 23:26 Michał Górny
2014-11-19 23:26 Michał Górny
2014-11-08 20:26 Zac Medico
2014-11-08 20:24 Zac Medico
2014-11-03  4:42 Zac Medico
2014-10-27 19:28 Zac Medico
2014-10-27  9:47 Zac Medico
2014-10-27  9:46 Zac Medico
2014-10-24 22:55 Zac Medico
2014-10-24 20:39 Zac Medico
2014-10-19 17:31 Zac Medico
2014-09-26  2:17 Brian Dolbec
2014-09-26  2:17 Brian Dolbec
2014-09-26  2:17 Brian Dolbec
2014-09-24 22:23 Brian Dolbec
2014-09-20 15:09 Brian Dolbec
2014-09-20  4:52 Brian Dolbec
2014-09-20  4:52 Brian Dolbec
2014-09-20  4:52 Brian Dolbec
2014-09-20  3:56 Arfrever Frehtes Taifersar Arahesis
2014-09-11 23:45 Brian Dolbec
2014-09-11 23:45 Brian Dolbec
2014-09-11 23:45 Brian Dolbec
2014-09-11 23:45 Brian Dolbec
2014-09-10  6:51 Michał Górny
2014-09-03 20:22 Michał Górny
2014-08-26 19:38 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-06 21:11 ` Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-11 20:52 Michał Górny
2014-08-19  7:01 ` Michał Górny
2014-08-11 20:52 Michał Górny
2014-08-19  7:01 ` Michał Górny
2014-08-10 10:32 Arfrever Frehtes Taifersar Arahesis
2014-08-04 12:16 Arfrever Frehtes Taifersar Arahesis
2014-08-03 15:24 [gentoo-commits] proj/portage:v2.2.11 " Brian Dolbec
2014-08-03 15:22 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2014-07-25 16:15 Alexander Berntsen
2014-06-16  5:16 Brian Dolbec
2014-04-19  7:59 Brian Dolbec
2014-04-19  5:26 Brian Dolbec
2014-04-19  5:26 Brian Dolbec
2014-02-19 17:52 Chris Reffett
2014-01-05 17:56 Brian Dolbec
2013-12-24  8:28 Arfrever Frehtes Taifersar Arahesis
2013-12-18  2:50 Mike Frysinger
2013-12-12 19:39 Mike Frysinger
2013-12-02 15:18 Arfrever Frehtes Taifersar Arahesis
2013-12-01  7:22 Mike Frysinger
2013-11-30  4:22 Mike Frysinger
2013-11-27  3:27 Mike Frysinger
2013-10-16  6:56 Mike Frysinger
2013-10-11 10:33 Mike Frysinger
2013-10-11 10:33 Mike Frysinger
2013-10-11 10:33 Mike Frysinger
2013-10-11 10:33 Mike Frysinger
2013-10-11 10:33 Mike Frysinger
2013-10-11 10:33 Mike Frysinger
2013-10-08 20:00 Mike Frysinger
2013-10-08 19:40 Mike Frysinger
2013-10-08 19:40 Mike Frysinger
2013-09-20 12:40 Zac Medico
2013-09-16  5:03 Arfrever Frehtes Taifersar Arahesis
2013-09-15  0:30 Zac Medico
2013-09-13  3:07 Zac Medico
2013-09-11 20:47 Zac Medico
2013-09-03 19:43 Zac Medico
2013-09-01 19:04 Zac Medico
2013-09-01 18:46 Zac Medico
2013-09-01 18:16 Zac Medico
2013-08-27  4:00 Zac Medico
2013-08-24 18:24 Zac Medico
2013-08-22  2:19 Zac Medico
2013-08-18  6:52 Zac Medico
2013-08-12 23:09 Zac Medico
2013-08-06  4:30 Zac Medico
2013-08-05 17:57 Zac Medico
2013-08-03 22:14 Zac Medico
2013-08-03 11:09 Zac Medico
2013-08-03  1:32 Zac Medico
2013-08-03  1:29 Zac Medico
2013-08-03  1:27 Zac Medico
2013-08-03  1:21 Zac Medico
2013-08-03  1:02 Zac Medico
2013-08-03  0:59 Zac Medico
2013-08-03  0:49 Zac Medico
2013-08-03  0:49 Zac Medico
2013-08-02 23:04 Zac Medico
2013-08-02 22:49 Zac Medico
2013-08-02 22:37 Zac Medico
2013-08-02 18:06 Zac Medico
2013-07-30 22:26 Zac Medico
2013-07-27 22:29 Zac Medico
2013-07-25 18:00 Zac Medico
2013-07-23 22:18 Arfrever Frehtes Taifersar Arahesis
2013-07-22 20:48 Zac Medico
2013-07-22  3:21 Zac Medico
2013-07-22  1:59 Zac Medico
2013-07-21 16:53 Zac Medico
2013-07-16 18:57 Arfrever Frehtes Taifersar Arahesis
2013-07-14 18:56 Arfrever Frehtes Taifersar Arahesis
2013-07-14 18:40 Arfrever Frehtes Taifersar Arahesis
2013-07-14 18:02 Arfrever Frehtes Taifersar Arahesis
2013-07-14  8:39 Arfrever Frehtes Taifersar Arahesis
2013-07-13 18:19 Zac Medico
2013-06-29  4:21 Zac Medico
2013-06-25 19:24 Zac Medico
2013-06-25 18:50 Zac Medico
2013-06-25  3:29 Zac Medico
2013-06-25  3:26 Zac Medico
2013-06-25  2:23 Arfrever Frehtes Taifersar Arahesis
2013-06-24 21:21 Zac Medico
2013-06-21 23:07 Zac Medico
2013-06-21 22:10 Zac Medico
2013-06-21 21:24 Zac Medico
2013-06-21 20:41 Zac Medico
2013-06-20  7:05 Zac Medico
2013-05-20 15:30 Zac Medico
2013-05-18 23:25 Zac Medico
2013-05-18 18:58 Zac Medico
2013-05-15 22:27 Zac Medico
2013-05-15 20:21 Zac Medico
2013-05-15 20:16 Zac Medico
2013-05-15 18:02 Zac Medico
2013-05-12 20:21 Zac Medico
2013-05-12 20:12 Zac Medico
2013-05-12 19:48 Zac Medico
2013-04-30  5:07 Zac Medico
2013-04-30  4:54 Zac Medico
2013-04-29  4:27 Zac Medico
2013-04-23  3:20 Zac Medico
2013-04-22 21:02 Zac Medico
2013-04-16 19:26 Zac Medico
2013-04-16 18:19 Zac Medico
2013-04-16 18:16 Zac Medico
2013-04-12  7:20 Zac Medico
2013-04-11 17:51 Zac Medico
2013-03-27 19:11 Mike Frysinger
2013-03-20  3:30 Zac Medico
2013-03-19 19:58 Zac Medico
2013-03-18 19:39 Zac Medico
2013-03-18 12:01 Zac Medico
2013-03-18 11:06 Zac Medico
2013-03-18 10:09 Zac Medico
2013-03-18  8:32 Zac Medico
2013-03-18  6:27 Zac Medico
2013-03-17 23:45 Zac Medico
2013-03-17 22:38 Zac Medico
2013-03-17 22:37 Zac Medico
2013-03-17 20:02 Zac Medico
2013-03-09  7:53 Zac Medico
2013-03-06 22:16 Zac Medico
2013-03-03 17:59 Zac Medico
2013-03-03  8:12 Zac Medico
2013-03-02  3:44 Zac Medico
2013-03-02  3:42 Zac Medico
2013-03-02  3:24 Zac Medico
2013-02-18  2:09 Mike Frysinger
2013-02-17 22:53 Zac Medico
2013-02-14 16:47 Zac Medico
2013-02-14  5:33 Zac Medico
2013-02-11  7:20 Zac Medico
2013-02-05  8:39 Zac Medico
2013-02-04 17:53 Zac Medico
2013-02-03  5:52 Mike Frysinger
2013-01-27 21:27 Zac Medico
2013-01-25 22:35 Zac Medico
2013-01-20 15:43 Zac Medico
2013-01-19  6:40 Zac Medico
2013-01-18 17:27 Zac Medico
2013-01-12  0:09 Zac Medico
2013-01-04 13:23 Zac Medico
2013-01-04  7:34 Zac Medico
2013-01-04  7:14 Zac Medico
2013-01-04  7:07 Zac Medico
2013-01-04  6:30 Zac Medico
2013-01-02  0:44 Zac Medico
2013-01-02  0:30 Zac Medico
2013-01-01 23:50 Zac Medico
2012-12-29  1:11 Zac Medico
2012-12-26 22:47 Zac Medico
2012-12-21 22:02 Zac Medico
2012-12-16  8:56 Zac Medico
2012-12-15 23:42 Zac Medico
2012-12-15 23:08 Zac Medico
2012-12-15 22:24 Zac Medico
2012-12-11 17:14 Zac Medico
2012-12-11 11:09 Zac Medico
2012-11-29 21:40 Zac Medico
2012-11-29  5:58 Zac Medico
2012-11-29  5:37 Zac Medico
2012-11-25 10:41 Arfrever Frehtes Taifersar Arahesis
2012-11-25 10:41 Arfrever Frehtes Taifersar Arahesis
2012-10-27 10:01 Zac Medico
2012-10-25  3:21 Zac Medico
2012-10-24 21:04 Arfrever Frehtes Taifersar Arahesis
2012-10-18  1:59 Zac Medico
2012-10-17 22:54 Arfrever Frehtes Taifersar Arahesis
2012-10-17 22:46 Arfrever Frehtes Taifersar Arahesis
2012-10-16 22:35 Zac Medico
2012-10-16 21:46 Zac Medico
2012-10-15  0:11 Zac Medico
2012-10-14 20:32 Zac Medico
2012-10-14 20:17 Zac Medico
2012-10-14 19:48 Zac Medico
2012-10-08 16:26 Zac Medico
2012-10-07 21:31 Zac Medico
2012-10-04 22:18 Zac Medico
2012-10-03 23:53 Zac Medico
2012-09-30 17:31 Zac Medico
2012-09-30 17:23 Zac Medico
2012-09-30  8:40 Zac Medico
2012-09-27 19:12 Zac Medico
2012-09-27 17:38 Zac Medico
2012-09-24 22:30 Arfrever Frehtes Taifersar Arahesis
2012-09-24  3:47 Mike Frysinger
2012-09-24  0:13 Mike Frysinger
2012-09-17  1:36 Zac Medico
2012-09-14 17:17 Zac Medico
2012-09-14 17:09 Zac Medico
2012-09-14  7:26 Zac Medico
2012-09-14  7:26 Zac Medico
2012-09-14  7:26 Zac Medico
2012-09-14  7:26 Zac Medico
2012-09-12  6:33 Zac Medico
2012-09-12  4:52 Zac Medico
2012-09-10 20:45 Zac Medico
2012-09-10 20:33 Zac Medico
2012-09-10 19:48 Zac Medico
2012-09-10  1:26 Zac Medico
2012-09-10  0:53 Zac Medico
2012-09-08 20:32 Zac Medico
2012-09-08 16:50 Zac Medico
2012-09-08 16:15 Zac Medico
2012-09-08  5:35 Zac Medico
2012-09-04  1:34 Zac Medico
2012-09-02 21:56 Zac Medico
2012-09-02  2:24 Zac Medico
2012-08-31 16:37 Zac Medico
2012-08-31 14:55 Ulrich Mueller
2012-08-31 14:52 Zac Medico
2012-08-31 14:47 Ulrich Mueller
2012-08-31  1:49 Zac Medico
2012-08-30 16:33 Zac Medico
2012-08-30  5:30 Zac Medico
2012-08-30  5:26 Zac Medico
2012-08-30  5:05 Zac Medico
2012-08-29 16:43 Zac Medico
2012-08-19  4:03 Zac Medico
2012-08-19  0:00 Zac Medico
2012-08-17 19:10 Mike Frysinger
2012-08-15  3:04 Zac Medico
2012-08-15  2:55 Zac Medico
2012-08-15  2:00 Zac Medico
2012-08-15  1:03 Zac Medico
2012-08-14  4:08 Zac Medico
2012-08-07 21:09 Zac Medico
2012-08-05 20:11 Zac Medico
2012-08-04 21:18 Zac Medico
2012-07-31 23:12 Arfrever Frehtes Taifersar Arahesis
2012-07-18 20:23 Zac Medico
2012-07-10  0:13 Zac Medico
2012-07-03 21:35 Zac Medico
2012-06-25  4:16 Arfrever Frehtes Taifersar Arahesis
2012-06-25  1:26 Arfrever Frehtes Taifersar Arahesis
2012-06-20 21:58 Zac Medico
2012-06-16  0:45 Zac Medico
2012-06-12  2:18 Zac Medico
2012-06-11 23:24 Zac Medico
2012-06-06  1:35 Zac Medico
2012-06-04 22:22 Zac Medico
2012-06-04 20:34 Zac Medico
2012-06-02  6:45 Zac Medico
2012-06-02  6:19 Zac Medico
2012-05-24  5:50 Mike Frysinger
2012-05-14 18:51 Mike Frysinger
2012-05-14  8:00 Zac Medico
2012-05-13 21:43 Zac Medico
2012-05-13 21:42 Zac Medico
2012-05-09 18:21 Zac Medico
2012-05-09  0:46 Zac Medico
2012-05-08 15:42 Zac Medico
2012-05-08  7:39 Zac Medico
2012-05-05  7:32 Zac Medico
2012-05-05  7:17 Zac Medico
2012-05-01 13:10 Zac Medico
2012-04-30 19:17 Zac Medico
2012-04-28 20:19 Zac Medico
2012-04-22 21:59 Zac Medico
2012-04-22 21:10 Zac Medico
2012-04-22 19:50 Arfrever Frehtes Taifersar Arahesis
2012-04-22 17:41 Zac Medico
2012-04-14  0:37 Zac Medico
2012-04-13 21:52 Zac Medico
2012-04-05 16:45 Zac Medico
2012-04-01 17:16 Zac Medico
2012-04-01 16:48 Zac Medico
2012-03-27 17:36 Zac Medico
2012-03-27 17:06 Zac Medico
2012-03-23  5:38 Zac Medico
2012-03-21  7:40 Zac Medico
2012-03-17 23:29 Zac Medico
2012-03-17 22:56 Zac Medico
2012-03-17 19:48 Zac Medico
2012-03-12  5:29 Mike Frysinger
2012-03-12  4:42 Mike Frysinger
2012-03-11 19:41 Mike Frysinger
2012-03-11  3:58 Mike Frysinger
2012-03-11  3:25 Mike Frysinger
2012-03-10 17:45 Zac Medico
2012-03-10 15:22 Zac Medico
2012-03-08 23:55 Zac Medico
2012-03-08 23:26 Mike Frysinger
2012-03-08 18:46 Mike Frysinger
2012-03-08  5:18 Mike Frysinger
2012-03-05  0:55 Zac Medico
2012-03-05  0:49 Zac Medico
2012-02-11  5:43 Zac Medico
2012-02-10 23:19 Zac Medico
2012-02-10 23:14 Zac Medico
2012-02-08 17:33 Zac Medico
2012-02-08 17:33 Zac Medico
2012-02-01 18:52 Zac Medico
2012-01-25  5:34 Zac Medico
2012-01-17 20:39 Zac Medico
2012-01-17 15:30 Zac Medico
2012-01-15 21:46 Arfrever Frehtes Taifersar Arahesis
2012-01-14 17:10 Zac Medico
2012-01-14 17:01 Zac Medico
2012-01-13 16:22 Zac Medico
2012-01-13 16:06 Zac Medico
2012-01-13 14:14 Zac Medico
2012-01-13 12:20 Zac Medico
2012-01-08  6:07 Arfrever Frehtes Taifersar Arahesis
2012-01-02  7:37 Zac Medico
2011-12-25 20:05 Zac Medico
2011-12-24 11:53 Zac Medico
2011-12-24 10:13 Zac Medico
2011-12-24  9:10 Zac Medico
2011-12-23  0:27 Zac Medico
2011-12-22 19:39 Zac Medico
2011-12-22  5:44 Zac Medico
2011-12-22  4:06 Zac Medico
2011-12-21 19:36 Zac Medico
2011-12-19  1:38 Arfrever Frehtes Taifersar Arahesis
2011-12-18 22:13 Zac Medico
2011-12-18 20:48 Arfrever Frehtes Taifersar Arahesis
2011-12-18 20:18 Zac Medico
2011-12-14  9:43 Zac Medico
2011-12-14  5:32 Zac Medico
2011-12-14  4:06 Zac Medico
2011-12-10 23:39 Zac Medico
2011-12-10 20:52 Zac Medico
2011-12-10 18:45 Zac Medico
2011-12-09 18:54 Zac Medico
2011-12-08 19:51 Zac Medico
2011-12-08 18:03 Zac Medico
2011-12-08  6:43 Zac Medico
2011-12-06 21:57 Zac Medico
2011-12-06 19:06 Zac Medico
2011-12-06 19:01 Zac Medico
2011-12-05  2:28 Zac Medico
2011-12-05  1:52 Zac Medico
2011-11-25  5:29 Zac Medico
2011-11-09 18:48 Zac Medico
2011-11-09 18:42 Zac Medico
2011-11-09  2:36 Zac Medico
2011-11-08 19:28 Zac Medico
2011-11-07 20:42 Zac Medico
2011-11-07 20:20 Zac Medico
2011-11-07 19:16 Zac Medico
2011-11-07 18:30 Arfrever Frehtes Taifersar Arahesis
2011-11-07  8:32 Zac Medico
2011-11-02  4:57 Zac Medico
2011-11-02  1:48 Zac Medico
2011-10-30  6:42 Arfrever Frehtes Taifersar Arahesis
2011-10-30  5:25 Zac Medico
2011-10-29 20:38 Zac Medico
2011-10-29 19:38 Zac Medico
2011-10-29 18:56 Zac Medico
2011-10-29 18:33 Zac Medico
2011-10-29  7:59 Zac Medico
2011-10-29  3:26 Zac Medico
2011-10-21  2:23 Zac Medico
2011-10-20 14:17 Zac Medico
2011-10-18  6:05 Zac Medico
2011-10-17  2:51 Zac Medico
2011-10-17  0:39 Zac Medico
2011-10-16  0:03 Zac Medico
2011-10-15 23:10 Zac Medico
2011-10-15 22:33 Zac Medico
2011-10-15 18:58 Zac Medico
2011-10-15 18:20 Zac Medico
2011-10-15  3:21 Zac Medico
2011-10-15  3:03 Zac Medico
2011-10-15  2:54 Zac Medico
2011-10-15  2:34 Zac Medico
2011-10-14 19:31 Zac Medico
2011-10-14  5:13 Zac Medico
2011-10-14  5:04 Zac Medico
2011-10-13 21:58 Zac Medico
2011-10-13 21:53 Zac Medico
2011-10-13 15:14 Zac Medico
2011-10-13 15:07 Zac Medico
2011-10-11 18:28 Zac Medico
2011-10-08  6:55 Zac Medico
2011-10-07 16:07 Zac Medico
2011-10-07 15:04 Zac Medico
2011-10-07 14:33 Zac Medico
2011-10-04  5:42 Zac Medico
2011-10-03 10:02 Zac Medico
2011-10-02  0:36 Zac Medico
2011-09-29 16:49 Zac Medico
2011-09-29  0:36 Zac Medico
2011-09-28 13:51 Zac Medico
2011-09-23 21:00 Zac Medico
2011-09-23 18:36 Fabian Groffen
2011-09-23 17:47 Zac Medico
2011-09-23 17:15 Zac Medico
2011-09-23  3:26 Arfrever Frehtes Taifersar Arahesis
2011-09-22 23:53 Zac Medico
2011-09-19  3:18 Zac Medico
2011-09-18 20:41 Zac Medico
2011-09-17 17:34 Zac Medico
2011-09-17  4:09 Zac Medico
2011-09-14 20:23 Zac Medico
2011-09-14 18:40 Zac Medico
2011-09-14 16:11 Zac Medico
2011-09-13  5:22 Zac Medico
2011-09-13  4:57 Zac Medico
2011-09-13  3:20 Zac Medico
2011-09-12 20:43 Zac Medico
2011-09-12  3:06 Zac Medico
2011-09-12  1:25 Zac Medico
2011-09-12  1:10 Zac Medico
2011-09-12  0:57 Zac Medico
2011-09-12  0:41 Zac Medico
2011-09-12  0:16 Zac Medico
2011-09-12  0:02 Zac Medico
2011-09-11 23:40 Zac Medico
2011-09-11 23:15 Zac Medico
2011-09-11 22:58 Zac Medico
2011-09-11 22:50 Zac Medico
2011-09-11 22:17 Zac Medico
2011-09-11 21:29 Zac Medico
2011-09-11 21:17 Zac Medico
2011-09-11  0:47 Zac Medico
2011-09-11  0:25 Zac Medico
2011-09-10 19:43 Zac Medico
2011-09-07 18:02 Zac Medico
2011-09-07 16:30 Zac Medico
2011-09-04  0:23 Zac Medico
2011-08-27 19:04 Zac Medico
2011-08-27 19:01 Zac Medico
2011-08-25 23:45 Zac Medico
2011-08-25 16:38 Zac Medico
2011-08-20 21:09 Zac Medico
2011-08-12 11:44 Zac Medico
2011-08-12 11:23 Zac Medico
2011-08-06  5:16 Zac Medico
2011-08-04 21:26 Zac Medico
2011-08-02 18:28 Zac Medico
2011-08-01 23:48 Zac Medico
2011-07-15 17:06 Zac Medico
2011-07-14 22:33 Zac Medico
2011-07-12 20:17 Zac Medico
2011-07-12 18:46 Zac Medico
2011-07-11 14:27 Zac Medico
2011-07-08 17:23 Zac Medico
2011-07-08 16:54 Zac Medico
2011-07-03 15:53 Zac Medico
2011-07-01 13:27 Zac Medico
2011-06-30  8:55 Zac Medico
2011-06-30  4:40 Zac Medico
2011-06-30  4:27 Zac Medico
2011-06-30  4:13 Zac Medico
2011-06-24 20:35 Zac Medico
2011-06-24 10:29 Zac Medico
2011-06-18 22:11 Zac Medico
2011-06-18 19:51 Zac Medico
2011-06-18 17:54 Zac Medico
2011-06-16 20:06 Zac Medico
2011-06-09 15:12 Zac Medico
2011-06-09 14:36 Zac Medico
2011-06-06  2:53 Zac Medico
2011-06-02 21:02 Zac Medico
2011-06-02 13:06 Zac Medico
2011-05-26  6:28 Zac Medico
2011-05-23  7:05 Zac Medico
2011-05-18  3:46 Zac Medico
2011-05-05 13:47 Zac Medico
2011-05-02 20:17 Arfrever Frehtes Taifersar Arahesis
2011-05-02 17:58 Zac Medico
2011-04-30 16:32 Arfrever Frehtes Taifersar Arahesis
2011-04-30  0:25 Zac Medico
2011-04-26 21:18 Zac Medico
2011-04-23 15:42 Zac Medico
2011-04-14  1:55 Zac Medico
2011-04-03 15:56 Zac Medico
2011-03-30 22:22 Arfrever Frehtes Taifersar Arahesis
2011-03-30 20:35 Arfrever Frehtes Taifersar Arahesis
2011-03-30 15:03 Arfrever Frehtes Taifersar Arahesis
2011-03-27 20:01 Zac Medico
2011-03-24  5:05 Zac Medico
2011-03-20 17:41 Zac Medico
2011-03-17 21:52 Zac Medico
2011-03-17 21:12 Zac Medico
2011-03-10 22:52 Zac Medico
2011-03-02  0:53 Zac Medico
2011-02-28 18:58 Zac Medico
2011-02-21 16:18 Zac Medico
2011-02-18 23:39 Ulrich Mueller
2011-02-18 15:38 Zac Medico
2011-02-13 14:19 Zac Medico
2011-02-13  8:38 Zac Medico
2011-02-06 23:03 Zac Medico

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