public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2013-01-05 13:47 Ulrich Mueller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Mueller @ 2013-01-05 13:47 UTC (permalink / raw
  To: gentoo-commits

commit:     40f82c2ca4450db7fbc70c3e281361deb8fc8e90
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  5 13:10:58 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jan  5 13:10:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=40f82c2c

Rewrite arch() fallback code in package-manager lib.

* libs/package-manager.bash.in (arch): Complete rewrite of the
fallback code if there is no make.profile symlink. It now relies
on bash variables HOSTTYPE and OSTYPE which are derived from the
standard GNU triplet. The previous implementation had used uname
which would query the kernel, while we need the userland. This
fixes a problem on ppc with 64 bit kernel and 32 bit userland.
Thanks to Brent Baude <ranger <AT> gentoo.org> and Raúl Porcel
<armin76 <AT> gentoo.org> for the suggestion.

---
 ChangeLog                    |   11 +++++
 libs/package-manager.bash.in |   92 +++++++++++++++++++++++++++++-------------
 2 files changed, 75 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af6eb4f..cb0e6b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-01-05  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/package-manager.bash.in (arch): Complete rewrite of the
+	fallback code if there is no make.profile symlink. It now relies
+	on bash variables HOSTTYPE and OSTYPE which are derived from the
+	standard GNU triplet. The previous implementation had used uname
+	which would query the kernel, while we need the userland. This
+	fixes a problem on ppc with 64 bit kernel and 32 bit userland.
+	Thanks to Brent Baude <ranger@gentoo.org> and Raúl Porcel
+	<armin76@gentoo.org> for the suggestion.
+
 2012-12-06  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/profile.eselect (get_repos, get_repo_path): Use EROOT

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index a34575d..886e3b7 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -42,7 +42,7 @@ run_paludis() {
 # arch
 # Return the architecture we're running on...
 arch() {
-	local ret=$(envvar sys-devel/gcc ARCH) suffix
+	local ret=$(envvar sys-devel/gcc ARCH)
 
 	# $arch will be null if there's no current make.profile symlink.
 	# We cannot get a list of valid profiles without it.
@@ -54,39 +54,75 @@ arch() {
 			return 1
 		fi
 
-		ret=$(uname -m)
-		case ${ret} in
-			alpha|amd64|ia64|m68k|ppc|ppc64) ;;
-			arm*) ret=arm ;;
-			i?86) ret=x86 ;;
-			mips*) ret=mips ;;
-			parisc*) ret=hppa ;;
-			"Power Macintosh") ret=ppc ;;
-			s390*) ret=s390 ;;
-			sh*) ret=sh ;;
-			sparc*) ret=sparc ;;
-			x86_64) ret=amd64 ;;
-			*) write_warning_msg \
-				"Unknown architecture. Please submit a bug including the output of 'uname -m'"
+		# Try to determine arch from HOSTTYPE and OSTYPE, which are
+		# derived from the GNU triplet (at build time of bash)
+		case ${HOSTTYPE} in
+			alpha*) 	ret=alpha	;;
+			arm*)   	ret=arm 	;;
+			hppa*)  	ret=hppa	;;
+			i?86)   	ret=x86 	;;
+			ia64)   	ret=ia64	;;
+			m68k)   	ret=m68k	;;
+			mips*)  	ret=mips	;;
+			powerpc)	ret=ppc 	;;
+			powerpc64)	ret=ppc64	;;
+			s390*)  	ret=s390	;;
+			sh*)    	ret=sh  	;;
+			sparc)  	ret=sparc	;;
+			sparc64)	ret=sparc64	;;
+			x86_64) 	ret=amd64	;;
+			*)
+				write_warning_msg \
+					"Unknown architecture \"${HOSTTYPE}\"." \
+					"Please submit a bug report."
 				return 1
 				;;
 		esac
 
