Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pkg_install Add support for fetching packages from ...



details:   https://anonhg.NetBSD.org/src/rev/f1e6a0ff3530
branches:  trunk
changeset: 473684:f1e6a0ff3530
user:      cgd <cgd%NetBSD.org@localhost>
date:      Tue Jun 15 06:32:00 1999 +0000

description:
Add support for fetching packages from HTTP URLs.  Since 'ftp' is already
invoked for (FTP) URLs, this was just a matter of recognizing HTTP URLs
in the places where FTP URLs were recognized (and updating a comment and
the manual page).

diffstat:

 usr.sbin/pkg_install/add/perform.c |   9 ++++++---
 usr.sbin/pkg_install/add/pkg_add.1 |   6 +++---
 usr.sbin/pkg_install/lib/file.c    |  16 ++++++++++++----
 3 files changed, 21 insertions(+), 10 deletions(-)

diffs (99 lines):

diff -r 3903dc483050 -r f1e6a0ff3530 usr.sbin/pkg_install/add/perform.c
--- a/usr.sbin/pkg_install/add/perform.c        Tue Jun 15 05:44:22 1999 +0000
+++ b/usr.sbin/pkg_install/add/perform.c        Tue Jun 15 06:32:00 1999 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.30 1999/05/12 20:43:49 tron Exp $        */
+/*     $NetBSD: perform.c,v 1.31 1999/06/15 06:32:00 cgd Exp $ */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.30 1999/05/12 20:43:49 tron Exp $");
+__RCSID("$NetBSD: perform.c,v 1.31 1999/06/15 06:32:00 cgd Exp $");
 #endif
 #endif
 
@@ -117,7 +117,10 @@
     }
     /* Nope - do it now */
     else {
-       /* Is it an ftp://foo.bar.baz/file.tgz specification? */
+       /*
+        * Is it an ftp://foo.bar.baz/file.tgz or http://foo.bar.baz/file.tgz
+        * specification?
+        */
        if (isURL(pkg)) {
            if (ispkgpattern(pkg)) {
                warnx("patterns not allowed in URLs, "
diff -r 3903dc483050 -r f1e6a0ff3530 usr.sbin/pkg_install/add/pkg_add.1
--- a/usr.sbin/pkg_install/add/pkg_add.1        Tue Jun 15 05:44:22 1999 +0000
+++ b/usr.sbin/pkg_install/add/pkg_add.1        Tue Jun 15 06:32:00 1999 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.14 1999/03/22 18:44:02 garbled Exp $
+.\" $NetBSD: pkg_add.1,v 1.15 1999/06/15 06:32:00 cgd Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintainance
 .\" of non-core utilities.
@@ -178,8 +178,8 @@
 .Ar pkg-name
 arguments may be specified, each being either a file containing the
 package (these usually ending with the ``.tgz'' suffix) or a
-URL pointing at a file available on an ftp site.  Thus you may
-extract files directly from their anonymous ftp locations (e.g.
+URL pointing at a file available on an ftp or web site.  Thus you may
+extract files directly from their anonymous ftp or WWW locations (e.g.
 .Nm
 ftp://ftp.netbsd.org/pub/NetBSD/packages/1.3.2/i386/shells/bash-2.02.1.tgz).
 Note:  If you wish to use
diff -r 3903dc483050 -r f1e6a0ff3530 usr.sbin/pkg_install/lib/file.c
--- a/usr.sbin/pkg_install/lib/file.c   Tue Jun 15 05:44:22 1999 +0000
+++ b/usr.sbin/pkg_install/lib/file.c   Tue Jun 15 06:32:00 1999 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: file.c,v 1.26 1999/04/12 00:29:51 hubertf Exp $        */
+/*     $NetBSD: file.c,v 1.27 1999/06/15 06:32:01 cgd Exp $    */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
 #else
-__RCSID("$NetBSD: file.c,v 1.26 1999/04/12 00:29:51 hubertf Exp $");
+__RCSID("$NetBSD: file.c,v 1.27 1999/06/15 06:32:01 cgd Exp $");
 #endif
 #endif
 
@@ -182,6 +182,8 @@
        ++fname;
     if (!strncmp(fname, "ftp://";, 6))
        return TRUE;
+    if (!strncmp(fname, "http://";, 7))
+       return TRUE;
     return FALSE;
 }
 
@@ -194,7 +196,10 @@
     while (isspace((unsigned char)*fname))
        ++fname;
     /* Don't ever call this on a bad URL! */
-    fname += strlen("ftp://";);
+    if (!strncmp(fname, "ftp://";, 6))
+       fname += strlen("ftp://";);
+    else
+       fname += strlen("http://";);
     /* Do we have a place to stick our work? */
     if ((ret = where) != NULL) {
        while (*fname && *fname != '/' && max--)
@@ -219,7 +224,10 @@
     while (isspace((unsigned char)*fname))
        ++fname;
     /* Don't ever call this on a bad URL! */
-    fname += strlen("ftp://";);
+    if (!strncmp(fname, "ftp://";, 6))
+       fname += strlen("ftp://";);
+    else
+       fname += strlen("http://";);
     /* Do we have a place to stick our work? */
     if ((ret = where) != NULL) {
        while (*fname && *fname != '/')



Home | Main Index | Thread Index | Old Index