Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/usr.sbin/pkg_install/add Pull up revision 1.14 (request...
details: https://anonhg.NetBSD.org/src/rev/68506c698eb6
branches: netbsd-1-4
changeset: 470230:68506c698eb6
user: he <he%NetBSD.org@localhost>
date: Mon Jan 31 20:56:45 2000 +0000
description:
Pull up revision 1.14 (requested by hubertf):
Implement FTP wildcard depends, to give NetBSD full wildcard support
not only in pkgsrc but also for binary packages installed from
local disk or via FTP.
diffstat:
usr.sbin/pkg_install/add/main.c | 44 ++++++++++++++++++++++++++++++++++------
1 files changed, 37 insertions(+), 7 deletions(-)
diffs (77 lines):
diff -r d20e5d2fa6d6 -r 68506c698eb6 usr.sbin/pkg_install/add/main.c
--- a/usr.sbin/pkg_install/add/main.c Mon Jan 31 20:46:08 2000 +0000
+++ b/usr.sbin/pkg_install/add/main.c Mon Jan 31 20:56:45 2000 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: main.c,v 1.9.2.3 1999/11/11 21:51:10 he Exp $ */
+/* $NetBSD: main.c,v 1.9.2.4 2000/01/31 20:56:45 he Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char *rcsid = "from FreeBSD Id: main.c,v 1.16 1997/10/08 07:45:43 charnier Exp";
#else
-__RCSID("$NetBSD: main.c,v 1.9.2.3 1999/11/11 21:51:10 he Exp $");
+__RCSID("$NetBSD: main.c,v 1.9.2.4 2000/01/31 20:56:45 he Exp $");
#endif
#endif
@@ -134,24 +134,54 @@
warn("realpath failed for '%s'", *argv);
} else
lpp = alloc_lpkg(cp);
- } else if (ispkgpattern(*argv)
- && (s = findbestmatchingname(dirname_of(*argv),
+ } else if (ispkgpattern(*argv)) {
+ if ((s = findbestmatchingname(dirname_of(*argv),
basename_of(*argv))) != NULL) {
+ char tmp[FILENAME_MAX];
+
+ snprintf(tmp, sizeof(tmp), "%s/%s", dirname_of(*argv), s);
+
+ if (Verbose)
+ printf("Using %s for %s\n", tmp, *argv);
+
+ if (!(cp = realpath(tmp, pkgname))) {
+ lpp = NULL;
+ warn("realpath failed for '%s'", tmp);
+ } else
+ lpp = alloc_lpkg(cp);
+ } else {
+ lpp = NULL;
+ warnx("can't find package pattern '%s'", *argv);
+ }
+ } else {
+ /* Maybe just a pkg name w/o pattern was given */
+ char tmp[FILENAME_MAX];
+
+ snprintf(tmp, sizeof(tmp), "%s-[0-9]*.tgz", *argv);
+ s=findbestmatchingname(dirname_of(tmp),
+ basename_of(tmp));
+ if (s) {
+ char tmp2[FILENAME_MAX];
+
+ snprintf(tmp2, sizeof(tmp2), "%s/%s", dirname_of(tmp), s);
+
if (Verbose)
- printf("Using %s for %s\n", s, *argv);
+ printf("Using %s for %s\n", tmp2, *argv);
- if (!(cp = realpath(s, pkgname))) {
+ if (!(cp = realpath(tmp2, pkgname))) {
lpp = NULL;
- warn("realpath failed for '%s'", s);
+ warn("realpath failed for '%s'", tmp2);
} else
lpp = alloc_lpkg(cp);
} else {
+ /* No go there... */
/* look for the file(pattern) in the expected places */
if (!(cp = fileFindByPath(NULL, *argv))) {
lpp = NULL;
warnx("can't find package '%s'", *argv);
} else
lpp = alloc_lpkg(cp);
+ }
}
}
if (lpp)
Home |
Main Index |
Thread Index |
Old Index