pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Sync pkgtools/pkg_install with src/usr.sbin/pkg_instal...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d390a4b5c6b4
branches:  trunk
changeset: 463144:d390a4b5c6b4
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Oct 29 23:00:27 2003 +0000

description:
Sync pkgtools/pkg_install with src/usr.sbin/pkg_install from 20031003.
New features include fetching binary packages using HTTP (thanks wiz!)
and some minor speed optimizations for pkg_delete.

diffstat:

 doc/CHANGES                                 |     3 +-
 pkgtools/pkg_install/files/README           |     4 +-
 pkgtools/pkg_install/files/add/futil.c      |     8 +-
 pkgtools/pkg_install/files/add/pkg_add.1    |    22 +-
 pkgtools/pkg_install/files/add/pkg_add.cat1 |    25 +-
 pkgtools/pkg_install/files/create/pl.c      |     8 +-
 pkgtools/pkg_install/files/delete/perform.c |     8 +-
 pkgtools/pkg_install/files/lib/fexec.c      |     8 +-
 pkgtools/pkg_install/files/lib/file.c       |    54 +-
 pkgtools/pkg_install/files/lib/ftpio.c      |  1155 +++++++++++++++++---------
 pkgtools/pkg_install/files/lib/lib.h        |     8 +-
 pkgtools/pkg_install/files/lib/str.c        |    20 +-
 pkgtools/pkg_install/files/lib/version.h    |     4 +-
 13 files changed, 855 insertions(+), 472 deletions(-)

diffs (truncated from 1928 to 300 lines):

diff -r a5f3fedee61a -r d390a4b5c6b4 doc/CHANGES
--- a/doc/CHANGES       Wed Oct 29 22:59:04 2003 +0000
+++ b/doc/CHANGES       Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.3760 2003/10/29 22:59:04 xtraeme Exp $
+$NetBSD: CHANGES,v 1.3761 2003/10/29 23:02:34 jlam Exp $
 
 Changes to the packages collection and infrastructure in 2003:
 
@@ -4279,3 +4279,4 @@
        Updated sun-jre14 to 2.2 [jschauma 2003-10-29]
        Updated sun-jdk14 to 2.2 [jschauma 2003-10-29]
        Updated MozillaFirebird-bin-realplayer to 1.0nb1 [xtraeme 2003-10-29]
+       Updated pkg_install to 20031003 [jlam 2003-10-29]
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/README
--- a/pkgtools/pkg_install/files/README Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/README Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.3 2003/09/23 07:13:45 grant Exp $
+# $NetBSD: README,v 1.4 2003/10/29 23:00:27 jlam Exp $
 # Original from FreeBSD, no rcs id.
 
 This is the pkg_install suite of tools for doing maintainance of
@@ -12,7 +12,7 @@
 
 In another round of enhancements, NetBSD changes were added by
 Alistair Crooks, Hubert Feyrer, Thorsten Frueauf, Christian E. Hopps,
-Johnny Lam and Matthias Scheler.
+Thomas Klausner, Johnny Lam, and Matthias Scheler.
 
 When making snapshots, please modify PKGTOOLS_VERSION in lib/version.h
 to that day's date.
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/add/futil.c
--- a/pkgtools/pkg_install/files/add/futil.c    Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/add/futil.c    Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: futil.c,v 1.5 2003/09/23 13:22:38 grant Exp $  */
+/*     $NetBSD: futil.c,v 1.6 2003/10/29 23:00:28 jlam Exp $   */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: futil.c,v 1.7 1997/10/08 07:45:39 charnier Exp";
 #else
-__RCSID("$NetBSD: futil.c,v 1.5 2003/09/23 13:22:38 grant Exp $");
+__RCSID("$NetBSD: futil.c,v 1.6 2003/10/29 23:00:28 jlam Exp $");
 #endif
 #endif
 
