pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files Sync with base system as of...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/66b3307be2fa
branches:  trunk
changeset: 502502:66b3307be2fa
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sat Nov 05 13:20:08 2005 +0000

description:
Sync with base system as of Sat Nov  5 13:19:32 UTC 2005.
Welcome to 20051103!
Now with "automatic" support.

diffstat:

 pkgtools/pkg_install/files/add/add.h            |    3 +-
 pkgtools/pkg_install/files/add/main.c           |   13 +-
 pkgtools/pkg_install/files/add/perform.c        |   21 +-
 pkgtools/pkg_install/files/add/pkg_add.1        |   32 +-
 pkgtools/pkg_install/files/add/pkg_add.cat1     |   21 +-
 pkgtools/pkg_install/files/admin/main.c         |  130 ++++++++++-
 pkgtools/pkg_install/files/admin/pkg_admin.1    |   19 +-
 pkgtools/pkg_install/files/admin/pkg_admin.cat1 |   12 +-
 pkgtools/pkg_install/files/bpm/bpm.sh.in        |    2 +-
 pkgtools/pkg_install/files/info/info.h          |   12 +-
 pkgtools/pkg_install/files/info/main.c          |   35 +-
 pkgtools/pkg_install/files/info/perform.c       |   69 +++-
 pkgtools/pkg_install/files/info/pkg_info.1      |   35 +-
 pkgtools/pkg_install/files/info/pkg_info.cat1   |   16 +-
 pkgtools/pkg_install/files/info/show.c          |   49 +---
 pkgtools/pkg_install/files/lib/automatic.c      |   80 ++++++
 pkgtools/pkg_install/files/lib/config.h         |  193 ++++++++++++++++
 pkgtools/pkg_install/files/lib/dewey.c          |  282 +++++++++++++++++++++++
 pkgtools/pkg_install/files/lib/dewey.h          |   19 +
 pkgtools/pkg_install/files/lib/lib.h            |   20 +-
 pkgtools/pkg_install/files/lib/plist.c          |   17 +-
 pkgtools/pkg_install/files/lib/str.c            |  285 +-----------------------
 pkgtools/pkg_install/files/lib/var.c            |  239 ++++++++++++++++++++
 pkgtools/pkg_install/files/lib/version.h        |    4 +-
 pkgtools/pkg_install/files/pi2nbcompat          |  141 +++++++++++
 pkgtools/pkg_install/files/pkg_install2nbcompat |    4 +-
 26 files changed, 1317 insertions(+), 436 deletions(-)

diffs (truncated from 2526 to 300 lines):

diff -r 0e74c29ad732 -r 66b3307be2fa pkgtools/pkg_install/files/add/add.h
--- a/pkgtools/pkg_install/files/add/add.h      Sat Nov 05 12:24:35 2005 +0000
+++ b/pkgtools/pkg_install/files/add/add.h      Sat Nov 05 13:20:08 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.4 2004/12/09 20:10:34 erh Exp $ */
+/* $NetBSD: add.h,v 1.5 2005/11/05 13:20:09 wiz Exp $ */
 
 /* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp  */
 
@@ -36,6 +36,7 @@
 extern Boolean NoInstall;
 extern Boolean NoRecord;
 extern Boolean Force;
+extern Boolean Automatic;
 extern int Replace;
 extern char *Mode;
 extern char *Owner;
diff -r 0e74c29ad732 -r 66b3307be2fa pkgtools/pkg_install/files/add/main.c
--- a/pkgtools/pkg_install/files/add/main.c     Sat Nov 05 12:24:35 2005 +0000
+++ b/pkgtools/pkg_install/files/add/main.c     Sat Nov 05 13:20:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.8 2004/12/29 12:16:56 agc Exp $     */
+/*     $NetBSD: main.c,v 1.9 2005/11/05 13:20:09 wiz Exp $     */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #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.8 2004/12/29 12:16:56 agc Exp $");
+__RCSID("$NetBSD: main.c,v 1.9 2005/11/05 13:20:09 wiz Exp $");
 #endif
 #endif
 
@@ -49,7 +49,7 @@
 #include "add.h"
 #include "verify.h"
 
-static char Options[] = "IK:LMRSVW:fhnp:s:t:uvw:";
+static char Options[] = "AIK:LMRSVW:fhnp:s:t:uvw:";
 
 char   *Prefix = NULL;
 char   *View = NULL;
@@ -57,6 +57,7 @@
 Boolean NoView = FALSE;
 Boolean NoInstall = FALSE;
 Boolean NoRecord = FALSE;
