From: Stephane Desneux Date: Wed, 12 Nov 2014 10:15:45 +0000 (+0100) Subject: scripts/buildname.nochroot: adjust datetime substitutions in /etc/tizen-build.conf X-Git-Tag: accepted/tizen/common/20141114.143717~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2580122356e548b447974bd077239d4eae9a07ee;p=platform%2Fupstream%2Fmeta-generic.git scripts/buildname.nochroot: adjust datetime substitutions in /etc/tizen-build.conf 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 --- diff --git a/scripts/buildname.nochroot b/scripts/buildname.nochroot index 330adc5..5ed5601 100644 --- a/scripts/buildname.nochroot +++ b/scripts/buildname.nochroot @@ -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