From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jul 10 17:00:27 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 867D616A4CF for ; Sat, 10 Jul 2004 17:00:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B03343D1D for ; Sat, 10 Jul 2004 17:00:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i6AH0RIc065835 for ; Sat, 10 Jul 2004 17:00:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i6AH0RhO065823; Sat, 10 Jul 2004 17:00:27 GMT (envelope-from gnats) Resent-Date: Sat, 10 Jul 2004 17:00:27 GMT Resent-Message-Id: <200407101700.i6AH0RhO065823@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matthew Seaman Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18B8F16A4CF for ; Sat, 10 Jul 2004 16:57:27 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D18343D31 for ; Sat, 10 Jul 2004 16:57:25 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i6AGvJ92062624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Jul 2004 17:57:19 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i6AGvHHF062623; Sat, 10 Jul 2004 17:57:17 +0100 (BST) (envelope-from matthew) Message-Id: <200407101657.i6AGvHHF062623@happy-idiot-talk.infracaninophile.co.uk> Date: Sat, 10 Jul 2004 17:57:17 +0100 (BST) From: Matthew Seaman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: mark@mark-and-erika.com Subject: ports/68896: make search can't be case insensitive under 5.x X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Matthew Seaman List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2004 17:00:27 -0000 >Number: 68896 >Category: ports >Synopsis: make search can't be case insensitive under 5.x >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 10 17:00:26 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Matthew Seaman >Release: FreeBSD 4.10-STABLE i386 >Organization: Infracaninophile >Environment: System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 4.10-STABLE FreeBSD 4.10-STABLE #78: Mon Jul 5 15:49:39 BST 2004 root@happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386 >Description: Ref: the thread on freebsd-questions@ starting with: http://lists.freebsd.org/pipermail/freebsd-questions/2004-July/051953.html Mark Frank noticed that, contrary to what it says in /usr/ports/CHANGES that 'make search' would not do a case insensitive search. Further investigation showed that this only occured on 5.x systems and was because the awk script in bsd.ports.subdir.mk was using the GNU 'IGNORECASE' extension, which isn't present in the one-true-awk used in 5.x. Under 4.x, which does use gawk, everything works as intended. As I don't have access to a 5.x system, this patch has only been tested under 4.x, but it should work. >How-To-Repeat: On a 5.x system: % cd /usr/ports % make search name=phpmyadmin icase=1 >Fix: --- bsd.port.subdir.mk.diff begins here --- --- bsd.port.subdir.mk.orig Sat Jul 10 17:25:21 2004 +++ bsd.port.subdir.mk Sat Jul 10 17:35:44 2004 @@ -346,24 +346,33 @@ -v rdeps="$$rdeps" -v xrdeps="$$xrdeps" \ -v icase="$${icase:-${PORTSEARCH_IGNORECASE}}" \ -v keylim="$${keylim:-${PORTSEARCH_KEYLIM}}" \ - -v xkeylim="$${xkeylim:-${PORTSEARCH_XKEYLIM}}"\ + -v xkeylim="$${xkeylim:-${PORTSEARCH_XKEYLIM}}" \ -v display="$${display:-${PORTSEARCH_DISPLAY_FIELDS}}" \ 'BEGIN { \ sub(top, "${PORTSDIR}", there); \ - IGNORECASE=icase; \ keylen = length(key); keylim = keylim && keylen; \ if (!keylim && keylen) \ - parms[0] = key; \ + parms[0] = (icase ? tolower(key) : key); \ xkeylen = length(xkey); xkeylim = xkeylim && xkeylen; \ if (!xkeylim && xkeylen) \ - xparms[0] = xkey; \ - if (length(name)) parms[1] = name; if (length(xname)) xparms[1] = xname; \ - if (length(path)) parms[2] = path; if (length(xpath)) xparms[2] = xpath; \ - if (length(info)) parms[4] = info; if (length(xinfo)) xparms[4] = xinfo; \ - if (length(maint)) parms[6] = maint; if (length(xmaint)) xparms[6] = xmaint; \ - if (length(cat)) parms[7] = cat; if (length(xcat)) xparms[7] = xcat; \ - if (length(bdeps)) parms[8] = bdeps; if (length(xbdeps)) xparms[8] = xbdeps; \ - if (length(rdeps)) parms[9] = rdeps; if (length(xrdeps)) xparms[9] = xrdeps; \ + xparms[0] = (icase ? tolower(xkey) : xkey); \ + if (icase) { \ + if (length(name)) parms[1] = tolower(name); if (length(xname)) xparms[1] = tolower(xname); \ + if (length(path)) parms[2] = tolower(path); if (length(xpath)) xparms[2] = tolower(xpath); \ + if (length(info)) parms[4] = tolower(info); if (length(xinfo)) xparms[4] = tolower(xinfo); \ + if (length(maint)) parms[6] = tolower(maint); if (length(xmaint)) xparms[6] = tolower(xmaint); \ + if (length(cat)) parms[7] = tolower(cat); if (length(xcat)) xparms[7] = tolower(xcat); \ + if (length(bdeps)) parms[8] = tolower(bdeps); if (length(xbdeps)) xparms[8] = tolower(xbdeps); \ + if (length(rdeps)) parms[9] = tolower(rdeps); if (length(xrdeps)) xparms[9] = tolower(xrdeps); \ + } else { \ + if (length(name)) parms[1] = name; if (length(xname)) xparms[1] = xname; \ + if (length(path)) parms[2] = path; if (length(xpath)) xparms[2] = xpath; \ + if (length(info)) parms[4] = info; if (length(xinfo)) xparms[4] = xinfo; \ + if (length(maint)) parms[6] = maint; if (length(xmaint)) xparms[6] = xmaint; \ + if (length(cat)) parms[7] = cat; if (length(xcat)) xparms[7] = xcat; \ + if (length(bdeps)) parms[8] = bdeps; if (length(xbdeps)) xparms[8] = xbdeps; \ + if (length(rdeps)) parms[9] = rdeps; if (length(xrdeps)) xparms[9] = xrdeps; \ + } \ fields["name"] = 1; names[1] = "Port"; \ fields["path"] = 2; names[2] = "Path"; \ fields["info"] = 4; names[4] = "Info"; \ @@ -380,17 +389,17 @@ if ($$2 !~ there) \ next; \ for (i in parms) \ - if ($$i !~ parms[i]) \ + if ((icase ? tolower($$i) : $$i) !~ parms[i]) \ next; \ for (i in xparms) \ - if ($$i ~ xparms[i]) \ + if ((icase ? tolower($$i) : $$i) ~ xparms[i]) \ next; \ found = 0; \ for (i = 1; i < 10; i++) \ if (i in disp) { \ - if (xkeylim && $$i ~ xkey) \ + if (xkeylim && (icase ? tolower($$i) : $$i) ~ xkey) \ next; \ - if (!found && keylim && $$i ~ key) \ + if (!found && keylim && (icase ? tolower($$i) : $$i) ~ key) \ found = 1; \ } \ if (keylim && !found) \ --- bsd.port.subdir.mk.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: