diff --git a/utils/xbps-pkgdb.c b/utils/xbps-pkgdb.c index d89228b81a5..339bd8c45a7 100644 --- a/utils/xbps-pkgdb.c +++ b/utils/xbps-pkgdb.c @@ -193,11 +193,8 @@ main(int argc, char **argv) exit(1); } obj = prop_dictionary_get(dbdict, argv[2]); - if (obj == NULL) { - printf("=> ERROR: package `%s' not registered in database.\n", - argv[2]); + if (obj == NULL) exit(1); - } printf("%s\n", prop_string_cstring_nocopy(obj)); } else { diff --git a/xbps.sh b/xbps.sh index 385baec3aa9..b12284b8ebf 100755 --- a/xbps.sh +++ b/xbps.sh @@ -1164,16 +1164,10 @@ check_installed_pkg() run_file $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}.tmpl fi - $XBPS_PKGDB_CMD installed $pkgname - if [ $? -eq 0 ]; then - # - # Package is installed, let's check the version. - # - iver="$($XBPS_PKGDB_CMD version $pkgname)" - if [ -n "$iver" ]; then - $XBPS_CMPVER_CMD $pkgname-$iver $pkgname-$reqver - [ $? -eq 0 ] && return 0 - fi + iver="$($XBPS_PKGDB_CMD version $pkgname)" + if [ -n "$iver" ]; then + $XBPS_CMPVER_CMD $pkgname-$iver $pkgname-$reqver + [ $? -eq 0 ] && return 0 fi return 1