From owner-freebsd-current Sun Sep 24 13:14:50 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA11789 for current-outgoing; Sun, 24 Sep 1995 13:14:50 -0700 Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id NAA11781 for ; Sun, 24 Sep 1995 13:14:47 -0700 Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <15045(5)>; Sun, 24 Sep 1995 13:14:06 PDT Received: by crevenia.parc.xerox.com id <177475>; Sun, 24 Sep 1995 13:14:01 -0700 From: Bill Fenner To: current@freebsd.org Subject: kernel versions and config's rm -rf Message-Id: <95Sep24.131401pdt.177475@crevenia.parc.xerox.com> Date: Sun, 24 Sep 1995 13:13:54 PDT Sender: owner-current@freebsd.org Precedence: bulk I usually like to be able to tell kernel builds apart by their version numbers... like "oh, PARC_MROUTER #1 has the mbuf leak, you want to run PARC_MROUTER #2". I built a -stable kernel to test multicast routing in -stable, but forgot to put MROUTING in it. So I built another one, and then was really confused because they were both FENESTRO #0, so build date was my only hint as to which one I was currently running. Instead of "rm -rf", maybe config could just do "make clean; rm *.h Makefile", to keep the "version" file around? Also, do we really want the kernel version number to start at 0? Under SunOS, my only other kernel building experience, version numbers start at 1, so to see all these version 0 kernels all the time kinda makes me think that something went wrong, and then I have to say "oh, yeah, FreeBSD's kernel version numbers start at 0". (This is because SunOS pre-increments the version number, while FreeBSD doesn't. This makes sense if you want to manually set the version number, but it does mean that without changing newvers.sh, kernels start at 0). Attached is a patch for newvers.sh and for usr.sbin/config/main.c for someone's perusal. Bill --- newvers.sh.orig Sun Sep 24 12:48:32 1995 +++ newvers.sh Sun Sep 24 12:48:55 1995 @@ -48,7 +48,7 @@ if [ ! -r version ] then - echo 0 > version + echo 1 > version fi touch version --- usr.sbin/config/main.c.orig Sun Sep 24 12:53:43 1995 +++ usr.sbin/config/main.c Sun Sep 24 13:07:55 1995 @@ -117,21 +117,18 @@ exit(2); } else if (!no_config_clobber) { - char tmp[strlen(p) + 8]; + char tmp[strlen(p) + 59]; - fprintf(stderr, "Removing old directory %s: ", p); + fprintf(stderr, "Cleaning old directory %s: ", p); fflush(stderr); - sprintf(tmp, "rm -rf %s", p); + sprintf(tmp, "cd %s; make clean > /dev/null ; " + "rm Makefile machine *.c *.h", p); if (system(tmp)) { fprintf(stderr, "Failed!\n"); perror(tmp); exit(2); } fprintf(stderr, "Done.\n"); - if (mkdir(p, 0777)) { - perror(p); - exit(2); - } } loadaddress = -1; dtab = NULL;