diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-07-30 17:03:56 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-07-30 17:03:56 +0000 |
commit | 54eac85aa9157aa01ef0e0cc50d11c8a2414e104 (patch) | |
tree | 379fa56023b5a37de1ea5d6473876c4d6817f0d2 | |
parent | 4871c244b90207d99d350379b16de4fabbf3f92a (diff) |
basic support for ftp:// in PKG_PATH. ok pvalchev@
-rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index fef7770e5ab..a11d4c93f7a 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -1,7 +1,7 @@ -/* $OpenBSD: file.c,v 1.22 2003/07/04 17:31:19 avsm Exp $ */ +/* $OpenBSD: file.c,v 1.23 2003/07/30 17:03:55 tedu Exp $ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: file.c,v 1.22 2003/07/04 17:31:19 avsm Exp $"; +static const char rcsid[] = "$OpenBSD: file.c,v 1.23 2003/07/30 17:03:55 tedu Exp $"; #endif /* @@ -401,11 +401,15 @@ fileFindByPath(char *base, char *fname) } cp = getenv("PKG_PATH"); + /* Check for ftp://... paths */ + if (isURL(cp)) { + snprintf(tmp, sizeof(tmp), "%s/%s", cp, ensure_tgz(fname)); + return tmp; + } while (cp) { char *cp2 = strsep(&cp, ":"); - snprintf(tmp, sizeof(tmp), "%s/%s", cp2 ? cp2 : cp, - ensure_tgz(fname)); + snprintf(tmp, sizeof(tmp), "%s/%s", cp2, ensure_tgz(fname)); if (ispkgpattern(tmp)) { char *s; s = findbestmatchingname(dirname_of(tmp), |