mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-06-07 05:51:29 +00:00
check-symbols: Use optparse to display --help
This commit is contained in:
parent
b26dbaee68
commit
d69622fa9c
@ -29,21 +29,55 @@
|
|||||||
# * nm (from binutils)
|
# * nm (from binutils)
|
||||||
|
|
||||||
DISTRO=$(lsb_release -c -s)
|
DISTRO=$(lsb_release -c -s)
|
||||||
VERSION=$(apt-cache madison "$1" | grep -- "$DISTRO"'/.*Sources$' | awk '{print $3}')
|
|
||||||
PACKAGES=$(apt-cache showsrc "$1" | grep-dctrl -s Binary -F Version "$VERSION" | sed 's/Binary\:\ //g;s/\,//g' | sort -u)
|
|
||||||
DEBLINE=""
|
DEBLINE=""
|
||||||
DEBUG=False
|
DEBUG=False
|
||||||
|
|
||||||
if [[ -z $1 ]]; then
|
usage() {
|
||||||
echo "Missing argument: source package name."
|
prog=$(basename $0)
|
||||||
exit 1
|
cat <<EOF
|
||||||
|
Usage: $prog [options] source-package [DEBDIR]
|
||||||
|
|
||||||
|
Get a diff of the exported symbols of all .so files in every binary package of
|
||||||
|
package the source package. The source package will be found in DEBDIR, defaulting to /var/cache/pbuilder/result.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
EOF
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
PACKAGE=""
|
||||||
|
DEBDIR="/var/cache/pbuilder/result"
|
||||||
|
POSITION=0
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-h|--help)
|
||||||
|
usage 0
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
usage 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ $POSITION -eq 0 ]; then
|
||||||
|
PACKAGE="$1"
|
||||||
|
elif [ $POSITION -eq 1 ]; then
|
||||||
|
DEBDIR="$1"
|
||||||
|
else
|
||||||
|
echo "Too many arguments." >&2
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
POSITION=$(($POSITION+1))
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $POSITION -eq 0 ]; then
|
||||||
|
echo "Missing argument: source package name." >&2
|
||||||
|
usage 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $2 ]]; then
|
VERSION=$(apt-cache madison "$PACKAGE" | grep -- "$DISTRO"'/.*Sources$' | awk '{print $3}')
|
||||||
DEBDIR="/var/cache/pbuilder/result"
|
PACKAGES=$(apt-cache showsrc "$PACKAGE" | grep-dctrl -s Binary -F Version "$VERSION" | sed 's/Binary\:\ //g;s/\,//g' | sort -u)
|
||||||
else
|
|
||||||
DEBDIR="$2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ `id -u` != "0" ]
|
if [ `id -u` != "0" ]
|
||||||
then
|
then
|
||||||
@ -67,7 +101,7 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ -z $DEBLINE ]]; then
|
if [[ -z $DEBLINE ]]; then
|
||||||
echo "Package doesn't exist: $1."
|
echo "Package doesn't exist: $PACKAGE."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -3,7 +3,8 @@ ubuntu-dev-tools (0.142) UNRELEASED; urgency=low
|
|||||||
* mk-sbuild: Support kmod, when checking for overlayfs availability.
|
* mk-sbuild: Support kmod, when checking for overlayfs availability.
|
||||||
* pbuilder-dist: improve bash_completion for *.dsc files. Thanks Maarten
|
* pbuilder-dist: improve bash_completion for *.dsc files. Thanks Maarten
|
||||||
Bezemer. (Closes: #670924, LP: #770529)
|
Bezemer. (Closes: #670924, LP: #770529)
|
||||||
* submittodebian, check-mir: Use optparse to display --help (LP: #988009)
|
* submittodebian, check-mir, check-symbols: Do enough argument parsing to
|
||||||
|
handle --help (LP: #988009)
|
||||||
|
|
||||||
-- Stefano Rivera <stefanor@debian.org> Wed, 25 Apr 2012 17:38:58 +0200
|
-- Stefano Rivera <stefanor@debian.org> Wed, 25 Apr 2012 17:38:58 +0200
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ from ubuntutools import subprocess
|
|||||||
from ubuntutools.test import unittest
|
from ubuntutools.test import unittest
|
||||||
|
|
||||||
BLACKLIST = {
|
BLACKLIST = {
|
||||||
'check-symbols': 'No Help',
|
|
||||||
'grep-merges': 'No Help',
|
'grep-merges': 'No Help',
|
||||||
'pbuilder-dist-simple': 'No Help',
|
'pbuilder-dist-simple': 'No Help',
|
||||||
'setup-packaging-environment': 'Throws Error',
|
'setup-packaging-environment': 'Throws Error',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user