No longer need to specify version for 'listfiles' target.

While here improve previous commit too.

--HG--
extra : convert_revision : 435009e7dc55d74f08cc57fc6f78deea0fcb3f39
This commit is contained in:
Juan RP 2008-12-09 16:53:06 +01:00
parent c4be9a5aba
commit ecad518a07

11
xbps.sh
View file

@ -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