X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsystem%2Flist_packages.sh;h=0a52aa64d380b77dd9f2b4cf166924f97db32665;hb=1d182878032cd9bf00ae3a33970a11e80ecb711a;hp=b4b030c2305e0f2d6a422f3da148aad5f26342ae;hpb=7b39f7e279005c8466ef508220a532ce2aa4abf8;p=feisty_meow.git diff --git a/scripts/system/list_packages.sh b/scripts/system/list_packages.sh index b4b030c2..0a52aa64 100644 --- a/scripts/system/list_packages.sh +++ b/scripts/system/list_packages.sh @@ -2,21 +2,30 @@ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +if [ -z "$*" ]; then + # no parameters, so we do a wildcard style of listing packages. + SEEK_PIECE=' cat ' +else + # we know the parameters are not empty, so we don't go with our + # wildcard approach for listing the package names. + SEEK_PIECE=' grep $* ' +fi + if debian_like; then - dpkg -la | grep $* + dpkg -la | eval $SEEK_PIECE exit $? fi -rpm_available="$(which rpm)" +rpm_available="$(whichable rpm)" if [ ! -z "$rpm_available" ]; then #is that the right phrase for rpm? somewhat forgotten. - rpm -qa | grep $* + rpm -qa | eval $SEEK_PIECE exit $? fi -yum_available="$(which yum)" +yum_available="$(whichable yum)" if [ ! -z "$yum_available" ]; then - yum list | grep $* + yum list | eval $SEEK_PIECE exit $? fi