From owner-freebsd-ports Thu Feb 8 2:22:17 2001 Delivered-To: freebsd-ports@freebsd.org Received: from ringworld.nanolink.com (pool147-tch-1.Sofia.0rbitel.net [212.95.170.147]) by hub.freebsd.org (Postfix) with SMTP id 1BB5037B491 for ; Thu, 8 Feb 2001 02:21:57 -0800 (PST) Received: (qmail 30580 invoked by uid 1000); 8 Feb 2001 10:20:13 -0000 Date: Thu, 8 Feb 2001 12:20:13 +0200 From: Peter Pentchev To: Maxim Sobolev Cc: Jordan Hubbard , ports@FreeBSD.org, jkh@FreeBSD.org, Edwin Groothuis Subject: Re: Request for comments [Fwd: bin/24695: [patch] pkg_info: prefix search for a package] Message-ID: <20010208122012.H21672@ringworld.oblivion.bg> Mail-Followup-To: Maxim Sobolev , Jordan Hubbard , ports@FreeBSD.org, jkh@FreeBSD.org, Edwin Groothuis References: <10197.981450491@winston.osd.bsdi.com> <3A7FC36A.1434D2CC@FreeBSD.org> <3A801D32.DE73F780@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A801D32.DE73F780@FreeBSD.org>; from sobomax@FreeBSD.org on Tue, Feb 06, 2001 at 05:50:10PM +0200 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, Feb 06, 2001 at 05:50:10PM +0200, Maxim Sobolev wrote: > Maxim Sobolev wrote: > > Here it is. With this patch pkg_install treats any arguments as shell globs by > default and as regexs with -x, so for example the following is equivalent: > $ pkg_info foo\* > $ pkg_info -x ^foo.\* > > Please let me know what do you think about those patches. Finally got the time to look them over; they work great! Just one minor thing - look at the attached patch to completely get rid of the AllInstalled variable, and make pkg_info DTRT when called with no arguments (that was the first thing I tried, and it failed badly :) Great work, thanks! G'luck, Peter -- I've heard that this sentence is a rumor. diff -urN pkg_install-orig/info/main.c pkg_install/info/main.c --- pkg_install-orig/info/main.c Thu Feb 8 11:41:05 2001 +++ pkg_install/info/main.c Thu Feb 8 12:14:37 2001 @@ -32,7 +32,6 @@ int Flags = 0; match_t MatchType = MATCH_GLOB; -Boolean AllInstalled = FALSE; Boolean Quiet = FALSE; char *InfoPrefix = ""; char PlayPen[FILENAME_MAX]; @@ -49,7 +48,7 @@ pkgs = start = argv; if (argc == 1) { - AllInstalled = TRUE; + MatchType = MATCH_ALL; Flags = SHOW_INDEX; } else while ((ch = getopt(argc, argv, Options)) != -1) { @@ -186,7 +185,7 @@ } /* If no packages, yelp */ - if (pkgs == start && !AllInstalled && !CheckPkg) + if (pkgs == start && (MatchType != MATCH_ALL) && !CheckPkg) warnx("missing package name(s)"), usage(); *pkgs = NULL; return pkg_perform(start); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message