Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Feb 2001 12:20:13 +0200
From:      Peter Pentchev <roam@orbitel.bg>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        Jordan Hubbard <jkh@winston.osd.bsdi.com>, ports@FreeBSD.org, jkh@FreeBSD.org, Edwin Groothuis <mavetju@chello.nl>
Subject:   Re: Request for comments [Fwd: bin/24695: [patch] pkg_info: prefix search for a package]
Message-ID:  <20010208122012.H21672@ringworld.oblivion.bg>
In-Reply-To: <3A801D32.DE73F780@FreeBSD.org>; from sobomax@FreeBSD.org on Tue, Feb 06, 2001 at 05:50:10PM %2B0200
References:  <10197.981450491@winston.osd.bsdi.com> <3A7FC36A.1434D2CC@FreeBSD.org> <3A801D32.DE73F780@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010208122012.H21672>