diff -u binstats-1.08/binstats binstats-1.08/binstats --- binstats-1.08/binstats +++ binstats-1.08/binstats @@ -183,14 +183,23 @@ EXEDIR=`echo $OLDPATH | tr : ' ' | sed s:\~:$HOME:g` fi -if [ $USEMANPATH -eq 1 -a -n "ype -p manpath" ];then +if [ $USEMANPATH -eq 1 ];then MANDIR=`manpath | tr : ' '` fi if [ $USELDSOCONF -eq 1 ]; then # use /etc/ld.so.conf plus the two "trusted" locations - LDSOCONF=`cat /etc/ld.so.conf | grep -v '^#' | xargs echo` + LDSOCONF=`cat /etc/ld.so.conf | grep -v '^#' | grep -v '^include ' | xargs echo` DLIBDIR="/lib /usr/lib $LDSOCONF" + + # Handle includes in LDSOCONF + LDSOCONF_INC=`cat /etc/ld.so.conf | grep -v '^#' | grep '^include ' | sed -e 's/^include //' | xargs echo` + for file in `ls $LDSOCONF_INC 2>/dev/null`; do + if [ -e "$file" ]; then + LDSOCONF=`cat $file | grep -v '^#' | grep -v '^include ' | xargs echo` + DLIBDIR="$DLIBDIR $LDSOCONF" + fi + done fi # ID number @@ -278,6 +287,17 @@ fi } +# Abort gracefully if a file is missing +check_aborted() +{ + file=$1 + if [ ! -e "$file" ] ; then + echo "$0: Task aborted and missing temporary file ($file). Exiting. " >&2 + exit 1 + fi + return 0 +} + #----------begin program--------------- if [ $FILEOPS -gt 0 ]; then @@ -286,6 +306,8 @@ derefsymlink -s | sort | uniq | \ awk -F '/' '{ printf "%s:%s\n", $NF, $0 }' > $ETEMPA +check_aborted $ETEMPA + echo "Find duplicated executable names" # use an awk script instead of whereis later (as suggested by Preston Crow) # R=repetition, N=name, P=path @@ -299,12 +321,18 @@ END { if (R==1) {printf("%s\n",P)} }' \ > $ETEMPD +check_aborted $ETEMPD + echo "Sort out list by alphabetical order" sort -t ':' $ETEMPA | cut -d ':' -f 2- > $EXELIST +check_aborted $EXELIST + echo "Find executable type (this will take a long time)" cat $EXELIST | xargs file > $EXEFILE +check_aborted $EXEFILE + echo "Look for dynamic library dependence (this will take an even longer time)" # hmm, ldd (1.7.14) seems to output some unprintable character when it # encounters a static a.out image @@ -327,18 +355,28 @@ /not found/ { if (NEW == 1) print CURPROG; NEW = 0 }' \ $ETEMPB > $DTEMPB +check_aborted $DTEMPB + echo "Look in $DLIBDIR for dynamic libraries" find $DLIBDIR -maxdepth 1 -type f -name 'lib*.so*' | \ derefsymlink -s | sort | uniq > $DLIBLIST +check_aborted $DLIBLIST + echo "Search for unused dynamic libraries" grep -v 'not found' $EXELIB | cut -d '/' -f 2- | cut -d ' ' -f 1 | \ sort | uniq | sed 's,^,/,g' > $DTEMPA +check_aborted $DTEMPA + derefsymlink -f $DTEMPA | sort | uniq > $DTEMPC +check_aborted $DTEMPC + diff -du $DLIBLIST $DTEMPC | grep '^-/' | cut -b 2- > $DLIBUN +check_aborted $DLIBUN + # If this is a Debian system, add the packages in too if isdebian ; then echo "Search for packages holding unused dynamic libraries" @@ -385,6 +423,8 @@ derefsymlink -s | sort | uniq | \ awk -F '/' '{ printf "%s;%s\n", $NF, $0 }' > $MTEMPA +check_aborted $MTEMPA + echo "Find duplicated man page names" sort -t ';' $MTEMPA | awk -F ';' \ 'BEGIN { R=0;N="";P="" } @@ -396,6 +436,8 @@ END { if (R==1) {printf("%s\n",P)} }' \ > $MTEMPB +check_aborted $MTEMPB + # finish messing around with files and lists of files # now work out some numbers diff -u binstats-1.08/debian/changelog binstats-1.08/debian/changelog --- binstats-1.08/debian/changelog +++ binstats-1.08/debian/changelog @@ -1,3 +1,30 @@ +binstats (1.08-9) unstable; urgency=low + + * Acknowledge NMU + * debian/control: + - Depend on bsdutils instead of bsdmainutils. Actually, remove + it completely as it is an essential package anyway (Closes: #964530) + - Add misc:Depends (lintian fix) + - Move to non-deprecated debhelper version + - Updated to latest standards version (no real changes) + - Declare Rules-Requires-Root: no + - Add Homepage (still working after ~20 years!) + * binstats: + - Remove useless comparison when adding MANPATH (Closes: #920852) + - Check if the files exist before proceeding in the script. Otherwise, if + the user sends a SIGINT (Cltr+C) to the program, tasks will be + cancelled and output is missing for the next tasks. + This also ensures that if SIGINT is sent this is handled right away. + (Closes: #693840) + - Since ld.so.conf can now include other files, go through these includes + and add the library directories that are included in there too + * debian/rules: Move to debhelper standard setup (fixes many lintian + * warnings) + * debian/compat: Move to compatibility level 13 + * debian/source/format: Declare the format used (1.0) + + -- Javier Fernández-Sanguino Peña Sun, 31 Jan 2021 18:29:29 +0100 + binstats (1.08-8.2) unstable; urgency=medium * Non-maintainer upload. @@ -51,7 +78,7 @@ * Fixed failures to find static linked executables (Closes: #124320). * Fixed outputs error message for non-existence man directory (Closes: #124323). - Thanks to Yamashita for patches :) + Thanks to Yamashita for patches :) -- Angel Ramos Tue, 8 Jan 2002 17:17:00 +0100 @@ -149,7 +176,7 @@ -- Johnie Ingram Thu, 5 Feb 1998 11:29:35 -0500 -binstats (1.00-3) unstable; urgency=low, closes=16984 +binstats (1.00-3) unstable; urgency=low * Added patch from David Rocher so it understands new-style ldd output (#16984) and counts libc6 binaries correctly. @@ -159,7 +186,7 @@ -- Johnie Ingram Thu, 5 Feb 1998 11:03:53 -0500 -binstats (1.00-2) unstable; urgency=low, closes=15437 +binstats (1.00-2) unstable; urgency=low * Debian changelog is now compressed (#15437). * Switched from debmake to debhelper packaging technology. @@ -174,4 +200,0 @@ - -Local variables: -mode: debian-changelog -End: diff -u binstats-1.08/debian/compat binstats-1.08/debian/compat --- binstats-1.08/debian/compat +++ binstats-1.08/debian/compat @@ -1 +1 @@ -9 +13 diff -u binstats-1.08/debian/control binstats-1.08/debian/control --- binstats-1.08/debian/control +++ binstats-1.08/debian/control @@ -2,12 +2,14 @@ Section: utils Priority: optional Maintainer: Javier Fernandez-Sanguino Pen~a -Standards-Version: 3.6.1 -Build-Depends: debhelper (>= 9) +Standards-Version: 4.5.0 +Build-Depends: debhelper (>= 13) +Rules-Requires-Root: no +Homepage: http://www.nottingham.ac.uk/~etzpc/binstats.html Package: binstats Architecture: all -Depends: bsdmainutils, debianutils (>= 1.13.1), file +Depends: debianutils (>= 1.13.1), file, ${misc:Depends} Description: Statistics tool for installed programs A utility to aid the tidying up of binaries, interpreted scripts, and dynamic libraries. It can find the number and identity of a.out and only in patch2: unchanged: --- binstats-1.08.orig/debian/rules.tiny +++ binstats-1.08/debian/rules.tiny @@ -0,0 +1,3 @@ +#!/usr/bin/make -f +%: + dh $@ only in patch2: unchanged: --- binstats-1.08.orig/debian/source/format +++ binstats-1.08/debian/source/format @@ -0,0 +1 @@ +1.0