From 0e9010a41e4cb658403bc21226bf985fe21b8907 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 13 Oct 2008 05:50:40 +0200 Subject: [PATCH] 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. --- pkgfs.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkgfs.sh b/pkgfs.sh index d83b486..01d5cf0 100755 --- a/pkgfs.sh +++ b/pkgfs.sh @@ -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 . stow Create links in master directory. unstow Remove links in master directory. @@ -1181,6 +1182,28 @@ list_pkgs() } # +# 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). # remove_pkg() @@ -1414,6 +1437,9 @@ install) list) list_pkgs ;; +listfiles) + list_pkg_files $2 + ;; remove) remove_pkg $2 ;; -- 2.11.4.GIT