scripts/buildname.nochroot: adjust datetime substitutions in /etc/tizen-build.conf 67/30167/2
authorStephane Desneux <stephane.desneux@open.eurogiciel.org>
Wed, 12 Nov 2014 10:15:45 +0000 (11:15 +0100)
committerMikko Ylinen <mikko.ylinen@intel.com>
Wed, 12 Nov 2014 14:00:12 +0000 (06:00 -0800)
New vars have been introduced by https://review.tizen.org/gerrit/30166.

This patch changes the way that datetime variables are substituted in /etc/tizen-build.conf

* correct the previous code by adding UTC representation
* added substitution for @BUILD_TIME@
* added substitution for @BUILD_TS@

Change-Id: I43ec223019ba6699846effbf6a69c6b5f2b2dc19
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
scripts/buildname.nochroot

index 330adc5..5ed5601 100644 (file)
@@ -4,8 +4,15 @@ if [ -n "$IMG_NAME" ]; then
        echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
        echo "$IMG_NAME @BUILD_ID@" >>$INSTALL_ROOT/etc/tizen-snapshot
 
+
+       build_ts=$(date -u +%s)
+       build_date=$(date -u --date @$build_ts +%Y%m%d_%H%M%S)
+       build_time=$(date -u --date @$build_ts +%H:%M:%S)
+
        sed -ri \
                -e 's|@BUILD_ID[@]|@BUILD_ID@|g' \
-               -e "s|@BUILD_DATE[@]|$(date +%Y%m%d_%H%M%S)|g" \
+               -e "s|@BUILD_DATE[@]|$build_date|g" \
+               -e "s|@BUILD_TIME[@]|$build_time|g" \
+               -e "s|@BUILD_TS[@]|$build_ts|g" \
                $INSTALL_ROOT/etc/tizen-build.conf
 fi