[MPlayer-dev-eng] version.sh patch

D Richard Felker III dalias at aerifal.cx
Wed Jul 31 07:03:57 CEST 2002


On Wed, Jul 31, 2002 at 01:24:18AM +0200, Felix Buenemann wrote:
> On Tuesday 30 July 2002 21:09, Arpi wrote:
> > Hi,
> >
> > hmm, what about this one? is it portable enough, to be commitable?
> hmm :)
> > and, what ahppens if no Entries file at all? syntax error?
> no, it will simply skip the for loop (I would need to check the whole script 
> to see, what the last_cvs_update var is set to in that case. However it 

For loop with zero items is NOT portable, afaik. Also this construct
will break if any of the find results have spaces in them (shouldn't
happen, but someone *could* create a dir under the mplayer tree with a
space in its name, and this should not break version.sh). The correct
way to do something like this (imho) is:

find . -name Entries 2>/dev/null | while read i ; do .... ; done

This also eliminates the zero iteration problem easily.

Of course the whole idea of this patch is rather silly imho. The find
operation could take a lot of time on a slow (e.g. nfs-mounted)
filesystem and it essentially has no benefits. I don't think anyone
cares about the version number being updated if they do cvs update in
a subdir but not the main dir...

Rich




More information about the MPlayer-dev-eng mailing list