From owner-freebsd-stable Sat Jul 22 23:37: 3 2000 Delivered-To: freebsd-stable@freebsd.org Received: from fnal.gov (heffalump.fnal.gov [131.225.9.20]) by hub.freebsd.org (Postfix) with ESMTP id A4D7137B795 for ; Sat, 22 Jul 2000 23:36:59 -0700 (PDT) (envelope-from zingelman@fnal.gov) Received: from nova.fnal.gov ([131.225.18.207]) by smtp.fnal.gov (PMDF V6.0-24 #44770) with ESMTP id <0FY5000IB11M9R@smtp.fnal.gov> for freebsd-stable@FreeBSD.ORG; Sun, 23 Jul 2000 01:36:58 -0500 (CDT) Received: from localhost (tez@localhost) by nova.fnal.gov (8.9.3+Sun/8.9.1) with ESMTP id BAA26716 for ; Sun, 23 Jul 2000 01:36:57 -0500 (CDT) Date: Sun, 23 Jul 2000 01:36:57 -0500 (CDT) From: Tim Zingelman Subject: sysinstall resetting USA_RESIDENT=NO X-Sender: tez@nova.fnal.gov To: freebsd-stable@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII X-Authentication-warning: nova.fnal.gov: tez owned process doing -bs Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Anytime sysinstall is run (after initial installation), it resets USA_RESIDENT=NO in /etc/make.conf as it starts up. Simply starting it and immediately exiting will cause this change to /etc/make.conf. Below are a set of patches to only reset USA_RESIDENT, if we have passed through the code that asks "are you really a USA resident", and otherwise leaves it alone. It could easily ask the question right there at initialization, if that is the preferred way to do it. This is my first real patch submission... is it prefered to submit a PR, or is sending to the list ok? Thanks, - Tim Index: config.c =================================================================== RCS file: /usr/CVS/src/release/sysinstall/config.c,v retrieving revision 1.156.2.3 diff -c -r1.156.2.3 config.c *** config.c 2000/07/16 17:29:58 1.156.2.3 --- config.c 2000/07/23 06:22:52 *************** *** 372,377 **** --- 372,378 ---- int i, nlines; FILE *fp; + if (!USAResValid) return; if (!file_readable(config)) { char *line = malloc(21); sprintf(line, "USA_RESIDENT=%s\n", USAResident ? "YES" : "NO"); Index: dist.c =================================================================== RCS file: /usr/CVS/src/release/sysinstall/dist.c,v retrieving revision 1.175.2.2 diff -c -r1.175.2.2 dist.c *** dist.c 2000/07/20 01:53:39 1.175.2.2 --- dist.c 2000/07/23 06:21:01 *************** *** 405,410 **** --- 405,411 ---- dialog_clear_norefresh(); USAResident = !msgYesNo("Are you actually resident in the United States?"); + USAResValid = TRUE; distVerifyFlags(); return i | DITEM_REDRAW | DITEM_RESTORE; Index: globals.c =================================================================== RCS file: /usr/CVS/src/release/sysinstall/globals.c,v retrieving revision 1.24 diff -c -r1.24 globals.c *** globals.c 2000/03/12 03:57:25 1.24 --- globals.c 2000/07/23 06:20:24 *************** *** 48,53 **** --- 48,54 ---- Boolean ColorDisplay; /* Are we on a color display? */ Boolean OnVTY; /* Are we on a VTY? */ Boolean USAResident; /* Are we cryptographically challenged? */ + Boolean USAResValid; /* Have we asked yet? */ Variable *VarHead; /* The head of the variable chain */ Device *mediaDevice; /* Where we're installing from */ int BootMgr; /* Which boot manager we're using */ *************** *** 70,73 **** --- 71,75 ---- mediaDevice = NULL; RunningAsInit = FALSE; USAResident = FALSE; + USAResValid = FALSE; } Index: sysinstall.h =================================================================== RCS file: /usr/CVS/src/release/sysinstall/sysinstall.h,v retrieving revision 1.186.2.6 diff -c -r1.186.2.6 sysinstall.h *** sysinstall.h 2000/07/21 20:43:48 1.186.2.6 --- sysinstall.h 2000/07/23 06:24:46 *************** *** 347,352 **** --- 347,353 ---- extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ Boolean USAResident; /* Are we cryptographically challenged? */ + Boolean USAResValid; /* Have we asked yet? */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ ##### To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message