mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-31 12:51:07 +00:00
Improvements to reverse-build-depends.
This commit is contained in:
parent
d6ba86bf51
commit
fc04d1c7e9
@ -7,7 +7,10 @@
|
|||||||
# that a package has.
|
# that a package has.
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [-c] <package name>"
|
echo "Usage: $0 [-c|-s] <package name>"
|
||||||
|
echo "Options:"
|
||||||
|
echo " -c: Print only the number of reverse dependencies."
|
||||||
|
echo " -s: Print all reverse dependencies in a single line."
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$1" = '-c' ]
|
if [ "$1" = '-c' ]
|
||||||
@ -16,6 +19,12 @@ then
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = '-s' ]
|
||||||
|
then
|
||||||
|
single_line=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $# -ne 1 ];
|
if [ $# -ne 1 ];
|
||||||
then
|
then
|
||||||
usage
|
usage
|
||||||
@ -32,9 +41,14 @@ result=$(
|
|||||||
grep-dctrl -sPackage -F Build-Depends,Build-Depends-Indep $1 \
|
grep-dctrl -sPackage -F Build-Depends,Build-Depends-Indep $1 \
|
||||||
/var/lib/apt/lists/*Sources | cut -d ' ' -f 2)
|
/var/lib/apt/lists/*Sources | cut -d ' ' -f 2)
|
||||||
|
|
||||||
if [ -z $count ]
|
if [ -z $count ] && [ -z $single_line ]
|
||||||
then
|
then
|
||||||
echo $result
|
echo "$result"
|
||||||
else
|
else
|
||||||
echo $result | wc -w
|
if [ -z $count ]
|
||||||
|
then
|
||||||
|
echo $result
|
||||||
|
else
|
||||||
|
echo "$result" | wc -l
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user