All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] .version, newversion in Makefile
@ 2001-10-10 21:22 Rudi Sluijtman
  2001-10-11  0:00 ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Rudi Sluijtman @ 2001-10-10 21:22 UTC (permalink / raw)
  To: linux-kernel

Hi, 

Due to a change in the main Makefile the .version file is overwritten
by a new empty one since at least 2.4.10-pre12, so the version becomes
or remains 1 after each recompile.

>From the xfs cvs tree (http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.4-xfs/):

> --- linux-2.4-xfs/linux/Makefile        2001/09/17 02:09:52     1.123
> +++ linux-2.4-xfs/linux/Makefile        2001/09/21 16:28:50     1.124
> @@ -1,7 +1,7 @@
>  VERSION = 2
>  PATCHLEVEL = 4
>  SUBLEVEL = 10
> -EXTRAVERSION =-pre10-xfs
> +EXTRAVERSION =-pre12-xfs
>   .
>   .
>  newversion:
> -       @if [ ! -f .version ]; then \
> -               echo 1 > .version; \
> -       else \
> -               expr 0`cat .version` + 1 > .version; \
> -       fi
> +       . scripts/mkversion > .version

The script does the same as the lines in the Makefile, except that it does
not specify stdout.

The script cats .version, but, this has just been overwritten because of
the redirection: "scripts/mkversion > .version", so it is empty before
the script can read it.

I do no know why the lines in the Makefile have been moved to a script,
but this is obviously not the way to do it.

A small change to mkversion and leaving out the "> .version" in the
Makefile for instance can do the trick:

A patch for this against linux-2.4.11:

diff -u --recursive --new-file linux-2.4.11/Makefile linux/Makefile
--- linux-2.4.11/Makefile	Wed Oct 10 22:59:03 2001
+++ linux/Makefile	Wed Oct 10 23:01:58 2001
@@ -300,7 +300,7 @@
 $(TOPDIR)/include/linux/compile.h: include/linux/compile.h
 
 newversion:
-	. scripts/mkversion > .version
+	. scripts/mkversion
 
 include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
 	@echo -n \#define UTS_VERSION \"\#`cat .version` > .ver
@@ -530,6 +530,6 @@
 	tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
 	rm $(KERNELPATH) ; \
 	cd $(TOPDIR) ; \
-	. scripts/mkversion > .version ; \
+	. scripts/mkversion ; \
 	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
 	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
diff -u --recursive --new-file linux-2.4.11/scripts/mkversion linux/scripts/mkversion
--- linux-2.4.11/scripts/mkversion	Wed Oct 10 22:59:34 2001
+++ linux/scripts/mkversion	Wed Oct 10 23:03:30 2001
@@ -1,6 +1,6 @@
 if [ ! -f .version ]
 then
-    echo 1
+    echo 1 > .version
 else
-    expr 0`cat .version` + 1
+    expr 0`cat .version` + 1 > .version
 fi


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-10-11  7:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-10 21:22 [patch] .version, newversion in Makefile Rudi Sluijtman
2001-10-11  0:00 ` Russell King
2001-10-11  0:08   ` David S. Miller
2001-10-11  0:13     ` Russell King
2001-10-11  7:34     ` Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.