Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  4 Apr 2002 15:36:12 +0200 (CEST)
From:      Thomas Quinot <thomas@cuivre.fr.eu.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/36747: [patch] Upgrade path from old -CURRENT is broken
Message-ID:  <20020404133612.0362F11287@shalmaneser.enst.fr>

next in thread | raw e-mail | index | archive | help

>Number:         36747
>Category:       bin
>Synopsis:       [patch] Upgrade path from old -CURRENT is broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 04 05:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Quinot
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD shalmaneser.enst.fr 5.0-CURRENT FreeBSD 5.0-CURRENT #13: Thu Mar 21 14:41:17 CET 2002 root@shalmaneser.enst.fr:/usr/obj/usr/src/sys/SHALMANESER i386


	
>Description:
	Recent changes to lib/libc/stdio/mktemp.c and usr.bin/xlint/*
	have introduced dependencies on two features that were recently
	introduced: the __FBSDID macro in cdefs.h, and the [gs]etprogname
	functions in stdlib.h. Unfortunately, these files are built
	as part of the cross-tools in buildworld.

	This breaks the upgrade path for systems installed with old
	versions of 5.0-CURRENT. 4-STABLE systems more than one year
	old are also probably impacted.

>How-To-Repeat:
	make buildworld on a freshly cvsupped source tree on a two year
	old 5.0-CURRENT box.
>Fix:

Here is a proposed solution:

diff -u usr.bin/xlint/lint1/cgram.y.dist usr.bin/xlint/lint1/cgram.y
--- usr.bin/xlint/lint1/cgram.y.dist	Thu Apr  4 12:47:01 2002
+++ usr.bin/xlint/lint1/cgram.y	Thu Apr  4 13:45:45 2002
@@ -37,7 +37,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: cgram.y,v 1.23 2002/01/31 19:36:53 tv Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/cgram.y,v 1.7 2002/03/03 15:12:19 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff -u usr.bin/xlint/lint1/scan.l.dist usr.bin/xlint/lint1/scan.l
--- usr.bin/xlint/lint1/scan.l.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint1/scan.l	Thu Apr  4 13:48:24 2002
@@ -37,7 +37,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: scan.l,v 1.26 2002/01/31 22:30:21 tv Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/scan.l,v 1.11 2002/03/03 15:12:20 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff -u usr.bin/xlint/lint1/decl.c.dist usr.bin/xlint/lint1/decl.c
--- usr.bin/xlint/lint1/decl.c.dist	Thu Apr  4 12:47:01 2002
+++ usr.bin/xlint/lint1/decl.c	Thu Apr  4 13:54:56 2002
@@ -36,7 +36,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: decl.c,v 1.29 2002/01/18 21:01:39 thorpej Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/decl.c,v 1.10 2002/03/03 15:12:19 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <sys/param.h>
 #include <limits.h>
diff -u usr.bin/xlint/lint1/err.c.dist usr.bin/xlint/lint1/err.c
--- usr.bin/xlint/lint1/err.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint1/err.c	Thu Apr  4 13:55:04 2002
@@ -35,7 +35,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: err.c,v 1.16 2001/12/13 23:56:00 augustss Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/err.c,v 1.8 2002/03/03 15:12:19 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <sys/types.h>
 #include <stdlib.h>
diff -u usr.bin/xlint/lint1/func.c.dist usr.bin/xlint/lint1/func.c
--- usr.bin/xlint/lint1/func.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint1/func.c	Thu Apr  4 13:55:09 2002
@@ -35,7 +35,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: func.c,v 1.16 2002/01/03 04:25:15 thorpej Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/func.c,v 1.9 2002/03/03 15:12:19 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff -u usr.bin/xlint/lint1/mem1.c.dist usr.bin/xlint/lint1/mem1.c
--- usr.bin/xlint/lint1/mem1.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint1/mem1.c	Thu Apr  4 13:55:14 2002
@@ -35,7 +35,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: mem1.c,v 1.6 2002/01/29 02:43:39 tv Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/mem1.c,v 1.8 2002/03/03 15:12:20 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <sys/types.h>
 #include <sys/mman.h>
diff -u usr.bin/xlint/lint1/tree.c.dist usr.bin/xlint/lint1/tree.c
--- usr.bin/xlint/lint1/tree.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint1/tree.c	Thu Apr  4 13:55:18 2002
@@ -35,7 +35,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: tree.c,v 1.24 2002/01/31 22:30:20 tv Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint1/tree.c,v 1.12 2002/03/03 15:12:20 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff -u usr.bin/xlint/lint1/main1.c.dist usr.bin/xlint/lint1/main1.c
--- usr.bin/xlint/lint1/main1.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint1/main1.c	Thu Apr  4 14:02:55 2002
@@ -113,7 +113,7 @@
 
 err_set	msgset;
 
-static	void	usage(void);
+static	void	usage(char *);
 
 int main(int, char *[]);
 
@@ -123,8 +123,6 @@
 	int	c;
 	char	*ptr;
 
-	setprogname(argv[0]);
-
 	ERR_ZERO(&msgset);
 	while ((c = getopt(argc, argv, "abcdeghmprstuvwyzFX:")) != -1) {
 		switch (c) {
@@ -168,7 +166,7 @@
 			break;
 		case '?':
 		default:
-			usage();
+			usage(argv[0]);
 			break;
 		}
 	}
@@ -176,7 +174,7 @@
 	argv += optind;
 
 	if (argc != 2)
-		usage();
+		usage(argv[0]);
 
 	/* open the input file */
 	if ((yyin = fopen(argv[0], "r")) == NULL)
