![](https://secure.gravatar.com/avatar/df8330968b6df8cd1c1942c5fb4b720c.jpg?s=120&d=mm&r=g)
Author: sip Date: 2006-04-08 18:18:06 +0200 (Sat, 08 Apr 2006) New Revision: 1192 Added: tools/prt-utils/trunk/revdep tools/prt-utils/trunk/revdep.1 Modified: tools/prt-utils/trunk/CHANGES tools/prt-utils/trunk/Makefile Log: added revdep script Modified: tools/prt-utils/trunk/CHANGES =================================================================== --- tools/prt-utils/trunk/CHANGES 2006-04-08 15:58:51 UTC (rev 1191) +++ tools/prt-utils/trunk/CHANGES 2006-04-08 16:18:06 UTC (rev 1192) @@ -1,3 +1,6 @@ +0.7.1 -> XXX +- Added revdep script by Johannes Winkelmann + 0.7.0 -> 0.7.1 - Removed warnings from oldfiles Modified: tools/prt-utils/trunk/Makefile =================================================================== --- tools/prt-utils/trunk/Makefile 2006-04-08 15:58:51 UTC (rev 1191) +++ tools/prt-utils/trunk/Makefile 2006-04-08 16:18:06 UTC (rev 1192) @@ -3,7 +3,7 @@ TOOLS = prtcreate prtrej prtsweep prtcheck prtwash pkgexport pkgsize \ prtorphan prtcheckmissing oldfiles finddeps dllist \ - findredundantdeps pkg_installed + findredundantdeps pkg_installed revdeps PREFIX = /usr MANDIR = $(PREFIX)/man Added: tools/prt-utils/trunk/revdep =================================================================== --- tools/prt-utils/trunk/revdep (rev 0) +++ tools/prt-utils/trunk/revdep 2006-04-08 16:18:06 UTC (rev 1192) @@ -0,0 +1,65 @@ +#!/bin/bash +# check linkage +# Johannes Winkelmann, jw at tks6 dot net + +# Usage: +# +# Formatted listing: +# RD_VERBOSE=1 ./revdep +# Include errorous files: +# RD_VERBOSE=2 ./revdep +# +# Pure list to be used as input to prt-get update +# ./revdep +# +# With an optional argument, only that port is checked + +check_linking() { + # set -x + err=0 + + files="`awk -v p="^$1\n" 'BEGIN {RS="";}; $0 ~ p {print}' /var/lib/pkg/db`" + for f in $files; do + if [ -f "/$f" ]; then + file -b "/$f" |grep -q 'shared' + if [ $? -eq 0 ]; then + ldd "/$f" 2> /dev/null |grep "not found" &> /dev/null + if [ $? -eq 0 ]; then + [ "$RD_VERBOSE" = "2" ] && echo " Error in: /$f" + err=1 + fi + fi + fi + done + + return $err +} + +[ -n "$RD_VERBOSE" ] && echo "** calculating deps" + +if [ -z "$1" ]; then + ports=(`pkginfo -i|awk '{print $1}'`) + [ -n "$RD_VERBOSE" ] && echo "** Checking ${#ports[*]} ports" +else + ports=($@) +fi + +[ -n "$RD_VERBOSE" ] && echo "** check linking" +for d in ${ports[*]}; do + if [ -n "$RD_VERBOSE" ]; then + echo -n "$d: " + fi + check_linking $d + + if [ $? -ne 0 ]; then + if [ -n "$RD_VERBOSE" ]; then + echo error + else + echo $d + fi + else + if [ -n "$RD_VERBOSE" ]; then + echo ok + fi + fi +done Property changes on: tools/prt-utils/trunk/revdep ___________________________________________________________________ Name: svn:executable + * Added: tools/prt-utils/trunk/revdep.1 =================================================================== --- tools/prt-utils/trunk/revdep.1 (rev 0) +++ tools/prt-utils/trunk/revdep.1 2006-04-08 16:18:06 UTC (rev 1192) @@ -0,0 +1,46 @@ +." Text automatically generated by txt2man-1.4.7 +.TH revdep 1 "April 08, 2006" "" "" +.SH NAME +\fBrevdep \fP- check package linkage +\fB +.SH SYNOPSIS +.nf +.fam C +\fBrevdep\fP [\fIpackagename\fP] +.fam T +.fi +.SH DESCRIPTION +Revdep checks for missing / wrong libraries of +installed packages using \fBldd\fP(1). +.SH OPTIONS +\fBrevdep\fP verbosity can be adjusted with the RD_VERBOSE +environment varable. Valid values are empty, '1' and '2' +.SH EXAMPLES +Formatted listing: +.PP +.nf +.fam C + RD_VERBOSE=1 revdep + +.fam T +.fi +Include errorous files: +.PP +.nf +.fam C + RD_VERBOSE=2 revdep + +.fam T +.fi +Pure list to be used as input to prt-get update +.PP +.nf +.fam C + revdep + +.fam T +.fi +.SH AUTHORS +Johannes Winkelmann <jw@tks6.net> +.SH SEE ALSO +\fBpkginfo\fP(8), \fBprt-get\fP(8)