[aur-general] changing the status of the maintainer field

Abhishek Dasgupta abhidg at gmail.com
Sat May 23 00:58:08 EDT 2009


2009/5/23 Angel Velásquez <angvp at archlinux.com.ve>:
> But now talking about the topic, you can also set the "Maintainer"
> flag with an env var and adding it to the .PKGINFO (I thought Andrei
> Thorp suggested this anyway) and past maintainers can be parsed in
> another .PKGINFO Field. This will need modifications of the makepkg
> script (and adding this to pacman in the -i option), but I think this
> is a good solution, for having the *actual* maintainer with -Qi or
> -Si.
>

Adding the Maintainer field to .PKGINFO has a few problems:
- This makes this quite complicated, needing changes to both makepkg
  and pacman.
- The information gets outdated and there should be only _one_ easily
  accessible information source about the current maintainer which is
  retrievable by scripts. For example, if you build a package which is not
  updated often; and after a few months you orphan it and it's picked up
  by someone else, it will not be visible to the user when the user does
  a pacman -Qi; that's why it's better IMO to keep this sort of information
  only in the PKGBUILDs.

Of course, as Allan said, there might not be enough motivation to change
the maintainer field in the PKGBUILD if one wishes to adopt a new package.
I suppose though, that it would be easy to write a script to do such things
automatically. Assuming we have one maintainer for each package, this
script (not fully fleshed out, but you get the idea) should work:

#!/bin/sh
# adopt: adopt a package from the repositories

# Change this to wherever you keep your full/partial SVN checkout.

if [!  -f /etc/makepkg.conf ]; then
  echo "adopt: no makepkg.conf found!"
  exit 1
fi

source /etc/makepkg.conf
if [ -z $MAINTAINER ]; then
  echo "adopt: Please set the MAINTAINER variable in /etc/makepkg.conf"
  exit 1
fi

if [ -z "$SVNROOT" ]; then
  echo "adopt: Please set the SVNROOT variable in /etc/makepkg.conf"
  exit 1
fi

if [ -z "$1" ]; then
  echo "Syntax: adopt pkgname"
  exit 1
fi

pkgname="$1"

if [ ! -d "$SVNROOT/$pkgname" ]
  echo "adopt: no package $pkgname in $SVNROOT"
  exit 1
fi

pushd "$SVNROOT/$pkgname" > /dev/null

if [ ! -f PKGBUILD ]; then
 echo "adopt: $pkgname exists, but no PKGBUILD."
fi

sed -i "/^maintainer.*/d" PKGBUILD
echo "maintainer=($MAINTAINER)" >> PKGBUILD

svn commit -m "changed maintainer to $MAINTAINER"
# probably give a check to see if uname of svn user same as $MAINTAINER

echo "adopted $pkgname"
popd > /dev/null

# EOF

A small note: I'm using makepkg.conf here but MAINTAINER and
SVNROOT could be put in some other configuration file as well.

Finally after setting all this up; adopting should become as easy as:
$ adopt pkg
pkg adopted

That's it! All the manual work is hidden away in this script.

Of course, all that is really needed is an easy way of getting the current
maintainers. I'll work on adding some kind of API to the web interface
to output the maintainer name given an URI like this:
http://archlinux.org/packages/core/i686/bash/maintainer

-- 
Abhishek


More information about the aur-general mailing list