Make it possible to leave out .note.netbsd.ident with command line flag -i.
This commit is contained in:
parent
5c3604e034
commit
ffd78a62ec
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh -
|
#!/bin/sh -
|
||||||
#
|
#
|
||||||
# $NetBSD: newvers.sh,v 1.54 2009/03/30 16:29:55 perry Exp $
|
# $NetBSD: newvers.sh,v 1.55 2009/12/16 20:54:49 pooka Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 1984, 1986, 1990, 1993
|
# Copyright (c) 1984, 1986, 1990, 1993
|
||||||
# The Regents of the University of California. All rights reserved.
|
# The Regents of the University of California. All rights reserved.
|
||||||
|
@ -47,6 +47,18 @@ d=$(pwd)
|
||||||
cwd=$(dirname $0)
|
cwd=$(dirname $0)
|
||||||
copyright=$(awk '{ printf("\"%s\\n\"", $0); }' ${cwd}/copyright)
|
copyright=$(awk '{ printf("\"%s\\n\"", $0); }' ${cwd}/copyright)
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-r)
|
||||||
|
rflag=-r
|
||||||
|
;;
|
||||||
|
-i)
|
||||||
|
iflag=-i
|
||||||
|
esac
|
||||||
|
echo arg
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [ -f ident ]; then
|
if [ -f ident ]; then
|
||||||
id="$(cat ident)"
|
id="$(cat ident)"
|
||||||
else
|
else
|
||||||
|
@ -58,7 +70,7 @@ osrelcmd=${cwd}/osrelease.sh
|
||||||
ost="NetBSD"
|
ost="NetBSD"
|
||||||
osr=$(sh $osrelcmd)
|
osr=$(sh $osrelcmd)
|
||||||
|
|
||||||
case $1 in
|
case "$rflag" in
|
||||||
-r)
|
-r)
|
||||||
fullversion="${ost} ${osr} (${id})\n"
|
fullversion="${ost} ${osr} (${id})\n"
|
||||||
;;
|
;;
|
||||||
|
@ -67,6 +79,8 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo $(expr ${v} + 1) > version
|
||||||
|
|
||||||
cat << _EOF > vers.c
|
cat << _EOF > vers.c
|
||||||
/*
|
/*
|
||||||
* Automatically generated file from $0
|
* Automatically generated file from $0
|
||||||
|
@ -86,6 +100,11 @@ const char kernel_ident[] = "${id}";
|
||||||
const char copyright[] =
|
const char copyright[] =
|
||||||
${copyright}
|
${copyright}
|
||||||
"\n";
|
"\n";
|
||||||
|
_EOF
|
||||||
|
|
||||||
|
[ "${iflag}" = -i ] && exit 0
|
||||||
|
|
||||||
|
cat << _EOF >> vers.c
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NetBSD identity note.
|
* NetBSD identity note.
|
||||||
|
@ -109,4 +128,3 @@ __asm(
|
||||||
);
|
);
|
||||||
|
|
||||||
_EOF
|
_EOF
|
||||||
echo $(expr ${v} + 1) > version
|
|
||||||
|
|
Loading…
Reference in New Issue