@@ -206,11 +204,11 @@
 }
 
 static void
-usage(void)
+usage(char *progname)
 {
 	(void)fprintf(stderr,
 	    "Usage: %s [-abcdeghmprstuvwyzF] [-X <id>[,<id>]... src dest\n",
-	    getprogname());
+	    progname);
 	exit(1);
 }
 
diff -u usr.bin/xlint/lint2/mem2.c.dist usr.bin/xlint/lint2/mem2.c
--- usr.bin/xlint/lint2/mem2.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint2/mem2.c	Thu Apr  4 14:34:47 2002
@@ -35,7 +35,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: mem2.c,v 1.6 2002/01/21 19:49:52 tv Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint2/mem2.c,v 1.7 2002/03/03 15:12:22 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <sys/param.h>
 #include <sys/types.h>
diff -u usr.bin/xlint/lint2/read.c.dist usr.bin/xlint/lint2/read.c
--- usr.bin/xlint/lint2/read.c.dist	Thu Apr  4 12:47:02 2002
+++ usr.bin/xlint/lint2/read.c	Thu Apr  4 14:34:57 2002
@@ -36,7 +36,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: read.c,v 1.12 2002/01/21 19:49:52 tv Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/lint2/read.c,v 1.8 2002/03/03 15:12:22 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <ctype.h>
 #include <limits.h>
diff -u usr.bin/xlint/xlint/xlint.c.dist usr.bin/xlint/xlint/xlint.c
--- usr.bin/xlint/xlint/xlint.c.dist	Thu Apr  4 12:47:03 2002
+++ usr.bin/xlint/xlint/xlint.c	Thu Apr  4 14:38:12 2002
@@ -36,7 +36,11 @@
 #if defined(__RCSID) && !defined(lint)
 __RCSID("$NetBSD: xlint.c,v 1.26 2002/01/22 01:14:03 thorpej Exp $");
 #endif
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/usr.bin/xlint/xlint/xlint.c,v 1.17 2002/03/11 11:32:55 markm Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 #include <sys/param.h>
 #include <sys/wait.h>
@@ -132,7 +136,7 @@
 static	void	terminate(int) __attribute__((__noreturn__));
 static	const	char *lbasename(const char *, int);
 static	void	appdef(char ***, const char *);
-static	void	usage(void);
+static	void	usage(char *);
 static	void	fname(const char *);
 static	void	runchild(const char *, char *const *, const char *, int);
 static	void	findlibs(char *const *);
@@ -279,18 +283,18 @@
 }
 
 static void
