public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: man/, bin/
@ 2012-04-26  3:33 Paul Varner
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Varner @ 2012-04-26  3:33 UTC (permalink / raw
  To: gentoo-commits

commit:     a6a159cd3f8c8a89eccbba57689623a747fea73f
Author:     Sławomir Nizio <slawomir.nizio <AT> sabayon <DOT> org>
AuthorDate: Wed Apr 25 22:50:57 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 03:31:07 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=a6a159cd

Extend eread to allow sorting (bug 413577).

---
 bin/eread   |   35 +++++++++++++++++++++++++++++++++--
 man/eread.1 |   13 +++++++++++++
 2 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/bin/eread b/bin/eread
index 7d0a970..d74a167 100755
--- a/bin/eread
+++ b/bin/eread
@@ -5,6 +5,7 @@
 #
 # Author: Donnie Berkholz <spyderous@gentoo.org>
 # Updated by: Uwe Klosa <uwe.klosa@gmail.com>
+# Updated by: Slawomir Nizio <slawomir.nizio@sabayon.org>
 
 # Get prefix
 EPREFIX=${EPREFIX:-$(portageq envvar EPREFIX)}
@@ -30,9 +31,33 @@ fi
 # Set up select prompt
 PS3="Choice? "
 
+SORT=${EREAD_SORT_ORDER}
+
+find_unsorted() {
+	find . -type f | sed -e "s:\./::g"
+}
+find_by_name() {
+	find . -type f | sort | sed -e "s:\./::g"
+}
+find_by_time() {
+	find . -type f | sort -k 3 -t : | sed -e "s:\./::g"
+}
+find_files() {
+	case ${SORT} in
+		alphabet)
+			find_by_name
+			;;
+		time)
+			find_by_time
+			;;
+		*)
+			find_unsorted
+		;;
+	esac
+}
+
 select_loop() {
-	ANY_FILES=$(find . -type f)
-	ANY_FILES=$(echo ${ANY_FILES} | sed -e "s:\./::g")
+	ANY_FILES=$(find_files)
 
 	if [[ -z ${ANY_FILES} ]]; then
 		echo "No log items to read"
@@ -51,6 +76,12 @@ select_loop() {
 				QUIT="yes"
 				break
 				;;
+			a)
+				SORT="alphabet"
+				;;
+			t)
+				SORT="time"
+				;;
 			*)
 				if [ -f "$FILE" ]; then
 					${PAGER} ${FILE}

diff --git a/man/eread.1 b/man/eread.1
index 5e18214..c58c7eb 100644
--- a/man/eread.1
+++ b/man/eread.1
@@ -8,5 +8,18 @@ eread
 .SH "DESCRIPTION"
 .LP 
 This tool is used to display and manage ELOG files produced by portage version 2.1 and higher.
+.SH "USAGE"
+.LP
+You can use the following commands:
+.TP
+.B "q"
+Quit
+.TP
+.B "a"
+Sort alphabetically
+.TP
+.B "t"
+Sort by time
 .SH "ENVIRONMENT VARIABLES"
 The eread utility uses the PAGER environment variable to display the ELOG files. If the variable is not set, it defaults to /usr/bin/less.
