pkgfs.sh: add a new target 'listfiles'.

This target lists the files (sorted) installed by a package.
Please note that package must be available in destdir and that
you must specify pkgname-version as argument.

--HG--
extra : convert_revision : 0e9010a41e4cb658403bc21226bf985fe21b8907
This commit is contained in:
Juan RP 2008-10-13 05:50:40 +02:00
parent aa35ce692a
commit 6a5e9b27c8
1 changed files with 26 additions and 0 deletions

View File

@ -100,6 +100,7 @@ Targets:
install Same than \`install-destdir´ but also stows package.
list Lists all currently \`stowned´ packages.
remove Remove package completely (unstow + remove data)
listfiles Lists files installed from <package_name>.
stow Create links in master directory.
unstow Remove links in master directory.
@ -1180,6 +1181,28 @@ list_pkgs()
done
}
#
# Lists files installed by a package.
#
list_pkg_files()
{
local pkg="$1"
if [ -z $pkg ]; then
echo "*** ERROR: unexistent package, aborting ***"
exit 1
fi
if [ ! -d "$PKGFS_DESTDIR/$pkg" ]; then
echo "*** ERROR: cannot find \`$pkg' in $PKGFS_DESTDIR ***"
exit 1
fi
for f in $($find_cmd $PKGFS_DESTDIR/$pkg -type f -print | sort -u); do
echo "${f##$PKGFS_DESTDIR/$pkg/}"
done
}
#
# Removes a currently installed package (unstow + removed from destdir).
#
@ -1414,6 +1437,9 @@ install)
list)
list_pkgs
;;
listfiles)
list_pkg_files $2
;;
remove)
remove_pkg $2
;;