listfiles command

This is similar to the "dpkg --listfiles" command.
This commit is contained in:
Steven Penny 2014-05-05 01:22:54 -05:00
parent 97ae776f82
commit 1cfa858ac0
1 changed files with 27 additions and 5 deletions

32
apt-cyg
View File

@ -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 <packages> list files owned by packages'
' show <packages> Displays the package records for the named'
' packages'
' rdepends <patterns> 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