Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rpg-manifest lists files with abbreviated base paths unless -a given
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Apr 26, 2010
1 parent 7530a7b commit 3a789b4
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions rpg-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,31 @@ set -e
. rpg-sh-setup

[ "$*" ] || set -- --help; ARGV="$@"
USAGE '${PROGNAME} <package>...
Show files installed for packages.'
USAGE '${PROGNAME} [-a] <package>...
Show files installed for packages.
Options
-a Show absolute paths to files instead of abbreviating.'

abbreviate () {
sed "
s|^$RPGLIB/|lib/|
s|^$RPGBIN/|bin/|
s|^$RPGMAN/|man/|
"
}

if test "$1" = '-a'
then filter='cat'
shift
else filter='abbreviate'
fi

for package in "$@"
do
packagedir="$RPGDB/$package/active"
if test -d "$packagedir"
then cat "$packagedir/manifest"
else warn "package not installed: $package"
exit 1
then $filter < "$packagedir/manifest"
else die "package not installed: $package"
fi
done

0 comments on commit 3a789b4

Please sign in to comment.