diff --git a/apt-cyg b/apt-cyg index abc497b..48c6f3e 100755 --- a/apt-cyg +++ b/apt-cyg @@ -44,6 +44,7 @@ function usage () { ' update update setup.ini' ' list [patterns] list packages matching given pattern. If no' ' pattern is given, list all installed packages.' + ' listfiles list files owned by packages' ' show Displays the package records for the named' ' packages' ' rdepends Display packages which require X to be installed,' @@ -121,9 +122,11 @@ function getsetup() function checkpackages() { - (( ${#packages} )) && return - echo Nothing to do, exiting - exit + if (( ! ${#packages} )) + then + echo Nothing to do, exiting + exit + fi } # process options @@ -175,7 +178,12 @@ do shift ;; - update | list | show | rdepends | search | searchall | install | remove) + update) + command=$1 + shift + ;; + + list | listfiles | show | rdepends | search | searchall | install | remove) if (( ${#command} )) then packages+=" $1" @@ -214,7 +222,6 @@ case "$command" in list) if (( ${#packages} )) then - checkpackages findworkspace for pkg in $packages do @@ -231,6 +238,21 @@ case "$command" in fi ;; + listfiles) + checkpackages + for pkg in $packages + do + if [ -e /etc/setup/"$pkg".lst.gz ] + then + gzip -cd /etc/setup/"$pkg".lst.gz + else + echo package $pkg is not installed + fi + echo + done | + head -c-1 + ;; + show) checkpackages findworkspace