Date: Thu, 25 Aug 2005 12:05:18 +0300 From: Vasil Dimov <vd@datamax.bg> To: FreeBSD-gnats-submit@FreeBSD.org Cc: marko@FreeBSD.org Subject: ports/85281: Tools/scripts/portsearch: fix default INDEX filename Message-ID: <20050825090518.GA64616@sinanica.bg.datamax> Resent-Message-ID: <200508250910.j7P9ALmI063233@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 85281 >Category: ports >Synopsis: Tools/scripts/portsearch: fix default INDEX filename >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Aug 25 09:10:21 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Vasil Dimov >Release: FreeBSD 5.4-STABLE i386 >Organization: DataMax >Environment: >Description: Tools/scripts/portsearch by default looks for /usr/ports/INDEX for the INDEX file, which is not the right assumption for 5.x and above. >How-To-Repeat: /usr/ports$ ./Tools/scripts/portsearch -n foo Unable to open /usr/ports/INDEX at ./Tools/scripts/portsearch line 128. /usr/ports$ >Fix: --- portsearch.diff begins here --- Index: portsearch =================================================================== RCS file: /home/ncvs/ports/Tools/scripts/portsearch,v retrieving revision 1.3 diff -u -r1.3 portsearch --- portsearch 9 Jan 2005 10:21:17 -0000 1.3 +++ portsearch 25 Aug 2005 08:33:18 -0000 @@ -43,9 +43,12 @@ # Global variables # +my $osrel = `/usr/bin/uname -r`; +$osrel =~ s/\..+$//s; + my $VERSION = "1.0"; -my $file = "/usr/ports/INDEX"; -my $match = 1; +my $file = "/usr/ports/INDEX" . ($osrel <= 4 ? "" : "-$osrel"); +my $match = 1; my $count = 0; # We only need 7 of the 10 fields in a record; define which ones in a --- portsearch.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050825090518.GA64616>