Duncan Murdoch <murdoch <at> stats.uwo.ca> writes: : : On Sun, 28 Nov 2004 18:09:20 +0000 (UTC), Gabor Grothendieck : <ggrothendieck <at> myway.com> wrote: : : > : > : >I have Windows XP build scripts that look for R in a variety : >of folders and if multiple ones are found, takes the last : >one. For example, I currently have the following : >in \Program Files\R : : > : > rw1060 : > rw1062 : > rw1071 : > rw1071beta : > rw1081 : > rw1090 : > rw1090dev : > rw1091 : > rw1091pat : > rw2000 : > rw2001beta : > : >Note that it currently correctly gets rw2001beta but if I : >add rw2001 then it will not pick it up since rw2001beta : >would continue to sort after it. : > : >I tried using dates in my scripts to pick out the right one : >but realized that it was somewhat error prone and decided to : >move back to ordering by the names. : > : >I wonder if a naming convention could be adopted that ensured : >that the names sort in order. For example, : > : > rw2010a - alpha, i.e. development version (previously rw2010dev) : > rw2010b - beta version (previously rw2001beta) : > rw2010f - final version (previously rw2010) : > rw2010p - patched version (previously rw2010pat) : : That would work. Use the rename command, and you've got it. :
Renaming is not really workable if you are giving your scripts to others. They won't want build scripts that rename their folders. : Another possibility is to have your build script split up the name and : apply a custom sort order to it. : : The pattern is: : : "rw" + version number + suffix : : The suffices appear in this order: "dev", "alpha", "beta", "", "pat" : (where not all appear, e.g. "dev" never appears for a minor release, : and sometimes "alpha" is skipped). Its really desirable to keep Windows batch scripts as simple as possible and such a transformation is trickier than you might think in the Windows batch language. I was hoping that the R team would consider a simplifying change to make it easier to create build scripts. The least such change that I can think of is to use alpha as a suffix in place of dev and to use final to suffix unsuffixed versions. That would be enough to allow them to sort in ascending order. This involves no coding at all for the R team. Just a decision to regularize the naming. Currently I am the only user of my scripts so, as a workaround I can delete the dev when I get the beta and delete the beta when I get the final (or alternately just wait for the final since the final/patch subset sort correctly) but it would be nice to have a simple general solution. ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel