From 26e9671003b84007ee722492b20567645d4b1646 Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Thu, 5 Jan 2012 15:37:36 +0200 Subject: [PATCH 1/5] sandbox/update-version: bash isn't always in /bin. On some systems, bash is in some different folder than /bin. It works with more systems to use /usr/bin/env bash. --- sandbox/update-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sandbox/update-version b/sandbox/update-version index 1eda83afe..007edf77e 100755 --- a/sandbox/update-version +++ b/sandbox/update-version @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "Updating version..." perl -pi -e "s/^version\s*=\s*['\"]([\S]+)[ '\"].*/version = '\1 ($( date -Iseconds ))'/" src/version.py git add src/version.py From a3f4fe3cb3c6c6d4f1d7807edb72ecb6202a929b Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Thu, 5 Jan 2012 15:44:14 +0200 Subject: [PATCH 2/5] update-version: Use UTC with version timestamps. If we don't use same timezone, we can get funny times, because we are on different timezones. For example, I could commit something at 16:00, then ProgVal/nyuszika7h/skizzhg/Banton could commit some- thing and timestamp would only show that it happened at the same time on different timezone. Timestamps using specific timezone could also make reading of version numbers easier. --- sandbox/update-version | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sandbox/update-version b/sandbox/update-version index 007edf77e..d8bc1b452 100755 --- a/sandbox/update-version +++ b/sandbox/update-version @@ -1,4 +1,7 @@ #!/usr/bin/env bash +export TZ="/usr/share/zoneinfo/UTC" # Use UTC with version timestamps. echo "Updating version..." perl -pi -e "s/^version\s*=\s*['\"]([\S]+)[ '\"].*/version = '\1 ($( date -Iseconds ))'/" src/version.py +unset TZ # Return to the system timezone. +exec $SHELL # Execute the current shell to return to use timezone if specified in config of shell. git add src/version.py From f922c09929cd28441b4e3a102d82a1be3d1a26ce Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Thu, 5 Jan 2012 16:10:28 +0200 Subject: [PATCH 3/5] sandbox/update-version: fix typo in comment. use --> user --- sandbox/update-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sandbox/update-version b/sandbox/update-version index d8bc1b452..cb8f381e6 100755 --- a/sandbox/update-version +++ b/sandbox/update-version @@ -3,5 +3,5 @@ export TZ="/usr/share/zoneinfo/UTC" # Use UTC with version timestamps. echo "Updating version..." perl -pi -e "s/^version\s*=\s*['\"]([\S]+)[ '\"].*/version = '\1 ($( date -Iseconds ))'/" src/version.py unset TZ # Return to the system timezone. -exec $SHELL # Execute the current shell to return to use timezone if specified in config of shell. +exec $SHELL # Execute the current shell to return to user timezone if specified in config of shell. git add src/version.py From ab379957e216e7c9479686ba6e78bcbc7a7a873a Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Thu, 5 Jan 2012 18:54:55 +0200 Subject: [PATCH 4/5] sandbox/update-version: vim modelines exist. Added vim modeline to enable syntax and set filetype :) --- sandbox/update-version | 1 + 1 file changed, 1 insertion(+) diff --git a/sandbox/update-version b/sandbox/update-version index cb8f381e6..fa9b147b5 100755 --- a/sandbox/update-version +++ b/sandbox/update-version @@ -5,3 +5,4 @@ perl -pi -e "s/^version\s*=\s*['\"]([\S]+)[ '\"].*/version = '\1 ($( date -Isec unset TZ # Return to the system timezone. exec $SHELL # Execute the current shell to return to user timezone if specified in config of shell. git add src/version.py +# vim: set ft=sh: syntax: From bfb3dd267c73cca9c55c5c7daf404892bd3b3bdb Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Thu, 5 Jan 2012 20:03:03 +0200 Subject: [PATCH 5/5] update-version: Fix misleading comment. --- sandbox/update-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sandbox/update-version b/sandbox/update-version index fa9b147b5..699c6380b 100755 --- a/sandbox/update-version +++ b/sandbox/update-version @@ -1,5 +1,5 @@ #!/usr/bin/env bash -export TZ="/usr/share/zoneinfo/UTC" # Use UTC with version timestamps. +export TZ="/usr/share/zoneinfo/UTC" # Set timezone as UTC for version timestamps to be in UTC. echo "Updating version..." perl -pi -e "s/^version\s*=\s*['\"]([\S]+)[ '\"].*/version = '\1 ($( date -Iseconds ))'/" src/version.py unset TZ # Return to the system timezone.