X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsystem%2Flist_packages.sh;h=d7317fbb6eecfbd30e28a96789a48d2c41da8802;hb=22d4569f276f139f5aa084586b28abea96eb0c7a;hp=6b3222f18e9cffcc6ef1947d46f3fa1ff5d5a36a;hpb=c041a073fe44baafa4ebcb516c7d377d52fff054;p=feisty_meow.git diff --git a/scripts/system/list_packages.sh b/scripts/system/list_packages.sh index 6b3222f1..d7317fbb 100644 --- a/scripts/system/list_packages.sh +++ b/scripts/system/list_packages.sh @@ -1,22 +1,31 @@ #!/bin/bash -source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" +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 -i $* ' +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