mkver revision 1.19
1#!/bin/sh 2PROG=${1-UNKNOWN} 3 4ConfStr="$PROG" 5 6ConfStr="$ConfStr 4.2.8p15" 7 8case "$CSET" in 9 '') ;; 10 *) ConfStr="$ConfStr@$CSET" ;; 11esac 12 13case "o" in 14 '') ;; 15 *) ConfStr="${ConfStr}-o" ;; 16esac 17 18if [ -n "$MKREPRO_TIMESTAMP" ]; then 19 SOURCE_DATE_EPOCH=$MKREPRO_TIMESTAMP 20fi 21 22if [ -n "$SOURCE_DATE_EPOCH" ]; then 23 ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -d@$SOURCE_DATE_EPOCH 2>/dev/null`" || 24 ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -r $SOURCE_DATE_EPOCH`" 25else 26 ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" 27fi 28 29if [ -n "$MKREPRO_TIMESTAMP" ]; then 30 RUN=1 31else 32 if [ ! -f .version ]; then 33 echo 0 > .version 34 fi 35 RUN="`cat .version`" 36 RUN="`expr $RUN + 1`" 37 echo $RUN > .version 38fi 39 40ConfStr="$ConfStr (${RUN})" 41 42echo "Version <${ConfStr}>"; 43 44rm -f version.c 45cat > version.c << -EoF- 46/* 47 * version file for $PROG 48 */ 49#include <config.h> 50const char * Version = "${ConfStr}"; 51-EoF- 52