[Mageia-sysadm] [1827] add small maintdb script
nicolas vigier
boklm at mars-attacks.org
Fri Jul 29 16:55:10 CEST 2011
On Sat, 16 Jul 2011, Michael Scherer wrote:
> 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 )
Ok.
>
>
> > + 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.
Yes, it seems it is not needed with "".
> > +function maintgetall()
> > +{
> > + cd "$MAINTDBDIR"
> > + for file in *
>
> Wouldn't this one have problem the day we have too much maintainers ?
too much packages ?
> ( even if "too much" is, according to my test, more than 60000 so this
> is just a retorical question )
According to tune2fs we have 1148096 free inodes, so that should be
enough. I don't know the limit for the "*" expansion.
More information about the Mageia-sysadm
mailing list