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 Remove first obstactle in p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fbf529f7bfb3
branches:  trunk
changeset: 531423:fbf529f7bfb3
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Jul 30 08:09:14 2007 +0000

description:
Remove first obstactle in pkg_add for switching to libarchive:
MASTER/SLAVE mode is gone now.

Bump version to 20070730.

diffstat:

 pkgtools/pkg_install/files/add/main.c       |  47 ++++++++---------------
 pkgtools/pkg_install/files/add/perform.c    |  27 ++++---------
 pkgtools/pkg_install/files/add/pkg_add.1    |  56 ++--------------------------
 pkgtools/pkg_install/files/add/pkg_add.cat1 |  28 ++------------
 pkgtools/pkg_install/files/lib/version.h    |   4 +-
 5 files changed, 36 insertions(+), 126 deletions(-)

diffs (truncated from 321 to 300 lines):

diff -r d19ea7a24131 -r fbf529f7bfb3 pkgtools/pkg_install/files/add/main.c
--- a/pkgtools/pkg_install/files/add/main.c     Mon Jul 30 08:07:00 2007 +0000
+++ b/pkgtools/pkg_install/files/add/main.c     Mon Jul 30 08:09:14 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.10 2006/06/27 23:36:13 hubertf Exp $        */
+/*     $NetBSD: main.c,v 1.11 2007/07/30 08:09:14 joerg 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.10 2006/06/27 23:36:13 hubertf Exp $");
+__RCSID("$NetBSD: main.c,v 1.11 2007/07/30 08:09:14 joerg Exp $");
 #endif
 #endif
 
@@ -49,7 +49,7 @@
 #include "add.h"
 #include "verify.h"
 
-static char Options[] = "AIK:LMRSVW:fhnp:s:t:uvw:";
+static char Options[] = "AIK:LRVW:fhnp:s:t:uvw:";
 
 char   *Prefix = NULL;
 char   *View = NULL;
@@ -65,14 +65,13 @@
 char   *PkgName = NULL;
 char   *Directory = NULL;
 char    FirstPen[MaxPathSize];
-add_mode_t AddMode = NORMAL;
 int     Replace = 0;
 
 static void
 usage(void)
 {
        (void) fprintf(stderr, "%s\n%s\n%s\n",
-           "usage: pkg_add [-AfhILMnRSuVv] [-K pkg_dbdir] [-p prefix]",
+           "usage: pkg_add [-AfhILnRuVv] [-K pkg_dbdir] [-p prefix]",
            "               [-s verification-type] [-t template] [-W viewbase] [-w view]",
            "               [[ftp|http]://[user[:password]@]host[:port]][/path/]pkg-name ...");
        exit(1);
@@ -109,10 +108,6 @@
                        NoView = TRUE;
                        break;
 
-               case 'M':
-                       AddMode = MASTER;
-                       break;
-
                case 'R':
                        NoRecord = TRUE;
                        break;
@@ -126,10 +121,6 @@
                        Prefix = optarg;
                        break;
 
-               case 'S':
-                       AddMode = SLAVE;
-                       break;
-
                case 's':
                        set_verification(optarg);
                        break;
@@ -171,25 +162,21 @@
        path_create(getenv("PKG_PATH"));
        TAILQ_INIT(&pkgs);
 
-       if (AddMode != SLAVE) {
-               /* Get all the remaining package names, if any */
-               for (ch = 0; *argv; ch++, argv++) {
-                       lpkg_t *lpp;
-
-                       if (IS_STDIN(*argv))
-                               lpp = alloc_lpkg("-");
-                       else
-                               lpp = alloc_lpkg(*argv);
+       /* Get all the remaining package names, if any */
+       for (ch = 0; *argv; ch++, argv++) {
+               lpkg_t *lpp;
 
-                       TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link);
-               }
+               if (IS_STDIN(*argv))
+                       lpp = alloc_lpkg("-");
+               else
+                       lpp = alloc_lpkg(*argv);
 