-		case $(uname -s) in
-			Linux) ;;
-			FreeBSD) suffix="-fbsd" ;;
-			NetBSD) suffix="-nbsd" ;;
-			OpenBSD) suffix="-obsd" ;;
-			DragonFly) suffix="-dfly" ;;
-			Darwin) suffix="-macos" ;;
-			*) write_warning_msg \
-				"Unknown OS. Please submit a bug including the output of 'uname -s'"
-				return 1
-				;;
-		esac
+		if [[ -z ${EPREFIX} ]]; then
+			case ${OSTYPE} in
+				linux*) 	;;
+				dragonfly*)	ret+="-dfly"	;;
+				freebsd*)	ret+="-fbsd"	;;
+				netbsd*)	ret+="-nbsd"	;;
+				openbsd*)	ret+="-obsd"	;;
+				*)
+					write_warning_msg \
+						"Unknown OS \"${OSTYPE}\"." \
+						"Please submit a bug report."
+					return 1
+					;;
+			esac
+		else
+			# Prefix architectures
+			if [[ ${ret} = amd64 && ${OSTYPE} != linux* ]]; then
+				# amd64 is sometimes called x64 on Prefix
+				ret=x64
+			fi
+			case ${OSTYPE} in
+				aix*)   	ret+="-aix" 	;;
+				cygwin*)	ret+="-cygwin"	;;
+				darwin*)	ret+="-macos"	;;
+				freebsd*)	ret+="-freebsd"	;;
+				hpux*)  	ret+="-hpux"	;;
+				interix*)	ret+="-interix"	;;
+				linux*) 	ret+="-linux"	;;
+				mint*)  	ret+="-mint"	;;
+				netbsd*)	ret+="-netbsd"	;;
+				openbsd*)	ret+="-openbsd"	;;
+				solaris*)	ret+="-solaris"	;;
+				winnt*) 	ret+="-winnt"	;;
+				*)
+					write_warning_msg \
+						"Unknown OS \"${OSTYPE}\"." \
+						"Please submit a bug report."
+					return 1
+					;;
+			esac
+		fi
 	fi
 
