diff --git a/check_packages2install b/check_packages2install index 505bf043bbee6dbc95343b69af591bb85ec2ed4e..8c8981bc835749f02c6c05268936201b0ed53d28 100755 --- a/check_packages2install +++ b/check_packages2install @@ -56,7 +56,18 @@ function _exec(){ fi } +# apply filter on incoming piped data +# filter is a param with spaced keywords that will be transformed +# to a regex +# param1 text if filter keywords (seperated by space) +function _filterPkg(){ + local _filter=$( echo $1 | tr " " "|" ) + + grep -E "^($_filter)" +} +# autodetect a package manager using which with +# a list of known pkg managers function detectPkgManager(){ local _list="apt yum pamac" local out=$( _exec "which $_list 2>/dev/null" )