mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 09:31:08 +00:00
Remove unneeded part. some small improvements
This commit is contained in:
parent
f5e5b02534
commit
11e26cdb19
@ -5,10 +5,9 @@
|
|||||||
# This script is used to update the maintainer field of an Ubuntu package
|
# This script is used to update the maintainer field of an Ubuntu package
|
||||||
# to match the DebianMaintainerField specification.
|
# to match the DebianMaintainerField specification.
|
||||||
|
|
||||||
if [ ${#@} -ge 1 ]; then
|
|
||||||
for argv in "$@"; do
|
for argv in "$@"; do
|
||||||
param=`echo $argv | cut -d'=' -f1`
|
param=${argv%=*}
|
||||||
value=`echo $argv | cut -d'=' -f2`
|
value=${argv#*=}
|
||||||
case $param in
|
case $param in
|
||||||
"--path") path="$value" ;;
|
"--path") path="$value" ;;
|
||||||
"--section") section=$value ;;
|
"--section") section=$value ;;
|
||||||
@ -16,7 +15,6 @@ if [ ${#@} -ge 1 ]; then
|
|||||||
*) echo "Bad parameter, please use --help" >&2; exit 1 ;;
|
*) echo "Bad parameter, please use --help" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
cd ${path-.}
|
cd ${path-.}
|
||||||
|
|
||||||
@ -29,36 +27,30 @@ else
|
|||||||
echo "Please execute «$0» in the source folder." >&2 && exit 1
|
echo "Please execute «$0» in the source folder." >&2 && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IGNORE_DOMAINS="ubuntu\.com|ubuntu\.com\.au"
|
[ -n "$(head -1 $DEBIANDIR/changelog | grep -E '\(*ubuntu.*\)')" ] &&
|
||||||
|
! grep -E "^Maintainer: .*@.*ubuntu.*>" $DEBIANDIR/control >/dev/null || \
|
||||||
[ -n "`head -n 1 $DEBIANDIR/changelog | grep -E "\(*ubuntu.*\)"`" ] &&
|
{ echo "Not an Ubuntu package or already maintained by the Ubuntu team." >&2; \
|
||||||
[ -z "`grep -E "^Maintainer: .*($IGNORE_DOMAINS)>" $DEBIANDIR/control`" ] || \
|
|
||||||
{ echo "Not an Ubuntu package or already maintained by the Ubuntu team." >&2 && \
|
|
||||||
exit 1; }
|
exit 1; }
|
||||||
|
|
||||||
mail=$(grep -E "^Maintainer" $DEBIANDIR/control | sed -r 's/.*<(.*)>/\1/')
|
|
||||||
case $mail in
|
|
||||||
"adconrad@0c3.net") email="Adam Conrad <adconrad@ubuntu.com>" ;;
|
|
||||||
"mpitt@debian.org") email="Martin Pitt <martin.pitt@ubuntu.com>" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -z "$email" ]; then
|
|
||||||
if [ -z "$section" ]; then
|
if [ -z "$section" ]; then
|
||||||
DISTRO=$(head -n 1 $DEBIANDIR/changelog|sed -r 's/.*\) (.*);.*/\1/' | cut -d'-' -f1)
|
DISTRO=$(sed -r '1!d;s/.*\) (.*);.*/\1/' $DEBIANDIR/changelog|cut -d'-' -f1)
|
||||||
pkgline=$(apt-cache madison `head -n 1 $DEBIANDIR/changelog | cut -d' ' \
|
pkgline=$(apt-cache madison $(head -1 $DEBIANDIR/changelog| cut -d' ' -f1)|\
|
||||||
-f1`| grep -m 1 "$DISTRO.*Sources")
|
grep -m 1 "$DISTRO.*Sources")
|
||||||
[ -z "$pkgline" ] && echo "You don't have $DISTRO in your source repos." \
|
if [ -z "$pkgline" ]; then
|
||||||
>&2 && exit 1
|
echo "You don't have $DISTRO in your source repos." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted")
|
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted")
|
||||||
fi
|
fi
|
||||||
case $section in
|
case $section in
|
||||||
"main"|"restricted") email="Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>" ;;
|
"main"|"restricted") email="Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>" ;;
|
||||||
"universe"|"multiverse") email="Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>" ;;
|
"universe"|"multiverse") email="Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>" ;;
|
||||||
|
*) echo "No section found for this package; aborting" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control
|
for file in control{,.in,.real}; do
|
||||||
[ -f $DEBIANDIR/control.in ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control.in
|
[ -f $DEBIANDIR/$file ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/$file
|
||||||
|
done
|
||||||
|
|
||||||
dch "Modify Maintainer value to match the DebianMaintainerField specification."
|
dch "Modify Maintainer value to match the DebianMaintainerField specification."
|
||||||
echo "Maintainer changed to $email."
|
echo "Maintainer changed to $email."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user