summaryrefslogtreecommitdiffstats
path: root/version.sh
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-06-05 17:38:10 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-06-05 17:38:10 +0000
commit4261c52c851f57da9978466b7f24b5ce64cd7d93 (patch)
treebfd54c4a451989dca2b716a21271460129934142 /version.sh
parenta32c084b973860db578f482cdb586249a510aaa5 (diff)
downloadmpv-4261c52c851f57da9978466b7f24b5ce64cd7d93.tar.bz2
mpv-4261c52c851f57da9978466b7f24b5ce64cd7d93.tar.xz
Generate the version string with awk on BSD systems and work around wrong
day/month order in the ls output. based on a patch by Chris Roccati <roccati - at - pobox - dot - com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15650 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh19
1 files changed, 11 insertions, 8 deletions
diff --git a/version.sh b/version.sh
index 1bdc221e06..fa561cd06e 100755
--- a/version.sh
+++ b/version.sh
@@ -18,14 +18,17 @@ case "$OS" in
Darwin|*BSD)
# BSD 'date -r' does not print modification time
# LC_ALL=C sets month/day order and English language in the date string
- LS=`LC_ALL=C ls -lT CVS/Entries`
- year=`echo $LS | cut -d' ' -f9 | cut -c 3-4`
- month=`echo $LS | awk -F" " '{printf "%.2d", \
- (index("JanFebMarAprMayJunJulAugSepOctNovDec",$6)+2)/3}'`
- day=`printf %.2d \` 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}"
+ # The if in the awk call works around wrong day/month order.
+ last_cvs_update=`LC_ALL=C ls -lT CVS/Entries | \
+ awk '{ \
+ day=$7; \
+ month=index(" JanFebMarAprMayJunJulAugSepOctNovDec", $6); \
+ if(month==0) { \
+ day=$6; \
+ month=index(" JanFebMarAprMayJunJulAugSepOctNovDec",$7); } \
+ printf("%s%.02d%.02d-%s", \
+ substr($9, 3, 2), (month+1)/3, day, substr($8, 0, 5)); \
+ }'`
;;
*)
last_cvs_update=`date +%y%m%d-%H:%M`