summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-05-21 14:44:10 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-05-21 14:44:10 +0000
commit33bb00a68082ee6ed3683974a80dff556acc82f9 (patch)
treeab250a969a6e1a211597b8f5be085884a0d8b7a9
parent7f5a85dbcbc791e0301af400e8d28021193f6fee (diff)
downloadmpv-33bb00a68082ee6ed3683974a80dff556acc82f9.tar.bz2
mpv-33bb00a68082ee6ed3683974a80dff556acc82f9.tar.xz
LANG=C ensures month/day order and English language in the date string for
more reliable operation in diverse environments. Tested on OpenBSD, NetBSD, FreeBSD, Darwin 10.2 and Darwin 10.1. Darwin 10.4 should work as well, 10.3 does not due to broken ls. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15537 b3059339-0415-0410-9bf9-f77b7e298cf2
-rwxr-xr-xversion.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/version.sh b/version.sh
index 770f1445a0..9be2ceb1a0 100755
--- a/version.sh
+++ b/version.sh
@@ -15,13 +15,14 @@ case "$OS" in
year=`echo $LS | awk -F" " '{print $9}'`
last_cvs_update="${year}${month}${day}-${hour}:${minute}"
;;
- Darwin)
- # Darwin/BSD 'date -r' does not print modification time
- LS=`ls -lT CVS/Entries`
+ Darwin|*BSD)
+ # BSD 'date -r' does not print modification time
+ # LANG=C sets month/day order and English language in the date string
+ LS=`LANG=C ls -lT CVS/Entries`
year=`echo $LS | cut -d' ' -f9 | cut -c 3-4`
month=`echo $LS | awk -F" " '{printf "%.2d", \
- (index("JanFebMarAprMayJunJulAugSepOctNovDec",$7)+2)/3}'`
- day=`echo $LS | cut -d' ' -f6`
+ (index("JanFebMarAprMayJunJulAugSepOctNovDec",$6)+2)/3}'`
+ day=`echo $LS | cut -d' ' -f7`
hour=`echo $LS | cut -d' ' -f8 | cut -d: -f1`
minute=`echo $LS | cut -d' ' -f8 | cut -d: -f2`
last_cvs_update="${year}${month}${day}-${hour}:${minute}"