[Mageia-sysadm] [1827] add small maintdb script

Michael Scherer misc at zarb.org
Sat Jul 16 15:25:36 CEST 2011


Le mardi 12 juillet 2011 à 01:10 +0200, root at mageia.org a écrit :

> +function maintset()
> +{
> +    checkname "$1"
> +    maintfile="$MAINTDBDIR/$1"
> +    newmaint="$2"
> +    if ! [ -f "$maintfile" ]
> +    then
> +	echo "Error: package $1 does not exist in maintdb." >&2
> +	exit 1
> +    fi
> +    curmaint=$(cat "$maintfile")

I think we could avoid using cat with $( < $maintfile )
( just because cat is evil )


> +    if [ a"$newmaint" = "anobody" ]
> +    then
> +	if [ a"$curmaint" = a"$user" ]

is the prefix still needed ?
On bash, this doesn't cause any trouble to have "$newmaint" = "nobody",
and outside old rh init script, I didn't see much people using it.


> +function maintgetall()
> +{
> +    cd "$MAINTDBDIR"
> +    for file in *

Wouldn't this one have problem the day we have too much maintainers ?
( even if "too much" is, according to my test, more than 60000 so this
is just a retorical question )

-- 
Michael Scherer



More information about the Mageia-sysadm mailing list