From: Renato S. <br....@gm...> - 2012-10-18 19:14:18
|
2012/10/17 Keith Marshall <kei...@us...> > On 17/10/12 00:06, Renato Silva wrote: > > I'm already doing pretty the same, but easier [than creating a > > /bin/bzr wrapper script]: alias bzr="env -u TZ bzr", > > Personally, I wouldn't classify that as "easier"; just an (almost) > equally effective alternative. The advantage of the wrapper script over > the alias is that you create it once, and it is always available when > /bin is sufficiently early in $PATH. With the alias, you have to > redefine it on every shell invocation, and it doesn't automatically > propagate to sub-shell processes. > > Certainly, you may be able to mitigate this limitation of aliases, by > defining them in $HOME/.bashrc, and also ensuring that $HOME/.bashrc is > sourced by $HOME/.profile and/or $HOME/.bash_profile; there may still be > scenarios in which you get a shell process which doesn't source the > appropriate $HOME/.bashrc, and in any such case, your alias fails. > > OTOH, with the wrapper script, the adapted command will be available in > every shell process which has /bin appropriately prioritised in $PATH, > irrespective of $HOME set-up on shell invocation; IMO, this is a more > robust solution. > > > but as explained I'm looking for a better solution (better than the > > TZ cache above as well) > > Well, in the first instance, all MSYS programs should work just fine > without $TZ being set at all; those which care will simply adopt a sane > default, (based on your system settings). If you can't live with that > sane default, (perhaps it doesn't seem so sane to you: e.g. for me it > appears to be equivalent to 'TZ=GMT0GMTDT' but I might have preferred it > to be 'TZ=GMT0BST'), and you absolutely *must* supply your own > alternative setting, then... > > Given the fundamental underlying issue, I very much doubt if any better > solution exists; my personal choice would be to implement the wrapper > script, using 'export -n TZ' to inhibit the propagation of the shell's > notion of $TZ to those processes which rely on MSVCRT semantics. > > Note that, when your file system is NTFS (or any other which supports > hard links for files), you should be able to create a generic wrapper, > and map it by hard linking to appropriate individual script names. > Thanks! yes, I like the link idea... Yes it is NTFS, but wouldn't symlinks work too? Windows 7 supports them out-of-the-box, while in XP I think I can use Link Shell Extension ( http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html#symboliclinksforwindowsxp ). IIRC it is possible to get symlink name from a linked script (that is, to determine which command to call in the wrapper). > > -- > Regards, > Keith. > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list > etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe > |