On Tue, Aug 16, 2011 at 4:19 PM, Jie Zhang <jzhang...@gmail.com> wrote:
> On Mon, Aug 15, 2011 at 6:21 PM, Andreas Fritiofson > <andreas.fritiof...@gmail.com> wrote: > > > +if test -f $srcdir/guess-rev.sh ; then > > Great, but you should probably check if it's executable instead of just a > > regular file. > > I considered if we should check this. But I finally decided it would > be better to just check if it's a regular file. my reason is: > > We decide if we are building for release or not by the existence of > guess-rev.sh, not by the existence of an executable guess-rev.sh. So > > 1. guess-rev.sh exists and is executable: checking regular file is > same as checking executable file. > 2. guess-rev.sh does not exist: checking regular file is same as > checking executable file. > 3. guess-rev.sh exists but is not executable: there must be something > wrong. If we check regular file, user will be given an error when > guess-rev.sh is going to be executed on compiler time. If we check > executable file, building for release is assumed and user will notice > it only in run time. > Agreed, failure is probably the better option if the permissions are botched. I'll leave it as is. /Andreas
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development