-	echo ${ret}${suffix}
+	echo "${ret}"
 }
 
 # envvar


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2013-06-17 15:26 Ulrich Mueller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Mueller @ 2013-06-17 15:26 UTC (permalink / raw
  To: gentoo-commits

commit:     6cf0931afd8a47eebd1b8f9fefe33327957c41a1
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 17 15:25:42 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 15:25:42 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=6cf0931a

Workaround for ARCH in prefix/linux profiles, bug 473542.

* libs/package-manager.bash.in (arch): Workaround for incorrect
definition of ARCH in prefix/linux profiles, bug 473542.

---
 ChangeLog                    |  5 +++++
 libs/package-manager.bash.in | 13 +++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 90c86c7..ba6c4f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-17  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/package-manager.bash.in (arch): Workaround for incorrect
+	definition of ARCH in prefix/linux profiles, bug 473542.
+
 2013-04-06  Ulrich Müller  <ulm@gentoo.org>
 
 	* doc/developer-guide.txt: Document the "unset" action; it is used

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index 886e3b7..7cf31b5 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -44,6 +44,19 @@ run_paludis() {
 arch() {
 	local ret=$(envvar sys-devel/gcc ARCH)
 
+	if [[ -n ${EPREFIX} && -n ${ret} && ${ret%-*} = "${ret}" ]]; then
+		# prefix/linux profiles lie about their ARCH
+		case $(envvar sys-devel/gcc KERNEL) in
+			linux) ret+="-linux" ;;
+			*)
+				write_warning_msg \
+					"Failed to determine \${ARCH}." \
+					"Please submit a bug report."
+				return 1
+				;;
+		esac
+	fi
+
 	# $arch will be null if there's no current make.profile symlink.
 	# We cannot get a list of valid profiles without it.
 	if [[ -z ${ret} ]]; then


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2013-11-10 20:24 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2013-11-10 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     26c49888ff5c503a1149719f87cb3f4a3f941a50
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 10 18:25:56 2013 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 18:25:56 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=26c49888

Implement space function more efficiently.

* libs/output.bash.in (space): Implement more efficiently.

---
 ChangeLog           | 4 ++++
 libs/output.bash.in | 7 +++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0aad0e4..31418dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-10  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/output.bash.in (space): Implement more efficiently.
+
 2013-10-27  Ulrich Müller  <ulm@gentoo.org>
 
 	* autogen.bash: Update for aclocal 1.14.

diff --git a/libs/output.bash.in b/libs/output.bash.in
index ac934bb..78e0c4f 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -242,9 +242,8 @@ highlight_marker() {
 # space PUBLIC
 # Write $1 numbers of spaces
 space() {
-	local n ret=""
-	for (( n = 1; n <= $1; ++n )); do
-		ret="${ret} "
+	local n=$1
+	while (( n-- > 0 )); do
+		echo -n " "
 	done
-	echo -n "${ret}"
 }


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2013-11-19  8:17 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2013-11-19  8:17 UTC (permalink / raw
  To: gentoo-commits

commit:     7e66a8cfbe7c3ca2b56aae3f4de648875d29241f
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 14 22:56:29 2013 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Nov 15 08:01:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=7e66a8cf

Suppress wrapping of lines in brief output mode, bug 490882.

* libs/output.bash.in (write_kv_list_entry): Suppress wrapping
of lines in brief output mode, in order to make automatic parsing
easier. Bug 490882.

---
 ChangeLog           |  4 ++++
 libs/output.bash.in | 13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9390b25..536344e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-11-15  Ulrich Müller  <ulm@gentoo.org>
 
+	* libs/output.bash.in (write_kv_list_entry): Suppress wrapping
+	of lines in brief output mode, in order to make automatic parsing
+	easier. Bug 490882.
+
 	* modules/modules.eselect (do_list): New local option --only-names
 	will output names of modules only, without their description.
 	This replaces the previous brief output mode behaviour and is

diff --git a/libs/output.bash.in b/libs/output.bash.in
index 5390792..92c367b 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -112,10 +112,15 @@ write_kv_list_entry() {
 
 	# if ${n} is less than or equal to zero then we have a long ${key}
 	# that will mess up the formatting of ${val}, so end the line, indent
-	# and let ${val} go on the next line.
+	# and let ${val} go on the next line. Don't start a new line when
+	# in brief output mode, in order to keep the output easily parsable.
 	if [[ ${n} -le 0 ]]; then
-		echo
-		n=$(( 28 + ${#rindent} ))
+		if is_output_mode brief; then
+			n=1
+		else
+			echo
+			n=$(( 28 + ${#rindent} ))
+		fi
 	fi
 
 	echo -n -e "$(space ${n})${right}"
@@ -123,7 +128,7 @@ write_kv_list_entry() {
 
 	text=${val//\%%%??%%%/}
 	# only loop if it doesn't fit on the same line
-	if [[ $(( ${n} + ${#text} )) -ge ${cols} ]]; then
+	if [[ $(( ${n} + ${#text} )) -ge ${cols} ]] && ! is_output_mode brief; then
 		local i=0 spc=""
 		rindent=$(space ${n})
 		local cwords=( $(apply_text_highlights "${right}" "${val}") )


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2013-11-19 12:54 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2013-11-19 12:54 UTC (permalink / raw
  To: gentoo-commits

commit:     8a49c1aac6f1f1824059513360f2abc8aece1cd3
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 19 12:54:32 2013 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Nov 19 12:54:32 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=8a49c1aa

Don't reset output mode in default do_help().

* libs/default.eselect.in (do_help): Don't reset output mode.

---
 ChangeLog               | 4 ++++
 libs/default.eselect.in | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 536344e..5c3750e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-19  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/default.eselect.in (do_help): Don't reset output mode.
+
 2013-11-15  Ulrich Müller  <ulm@gentoo.org>
 
 	* libs/output.bash.in (write_kv_list_entry): Suppress wrapping

diff --git a/libs/default.eselect.in b/libs/default.eselect.in
index 5783a8d..844cc5c 100644
--- a/libs/default.eselect.in
+++ b/libs/default.eselect.in
@@ -95,7 +95,6 @@ describe_help() {
 }
 
 do_help() {
-	set_output_mode default
 	echo "${DESCRIPTION}"
 	show_usage_message
 	if is_function show_extra_help_text; then


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2014-01-19 16:36 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2014-01-19 16:36 UTC (permalink / raw
  To: gentoo-commits

commit:     1d1b8a2af52d7134605873de4efc1a29577fb684
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 19 16:39:42 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jan 19 16:39:42 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=1d1b8a2a

Recognise arm64 in package-manager lib.

* libs/package-manager.bash.in (arch): Recognise aarch64*/arm64.

---
 ChangeLog                    | 4 ++++
 libs/package-manager.bash.in | 1 +
 2 files changed, 5 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index bab002a..61e7e66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-19  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/package-manager.bash.in (arch): Recognise aarch64*/arm64.
+
 2013-12-07  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index f9bc029..b508e1e 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -70,6 +70,7 @@ arch() {
 		# Try to determine arch from HOSTTYPE and OSTYPE, which are
 		# derived from the GNU triplet (at build time of bash)
 		case ${HOSTTYPE} in
+			aarch64*)  	ret=arm64 	;;
 			alpha*) 	ret=alpha	;;
 			arm*)   	ret=arm 	;;
 			hppa*)  	ret=hppa	;;


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2014-03-14 19:43 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2014-03-14 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     6cfcd9b33e08157146d08783872635a0545f4ead
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 14 16:02:20 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Mar 14 16:10:34 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=6cfcd9b3

Don't output spurious whitespace in write_kv_list_entry.

* libs/output.bash.in (write_kv_list_entry): Don't output spurious
trailing whitespace if value is an empty string.

---
 ChangeLog           | 5 +++++
 libs/output.bash.in | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6aad604..0566eeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-14  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/output.bash.in (write_kv_list_entry): Don't output spurious
+	trailing whitespace if value is an empty string.
+
 2014-02-25  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/news.eselect (accepted_languages): Suppress "C"

diff --git a/libs/output.bash.in b/libs/output.bash.in
index 140de9e..2681c8c 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -110,6 +110,13 @@ write_kv_list_entry() {
 	text=${key//\%%%??%%%/}
 	n=$(( 26 + ${#rindent} - ${#lindent} - ${#text} ))
 
+	text=${val//\%%%??%%%/}
+	if [[ -z ${text} ]]; then
+		# empty ${val}: end the line and be done
+		echo
+		return
+	fi
+
 	# if ${n} is less than or equal to zero then we have a long ${key}
 	# that will mess up the formatting of ${val}, so end the line, indent
 	# and let ${val} go on the next line. Don't start a new line when
@@ -126,7 +133,6 @@ write_kv_list_entry() {
 	echo -n -e "$(space ${n})${right}"
 	n=$(( 28 + ${#rindent} ))
 
-	text=${val//\%%%??%%%/}
 	# only loop if it doesn't fit on the same line
 	if [[ $(( ${n} + ${#text} )) -ge ${cols} ]] && ! is_output_mode brief; then
 		local i=0 spc=""


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2016-06-01 19:43 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2016-06-01 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     da9a451824ccd5e4e2b9be405fecad82599ba702
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  1 19:41:11 2016 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun  1 19:41:11 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=da9a4518

Avoid absolute paths for programs.

* configure.ac: Where possible, use AC_CHECK_PROGS instead of
AC_PATH_PROGS, in order to avoid absolute paths, bug 122260.
* libs/core.bash.in (sed):
* libs/package-manager.bash.in (portageq): Invoke commands with
"command" so that they will work without a path.

 ChangeLog                    |  8 ++++++++
 configure.ac                 | 31 +++++++++++++------------------
 libs/core.bash.in            |  4 ++--
 libs/package-manager.bash.in |  4 ++--
 4 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5bb2855..c166ad0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-06-01  Ulrich Müller  <ulm@gentoo.org>
+
+	* configure.ac: Where possible, use AC_CHECK_PROGS instead of
+	AC_PATH_PROGS, in order to avoid absolute paths, bug 122260.
+	* libs/core.bash.in (sed):
+	* libs/package-manager.bash.in (portageq): Invoke commands with
+	"command" so that they will work without a path.
+
 2016-01-27  Ulrich Müller  <ulm@gentoo.org>
 
 	* bin/eselect.in: Set umask +rx, bug 572348.

diff --git a/configure.ac b/configure.ac
index 8f38759..6fce662 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ fi
 
 # AC_PROG_SED doesn't work here, because on Gentoo FreeBSD systems it
 # is confused by a wrapper script that is in the PATH at build time.
-AC_PATH_PROGS(SED, [gsed sed])
+AC_CHECK_PROGS(SED, [gsed sed])
 if test x$SED = x; then
     AC_MSG_ERROR([sed is required])
 fi
@@ -31,27 +31,22 @@ else
     AC_MSG_ERROR([GNU sed is required])
 fi
 
-AC_PATH_PROG(PORTAGEQ, portageq, /usr/bin/portageq,
-  [$prefix/bin:/usr/bin:/bin:$PATH])
 AC_PATH_PROG(ENV_UPDATE, env-update, /usr/sbin/env-update,
   [$PATH:$prefix/sbin:/usr/sbin])
 
-AC_PATH_PROG(READLINK, greadlink)
-if test x$READLINK = x; then
-    AC_PATH_PROG(READLINK, readlink)
-    if test x$READLINK != x; then
-        AC_MSG_CHECKING([whether readlink supports -f])
-        if $READLINK -f . >/dev/null 2>&1; then
-            AC_MSG_RESULT(yes)
-        else
-            AC_MSG_RESULT(no)
-            READLINK=""
-        fi
-    fi
-    if test x$READLINK = x; then
-        AC_PATH_PROG(REALPATH, realpath)
+AC_CHECK_PROGS(READLINK, [greadlink readlink])
+if test x$READLINK != x; then
+    AC_MSG_CHECKING([whether $READLINK supports -f])
+    if $READLINK -f . >/dev/null 2>&1; then
+        AC_MSG_RESULT(yes)
+    else
+        AC_MSG_RESULT(no)
+        READLINK=""
     fi
 fi
+if test x$READLINK = x; then
+    AC_CHECK_PROGS(REALPATH, realpath)
+fi
 if test x$READLINK != x; then
     CANONICALISE="$READLINK -f"
 elif test x$REALPATH != x; then
@@ -63,7 +58,7 @@ AC_SUBST(CANONICALISE)
 
 # Gentoo uses rst2html.py but most other
 # distros install it w/o the .py extension
-AC_PATH_PROGS(RST2HTML, [rst2html rst2html.py])
+AC_CHECK_PROGS(RST2HTML, [rst2html rst2html.py])
 
 # Support for Gentoo Prefix
 AC_MSG_CHECKING([if target installation is in an offset prefix])

diff --git a/libs/core.bash.in b/libs/core.bash.in
index 6b6f049..baddfde 100644
--- a/libs/core.bash.in
+++ b/libs/core.bash.in
@@ -119,7 +119,7 @@ inherit() {
 	done
 }
 
-# GNU sed wrapper (real path to GNU sed determined by configure)
+# GNU sed wrapper (sed or gsed, as determined by configure)
 sed() {
-	@SED@ "$@"
+	command @SED@ "$@"
 }

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index 691bd3c..b6d8218 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -28,9 +28,9 @@ package_manager() {
 }
 
 # portageq
-# Run portageq with safe filename as set by configure. Redirect stderr
+# Run portageq. Redirect stderr
 portageq() {
-	@PORTAGEQ@ "$@" 2>/dev/null
+	command portageq "$@" 2>/dev/null
 }
 
 # run_paludis PRIVATE


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2016-10-30  9:17 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2016-10-30  9:17 UTC (permalink / raw
  To: gentoo-commits

commit:     a121df41e723306bdd925098ebd4a8939ac188fe
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 23:09:10 2016 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 23:09:10 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=a121df41

Ignore comment lines when parsing config files.

* libs/config.bash.in (store_config): Ignore comment lines in
config files and make parsing more robust, bug 598480.

 ChangeLog           | 5 +++++
 libs/config.bash.in | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index eb3db3b..e9fc937 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-30  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/config.bash.in (store_config): Ignore comment lines in
+	config files and make parsing more robust, bug 598480.
+
 2016-06-17  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.6.

diff --git a/libs/config.bash.in b/libs/config.bash.in
index 80ef798..9fbecf0 100644
--- a/libs/config.bash.in
+++ b/libs/config.bash.in
@@ -57,9 +57,11 @@ store_config() {
 		# parse the names of all settings in the file
 		local ifs_save=${IFS} IFS=$'\n'
 		for line in ${content} ; do
-			[[ ${line/=/} != ${line} ]] || continue
-			line=${line/=*/}
-			local ${line}=""
+			line=${line##*([[:space:]])}
+			[[ ${line} != "#"* && ${line} == *=* ]] || continue
+			line=${line%%=*}
+			# assignment will fail if ${line} is not a valid identifier
+			local ${line}="" || continue
 			vars=(${vars[@]} ${line})
 		done
 		IFS=${ifs_save}


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2016-11-01  6:43 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2016-11-01  6:43 UTC (permalink / raw
  To: gentoo-commits

commit:     6e078f8a6e665f473bbf96668f13871e6119e0d8
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 31 08:30:55 2016 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Oct 31 08:30:55 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=6e078f8a

Disable eval again.

* libs/core.bash.in (eval): Disable eval again, because the
workaround for the rc module (sourcing functions.sh) is no longer
needed. See also 2005-05-15 change by ciaranm.

This partially reverts commit 76867bf1a47570cd9548100caed519252b5ced5a.

 ChangeLog         | 6 ++++++
 README            | 2 +-
 libs/core.bash.in | 6 ++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c7a54f6..80bc483 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-31  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/core.bash.in (eval): Disable eval again, because the
+	workaround for the rc module (sourcing functions.sh) is no longer
+	needed. See also 2005-05-15 change by ciaranm.
+
 2016-10-30  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.7.

diff --git a/README b/README
index 945dc41..de19882 100644
--- a/README
+++ b/README
@@ -34,7 +34,7 @@ Style Notes
   one tab per indent level, with each tab representing 4 places.
 * Avoid lines wider than 79 positions.
 * Public functions don't get the ``es_`` prefix, private functions do.
-* eval is evil, so don't use it.
+* eval is evil, so we disabled it.
 * Absolute paths to executables are not portable, so don't use them.
 
 \f

diff --git a/libs/core.bash.in b/libs/core.bash.in
index baddfde..da35ee9 100644
--- a/libs/core.bash.in
+++ b/libs/core.bash.in
@@ -119,6 +119,12 @@ inherit() {
 	done
 }
 
+# make eval not work, because it's evil
+eval() {
+	write_warning_msg "Don't use eval. Find another way."
+	builtin eval "$@"
+}
+
 # GNU sed wrapper (sed or gsed, as determined by configure)
 sed() {
 	command @SED@ "$@"


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2016-12-10  8:18 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2016-12-10  8:18 UTC (permalink / raw
  To: gentoo-commits

commit:     eb8e92c757d14ed3c1769d622a5588a5d47f3a3e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 06:04:34 2016 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 12:22:01 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=eb8e92c7

Fix pkgcore support.

* libs/package-manager.bash.in (get_repositories)
(get_repo_news_dir): Fix pinspect calls, bug 304011.

 ChangeLog                    | 3 +++
 libs/package-manager.bash.in | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4d12473..0d77f5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-12-04  Ulrich Müller  <ulm@gentoo.org>
 
+	* libs/package-manager.bash.in (get_repositories)
+	(get_repo_news_dir): Fix pinspect calls, bug 304011.
+
 	* modules/news.eselect (find_items, find_repo_dir): Check return
 	status of package manager calls, bug 601506.
 

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index b6d8218..aececfd 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -180,7 +180,7 @@ has_version() {
 get_repositories() {
 	case $(package_manager) in
 		portage) portageq get_repos "${EROOT:-/}" ;;
-		pkgcore) pinspect portageq get_repositories ;;
+		pkgcore) pinspect portageq get_repos "${ROOT:-/}" ;;
 		paludis) run_paludis print-repositories ;;
 	esac
 }
@@ -193,7 +193,7 @@ get_repo_news_dir() {
 	case $(package_manager) in
 		portage) echo "$(portageq get_repo_path \
 			"${EROOT:-/}" "${repo}")/metadata/news" ;;
-		pkgcore) pinspect portageq get_repo_news_path "${repo}" ;;
+		pkgcore) pinspect portageq get_repo_news_path "${ROOT:-/}" "${repo}" ;;
 		paludis) run_paludis print-repository-metadata ${repo} \
 			--raw-name newsdir --format '%v\n' ;;
 	esac


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2017-03-21  6:33 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2017-03-21  6:33 UTC (permalink / raw
  To: gentoo-commits

commit:     5f31448766d94618df7ac25c53a05270aec344ce
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 21 04:35:11 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 06:31:28 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=5f314487

Fill out arch matches a bit more in package-manager lib.

* libs/package-manager.bash.in (arch): Fill out arch matches
a bit more.

 ChangeLog                    |  5 +++++
 libs/package-manager.bash.in | 14 ++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 20e9ad3..9508639 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-21  Mike Frysinger <vapier@gentoo.org>
+
+	* libs/package-manager.bash.in (arch): Fill out arch matches
+	a bit more.
+
 2016-12-10  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.8.

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index aececfd..8194fff 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -75,15 +75,17 @@ arch() {
 			arm*)   	ret=arm 	;;
 			hppa*)  	ret=hppa	;;
 			i?86)   	ret=x86 	;;
-			ia64)   	ret=ia64	;;
-			m68k)   	ret=m68k	;;
+			ia64*)  	ret=ia64	;;
+			m68k*)  	ret=m68k	;;
 			mips*)  	ret=mips	;;
-			powerpc)	ret=ppc 	;;
-			powerpc64)	ret=ppc64	;;
+			nios2)  	ret=nios	;;
+			or1k|or32*)	ret=openrisc;;
+			powerpc64*)	ret=ppc64	;;
+			powerpc*)	ret=ppc 	;;
+			riscv*) 	ret=riscv	;;
 			s390*)  	ret=s390	;;
 			sh*)    	ret=sh  	;;
-			sparc)  	ret=sparc	;;
-			sparc64)	ret=sparc64	;;
+			sparc*) 	ret=sparc	;;
 			x86_64) 	ret=amd64	;;
 			*)
 				write_warning_msg \


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2017-06-18 19:32 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2017-06-18 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     4dc56d6df4edec24762052abbcdf171a478335fb
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 18 19:23:31 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jun 18 19:23:31 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4dc56d6d

Fix mapping for nios2 in package-manager lib.

* libs/package-manager.bash.in (arch): Map nios2 to nios2 (as it
is called in profiles/arch.list) rather	than nios.

 ChangeLog                    | 5 +++++
 libs/package-manager.bash.in | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 11bc25d..35260ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-18  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/package-manager.bash.in (arch): Map nios2 to nios2 (as it
+	is called in profiles/arch.list) rather	than nios.
+
 2017-05-22  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/profile.eselect (set_symlink): Fix regex, bug 614008.

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index fb922a8..c675e7d 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -78,7 +78,7 @@ arch() {
 			ia64*)  	ret=ia64	;;
 			m68k*)  	ret=m68k	;;
 			mips*)  	ret=mips	;;
-			nios2)  	ret=nios	;;
+			nios2)  	ret=nios2	;;
 			or1k|or32*)	ret=openrisc;;
 			powerpc64*)	ret=ppc64	;;
 			powerpc*)	ret=ppc 	;;


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2017-12-25 11:00 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2017-12-25 11:00 UTC (permalink / raw
  To: gentoo-commits

commit:     bc8d7b4d1cffbf60d31753aee798c65d554d0fa2
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 25 09:11:29 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 25 09:11:29 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=bc8d7b4d

Make eval die.

* libs/core.bash.in (eval): Make it fatal again, after more than
one year of transition time.

 ChangeLog         | 5 +++++
 libs/core.bash.in | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a8d3693..648e874 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-25  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/core.bash.in (eval): Make it fatal again, after more than
+	one year of transition time.
+
 2017-10-14  Ulrich Müller  <ulm@gentoo.org>
 
 	* man/news.eselect.5: Update URI of GLEP 42.

diff --git a/libs/core.bash.in b/libs/core.bash.in
index 06f767e..281dbde 100644
--- a/libs/core.bash.in
+++ b/libs/core.bash.in
@@ -121,8 +121,7 @@ inherit() {
 
 # make eval not work, because it's evil
 eval() {
-	write_warning_msg "Don't use eval. Find another way."
-	builtin eval "$@"
+	die "Don't use eval. Find another way."
 }
 
 # GNU sed wrapper (sed or gsed, as determined by configure)


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2023-03-14 16:53 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2023-03-14 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ea6e42593c5d070462f450341b561bb415ad1bac
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 14 14:23:07 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar 14 16:52:06 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=ea6e4259

Allow to specify modules by path

* libs/core.bash.in (find_module): Allow to specify an absolute
path as the module's filename.

Bug: https://bugs.gentoo.org/901205
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog         |  5 +++++
 libs/core.bash.in | 11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index aab936d..4b57867 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-03-14  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/core.bash.in (find_module): Allow to specify an absolute
+	path as the module's filename.
+
 2023-02-28  Ulrich Müller  <ulm@gentoo.org>
 
 	* bin/eselect.in: Disable colours if NO_COLOR is nonempty.

diff --git a/libs/core.bash.in b/libs/core.bash.in
index 740354e..2800cc5 100644
--- a/libs/core.bash.in
+++ b/libs/core.bash.in
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright (c) 2005-2020 Gentoo Authors
+# Copyright (c) 2005-2023 Gentoo Authors
 #
 # This file is part of the 'eselect' tools framework.
 #
@@ -69,6 +69,15 @@ die() {
 # Find module and echo its filename. Die if module doesn't exist.
 find_module() {
 	local modname=$1 modpath
+
+	if [[ ${modname} == */* ]]; then
+		if [[ ${modname} == *.eselect && -f ${modname} ]]; then
+			echo "${modname}"
+			return
+		fi
+		die -q "Can't load module ${modname}"
+	fi
+
 	for modpath in "${ESELECT_MODULES_PATH[@]}"; do
 		if [[ -f ${modpath}/${modname}.eselect ]]; then
 			echo "${modpath}/${modname}.eselect"


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

* [gentoo-commits] proj/eselect:master commit in: libs/, /
@ 2023-05-12 16:44 Ulrich Müller
  0 siblings, 0 replies; 16+ messages in thread
From: Ulrich Müller @ 2023-05-12 16:44 UTC (permalink / raw
  To: gentoo-commits

commit:     9a77220d8ef4f4cca4e95be0af8e67571cc5f5ad
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May 11 16:59:57 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu May 11 16:59:57 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=9a77220d

Don't substitute PORTAGEQ in libs

* libs/Makefile.am (dosed): Don't substitute PORTAGEQ, it no
longer exists in configure.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog        | 5 +++++
 libs/Makefile.am | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f807496..0684481 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-05-11  Ulrich Müller  <ulm@gentoo.org>
+
+	* libs/Makefile.am (dosed): Don't substitute PORTAGEQ, it no
+	longer exists in configure.
+
 2023-03-20  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.22.

diff --git a/libs/Makefile.am b/libs/Makefile.am
index 6ebd08e..c5f3de3 100644
--- a/libs/Makefile.am
+++ b/libs/Makefile.am
@@ -28,7 +28,6 @@ EXTRA_DIST = \
 
 dosed = @SED@ \
 	-e 's%\@SED\@%@SED@%g' \
-	-e 's%\@PORTAGEQ\@%@PORTAGEQ@%g' \
 	-e 's%\@ENV_UPDATE\@%@ENV_UPDATE@%g' \
 	-e 's%\@CANONICALISE\@%@CANONICALISE@%g' \
 	-e 's%\@libdir\@%@libdir@%g'


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

end of thread, other threads:[~2023-05-12 16:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19  8:17 [gentoo-commits] proj/eselect:master commit in: libs/, / Ulrich Müller
  -- strict thread matches above, loose matches on Subject: below --
2023-05-12 16:44 Ulrich Müller
2023-03-14 16:53 Ulrich Müller
2017-12-25 11:00 Ulrich Müller
2017-06-18 19:32 Ulrich Müller
2017-03-21  6:33 Ulrich Müller
2016-12-10  8:18 Ulrich Müller
2016-11-01  6:43 Ulrich Müller
2016-10-30  9:17 Ulrich Müller
2016-06-01 19:43 Ulrich Müller
2014-03-14 19:43 Ulrich Müller
2014-01-19 16:36 Ulrich Müller
2013-11-19 12:54 Ulrich Müller
2013-11-10 20:24 Ulrich Müller
2013-06-17 15:26 Ulrich Mueller
2013-01-05 13:47 Ulrich Mueller

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