Handle the case where the version file might be empty, which can occur
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 8 Jun 2005 22:14:37 +0000 (22:14 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 8 Jun 2005 22:14:37 +0000 (22:14 +0000)
if a machine crashes while building the kernel.

sys/conf/newvers.sh

index 39c02b3..39ea9b4 100644 (file)
@@ -33,7 +33,7 @@
 #
 #      @(#)newvers.sh  8.1 (Berkeley) 4/20/94
 # $FreeBSD: src/sys/conf/newvers.sh,v 1.44.2.30 2003/04/04 07:02:46 murray Exp $
-# $DragonFly: src/sys/conf/newvers.sh,v 1.13 2005/05/09 17:24:14 dillon Exp $
+# $DragonFly: src/sys/conf/newvers.sh,v 1.14 2005/06/08 22:14:37 dillon Exp $
 
 tag="\$Name:  $"
 
@@ -146,6 +146,9 @@ fi
 
 touch version
 v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
+if [ "$v" = "" ]; then
+    v=1
+fi
 i=`make -V KERN_IDENT`
 cat << EOF > vers.c
 $COPYRIGHT