@@ -95,8 +95,8 @@
        if (Owner != NULL && Group != NULL) {
                if (snprintf(owner_group, sizeof(owner_group),
                             "%s:%s", Owner, Group) > sizeof(owner_group)) {
-                       warnx("'%s:%s' is too long (%d max)",
-                             Owner, Group, sizeof(owner_group));
+                       warnx("'%s:%s' is too long (%lu max)",
+                             Owner, Group, (unsigned long) sizeof(owner_group));
                        return;
                }
                if (fcexec(cd_to, CHOWN_CMD, "-R", owner_group, arg))
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/add/pkg_add.1
--- a/pkgtools/pkg_install/files/add/pkg_add.1  Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.1  Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.5 2003/09/23 07:13:47 grant Exp $
+.\" $NetBSD: pkg_add.1,v 1.6 2003/10/29 23:00:28 jlam Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_add.1
 .\"
-.Dd September 8, 2003
+.Dd October 3, 2003
 .Dt PKG_ADD 1
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@
 .Bk -words
 .Op Fl w Ar view
 .Ek
-.Ar \fR[ftp://[\fIuser\fR[:\fIpassword]\fR@]\fIhost\fR[:\fIport\fR]][/\fIpath/\fR]pkg-name ...
+.Ar \fR[[ftp|http]://[\fIuser\fR[:\fIpassword]\fR@]\fIhost\fR[:\fIport\fR]][/\fIpath/\fR]pkg-name ...
 .Sh DESCRIPTION
 The
 .Nm
@@ -56,7 +56,7 @@
 configurations, installation instructions and/or other files.
 .Nm
 can recursively install other packages that the current package
-depends on or requires from both local disk and via FTP.
+depends on or requires from both local disk and via FTP or HTTP.
 .Sh WARNING
 .Bf -emphasis
 Since the
@@ -273,15 +273,17 @@
 package (these usually ending with the ``.tgz'' suffix) or a
 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.
+locations (e.g.,
 .Nm
-ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/shells/bash-2.04.tgz).
-Note:  If you wish to use
+ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/shells/bash-2.04.tgz
+or
+.Nm
+http://www.example.org/packages/screen-4.0.tbz).
+Note:  For ftp transfers, if you wish to use
 .Bf -emphasis
 passive mode
 .Ef
-ftp in such transfers, set
-the variable
+ftp in such transfers, set the variable
 .Bf -emphasis
 FTP_PASSIVE_MODE
 .Ef
@@ -558,6 +560,8 @@
 .It "Hubert Feyrer"
 .Nx
 wildcard dependency processing, pkgdb, upgrading, etc.
+.It Thomas Klausner
+HTTP support.
 .El
 .Sh BUGS
 Hard links between files in a distribution are only preserved if either
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/add/pkg_add.cat1
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1       Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1       Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-PKG_ADD(1)              NetBSD General Commands Manual              PKG_ADD(1)
+PKG_ADD(1)                  NetBSD Reference Manual                 PKG_ADD(1)
 
 NNAAMMEE
      ppkkgg__aadddd - a utility for installing and upgrading software package distri-
@@ -7,7 +7,7 @@
 SSYYNNOOPPSSIISS
      ppkkgg__aadddd [--ffIILLMMnnRRSSuuVVvv] [--KK _p_k_g___d_b_d_i_r] [--pp _p_r_e_f_i_x] [--ss _v_e_r_i_f_i_c_a_t_i_o_n_-_t_y_p_e]
              [--tt _t_e_m_p_l_a_t_e] [--WW _v_i_e_w_b_a_s_e] [--ww _v_i_e_w]
-             [ftp://[_u_s_e_r[:_p_a_s_s_w_o_r_d_]@]_h_o_s_t[:_p_o_r_t]][/_p_a_t_h_/]pkg-name ...
+             [[ftp|http]://[_u_s_e_r[:_p_a_s_s_w_o_r_d_]@]_h_o_s_t[:_p_o_r_t]][/_p_a_t_h_/]pkg-name ...
 
 DDEESSCCRRIIPPTTIIOONN
      The ppkkgg__aadddd command is used to extract and upgrade packages that have
@@ -15,7 +15,7 @@
      prepared collections of pre-built binaries, documentation, configura-
      tions, installation instructions and/or other files.  ppkkgg__aadddd can recur-
      sively install other packages that the current package depends on or re-
-     quires from both local disk and via FTP.
+     quires from both local disk and via FTP or HTTP.
 
 WWAARRNNIINNGG
      _S_i_n_c_e _t_h_e ppkkgg__aadddd _c_o_m_m_a_n_d _m_a_y _e_x_e_c_u_t_e _s_c_r_i_p_t_s _o_r _p_r_o_g_r_a_m_s _c_o_n_t_a_i_n_e_d 
_w_i_t_h_-
@@ -146,14 +146,15 @@
      One or more _p_k_g_-_n_a_m_e 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 or web site.  Thus you may
-     extract files directly from their anonymous ftp or WWW locations (e.g.
+     extract files directly from their anonymous ftp or WWW locations (e.g.,
      ppkkgg__aadddd ftp://ftp.NetBSD.org/pub/NetBSD/pack-
-     ages/1.5/i386/shells/bash-2.04.tgz).  Note:  If you wish to use _p_a_s_s_i_v_e
-     _m_o_d_e ftp in such transfers, set the variable _F_T_P___P_A_S_S_I_V_E___M_O_D_E to some
-     value in your environment.  Otherwise, the more standard ACTIVE mode may
-     be used.  If ppkkgg__aadddd consistently fails to fetch a package from a site
-     known to work, it may be because you have a firewall that demands the us-
-     age of _p_a_s_s_i_v_e _m_o_d_e ftp.
+     ages/1.5/i386/shells/bash-2.04.tgz or ppkkgg__aadddd http://www.exam-
+     ple.org/packages/screen-4.0.tbz).  Note:  For ftp transfers, if you wish
+     to use _p_a_s_s_i_v_e _m_o_d_e  ftp in such transfers, set the variable _F_T_P___P_A_S_-
+     _S_I_V_E___M_O_D_E  to some value in your environment.  Otherwise, the more stan-
+     dard ACTIVE mode may be used.  If ppkkgg__aadddd consistently fails to fetch a
+     package from a site known to work, it may be because you have a firewall
+     that demands the usage of _p_a_s_s_i_v_e _m_o_d_e  ftp.
 
 TTEECCHHNNIICCAALL DDEETTAAIILLSS
      ppkkgg__aadddd extracts each package's "packing list" into a special staging di-
@@ -320,6 +321,8 @@
              NetBSD refinements.
      Hubert Feyrer
              NetBSD wildcard dependency processing, pkgdb, upgrading, etc.
+     Thomas Klausner
+             HTTP support.
 
 BBUUGGSS
      Hard links between files in a distribution are only preserved if either
@@ -334,4 +337,4 @@
 
      Sure to be others.
 
-NetBSD 1.6                     September 8, 2003                    NetBSD 1.6
+NetBSD 1.6.1                    October 3, 2003                              6
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/create/pl.c
--- a/pkgtools/pkg_install/files/create/pl.c    Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/create/pl.c    Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pl.c,v 1.5 2003/09/23 07:13:50 grant Exp $     */
+/*     $NetBSD: pl.c,v 1.6 2003/10/29 23:00:28 jlam Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp";
 #else
-__RCSID("$NetBSD: pl.c,v 1.5 2003/09/23 07:13:50 grant Exp $");
+__RCSID("$NetBSD: pl.c,v 1.6 2003/10/29 23:00:28 jlam Exp $");
 #endif
 #endif
 
@@ -63,10 +63,10 @@
                        for (slashc = 0, slash = &name[prefixcc + 1]; (slash = strchr(slash, '/')) != (char *) NULL; slash++, slashc++) {
                        }
                        for (cc = i = 0; i < slashc; i++) {
-                               strnncpy(&newtgt[cc], sizeof(newtgt) - cc, "../", 3);
+                               strlcpy(&newtgt[cc], "../", sizeof(newtgt) - cc);
                                cc += 3;
                        }
-                       strnncpy(&newtgt[cc], sizeof(newtgt) - cc, &oldtgt[prefixcc + 1], strlen(&oldtgt[prefixcc + 1]));
+                       strlcpy(&newtgt[cc], &oldtgt[prefixcc + 1], sizeof(newtgt) - cc);
                        (void) fprintf(stderr, "Full pathname symlink `%s' is target of `%s' - adjusting to `%s'\n", oldtgt, name, newtgt);
                        if (unlink(name) != 0) {
                                warn("can't unlink `%s'", name);
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/delete/perform.c
--- a/pkgtools/pkg_install/files/delete/perform.c       Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/delete/perform.c       Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.9 2003/09/23 13:22:39 grant Exp $        */
+/*     $NetBSD: perform.c,v 1.10 2003/10/29 23:00:28 jlam Exp $        */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.9 2003/09/23 13:22:39 grant Exp $");
+__RCSID("$NetBSD: perform.c,v 1.10 2003/10/29 23:00:28 jlam Exp $");
 #endif
 #endif
 
@@ -628,7 +628,7 @@
                TAILQ_INIT(&trypkgs);
                snprintf(try, FILENAME_MAX, "%s-[0-9]*", pkg);
                if (findmatchingname(_pkgdb_getPKGDB_DIR(), try,
-                       add_to_list_fn, &trypkgs) == NULL) {
+                       add_to_list_fn, &trypkgs) == 0) {
                        warnx("package '%s' not installed", pkg);
                        return 1;
                }
@@ -836,7 +836,7 @@
        if (!Fake) {
                /* Finally nuke the +-files and the pkgdb-dir (/var/db/pkg/foo) */
                if (is_depoted_pkg) {
-                       (void) vsystem("%s %s/+*", REMOVE_CMD, LogDir);
+                       (void) remove_files(LogDir, "+*");
                        if (isemptydir(LogDir))
                                (void) fexec(RMDIR_CMD, LogDir, NULL);
                        else
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/lib/fexec.c
--- a/pkgtools/pkg_install/files/lib/fexec.c    Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/lib/fexec.c    Wed Oct 29 23:00:27 2003 +0000
@@ -65,7 +65,7 @@
 #include "lib.h"
 
 #ifndef lint
-__RCSID("$NetBSD: fexec.c,v 1.4 2003/09/23 13:22:41 grant Exp $");
+__RCSID("$NetBSD: fexec.c,v 1.5 2003/10/29 23:00:28 jlam Exp $");
 #endif
 
 static int     vfcexec(const char *, int, const char *, va_list);
@@ -82,7 +82,7 @@
        if (argv == NULL) {
                argv = malloc(max * sizeof(const char *));
                if (argv == NULL) {
-                       warnx("vfcexec can't alloc arg space");
+                       warn("vfcexec: Can't alloc arg space");
                        return -1;
                }
        }
@@ -98,8 +98,10 @@
                        new = max * 2;
                        ptr = realloc(argv, new * sizeof(const char *));
                        if (ptr == NULL) {
-                               warnx("vfcexec can't alloc arg space");
+                               warn("vfcexec: Can't alloc arg space");
                                free(argv);
+                               argv = NULL;
+                               max = 4;
                                return -1;
                        }
                        argv = ptr;
diff -r a5f3fedee61a -r d390a4b5c6b4 pkgtools/pkg_install/files/lib/file.c
--- a/pkgtools/pkg_install/files/lib/file.c     Wed Oct 29 22:59:04 2003 +0000
+++ b/pkgtools/pkg_install/files/lib/file.c     Wed Oct 29 23:00:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file.c,v 1.8 2003/09/23 13:22:41 grant Exp $   */
+/*     $NetBSD: file.c,v 1.9 2003/10/29 23:00:28 jlam Exp $    */



Home | Main Index | Thread Index | Old Index