-usage(void)
+usage(char *progname)
 {
 
 	(void)fprintf(stderr,
 	    "Usage: %s [-abceghprvwxzHF] [-s|-t] [-i|-nu] [-Dname[=def]]"
-	    " [-Uname] [-X <id>[,<id>]...\n", getprogname());
+	    " [-Uname] [-X <id>[,<id>]...\n", progname);
 	(void)fprintf(stderr,
 	    "\t[-Idirectory] [-Ldirectory] [-llibrary] [-ooutputfile]"
 	    " file...\n");
 	(void)fprintf(stderr,
 	    "       %s [-abceghprvwzHF] [-s|-t] -Clibrary [-Dname[=def]]\n"
-	    " [-X <id>[,<id>]...\n", getprogname());
+	    " [-X <id>[,<id>]...\n", progname);
 	(void)fprintf(stderr, "\t[-Idirectory] [-Uname] [-Bpath] file"
 	    " ...\n");
 	terminate(-1);
@@ -304,8 +308,6 @@
 	char	flgbuf[3], *tmp, *s;
 	size_t	len;
 
-	setprogname(argv[0]);
-
 	if ((tmp = getenv("TMPDIR")) == NULL || (len = strlen(tmp)) == 0) {
 		tmpdir = xstrdup(_PATH_TMP);
 	} else {
@@ -395,7 +397,7 @@
 
 		case 'i':
 			if (Cflag)
-				usage();
+				usage(argv[0]);
 			iflag = 1;
 			break;
 
@@ -414,7 +416,7 @@
 
 		case 's':
 			if (tflag)
-				usage();
+				usage(argv[0]);
 			freelst(&lcflags);
 			appcstrg(&lcflags, "-trigraphs");
 			appcstrg(&lcflags, "-Wtrigraphs");
@@ -428,7 +430,7 @@
 #if !HAVE_CONFIG_H
 		case 't':
 			if (sflag)
-				usage();
+				usage(argv[0]);
 			freelst(&lcflags);
 			appcstrg(&lcflags, "-traditional");
 			appstrg(&lcflags, concat2("-D", MACHINE));
@@ -445,7 +447,7 @@
 
 		case 'C':
 			if (Cflag || oflag || iflag)
-				usage();
+				usage(argv[0]);
 			Cflag = 1;
 			appstrg(&l2flags, concat2("-C", optarg));
 			p2out = xmalloc(sizeof ("llib-l.ln") + strlen(optarg));
@@ -455,7 +457,7 @@
 
 		case 'd':
 			if (dflag)
-				usage();
+				usage(argv[0]);
 			dflag = 1;
 			appcstrg(&cflags, "-nostdinc");
 			appcstrg(&cflags, "-idirafter");
@@ -475,7 +477,7 @@
 
 		case 'o':
 			if (Cflag || oflag)
-				usage();
+				usage(argv[0]);
 			oflag = 1;
 			outputfn = xstrdup(optarg);
 			break;
@@ -498,7 +500,7 @@
 			break;
 
 		default:
-			usage();
+			usage(argv[0]);
 			/* NOTREACHED */
 		}
 	}
@@ -529,7 +531,7 @@
 				break;
 
 			default:
-				usage();
+				usage(argv[0]);
 				/* NOTREACHED */
 			}
 			if (arg[2])
@@ -538,7 +540,7 @@
 				argc--;
 				appcstrg(list, *++argv);
 			} else
-				usage();
+				usage(argv[0]);
 		} else {
 			/* filename */
 			fname(arg);
@@ -549,7 +551,7 @@
 	}
 
 	if (first)
-		usage();
+		usage(argv[0]);
 
 	if (iflag)
 		terminate(0);
diff -u lib/libc/stdio/mktemp.c.dist lib/libc/stdio/mktemp.c
--- lib/libc/stdio/mktemp.c.dist	Thu Apr  4 13:34:45 2002
+++ lib/libc/stdio/mktemp.c	Thu Apr  4 13:46:30 2002
@@ -35,7 +35,11 @@
 static char sccsid[] = "@(#)mktemp.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
+#ifdef __FBSDID
 __FBSDID("$FreeBSD: src/lib/libc/stdio/mktemp.c,v 1.24 2002/03/22 21:53:04 obrien Exp $");
+#elif !defined(lint)
+static char rcsid[] = "$FreeBSD$";
+#endif
 
 /* #include "namespace.h" */
 #include <sys/types.h>

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020404133612.0362F11287>