+Boolean Automatic = FALSE;
 
 char   *Mode = NULL;
 char   *Owner = NULL;
@@ -71,7 +72,7 @@
 usage(void)
 {
        (void) fprintf(stderr, "%s\n%s\n%s\n",
-           "usage: pkg_add [-fhILMnRSuVv] [-p prefix] [-s verification-type]",
+           "usage: pkg_add [-AfhILMnRSuVv] [-p prefix] [-s verification-type]",
            "               [-t template] [-W viewbase] [-w view]",
            "               pkg-name [pkg-name ...]");
        exit(1);
@@ -88,6 +89,10 @@
        setprogname(argv[0]);
        while ((ch = getopt(argc, argv, Options)) != -1) {
                switch (ch) {
+               case 'A':
+                       Automatic = TRUE;
+                       break;
+
                case 'f':
                        Force = TRUE;
                        break;
diff -r 0e74c29ad732 -r 66b3307be2fa pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Sat Nov 05 12:24:35 2005 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Sat Nov 05 13:20:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.33 2005/07/25 13:13:00 hubertf Exp $     */
+/*     $NetBSD: perform.c,v 1.34 2005/11/05 13:20:09 wiz 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.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.33 2005/07/25 13:13:00 hubertf Exp $");
+__RCSID("$NetBSD: perform.c,v 1.34 2005/11/05 13:20:09 wiz Exp $");
 #endif
 #endif
 
@@ -191,7 +191,8 @@
                            Viewbase ? "-W" : "", Viewbase ? Viewbase : "",
                            Force ? "-f" : "",
                            Prefix ? "-p" : "", Prefix ? Prefix : "",
-                           Verbose ? "-v" : "", name, NULL)) {
+                           Verbose ? "-v" : "",
+                           "-A", name, NULL)) {
                warnx("autoload of dependency `%s' failed%s",
                        name, Force ? " (proceeding anyway)" : "!");
                if (!Force)
@@ -346,6 +347,7 @@
                         * take up once it's unpacked.  I've noticed that most packages
                         * compress an average of 75%, so multiply by 4 for good measure.
                         */
+
                        needed = 4 * (uint64_t) sb.st_size;
                        if (!inPlace && min_free(playpen) < needed) {
                                warnx("projected size of %" PRIu64 " bytes exceeds available free space\n"
@@ -497,7 +499,15 @@
 
        /* See if this package (exact version) is already registered */
        if ((isdir(LogDir) || islinktodir(LogDir)) && !Force) {
-               warnx("package `%s' already recorded as installed", PkgName);
+               if (!Automatic && is_automatic_installed(LogDir)) {
+                       mark_as_automatic_installed(LogDir, 0);
+                       warnx("package `%s' was already installed as "
+                             "dependency, now marked as installed manually",
+                             PkgName);
+               } else {
+                       warnx("package `%s' already recorded as installed",
+                             PkgName);
+               }
                goto success;   /* close enough for government work */
        }
 
@@ -941,6 +951,8 @@
                                        warnx("cannot properly close file %s", contents);
                        }
                }
+               if (Automatic)
+                       mark_as_automatic_installed(LogDir, 1);
                if (Verbose)
                        printf("Package %s registered in %s\n", PkgName, LogDir);
        }
@@ -1064,4 +1076,3 @@
        
        return err_cnt;
 }
-
diff -r 0e74c29ad732 -r 66b3307be2fa pkgtools/pkg_install/files/add/pkg_add.1
--- a/pkgtools/pkg_install/files/add/pkg_add.1  Sat Nov 05 12:24:35 2005 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.1  Sat Nov 05 13:20:08 2005 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.15 2005/07/18 09:14:04 hubertf Exp $
+.\" $NetBSD: pkg_add.1,v 1.16 2005/11/05 13:20:09 wiz Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_add.1
 .\"
-.Dd July 13, 2005
+.Dd November 1, 2005
 .Dt PKG_ADD 1
 .Os
 .Sh NAME
@@ -25,25 +25,13 @@
 .Nd a utility for installing and upgrading software package distributions
 .Sh SYNOPSIS
 .Nm
-.Op Fl fILMnRSuVv
-.Bk -words
+.Op Fl AfILMnRSuVv
 .Op Fl K Ar pkg_dbdir
-.Ek
-.Bk -words
 .Op Fl p Ar prefix
-.Ek
-.Bk -words
 .Op Fl s Ar verification-type
-.Ek
-.Bk -words
 .Op Fl t Ar template
-.Ek
-.Bk -words
 .Op Fl W Ar viewbase
-.Ek
-.Bk -words
 .Op Fl w Ar view
-.Ek
 .Ar \fR[[ftp|http]://[\fIuser\fR[:\fIpassword]\fR@]\fIhost\fR[:\fIport\fR]][/\fIpath/\fR]pkg-name ...
 .Sh DESCRIPTION
 The
@@ -114,6 +102,20 @@
 environment variable.
 Any dependencies required by the installed package will be searched
 in the same location that the original package was installed from.
+.It Fl A
+Mark package as installed automatically, as dependency of another
+package.
+You can use
+.Dl Ic pkg_admin set automatic=YES
+to mark packages this way after installation, and
+.Dl Ic pkg_admin unset automatic
+to remove the mark.
+If you
+.Nm
+a package without specifying
+.Fl A
+after it had already been automatically installed, the mark is
+removed.
 .It Fl f
 Force installation to proceed even if prerequisite packages are not
 installed or the requirements script fails.
diff -r 0e74c29ad732 -r 66b3307be2fa pkgtools/pkg_install/files/add/pkg_add.cat1
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1       Sat Nov 05 12:24:35 2005 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1       Sat Nov 05 13:20:08 2005 +0000
@@ -1,11 +1,11 @@
 PKG_ADD(1)              NetBSD General Commands Manual              PKG_ADD(1)
 
 NNAAMMEE
-     ppkkgg__aadddd - a utility for installing and upgrading software package distri-
-     butions
+     ppkkgg__aadddd -- a utility for installing and upgrading software package dis-
+     tributions
 
 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]
+     ppkkgg__aadddd [--AAffIILLMMnnRRSSuuVVvv] [--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|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 ...
 
@@ -45,6 +45,15 @@
              required by the installed package will be searched in the same
              location that the original package was installed from.
 
+     --AA      Mark package as installed automatically, as dependency of another
+             package.  You can use
+                   ppkkgg__aaddmmiinn sseett aauuttoommaattiicc==YYEESS
+             to mark packages this way after installation, and
+                   ppkkgg__aaddmmiinn uunnsseett aauuttoommaattiicc
+             to remove the mark.  If you ppkkgg__aadddd a package without specifying
+             --AA after it had already been automatically installed, the mark is
+             removed.
+
      --ff      Force installation to proceed even if prerequisite packages are
              not installed or the requirements script fails.  Although ppkkgg__aadddd
              will still try to find and auto-install missing prerequisite
@@ -214,9 +223,7 @@
 
            7.   The package build information from _+_B_U_I_L_D___I_N_F_O is then checked
                 for IGNORE_RECOMMENDED.  If the package was built with depen-
-                dency recommendations ignored, installation will be aborted.
-                This behavior is overridable with the --ff flag and the
-                PKG_IGNORE_RECOMMENDED environment variable.
+                dency recommendations ignored, a warning will be issued.
 
            8.   If the package contains a _r_e_q_u_i_r_e script (see pkg_create(1)),
                 it is executed with the following arguments:
@@ -380,4 +387,4 @@
 
      Sure to be others.
 
-NetBSD 2.0                        May 7, 2005                       NetBSD 2.0
+NetBSD 3.0                     November 1, 2005                     NetBSD 3.0
diff -r 0e74c29ad732 -r 66b3307be2fa pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c   Sat Nov 05 12:24:35 2005 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c   Sat Nov 05 13:20:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.18 2005/03/11 21:20:15 rillig Exp $ */
+/*     $NetBSD: main.c,v 1.19 2005/11/05 13:20:09 wiz Exp $    */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.18 2005/03/11 21:20:15 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.19 2005/11/05 13:20:09 wiz Exp $");
 #endif
 
 /*
@@ -68,6 +68,9 @@
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
 
 #include "lib.h"
 
@@ -81,10 +84,11 @@
 static int     quiet;
 
 static int checkpattern_fn(const char *, void *);
+static void set_unset_variable(char **, Boolean);
 
 /* print usage message and exit */
 static void 
-usage(const char *prog)
+usage(void)
 {
        (void) fprintf(stderr, "usage: %s [-bqSV] [-d lsdir] [-K pkg_dbdir] [-s sfx] command args ...\n"
            "Where 'commands' and 'args' are:\n"
@@ -92,6 +96,8 @@
            " check [pkg ...]             - check md5 checksum of installed files\n"
            " add pkg ...                 - add pkg files to database\n"



Home | Main Index | Thread Index | Old Index