Changeset View
Changeset View
Standalone View
Standalone View
stand/common/newvers.sh
Show All 38 Lines | r) | ||||
include_metadata= | include_metadata= | ||||
;; | ;; | ||||
esac | esac | ||||
done | done | ||||
shift $((OPTIND - 1)) | shift $((OPTIND - 1)) | ||||
LC_ALL=C; export LC_ALL | LC_ALL=C; export LC_ALL | ||||
u=${USER-root} h=${HOSTNAME-`hostname`} t=`date` | u=${USER-root} h=${HOSTNAME-`hostname`} t=`date` | ||||
#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '` | |||||
r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` | r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` | ||||
bootprog_info="FreeBSD/${3} ${2}, Revision ${r}\\n" | bootprog_info="FreeBSD/${3} ${2}, Revision ${r}\\n" | ||||
if [ -n "${include_metadata}" ]; then | if [ -n "${include_metadata}" ]; then | ||||
bootprog_info="$bootprog_info(${t} ${u}@${h})\\n" | bootprog_info="$bootprog_info(${t} ${u}@${h})\\n" | ||||
fi | fi | ||||
cat > $tempfile <<EOF | cat > $tempfile <<EOF | ||||
char bootprog_info[] = "$bootprog_info"; | char bootprog_info[] = "$bootprog_info"; | ||||
unsigned bootprog_rev = ${r%%.*} * 1000 + ${r##*.}; | unsigned bootprog_rev = ${r%%.*} * 1000 + ${r##*.}; | ||||
EOF | EOF | ||||
mv $tempfile vers.c | mv $tempfile vers.c |