diff options
author | joerg <joerg@pkgsrc.org> | 2007-07-30 08:09:14 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2007-07-30 08:09:14 +0000 |
commit | ee5d571224b1a673e4410b840183bbfa2c6e9ffc (patch) | |
tree | 88be5f7d44d7fe1504fc947d05459da9d03324b5 /pkgtools/pkg_install/files/add | |
parent | d7d48a73a728abfa51e2c8b38429325088a4b633 (diff) | |
download | pkgsrc-ee5d571224b1a673e4410b840183bbfa2c6e9ffc.tar.gz |
Remove first obstactle in pkg_add for switching to libarchive:
MASTER/SLAVE mode is gone now.
Bump version to 20070730.
Diffstat (limited to 'pkgtools/pkg_install/files/add')
-rw-r--r-- | pkgtools/pkg_install/files/add/main.c | 45 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 27 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/pkg_add.1 | 56 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/pkg_add.cat1 | 28 |
4 files changed, 33 insertions, 123 deletions
diff --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c index b1d782497cd..d73b2436d63 100644 --- a/pkgtools/pkg_install/files/add/main.c +++ b/pkgtools/pkg_install/files/add/main.c @@ -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 @@ __RCSID("$NetBSD: main.c,v 1.10 2006/06/27 23:36:13 hubertf Exp $"); #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 *Group = NULL; 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 @@ main(int argc, char **argv) NoView = TRUE; break; - case 'M': - AddMode = MASTER; - break; - case 'R': NoRecord = TRUE; break; @@ -126,10 +121,6 @@ main(int argc, char **argv) Prefix = optarg; break; - case 'S': - AddMode = SLAVE; - break; - case 's': set_verification(optarg); break; @@ -171,25 +162,21 @@ main(int argc, char **argv) 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; + /* 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); + if (IS_STDIN(*argv)) + lpp = alloc_lpkg("-"); + else + lpp = alloc_lpkg(*argv); - TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); - } + TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); + } - 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(); + if (!ch) { + /* If no packages, yelp */ + warnx("missing package name(s)"), usage(); } /* Increase # of max. open file descriptors as high as possible */ diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index 4e94fb72fed..b935335af67 100644 --- a/pkgtools/pkg_install/files/add/perform.c +++ b/pkgtools/pkg_install/files/add/perform.c @@ -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 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs) /* 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 @@ pkg_perform(lpkg_head_t *pkgs) 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 --git a/pkgtools/pkg_install/files/add/pkg_add.1 b/pkgtools/pkg_install/files/add/pkg_add.1 index 51c70896246..bcf47c8fd9e 100644 --- a/pkgtools/pkg_install/files/add/pkg_add.1 +++ b/pkgtools/pkg_install/files/add/pkg_add.1 @@ -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 @@ if it's set, otherwise it defaults to .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 @@ directive will be replaced, since .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 --git a/pkgtools/pkg_install/files/add/pkg_add.cat1 b/pkgtools/pkg_install/files/add/pkg_add.cat1 index 30eaaeffc64..de02cbf3827 100644 --- a/pkgtools/pkg_install/files/add/pkg_add.cat1 +++ b/pkgtools/pkg_install/files/add/pkg_add.cat1 @@ -5,7 +5,7 @@ NNAAMMEE 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 @@ OOPPTTIIOONNSS --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 @@ OOPPTTIIOONNSS 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. - --ss _v_e_r_i_f_i_c_a_t_i_o_n_-_t_y_p_e Use a callout to an external program to verify the binary package being installed against an existing detached signature file. The |