suppress egrep output, skip sbuild-build-depends packages and strip off arch qualifier later

This commit is contained in:
josch 2014-07-10 16:20:09 +02:00
parent eae12b8c60
commit 24b88174a4

View file

@ -15,25 +15,28 @@ get_metaset() {
if apt-cache show --no-all-versions "${name}=${ver}" \ if apt-cache show --no-all-versions "${name}=${ver}" \
| grep-dctrl -P "" -s Tag -n \ | grep-dctrl -P "" -s Tag -n \
| sed 's/, /\n/g; s/[, ]//g;' \ | sed 's/, /\n/g; s/[, ]//g;' \
| egrep '^(role::metapackage|role::dummy)$'; then | egrep '^(role::metapackage|role::dummy)$' \
> /dev/null; then
ismeta="yes" ismeta="yes"
fi fi
fi fi
# check if there is any regular file in the package besides /usr/share/doc # check if there is any regular file in the package besides /usr/share/doc
if [ $ismeta = "no" ]; then if [ $ismeta = "no" ]; then
apt-get download "${name}=${ver}" > /dev/null apt-get download "${name}=${ver}" > /dev/null
mkdir "$name" # strip off architecture qualifier
pkgname=`echo $name | cut -d ':' -f 1`
mkdir "$pkgname"
# we cannot include the version here because apt urlencodes the : character # we cannot include the version here because apt urlencodes the : character
dpkg --extract ${name}_*.deb $name dpkg --extract ${pkgname}_*.deb $pkgname
if [ -d ${name}/usr/share/doc ]; then if [ -d ${pkgname}/usr/share/doc ]; then
rm -r ${name}/usr/share/doc rm -r ${pkgname}/usr/share/doc
fi fi
# check if besides /usr/share/doc there is any regular file # check if besides /usr/share/doc there is any regular file
# in this package (symlinks do not count) # in this package (symlinks do not count)
if [ `find $name -type f | wc -l` -eq 0 ]; then if [ `find $pkgname -type f | wc -l` -eq 0 ]; then
ismeta="yes" ismeta="yes"
fi fi
rm -r ${name}_${ver}_*.deb $name rm -r ${pkgname}_*.deb $pkgname
fi fi
if [ $ismeta = "yes" ]; then if [ $ismeta = "yes" ]; then
# retrieve all its unversioned dependencies # retrieve all its unversioned dependencies
@ -93,9 +96,12 @@ elif [ "$#" -eq 2 ]; then
# output the files belonging to all packages # output the files belonging to all packages
dpkg --list | awk '$1 == "ii" { print $2, $3 }' | while read namever; do dpkg --list | awk '$1 == "ii" { print $2, $3 }' | while read namever; do
set -- $namever set -- $namever
# strip off architecture qualifier name=$1
name=`echo $1 | cut -d ':' -f 1`
ver=$2 ver=$2
# skip all sbuild dummy packages
case $name in
sbuild-build-depends*) continue;;
esac
if grep --line-regexp "${name}=${ver}" "${tmpdir}/bdselection.list"; then if grep --line-regexp "${name}=${ver}" "${tmpdir}/bdselection.list"; then
# if the package contains no other files than in /usr/share/doc # if the package contains no other files than in /usr/share/doc
# or if all the other files are symlinks # or if all the other files are symlinks