public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:2.1.9 commit in: man/, bin/
@ 2011-05-04 20:03 Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d78d81084de5fe974ecebf64a7080914428f5afc
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun May  1 14:50:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 19:49:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d78d8108

Support multiple arguments in set_unless_changed() and unset_unless_changed().
Use VARIABLE=VALUE syntax for arguments of set_unless_changed().

---
 bin/ebuild.sh |   43 +++++++++++++++++++++++++------------------
 man/portage.5 |    4 ++--
 2 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index e652cb5..6593755 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1639,32 +1639,39 @@ _ebuild_phase_funcs() {
 	esac
 }
 
-# Set given variable unless this variable has been already set (e.g. during emerge
-# invocation) to a value different than value set in make.conf.
+# 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 [[ $# -ne 2 ]]; then
-		die "${FUNCNAME}() requires 2 arguments: VARIABLE VALUE"
+	if [[ $# -lt 1 ]]; then
+		die "${FUNCNAME}() requires at least 1 argument: VARIABLE=VALUE"
 	fi
 
-	local variable="$1" value="$2"
-
-	if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-		eval "${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 variable unless this variable has been set (e.g. during emerge
-# invocation) to a value different than value set in make.conf.
+# 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 [[ $# -ne 1 ]]; then
-		die "${FUNCNAME}() requires 1 argument: VARIABLE"
+	if [[ $# -lt 1 ]]; then
+		die "${FUNCNAME}() requires at least 1 argument: VARIABLE"
 	fi
 
-	local variable="$1"
-
-	if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-		unset ${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

diff --git a/man/portage.5 b/man/portage.5
index 90b1648..27c1d7c 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -678,12 +678,12 @@ set_unless_changed and unset_unless_changed functions can be used to set or
 unset given variables only if these variable have not been set to values
 different than values set in make.conf. This functionality can be useful for
 temporary overriding of these variables during emerge invocation. Variables
-set in the usual VARIABLE=VALUE style will unconditionally override variables
+set without using set_unless_changed will unconditionally override variables
 set during emerge invocation.
 
 .I Syntax:
 .nf
-set_unless_changed VARIABLE VALUE
+set_unless_changed VARIABLE=VALUE
 unset_unless_changed VALUE
 .fi
 



^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: man/, bin/
@ 2011-05-04 20:03 Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     eb6da843dc0ef3fcf869645dbbe479b6bb010d75
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun May  1 01:21:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 19:48:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb6da843

Bug #365439: Add set_unless_changed() and unset_unless_changed().

---
 bin/ebuild.sh             |   28 ++++++++++++++++++++++++++++
 bin/isolated-functions.sh |    4 ++--
 man/portage.5             |   20 +++++++++++++++++---
 3 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index c79d4c3..e652cb5 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1639,6 +1639,34 @@ _ebuild_phase_funcs() {
 	esac
 }
 
+# Set given variable unless this variable has been already set (e.g. during emerge
+# invocation) to a value different than value set in make.conf.
+set_unless_changed() {
+	if [[ $# -ne 2 ]]; then
+		die "${FUNCNAME}() requires 2 arguments: VARIABLE VALUE"
+	fi
+
+	local variable="$1" value="$2"
+
+	if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
+		eval "${variable}=\"${value}\""
+	fi
+}
+
+# Unset given variable unless this variable has been set (e.g. during emerge
+# invocation) to a value different than value set in make.conf.
+unset_unless_changed() {
+	if [[ $# -ne 1 ]]; then
+		die "${FUNCNAME}() requires 1 argument: VARIABLE"
+	fi
+
+	local variable="$1"
+
+	if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
+		unset ${variable}
+	fi
+}
+
 PORTAGE_BASHRCS_SOURCED=0
 
 # @FUNCTION: source_all_bashrcs

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 2f144a0..24443ac 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -585,8 +585,8 @@ save_ebuild_env() {
 			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 \
-			source_all_bashrcs ebuild_main \
-			ebuild_phase ebuild_phase_with_hooks \
+			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 \
 			${QA_INTERCEPTORS}

diff --git a/man/portage.5 b/man/portage.5
index eb56cd5..90b1648 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Feb 2011" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "May 2011" "Portage VERSION" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"
@@ -673,8 +673,22 @@ In this directory additional package\-specific bashrc files can be created.
 Note that if package\-specific environment variable settings are all that's
 needed, then \fB/etc/portage/package.env\fR should be used instead of the
 bashrc approach that is described here.
-Portage will source all of them after \fB/etc/portage/bashrc\fR in the following
-order:
+
+set_unless_changed and unset_unless_changed functions can be used to set or
+unset given variables only if these variable have not been set to values
+different than values set in make.conf. This functionality can be useful for
+temporary overriding of these variables during emerge invocation. Variables
+set in the usual VARIABLE=VALUE style will unconditionally override variables
+set during emerge invocation.
+
+.I Syntax:
+.nf
+set_unless_changed VARIABLE VALUE
+unset_unless_changed VALUE
+.fi
+
+Portage will source all of these bashrc files after \fB/etc/portage/bashrc\fR
+in the following order:
 .nr step 1 1
 .IP \n[step]. 3
 /etc/portage/env/${CATEGORY}/${PN}



^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: man/, bin/
@ 2011-05-04 20:03 Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     0256a96fc5be3f3ed303d2993bd7fd9b75ec8ecf
Author:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun May  1 15:57:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 19:49:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0256a96f

repoman: Check for PROVIDE.

This will fix bug #365505.

---
 bin/repoman   |    5 +++++
 man/repoman.1 |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index d6c26d6..017a27b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -366,6 +366,7 @@ qahelp={
 	"metadata.bad":"Bad metadata.xml files",
 	"metadata.warning":"Warnings in metadata.xml files",
 	"portage.internal":"The ebuild uses an internal Portage function",
+	"virtual.oldstyle":"The ebuild PROVIDEs an old-style virtual (see GLEP 37)",
 	"virtual.versioned":"PROVIDE contains virtuals with versions",
 	"virtual.exists":"PROVIDE contains existing package names",
 	"virtual.unavailable":"PROVIDE contains a virtual which contains no profile default",
@@ -1547,6 +1548,10 @@ for x in scanlist:
 				stats["virtual.exists"]+=1
 				fails["virtual.exists"].append(x+"/"+y+".ebuild: "+prov_cp)
 
+		if myaux.get("PROVIDE"):
+			stats["virtual.oldstyle"]+=1
+			fails["virtual.oldstyle"].append(relative_path)
+
 		for pos, missing_var in enumerate(missingvars):
 			if not myaux.get(missing_var):
 				if catdir == "virtual" and \

diff --git a/man/repoman.1 b/man/repoman.1
index 162b62b..7c34024 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -353,6 +353,9 @@ Ebuild uses D, ROOT, ED, EROOT or EPREFIX with helpers
 .B virtual.exists
 PROVIDE contains existing package names
 .TP
+.B virtual.oldstyle
+The ebuild PROVIDEs an old-style virtual (see GLEP 37)
+.TP
 .B virtual.unavailable
 PROVIDE contains a virtual which contains no profile default
 .TP



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

end of thread, other threads:[~2011-05-04 20:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-04 20:03 [gentoo-commits] proj/portage:2.1.9 commit in: man/, bin/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2011-05-04 20:03 Zac Medico
2011-05-04 20: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