-               if (!ch)
-                       /* If no packages, yelp */
-                       warnx("missing package name(s)"), usage();
-               else if (ch > 1 && AddMode == MASTER)
-                       warnx("only one package name may be specified with master mode"),
-                               usage();
+               TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link);
+       }
+
+       if (!ch) {
+               /* If no packages, yelp */
+               warnx("missing package name(s)"), usage();
        }
        
        /* Increase # of max. open file descriptors as high as possible */
diff -r d19ea7a24131 -r fbf529f7bfb3 pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Mon Jul 30 08:07:00 2007 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Mon Jul 30 08:09:14 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.50 2007/07/26 11:30:55 joerg Exp $       */
+/*     $NetBSD: perform.c,v 1.51 2007/07/30 08:09:14 joerg Exp $       */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -14,7 +14,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.50 2007/07/26 11:30:55 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.51 2007/07/30 08:09:14 joerg Exp $");
 #endif
 #endif
 
@@ -376,13 +376,6 @@
                /* Check for sanity */
                if (sanity_check(pkg))
                        goto bomb;
-
-               /* If we're running in MASTER mode, just output the plist and return */
-               if (AddMode == MASTER) {
-                       printf("%s\n", where_playpen());
-                       write_plist(&Plist, stdout, NULL);
-                       return 0;
-               }
        }
 
        /* Read the OS, version and architecture from BUILD_INFO file */
@@ -1053,16 +1046,12 @@
 
        TAILQ_INIT(&files);
 
