mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-16 04:41:09 +00:00
Updated to Lutin's last version and made it also work from the debian/ dir.
This commit is contained in:
parent
ad592fb64f
commit
6c3e88e77b
@ -4,40 +4,51 @@
|
||||
#written and (c) 2007 by Albin Tonnerre <lut1n.tne@gmail.com> (Lutin)
|
||||
#this code is under the GNU GPL V2 licence
|
||||
|
||||
( [ ! -f "$PWD/debian/changelog" ] || [ ! -f "$PWD/debian/control" ] ) && echo "Please run that script in the source folder" >&2 && exit 1
|
||||
[ -n "`echo $1 | sed -r 's/(--help|universe|multiverse|main|restricted)//'`" ]\
|
||||
&& echo "Bad parameter, please use --help" >&2 && exit 1
|
||||
|
||||
IGNORE_MAINTAINER="lamont@debian.org q-funk@iki.fi cjwatson@debian.org"
|
||||
IGNORE_DOMAINS="ubuntu\.com|canonical\.com|ubuntu\.com\.au"
|
||||
[ "$1" == --help ] && echo "Launch this script without any option or with the section as the only parameter (if the package is not yet in the archive or if you don't have the feisty source repo in your sources.list)" && exit 0
|
||||
|
||||
[ -n "`head -n 1 debian/changelog | grep -E "\(*ubuntu.*\)"`" ] &&
|
||||
[ -z "`grep -E "^Maintainer: .*($IGNORE_DOMAINS)>" debian/control`" ] || \
|
||||
( echo "Not an ubuntu package or already maintained by the ubuntu team" >&2 && exit 1 )
|
||||
# look for the debian directory
|
||||
if [ -f debian/control -a -f debian/changelog ]; then
|
||||
DEBIANDIR=debian
|
||||
elif [ -f control -a -f changelog ]; then
|
||||
DEBIANDIR=.
|
||||
else
|
||||
echo "Please run that script in the source folder" >&2 && exit 1
|
||||
fi
|
||||
|
||||
mail=$(grep -E "^Maintainer" debian/control | sed -r 's/.*<(.*)>/\1/')
|
||||
for maint in $IGNORE_MAINTAINER; do [ "$maint" = "$mail" ] && echo \
|
||||
"Maintainer is in the ignore list" >&2 && exit 1; done
|
||||
IGNORE_DOMAINS="ubuntu\.com|ubuntu\.com\.au"
|
||||
|
||||
[ -n "`head -n 1 $DEBIANDIR/changelog | grep -E "\(*ubuntu.*\)"`" ] &&
|
||||
[ -z "`grep -E "^Maintainer: .*($IGNORE_DOMAINS)>" $DEBIANDIR/control`" ] || \
|
||||
{ echo "Not an ubuntu package or already maintained by the ubuntu team" >&2 && \
|
||||
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
|
||||
DISTRO=$(head -n 1 debian/changelog|sed -r 's/.*\) (.*);.*/\1/' | cut -d'-' -f1)
|
||||
pkgline=$(apt-cache madison `head -n 1 debian/changelog | cut -d' ' -f1` |\
|
||||
grep -m 1 "$DISTRO.*Sources")
|
||||
[ -z "$pkgline" ] && echo "You don't have $DISTRO in your source repos" >&2\
|
||||
&& exit 1
|
||||
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted")
|
||||
if [ -z "$1" ]; then
|
||||
DISTRO=$(head -n 1 $DEBIANDIR/changelog|sed -r 's/.*\) (.*);.*/\1/' | cut -d'-' -f1)
|
||||
pkgline=$(apt-cache madison `head -n 1 $DEBIANDIR/changelog | cut -d' ' -f1`|\
|
||||
grep -m 1 "$DISTRO.*Sources")
|
||||
[ -z "$pkgline" ] && echo "You don't have $DISTRO in your source repos" \
|
||||
>&2 && exit 1
|
||||
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted")
|
||||
else section=$1; fi
|
||||
case $section in
|
||||
"main"|"restricted") email="Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>" ;;
|
||||
"universe"|"multiverse") email="Ubuntu MOTU Developers <ubuntu-motu@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>" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
sed -ri "s/(^Maintainer:) (.*)/\1 $email\nX-Original-\1 \2/" debian/control
|
||||
[ -f debian/control.in ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nX-Original-\1 \2/" debian/control.in
|
||||
sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control
|
||||
[ -f $DEBIANDIR/control.in ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control.in
|
||||
|
||||
dch Modified Maintainer value to match Debian-Maintainer-Field Spec
|
||||
dch "Modified Maintainer value to match Debian-Maintainer-Field Spec"
|
||||
echo "Maintainer changed to $email"
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user