From: Ian Kelling Date: Thu, 13 Apr 2017 10:01:06 +0000 (-0700) Subject: be amenable to systems without aptitude X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=29a9cf3a392bc7229a332c136b9ea7d4b70b53f2;p=distro-functions be amenable to systems without aptitude --- diff --git a/src/package-manager-abstractions b/src/package-manager-abstractions index 20dbc05..6936c92 100644 --- a/src/package-manager-abstractions +++ b/src/package-manager-abstractions @@ -105,7 +105,11 @@ EOF } # package info pl() { - aptitude show "$@" + if type -p aptitude &>/dev/null; then + aptitude show "$@" + else + apt-cache show "$@" + fi } pfile() { local file=$1 @@ -115,8 +119,8 @@ EOF # package name. So, commenting this, waiting to find # a config file only tracked by ucfq to see if it gives the # package name and if I can identify this kind of file. -# if [[ $file == /* ]] && ! ucfq -w $file | grep ::: &>/dev/null; then -# ucfq $file + # if [[ $file == /* ]] && ! ucfq -w $file | grep ::: &>/dev/null; then + # ucfq $file if [[ $file == */* ]]; then apt-file find -x "$file"\$