From ecad518a07155c1942af3d1644423fb285fbc844 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 9 Dec 2008 16:53:06 +0100 Subject: [PATCH] No longer need to specify version for 'listfiles' target. While here improve previous commit too. --HG-- extra : convert_revision : 435009e7dc55d74f08cc57fc6f78deea0fcb3f39 --- xbps.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xbps.sh b/xbps.sh index a73d9379ad..01e0c0cdd3 100755 --- a/xbps.sh +++ b/xbps.sh @@ -1260,15 +1260,18 @@ install_pkg() list_pkg_files() { local pkg="$1" - local f="$XBPS_DESTDIR/$pkg/.xbps-filelist" + local ver= [ -z $pkg ] && msg_error "unexistent package, aborting." - if [ ! -d "$XBPS_DESTDIR/$pkg" ]; then + ver=$($XBPS_PKGDB_CMD version $pkg) + [ -z "$ver" ] && msg_error "$pkg is not installed." + + if [ ! -d "$XBPS_DESTDIR/$pkg-$ver" ]; then msg_error "cannot find $pkg in $XBPS_DESTDIR." fi - cat $f|sort -u + cat $XBPS_DESTDIR/$pkg-$ver/.xbps-filelist|sort -u } # @@ -1298,6 +1301,8 @@ remove_pkg() fi ver=$($XBPS_PKGDB_CMD version $pkg) + [ -z "$ver" ] && msg_error "$pkg is not installed." + if [ ! -d "$XBPS_DESTDIR/$pkg-$ver" ]; then msg_error "cannot find package on $XBPS_DESTDIR." fi