+Another environment variable is EREAD_SORT_ORDER which can be set to specify default sort order of ELOG files. Values \fBalphabet\fP and \fBtime\fP are recognized. If EREAD_SORT_ORDER is not set or has another value, the output is unsorted.



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: man/, bin/
@ 2013-01-14 22:50 Paul Varner
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Varner @ 2013-01-14 22:50 UTC (permalink / raw
  To: gentoo-commits

commit:     7bc679e4d730543f31cc928d66d3ceeb98f686e6
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 14 22:12:29 2013 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Jan 14 22:49:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=7bc679e4

Add REVDEP_DEFAULT_OPTS variable to allow overriding of EMERGE_DEFAULT_OPTS for revdep-rebuild.

---
 bin/revdep-rebuild.sh |   12 +++++++++++-
 man/revdep-rebuild.1  |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/bin/revdep-rebuild.sh b/bin/revdep-rebuild.sh
index 75c5767..6b32ae4 100755
--- a/bin/revdep-rebuild.sh
+++ b/bin/revdep-rebuild.sh
@@ -61,6 +61,7 @@ declare EMERGE_DEFAULT_OPTS    # String of options portage assumes to be set
 declare EMERGE_OPTIONS         # Array of options to pass to portage
 declare PORTAGE_NICENESS       # Renice to this value
 declare PORTAGE_ROOT           # The root path for portage
+declare REVDEP_DEFAULT_OPTS    # String of default emerge options for revdep-rebuild
 
 # Customizable incremental variables:
 # These variables can be prepended to either by setting the variable in
@@ -441,6 +442,12 @@ get_opts() {
 	SONAME="not found"
 	SEARCH_BROKEN=1
 	FULL_LD_PATH=1
+
+	# Add the revdep-rebuild default options
+	if [[ -n ${REVDEP_DEFAULT_OPTS} ]]; then
+		EMERGE_OPTIONS+=("$REVDEP_DEFAULT_OPTS")
+	fi
+
 	while [[ $1 ]]; do
 		case $1 in
 			--) shift
@@ -1032,16 +1039,19 @@ portage_settings() {
 	local ORIG_SEARCH_DIRS="$SEARCH_DIRS"
 	local ORIG_SEARCH_DIRS_MASK="$SEARCH_DIRS_MASK"
 	local ORIG_LD_LIBRARY_MASK="$LD_LIBRARY_MASK"
+	local ORIG_REVDEP_DEFAULT_OPTS="$REVDEP_DEFAULT_OPTS"
 	unset SEARCH_DIRS
 	unset SEARCH_DIRS_MASK
 	unset LD_LIBRARY_MASK
+	unset REVDEP_DEFAULT_OPTS
 
-	eval $(portageq envvar -v PORTAGE_ROOT PORTAGE_NICENESS EMERGE_DEFAULT_OPTS NOCOLOR SEARCH_DIRS SEARCH_DIRS_MASK LD_LIBRARY_MASK)
+	eval $(portageq envvar -v PORTAGE_ROOT PORTAGE_NICENESS EMERGE_DEFAULT_OPTS NOCOLOR SEARCH_DIRS SEARCH_DIRS_MASK LD_LIBRARY_MASK REVDEP_DEFAULT_OPTS)
 	export NOCOLOR
 
 	SEARCH_DIRS="$ORIG_SEARCH_DIRS $SEARCH_DIRS"
 	SEARCH_DIRS_MASK="$ORIG_SEARCH_DIRS_MASK $SEARCH_DIRS_MASK"
 	LD_LIBRARY_MASK="$ORIG_LD_LIBRARY_MASK $LD_LIBRARY_MASK"
+	REVDEP_DEFAULT_OPTS="$ORIG_REVDEP_DEFAULT_OPTS $REVDEP_DEFAULT_OPTS"
 }
 
 ##

diff --git a/man/revdep-rebuild.1 b/man/revdep-rebuild.1
index 98aa560..70cead1 100644
--- a/man/revdep-rebuild.1
+++ b/man/revdep-rebuild.1
@@ -72,6 +72,10 @@ While a user can edit and modify the files in the /etc/revdep\-rebuild directory
 An entry of "\-*" means to clear the variable from that point forward.
 Example: SEARCH_DIRS="/usr/bin \-*" will set SEARCH_DIRS to contain only /usr/bin
 
+REVDEP_DEFAULT_OPTS \- List of default emerge options for revdep-rebuild
+
+The REVDEP_DEFAULT_OPTS variable can be used to override EMERGE_DEFAULT_OPTIONS and to default emerge options to revdep\-rebuild. This variable is appended to the values of EMERGE_DEFAULT_OPTIONS and can still be overridden by command line options. Please note that this variable is only for options to pass to emerge and not options for revdep\-rebuild itself.
+
 revdep\-rebuild honors the NOCOLOR and PORTAGE_NICENESS variables from /etc/make.conf
 .SH "EXAMPLES"
 It is recommended that when running revdep\-rebuild that the following command be used initially:


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: man/, bin/
@ 2013-01-17 22:38 Paul Varner
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Varner @ 2013-01-17 22:38 UTC (permalink / raw
  To: gentoo-commits

commit:     4386dfd32cf794e2dc42b0d0e68ede9341655217
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 17 22:36:07 2013 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Thu Jan 17 22:36:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=4386dfd3

Change behavior and name of REVDEP_DEFAULT_OPTS variable.

* Changed name to REVDEP_REBUILD_DEFAULTS_OPTS
* Change behavior to have it replace the value of
  EMERGE_DEFAULT_OPTS.

---
 bin/revdep-rebuild.sh |   21 +++++++++++----------
 man/revdep-rebuild.1  |    4 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/bin/revdep-rebuild.sh b/bin/revdep-rebuild.sh
index 6b32ae4..a14700e 100755
--- a/bin/revdep-rebuild.sh
+++ b/bin/revdep-rebuild.sh
@@ -61,7 +61,7 @@ declare EMERGE_DEFAULT_OPTS    # String of options portage assumes to be set
 declare EMERGE_OPTIONS         # Array of options to pass to portage
 declare PORTAGE_NICENESS       # Renice to this value
 declare PORTAGE_ROOT           # The root path for portage
-declare REVDEP_DEFAULT_OPTS    # String of default emerge options for revdep-rebuild
+declare REVDEP_REBUILD_DEFAULT_OPTS # String of default emerge options for revdep-rebuild
 
 # Customizable incremental variables:
 # These variables can be prepended to either by setting the variable in
@@ -443,11 +443,6 @@ get_opts() {
 	SEARCH_BROKEN=1
 	FULL_LD_PATH=1
 
-	# Add the revdep-rebuild default options
-	if [[ -n ${REVDEP_DEFAULT_OPTS} ]]; then
-		EMERGE_OPTIONS+=("$REVDEP_DEFAULT_OPTS")
-	fi
-
 	while [[ $1 ]]; do
 		case $1 in
 			--) shift
@@ -1039,19 +1034,25 @@ portage_settings() {
 	local ORIG_SEARCH_DIRS="$SEARCH_DIRS"
 	local ORIG_SEARCH_DIRS_MASK="$SEARCH_DIRS_MASK"
 	local ORIG_LD_LIBRARY_MASK="$LD_LIBRARY_MASK"
-	local ORIG_REVDEP_DEFAULT_OPTS="$REVDEP_DEFAULT_OPTS"
+	local ORIG_REVDEP_REBUILD_DEFAULT_OPTS="$REVDEP_REBUILD_DEFAULT_OPTS"
 	unset SEARCH_DIRS
 	unset SEARCH_DIRS_MASK
 	unset LD_LIBRARY_MASK
-	unset REVDEP_DEFAULT_OPTS
+	unset REVDEP_REBUILD_DEFAULT_OPTS
 
-	eval $(portageq envvar -v PORTAGE_ROOT PORTAGE_NICENESS EMERGE_DEFAULT_OPTS NOCOLOR SEARCH_DIRS SEARCH_DIRS_MASK LD_LIBRARY_MASK REVDEP_DEFAULT_OPTS)
+	eval $(portageq envvar -v PORTAGE_ROOT PORTAGE_NICENESS EMERGE_DEFAULT_OPTS NOCOLOR SEARCH_DIRS SEARCH_DIRS_MASK LD_LIBRARY_MASK REVDEP_REBUILD_DEFAULT_OPTS)
 	export NOCOLOR
 
 	SEARCH_DIRS="$ORIG_SEARCH_DIRS $SEARCH_DIRS"
 	SEARCH_DIRS_MASK="$ORIG_SEARCH_DIRS_MASK $SEARCH_DIRS_MASK"
 	LD_LIBRARY_MASK="$ORIG_LD_LIBRARY_MASK $LD_LIBRARY_MASK"
-	REVDEP_DEFAULT_OPTS="$ORIG_REVDEP_DEFAULT_OPTS $REVDEP_DEFAULT_OPTS"
+	REVDEP_REBUILD_DEFAULT_OPTS="$ORIG_REVDEP_REBUILD_DEFAULT_OPTS $REVDEP_REBUILD_DEFAULT_OPTS"
+
+	# Replace EMERGE_DEFAULT_OPTS with REVDEP_REBUILD_DEFAULT_OPTS (if it exists)
+	if [[ -n ${REVDEP_REBUILD_DEFAULT_OPTS} ]]; then
+		EMERGE_DEFAULT_OPTS=("$REVDEP_REBUILD_DEFAULT_OPTS")
+	fi
+
 }
 
 ##

diff --git a/man/revdep-rebuild.1 b/man/revdep-rebuild.1
index 70cead1..d2d2d58 100644
--- a/man/revdep-rebuild.1
+++ b/man/revdep-rebuild.1
@@ -72,9 +72,9 @@ While a user can edit and modify the files in the /etc/revdep\-rebuild directory
 An entry of "\-*" means to clear the variable from that point forward.
 Example: SEARCH_DIRS="/usr/bin \-*" will set SEARCH_DIRS to contain only /usr/bin
 
-REVDEP_DEFAULT_OPTS \- List of default emerge options for revdep-rebuild
+REVDEP_REBUILD_DEFAULT_OPTS \- List of default emerge options for revdep-rebuild
 
-The REVDEP_DEFAULT_OPTS variable can be used to override EMERGE_DEFAULT_OPTIONS and to default emerge options to revdep\-rebuild. This variable is appended to the values of EMERGE_DEFAULT_OPTIONS and can still be overridden by command line options. Please note that this variable is only for options to pass to emerge and not options for revdep\-rebuild itself.
+The REVDEP_REBUILD_DEFAULT_OPTS variable can be used to override EMERGE_DEFAULT_OPTS for revdep\-rebuild. This variable replaces the values of EMERGE_DEFAULT_OPTS and can still be overridden by command line options. Please note that this variable is only for options to pass to emerge and not options for revdep\-rebuild itself.
 
 revdep\-rebuild honors the NOCOLOR and PORTAGE_NICENESS variables from /etc/make.conf
 .SH "EXAMPLES"


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: man/, bin/
@ 2014-11-11 16:36 Paul Varner
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Varner @ 2014-11-11 16:36 UTC (permalink / raw
  To: gentoo-commits

commit:     14f2062ff0ce73d0118f960bad8e15425b73e538
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 11 16:31:33 2014 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Nov 11 16:31:33 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=14f2062f

revdep-rebuild.sh: Look for issues with symbols. (Bug 63643)

These changes cause revdep-rebuild.sh to unconditionally look for
"Symbol not defined" in ldd -d -r ouput.  Additionally, it adds the
options -u, --search-symbols to look for "undefined symbol".  Using this
option will cause false positives in the revdep-rebuild output.

---
 bin/revdep-rebuild.sh | 38 ++++++++++++++++++++++++++++++++++++--
 man/revdep-rebuild.1  |  3 +++
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/bin/revdep-rebuild.sh b/bin/revdep-rebuild.sh
index 01a0454..633701e 100755
--- a/bin/revdep-rebuild.sh
+++ b/bin/revdep-rebuild.sh
@@ -54,6 +54,7 @@ declare ORDER_PKGS             # ...sort the atoms in deep dependency order
 declare PACKAGE_NAMES          # ...emerge by slot, not by versionated atom
 declare RM_OLD_TEMPFILES       # ...remove tempfiles from prior runs
 declare SEARCH_BROKEN          # ...search for broken libraries and binaries
+declare SEARCH_SYMBOLS         # ...search for broken binaries with undefined symbols
 declare VERBOSE                # ...give verbose output
 
 # Globals that impact portage directly:
@@ -191,6 +192,7 @@ Broken reverse dependency rebuilder.
                        (also passed to emerge command)
   -P, --no-progress    Turn off the progress meter
   -q, --quiet          Be less verbose (also passed to emerge command)
+  -u, --search-symbols Search for undefined symbols (may have false positives)
   -v, --verbose        Be more verbose (also passed to emerge command)
 
 Calls emerge, options after -- are ignored by $APP_NAME
@@ -390,6 +392,7 @@ get_longopts() {
 		                                 --quiet) progress() { :; }
 		                                          QUIET=1
 		                                          EMERGE_OPTIONS+=($1);;
+		                        --search-symbols) SEARCH_SYMBOLS=1;;
 		                               --verbose) VERBOSE=1
 		                                          EMERGE_OPTIONS+=("--verbose");;
 		                         --extra-verbose) warn_deprecated_opt "$1" "--verbose"
