From owner-freebsd-qa@FreeBSD.ORG Tue Feb 28 19:19:14 2006 Return-Path: X-Original-To: freebsd-qa@freebsd.org Delivered-To: freebsd-qa@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B70F16A427 for ; Tue, 28 Feb 2006 19:19:14 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id D431543D93 for ; Tue, 28 Feb 2006 19:18:56 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k1SJIlmh019026; Tue, 28 Feb 2006 14:18:54 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-qa@freebsd.org, Seth Kingsley Date: Tue, 28 Feb 2006 14:19:52 -0500 User-Agent: KMail/1.9.1 References: <200602261910.k1QJAAmZ089790@freefall.freebsd.org> In-Reply-To: <200602261910.k1QJAAmZ089790@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602281419.53871.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1306/Tue Feb 28 04:50:04 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Subject: Re: bin/93853: [PATCH]: Add country-specific keymap selection to sysinstall X-BeenThere: freebsd-qa@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD Quality Assurance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2006 19:19:14 -0000 On Sunday 26 February 2006 14:10, Seth Kingsley wrote: > The following reply was made to PR bin/93853; it has been noted by GNATS. > > From: Seth Kingsley > To: K?vesd?n G?bor > Cc: bug-followup@FreeBSD.org > Subject: Re: bin/93853: [PATCH]: Add country-specific keymap selection to sysinstall > Date: Sun, 26 Feb 2006 11:02:51 -0800 > > On Sun, Feb 26, 2006 at 11:58:19AM +0100, K?vesd?n G?bor wrote: > > Great idea, I'd love to see it implemented. :) > > Could you possibly add Hungarian to the list, please? > > Hungary will work out of the box with this patch. I've just tested it. If > you're looking at the mappings from country to language in the diff, that's > only to handle cases where the keymap file is named after the language instead > of the 2-letter country code, such as "danish.iso", instead of "dk.iso". All > 240 countries listed in /usr/share/misc/iso3166 are included in the country > selection menu. Hmm, I tried this out. One thing I ran into just running it during multiuser is that hitting Enter didn't work in the country selection dialog. I had to hit 'O' for Ok for some reason. It works if I pick a non-default country actually, so it's something in the logic for the default country case. Hmm, I fixed this by fixing dmenuSetCountryVariable() to return DITEM_SUCCESS rather than void in the DEFAULT_COUNTRY case. That's really odd that it didn't flag that as a warning. Also, I fixed keymapMenuSelect() to correctly return a DITEM_* value if VAR_COUNTRY wasn't set (dmenuOpenSimple returns a boolean). Finally, I think that this should only popup during installs and if it is run as non-init it shouldn't pop this menu up (under the assumption that in multiuser you've already set the keymap). Updated portions of the diff look like: @@ -111,6 +112,21 @@ } int +dmenuSetCountryVariable(dialogMenuItem *tmp) +{ + variable_set((char *)tmp->data, FALSE); +#ifdef WITH_SYSCONS + /* Don't prompt the user for a keymap if they're using the default locale. */ + if (!strcmp(variable_get(VAR_COUNTRY), DEFAULT_COUNTRY)) + return DITEM_SUCCESS; + + return keymapMenuSelect(tmp); +#else + return DITEM_SUCCESS; +#endif +} ... + if ((country = variable_get(VAR_COUNTRY)) != NULL) + { + lang = country; + for (i = 0; map[i].country; ++i) + if (!strcmp(country, map[i].country)) + { + lang = map[i].lang; + break; + } + (simplified logic that defaults lang to country) ... + } + else + return dmenuOpenSimple(&MenuSysconsKeymap, FALSE) ? DITEM_SUCCESS : + DITEM_FAILURE; +} + ... @@ -158,6 +158,10 @@ systemShutdown(status); } + /* Get user's country and keymap */ + if (RunningAsInit) + configCountry(NULL); + /* Begin user dialog at outer menu */ dialog_clear(); while (1) { Does this sound ok? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org