-       if (AddMode == SLAVE)
-               err_cnt = pkg_do(NULL, NULL);
-       else {
-               while ((lpp = TAILQ_FIRST(pkgs)) != NULL) {
-                       path_prepend_from_pkgname(lpp->lp_name);
-                       err_cnt += pkg_do(lpp->lp_name, pkgs);
-                       path_prepend_clear();
-                       TAILQ_REMOVE(pkgs, lpp, lp_link);
-                       free_lpkg(lpp);
-               }
+       while ((lpp = TAILQ_FIRST(pkgs)) != NULL) {
+               path_prepend_from_pkgname(lpp->lp_name);
+               err_cnt += pkg_do(lpp->lp_name, pkgs);
+               path_prepend_clear();
+               TAILQ_REMOVE(pkgs, lpp, lp_link);
+               free_lpkg(lpp);
        }
        
        ftp_stop();
diff -r d19ea7a24131 -r fbf529f7bfb3 pkgtools/pkg_install/files/add/pkg_add.1
--- a/pkgtools/pkg_install/files/add/pkg_add.1  Mon Jul 30 08:07:00 2007 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.1  Mon Jul 30 08:09:14 2007 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.21 2007/07/26 11:30:55 joerg Exp $
+.\" $NetBSD: pkg_add.1,v 1.22 2007/07/30 08:09:15 joerg Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -25,7 +25,7 @@
 .Nd a utility for installing and upgrading software package distributions
 .Sh SYNOPSIS
 .Nm
-.Op Fl AfILMnRSuVv
+.Op Fl AfILnRuVv
 .Op Fl K Ar pkg_dbdir
 .Op Fl p Ar prefix
 .Op Fl s Ar verification-type
@@ -136,28 +136,6 @@
 .Pa /var/db/pkg .
 .It Fl L
 Don't add the package to any views after installation.
-.It Fl M
-Run in
-.Cm MASTER
-mode.
-This is a very specialized mode for running
-.Nm
-and is meant to be run in conjunction with
-.Cm SLAVE
-mode.
-When run in this mode,
-.Nm
-does no work beyond extracting the package into a temporary staging
-area (see the
-.Fl t
-option), reading in the packing list, and then dumping it (prefaced by
-the current staging area) to stdout where it may be filtered by a
-program such as
-.Xr sed 1 .
-When used in conjunction with
-.Cm SLAVE
-mode, it allows you to make radical changes to the package structure
-before acting on its contents.
 .It Fl n
 Don't actually install a package, just report the steps that
 would be taken if it was.
@@ -173,37 +151,13 @@
 .Nm
 has no way of knowing which directory settings are relative and
 which are absolute.
-It is rare in any case to see more than one directory transition made,
-but when such does happen and you wish to have control over *all* directory
-transitions, then you may then wish to look into the use of
-.Cm MASTER
-and
-.Cm SLAVE
-modes (see the
-.Fl M
-and
-.Fl S
-options).
+Only one directory transition is supported and the second one is expected to go
+into
+.Ar pkgdb .
 .It Fl R
 Do not record the installation of a package.
 This means that you cannot deinstall it later, so only use this option if
 you know what you are doing!
-.It Fl S
-Run in
-.Cm SLAVE
-mode.
-This is a very specialized mode for running
-.Nm
-and is meant to be run in conjunction with
-.Cm MASTER
-mode.
-When run in this mode,
-.Nm
-expects the release contents to be already extracted and waiting
-in the staging area, the location of which is read as a string
-from stdin.
-The complete packing list is also read from stdin,
-and the contents then acted on as normal.
 .It Fl s Ar verification-type
 Use a callout to an external program to verify the binary package
 being installed against an existing detached signature file.
diff -r d19ea7a24131 -r fbf529f7bfb3 pkgtools/pkg_install/files/add/pkg_add.cat1
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1       Mon Jul 30 08:07:00 2007 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1       Mon Jul 30 08:09:14 2007 +0000
@@ -5,7 +5,7 @@
      tributions
 
 SSYYNNOOPPSSIISS
-     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]
+     ppkkgg__aadddd [--AAffIILLnnRRuuVVvv] [--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 ...
 
@@ -72,16 +72,6 @@
 
      --LL      Don't add the package to any views after installation.
 
-     --MM      Run in MMAASSTTEERR mode.  This is a very specialized mode for running
-             ppkkgg__aadddd and is meant to be run in conjunction with SSLLAAVVEE mode.
-             When run in this mode, ppkkgg__aadddd does no work beyond extracting the
-             package into a temporary staging area (see the --tt option), read-
-             ing in the packing list, and then dumping it (prefaced by the
-             current staging area) to stdout where it may be filtered by a
-             program such as sed(1).  When used in conjunction with SSLLAAVVEE
-             mode, it allows you to make radical changes to the package struc-
-             ture before acting on its contents.
-
      --nn      Don't actually install a package, just report the steps that
              would be taken if it was.
 
@@ -90,24 +80,14 @@
              package.  If a package has set its default directory, it will be
              overridden by this flag.  Note that only the first @@ccwwdd directive
              will be replaced, since ppkkgg__aadddd has no way of knowing which
-             directory settings are relative and which are absolute.  It is
-             rare in any case to see more than one directory transition made,
-             but when such does happen and you wish to have control over *all*
-             directory transitions, then you may then wish to look into the
-             use of MMAASSTTEERR and SSLLAAVVEE modes (see the --MM and --SS options).
+             directory settings are relative and which are absolute.  Only one
+             directory transition is supported and the second one is expected
+             to go into _p_k_g_d_b.
 
      --RR      Do not record the installation of a package.  This means that you
              cannot deinstall it later, so only use this option if you know
              what you are doing!
 
-     --SS      Run in SSLLAAVVEE mode.  This is a very specialized mode for running
-             ppkkgg__aadddd and is meant to be run in conjunction with MMAASSTTEERR mode.
-             When run in this mode, ppkkgg__aadddd expects the release contents to be
-             already extracted and waiting in the staging area, the location
-             of which is read as a string from stdin.  The complete packing
-             list is also read from stdin, and the contents then acted on as
-             normal.



Home | Main Index | Thread Index | Old Index