listfiles command
This is similar to the "dpkg --listfiles" command.
This commit is contained in:
parent
97ae776f82
commit
1cfa858ac0
32
apt-cyg
32
apt-cyg
|
@ -44,6 +44,7 @@ function usage () {
|
||||||
' update update setup.ini'
|
' update update setup.ini'
|
||||||
' list [patterns] list packages matching given pattern. If no'
|
' list [patterns] list packages matching given pattern. If no'
|
||||||
' pattern is given, list all installed packages.'
|
' pattern is given, list all installed packages.'
|
||||||
|
' listfiles <packages> list files owned by packages'
|
||||||
' show <packages> Displays the package records for the named'
|
' show <packages> Displays the package records for the named'
|
||||||
' packages'
|
' packages'
|
||||||
' rdepends <patterns> Display packages which require X to be installed,'
|
' rdepends <patterns> Display packages which require X to be installed,'
|
||||||
|
@ -121,9 +122,11 @@ function getsetup()
|
||||||
|
|
||||||
function checkpackages()
|
function checkpackages()
|
||||||
{
|
{
|
||||||
(( ${#packages} )) && return
|
if (( ! ${#packages} ))
|
||||||
echo Nothing to do, exiting
|
then
|
||||||
exit
|
echo Nothing to do, exiting
|
||||||
|
exit
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# process options
|
# process options
|
||||||
|
@ -175,7 +178,12 @@ do
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
update | list | show | rdepends | search | searchall | install | remove)
|
update)
|
||||||
|
command=$1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
list | listfiles | show | rdepends | search | searchall | install | remove)
|
||||||
if (( ${#command} ))
|
if (( ${#command} ))
|
||||||
then
|
then
|
||||||
packages+=" $1"
|
packages+=" $1"
|
||||||
|
@ -214,7 +222,6 @@ case "$command" in
|
||||||
list)
|
list)
|
||||||
if (( ${#packages} ))
|
if (( ${#packages} ))
|
||||||
then
|
then
|
||||||
checkpackages
|
|
||||||
findworkspace
|
findworkspace
|
||||||
for pkg in $packages
|
for pkg in $packages
|
||||||
do
|
do
|
||||||
|
@ -231,6 +238,21 @@ case "$command" in
|
||||||
fi
|
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)
|
show)
|
||||||
checkpackages
|
checkpackages
|
||||||
findworkspace
|
findworkspace
|
||||||
|
|
Loading…
Reference in New Issue