@@ -408,7 +411,7 @@ get_longopts() {
 # Get single-letter commandline options preceded by a single dash.
 get_shortopts() {
 	local OPT OPTSTRING OPTARG OPTIND
-	while getopts ":CdehikL:loPpqu:vX" OPT; do
+	while getopts ":CdehikL:loPpquvX" OPT; do
 		case "$OPT" in
 			C) # TODO: Match syntax with the rest of gentoolkit
 			   export NOCOLOR="yes";;
@@ -429,6 +432,7 @@ get_shortopts() {
 			q) progress() { :; }
 			   QUIET=1
 			   EMERGE_OPTIONS+=("--quiet");;
+			u) SEARCH_SYMBOLS=1;;
 			v) VERBOSE=1
 			   EMERGE_OPTIONS+=("--verbose");;
 			X) # No longer used, since it is the default.
@@ -732,6 +736,8 @@ main_checks() {
 	local ldd_status
 	local numFiles
 	local COMPLETE_LD_LIBRARY_PATH
+	local message
+	local broken_lib
 	if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then
 		[[ -r "$LDPATH_FILE" && -s "$LDPATH_FILE" ]] ||
 			die 1 "Unable to find $LDPATH_FILE"
@@ -748,7 +754,7 @@ main_checks() {
 			if [[ $target_file != *.la ]]; then
 				# Note: double checking seems to be faster than single with complete path
 				# (special add ons are rare).
-				ldd_output=$(ldd "$target_file" 2>> "$ERRORS_FILE" | sort -u)
+				ldd_output=$(ldd -d -r "$target_file" 2>> "$ERRORS_FILE" | sort -u)
 				ldd_status=$? # TODO: Check this for problems with sort
 				# HACK: if LD_LIBRARY_MASK is null or undefined grep -vF doesn't work
 				if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
@@ -794,6 +800,34 @@ main_checks() {
 						fi
 					fi
 				fi
+				# Search for symbols not defined
+				if [[ $SEARCH_BROKEN ]]; then
+					# Look for symbol not defined errors
+					if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
+						grep -q -E 'symbol .* not defined'; then
+						message=$(gawk '/symbol .* not defined/ {NF--; print $0}' <<< "$ldd_output")
+						broken_lib=$(gawk '/symbol .* not defined/ {print $NF}' <<< "$ldd_output" | \
+							sed 's/[()]//g')
+						echo "obj $broken_lib" >> "$BROKEN_FILE"
+						echo_v "  broken $broken_lib ($message)"
+					fi
+				fi
+				# Look for undefined symbol error if not a .so file
+				if [[ $SEARCH_BROKEN && $SEARCH_SYMBOLS ]]; then
+					case $target_file in
+					*.so|*.so.*)
+						;;
+					*)
+						if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
+							grep -q -F 'undefined symbol:'; then
+							message=$(gawk '/undefined symbol:/ {print $3}' <<< "$ldd_output")
+							message="${message//$'\n'/ }"
+							echo "obj $target_file" >> "$BROKEN_FILE"
+							echo_v "  broken $target_file (undefined symbols(s): $message)"
+						fi
+						;;
+					esac
+				fi
 			elif [[ $SEARCH_BROKEN ]]; then
 				# Look for broken .la files
 				la_SEARCH_DIRS="$(parse_ld_so_conf)"

diff --git a/man/revdep-rebuild.1 b/man/revdep-rebuild.1
index 59d7def..d1833e1 100644
--- a/man/revdep-rebuild.1
+++ b/man/revdep-rebuild.1
@@ -44,6 +44,9 @@ Turn off the progress meter
 .B \-q | \-\-quiet
 Print less output and disable the progress meter.  (This option is also passed to portage.)
 .TP
+.B \-u | \-\-search\-symbols
+Searches for undefined symbols in executibles. This will most likely have false positives in the output, so it is recommended to only use this option with pretend and manually fix any legitimate issues found. \fBNote:\fR This is currently only implemented in revdep-rebuild.sh, it is not implemented in revdep-rebuild.py.
+.TP
 .B \-v | \-\-verbose
 More output.  (Prints the revdep\-rebuild search environment.)
 .TP


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

end of thread, other threads:[~2014-11-11 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 22:38 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: man/, bin/ Paul Varner
  -- strict thread matches above, loose matches on Subject: below --
2014-11-11 16:36 Paul Varner
2013-01-14 22:50 Paul Varner
2012-04-26  3:33 Paul Varner

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