diff options
author | wiz <wiz> | 2014-12-30 15:13:19 +0000 |
---|---|---|
committer | wiz <wiz> | 2014-12-30 15:13:19 +0000 |
commit | ee5d7b7ebf1d11adb63a9471e89d9e4ccda9ae48 (patch) | |
tree | 72a940b4201682de30eda8c9b0e307555f4681b7 /pkgtools/pkg_install | |
parent | c5db1833fafe8a0071d20fe028a667c21ef7d3dc (diff) | |
download | pkgsrc-ee5d7b7ebf1d11adb63a9471e89d9e4ccda9ae48.tar.gz |
Remove pkg_views support, second part: infrastructure.
Diffstat (limited to 'pkgtools/pkg_install')
23 files changed, 53 insertions, 1406 deletions
diff --git a/pkgtools/pkg_install/DESCR b/pkgtools/pkg_install/DESCR index f59aa3b77e6..61bd8cd55e9 100644 --- a/pkgtools/pkg_install/DESCR +++ b/pkgtools/pkg_install/DESCR @@ -10,8 +10,6 @@ pkg_admin perform various pkgsrc administrative tasks pkg_create create software package distributions pkg_delete delete installed packages pkg_info display information about installed or binary packages -pkg_view manage package views -linkfarm manage symbolic links for package views For the following tools compatibility wrappers are included: diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile index 04d6b897f27..8cea97d94e8 100644 --- a/pkgtools/pkg_install/Makefile +++ b/pkgtools/pkg_install/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.203 2014/03/14 22:09:04 ryoon Exp $ +# $NetBSD: Makefile,v 1.204 2014/12/30 15:13:20 wiz Exp $ # Notes to package maintainers: # @@ -7,7 +7,6 @@ # change in the pkg_* tools that pkgsrc relies on for proper operation. PKGNAME= pkg_install-${VERSION} -PKGREVISION= 1 CATEGORIES= pkgtools MAINTAINER= agc@NetBSD.org diff --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c index 0f452a0c762..fd003382366 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.27 2010/09/14 22:26:18 gdt Exp $ */ +/* $NetBSD: main.c,v 1.28 2014/12/30 15:13:20 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: main.c,v 1.27 2010/09/14 22:26:18 gdt Exp $"); +__RCSID("$NetBSD: main.c,v 1.28 2014/12/30 15:13:20 wiz Exp $"); /* * @@ -39,14 +39,11 @@ __RCSID("$NetBSD: main.c,v 1.27 2010/09/14 22:26:18 gdt Exp $"); #include "lib.h" #include "add.h" -static char Options[] = "AC:DIK:LP:RVW:fhm:np:t:Uuvw:"; +static char Options[] = "AC:DIK:P:RVfhm:np:t:Uuv"; char *Destdir = NULL; char *OverrideMachine = NULL; char *Prefix = NULL; -char *View = NULL; -char *Viewbase = NULL; -Boolean NoView = FALSE; Boolean NoInstall = FALSE; Boolean NoRecord = FALSE; Boolean Automatic = FALSE; @@ -66,9 +63,8 @@ static void usage(void) { (void) fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pkg_add [-AfhILnRuVv] [-C config] [-P destdir] [-K pkg_dbdir]", - " [-m machine] [-p prefix] [-s verification-type", - " [-W viewbase] [-w view]\n", + "usage: pkg_add [-AfhInRuVv] [-C config] [-P destdir] [-K pkg_dbdir]", + " [-m machine] [-p prefix] [-s verification-type]\n", " [[ftp|http]://[user[:password]@]host[:port]][/path/]pkg-name ..."); exit(1); } @@ -112,10 +108,6 @@ main(int argc, char **argv) pkgdb_set_dir(optarg, 3); break; - case 'L': - NoView = TRUE; - break; - case 'R': NoRecord = TRUE; break; @@ -150,14 +142,6 @@ main(int argc, char **argv) Verbose = TRUE; break; - case 'W': - Viewbase = optarg; - break; - - case 'w': - View = optarg; - break; - case 'h': case '?': default: diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index 88c9d48b11e..9e480036adb 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.105 2013/09/02 10:28:44 jperkin Exp $ */ +/* $NetBSD: perform.c,v 1.106 2014/12/30 15:13:20 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" #endif @@ -6,7 +6,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: perform.c,v 1.105 2013/09/02 10:28:44 jperkin Exp $"); +__RCSID("$NetBSD: perform.c,v 1.106 2014/12/30 15:13:20 wiz Exp $"); /*- * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> @@ -75,7 +75,6 @@ struct pkg_meta { char *meta_install; char *meta_deinstall; char *meta_preserve; - char *meta_views; char *meta_installed_info; }; @@ -121,7 +120,6 @@ static const struct pkg_meta_desc { { offsetof(struct pkg_meta, meta_size_pkg), SIZE_PKG_FNAME, 0, 0444 }, { offsetof(struct pkg_meta, meta_size_all), SIZE_ALL_FNAME, 0, 0444 }, { offsetof(struct pkg_meta, meta_preserve), PRESERVE_FNAME, 0, 0444 }, - { offsetof(struct pkg_meta, meta_views), VIEWS_FNAME, 0, 0444 }, { offsetof(struct pkg_meta, meta_required_by), REQUIRED_BY_FNAME, 0, 0644 }, { offsetof(struct pkg_meta, meta_installed_info), INSTALLED_INFO_FNAME, 0, 0644 }, { 0, NULL, 0, 0 }, @@ -1179,30 +1177,6 @@ check_dependencies(struct pkg_task *pkg) return status; } -/* - * If this package uses pkg_views, register it in the default view. - */ -static void -pkg_register_views(struct pkg_task *pkg) -{ - if (Fake || NoView || pkg->meta_data.meta_views == NULL) - return; - - if (Verbose) { - printf("%s/pkg_view -d %s %s%s %s%s %sadd %s\n", - BINDIR, pkgdb_get_dir(), - View ? "-w " : "", View ? View : "", - Viewbase ? "-W " : "", Viewbase ? Viewbase : "", - Verbose ? "-v " : "", pkg->pkgname); - } - - fexec_skipempty(BINDIR "/pkg_view", "-d", pkgdb_get_dir(), - View ? "-w " : "", View ? View : "", - Viewbase ? "-W " : "", Viewbase ? Viewbase : "", - Verbose ? "-v " : "", "add", pkg->pkgname, - (void *)NULL); -} - static int preserve_meta_data_file(struct pkg_task *pkg, const char *name) { @@ -1433,12 +1407,7 @@ pkg_do(const char *pkgpath, int mark_automatic, int top_level) if (pkg->meta_data.meta_mtree != NULL) warnx("mtree specification in pkg `%s' ignored", pkg->pkgname); - if (pkg->meta_data.meta_views != NULL) { - pkg->logdir = xstrdup(pkg->prefix); - pkgdb_set_dir(dirname_of(pkg->logdir), 4); - } else { - pkg->logdir = xasprintf("%s/%s", config_pkg_dbdir, pkg->pkgname); - } + pkg->logdir = xasprintf("%s/%s", config_pkg_dbdir, pkg->pkgname); if (Destdir != NULL) pkg->install_logdir = xasprintf("%s/%s", Destdir, pkg->logdir); @@ -1539,8 +1508,6 @@ pkg_do(const char *pkgpath, int mark_automatic, int top_level) if (pkg->meta_data.meta_display != NULL) fputs(pkg->meta_data.meta_display, stdout); - pkg_register_views(pkg); - status = 0; goto clean_memory; diff --git a/pkgtools/pkg_install/files/add/pkg_add.1 b/pkgtools/pkg_install/files/add/pkg_add.1 index e9dcfc4e4f7..567911ead4b 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.45 2010/09/14 22:26:18 gdt Exp $ +.\" $NetBSD: pkg_add.1,v 1.46 2014/12/30 15:13:20 wiz Exp $ .\" .\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. @@ -17,7 +17,7 @@ .\" .\" @(#)pkg_add.1 .\" -.Dd June 16, 2010 +.Dd December 27, 2014 .Dt PKG_ADD 1 .Os .Sh NAME @@ -25,14 +25,12 @@ .Nd a utility for installing and upgrading software package distributions .Sh SYNOPSIS .Nm -.Op Fl AfILnRUuVv +.Op Fl AfInRUuVv .Op Fl C Ar config .Op Fl K Ar pkg_dbdir .Op Fl m Ar machine .Op Fl P Ar destdir .Op Fl p Ar prefix -.Op Fl W Ar viewbase -.Op Fl w Ar view .Ar Oo Oo Li ftp|http Oc Ns Li :// Ns Oo Ar user Oc Ns \ Oo Li \&: Ns Ar password Oc \ Ns Li @ Oc Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns \ @@ -142,8 +140,6 @@ Override the value of the .Dv PKG_DBDIR configuration option with the value .Ar pkg_dbdir . -.It Fl L -Don't add the package to any views after installation. .It Fl m Override the machine architecture returned by uname with .Ar machine . @@ -179,14 +175,6 @@ See below for a more detailed description of the process. Print version number and exit. .It Fl v Turn on verbose output. -.It Fl W Ar viewbase -Passed down to -.Xr pkg_view 1 -for managed views. -.It Fl w Ar view -Passed down to -.Xr pkg_view 1 -for managed views. .El .Pp One or more @@ -337,11 +325,6 @@ Any package dependencies are recorded in the other packages' .Pa +REQUIRED_BY file. .It -If the package is a depoted package, then add it to the registered -by calling -.Xr pkg_view 1 -accordingly. -.It Finally, if we were upgrading a package, any .Pa +REQUIRED_BY file that was moved aside before upgrading was started is now moved @@ -386,9 +369,6 @@ are prefixed with See .Xr pkg_install.conf 5 for options, that can also be specified using the environment. -Packages using views are also affected by the environment variables -documented for -.Xr pkg_view 1 . .Sh EXAMPLES In all cases, .Nm diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c index c688e944c2d..c7599b1e687 100644 --- a/pkgtools/pkg_install/files/admin/main.c +++ b/pkgtools/pkg_install/files/admin/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.62 2013/08/03 11:45:14 obache Exp $ */ +/* $NetBSD: main.c,v 1.63 2014/12/30 15:13:20 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: main.c,v 1.62 2013/08/03 11:45:14 obache Exp $"); +__RCSID("$NetBSD: main.c,v 1.63 2014/12/30 15:13:20 wiz Exp $"); /*- * Copyright (c) 1999-2009 The NetBSD Foundation, Inc. @@ -103,8 +103,6 @@ usage(void) " rebuild - rebuild pkgdb from +CONTENTS files\n" " rebuild-tree - rebuild +REQUIRED_BY files from forward deps\n" " check [pkg ...] - check md5 checksum of installed files\n" - " add pkg ... - add pkg files to database\n" - " delete pkg ... - delete file entries for pkg in database\n" " set variable=value pkg ... - set installation variable for package\n" " unset variable pkg ... - unset installation variable for package\n" " lsall /path/to/pkgpattern - list all pkgs matching the pattern\n" @@ -220,15 +218,6 @@ add_pkg(const char *pkgdir, void *vp) return 0; } -static void -delete1pkg(const char *pkgdir) -{ - if (!pkgdb_open(ReadWrite)) - err(EXIT_FAILURE, "cannot open pkgdb"); - (void) pkgdb_remove_pkg(pkgdir); - pkgdb_close(); -} - static void rebuild(void) { @@ -516,21 +505,6 @@ main(int argc, char *argv[]) pkgdb_dump(); - } else if (strcasecmp(argv[0], "add") == 0) { - struct pkgdb_count count; - - count.files = 0; - count.directories = 0; - count.packages = 0; - - for (++argv; *argv != NULL; ++argv) - add_pkg(*argv, &count); - } else if (strcasecmp(argv[0], "delete") == 0) { - argv++; /* "delete" */ - while (*argv != NULL) { - delete1pkg(*argv); - argv++; - } } else if (strcasecmp(argv[0], "set") == 0) { argv++; /* "set" */ set_unset_variable(argv, FALSE); diff --git a/pkgtools/pkg_install/files/admin/pkg_admin.1 b/pkgtools/pkg_install/files/admin/pkg_admin.1 index 6b58ebad409..ea4ac6f3d4e 100644 --- a/pkgtools/pkg_install/files/admin/pkg_admin.1 +++ b/pkgtools/pkg_install/files/admin/pkg_admin.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_admin.1,v 1.33 2012/12/17 04:34:02 agc Exp $ +.\" $NetBSD: pkg_admin.1,v 1.34 2014/12/30 15:13:20 wiz Exp $ .\" .\" Copyright (c) 1999-2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -34,7 +34,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 14, 2012 +.Dd December 27, 2014 .Dt PKG_ADMIN 1 .Os .Sh NAME @@ -106,13 +106,6 @@ Be more verbose. .Pp The following commands are supported: .Bl -tag -width indent -.It Cm add Ar pkg ... -For each listed package, write the absolute pathnames of the files listed in -its -.Pa +CONTENTS -file together with the package they belong to into the package database. -This should be used only by -.Xr pkg_view 1 . .It Cm audit Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ... Check the listed installed packages for vulnerabilities. If no package is given, check all installed packages. @@ -187,11 +180,6 @@ otherwise it exits with error. Print the current value of .Ar variable as used after parsing the configuration file. -.It Cm delete Ar pkg ... -For each listed package, remove all file entries in the package database that -belong to the package. -This should be used only by -.Xr pkg_view 1 . .It Cm dump Dump the contents of the package database, similar to .Cm pkg_info -F . @@ -310,7 +298,6 @@ for options, that can also be specified using the environment. .Xr pkg_create 1 , .Xr pkg_delete 1 , .Xr pkg_info 1 , -.Xr pkg_view 1 , .Xr pkg_install.conf 5 , .Xr pkgsrc 7 .Sh HISTORY diff --git a/pkgtools/pkg_install/files/create/build.c b/pkgtools/pkg_install/files/create/build.c index 6cdc7449f58..4479a19871e 100644 --- a/pkgtools/pkg_install/files/create/build.c +++ b/pkgtools/pkg_install/files/create/build.c @@ -1,4 +1,4 @@ -/* $NetBSD: build.c,v 1.15 2010/04/20 00:39:13 joerg Exp $ */ +/* $NetBSD: build.c,v 1.16 2014/12/30 15:13:20 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: build.c,v 1.15 2010/04/20 00:39:13 joerg Exp $"); +__RCSID("$NetBSD: build.c,v 1.16 2014/12/30 15:13:20 wiz Exp $"); /*- * Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -93,7 +93,6 @@ static struct memory_file *build_info_file; static struct memory_file *size_pkg_file; static struct memory_file *size_all_file; static struct memory_file *preserve_file; -static struct memory_file *views_file; static void write_meta_file(struct memory_file *file, struct archive *archive) @@ -292,8 +291,6 @@ make_dist(const char *pkg, const char *suffix, const package_t *plist) write_meta_file(size_all_file, archive); if (Preserve) write_meta_file(preserve_file, archive); - if (create_views) - write_meta_file(views_file, archive); initial_cwd = getcwd(NULL, 0); @@ -407,8 +404,6 @@ pkg_build(const char *pkg, const char *full_pkg, const char *suffix, preserve_file = load_and_add(plist, Preserve, PRESERVE_FNAME, 0444); } - if (create_views) - views_file = make_and_add(plist, VIEWS_FNAME, xstrdup(""), 0444); /* Finally, write out the packing list */ stringify_plist(plist, &plist_buf, &plist_len, realprefix); diff --git a/pkgtools/pkg_install/files/create/create.h b/pkgtools/pkg_install/files/create/create.h index 6e07915bbe7..c21d5851896 100644 --- a/pkgtools/pkg_install/files/create/create.h +++ b/pkgtools/pkg_install/files/create/create.h @@ -1,4 +1,4 @@ -/* $NetBSD: create.h,v 1.14 2009/11/05 16:22:32 joerg Exp $ */ +/* $NetBSD: create.h,v 1.15 2014/12/30 15:13:20 wiz Exp $ */ /* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */ @@ -58,7 +58,6 @@ extern const char *CompressionType; extern int PlistOnly; extern int RelativeLinks; extern int update_pkgdb; -extern int create_views; void check_list(package_t *, const char *); void copy_plist(char *, package_t *); diff --git a/pkgtools/pkg_install/files/create/main.c b/pkgtools/pkg_install/files/create/main.c index ad9be9ee158..fe57d18d642 100644 --- a/pkgtools/pkg_install/files/create/main.c +++ b/pkgtools/pkg_install/files/create/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.19 2010/01/22 13:30:41 joerg Exp $ */ +/* $NetBSD: main.c,v 1.20 2014/12/30 15:13:20 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: main.c,v 1.19 2010/01/22 13:30:41 joerg Exp $"); +__RCSID("$NetBSD: main.c,v 1.20 2014/12/30 15:13:20 wiz Exp $"); /* * FreeBSD install - a package for the installation and maintainance @@ -26,7 +26,7 @@ __RCSID("$NetBSD: main.c,v 1.19 2010/01/22 13:30:41 joerg Exp $"); #include "lib.h" #include "create.h" -static const char Options[] = "B:C:D:EF:I:K:L:OP:S:T:UVb:c:d:f:g:i:k:ln:p:r:s:u:v"; +static const char Options[] = "B:C:D:F:I:K:L:OP:S:T:UVb:c:d:f:g:i:k:ln:p:r:s:u:v"; char *Prefix = NULL; char *Comment = NULL; @@ -48,7 +48,6 @@ char *DefaultGroup = NULL; char *realprefix = NULL; const char *CompressionType = NULL; int update_pkgdb = 1; -int create_views = 0; int PlistOnly = 0; int RelativeLinks = 0; Boolean File2Pkg = FALSE; @@ -57,7 +56,7 @@ static void usage(void) { fprintf(stderr, - "usage: pkg_create [-ElOUVv] [-B build-info-file] [-b build-version-file]\n" + "usage: pkg_create [-lOUVv] [-B build-info-file] [-b build-version-file]\n" " [-C cpkgs] [-D displayfile] [-F compression] \n" " [-I realprefix] [-i iscript]\n" " [-K pkg_dbdir] [-k dscript]\n" @@ -81,10 +80,6 @@ main(int argc, char **argv) Verbose = TRUE; break; - case 'E': - create_views = 1; - break; - case 'F': CompressionType = optarg; break; diff --git a/pkgtools/pkg_install/files/create/pkg_create.1 b/pkgtools/pkg_install/files/create/pkg_create.1 index 1412bbed056..4c95c3a5bfa 100644 --- a/pkgtools/pkg_install/files/create/pkg_create.1 +++ b/pkgtools/pkg_install/files/create/pkg_create.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_create.1,v 1.25 2010/04/20 00:39:13 joerg Exp $ +.\" $NetBSD: pkg_create.1,v 1.26 2014/12/30 15:13:20 wiz Exp $ .\" .\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. @@ -24,7 +24,7 @@ .\" [jkh] Took John's changes back and made some additional extensions for .\" better integration with FreeBSD's new ports collection. .\" -.Dd January 20, 2010 +.Dd December 27, 2014 .Dt PKG_CREATE 1 .Os .Sh NAME @@ -32,70 +32,28 @@ .Nd a utility for creating software package distributions .Sh SYNOPSIS .Nm -.Op Fl ElOUVv -.Bk -words +.Op Fl lOUVv .Op Fl B Ar build-info-file -.Ek -.Bk -words .Op Fl b Ar build-version-file -.Ek -.Bk -words .Op Fl C Ar cpkgs -.Ek -.Bk -words .Op Fl D Ar displayfile -.Ek -.Bk -words .Op Fl F Ar compression -.Ek -.Bk -words .Op Fl g Ar group -.Ek -.Bk -words .Op Fl I Ar realprefix -.Ek -.Bk -words .Op Fl i Ar iscript -.Ek -.Bk -words .Op Fl K Ar pkg_dbdir -.Ek -.Bk -words .Op Fl k Ar dscript -.Ek -.Bk -words .Op Fl n Ar preserve-file -.Ek -.Bk -words .Op Fl P Ar dpkgs -.Ek -.Bk -words -.Op Fl T Ar buildpkgs -.Ek -.Bk -words .Op Fl p Ar prefix -.Ek -.Bk -words .Op Fl S Ar size-all-file -.Ek -.Bk -words .Op Fl s Ar size-pkg-file -.Ek -.Bk -words +.Op Fl T Ar buildpkgs .Op Fl t Ar template -.Ek -.Bk -words .Op Fl u Ar owner -.Ek -.Bk -words .Fl c Ar comment -.Ek -.Bk -words .Fl d Ar description -.Ek -.Bk -words .Fl f Ar packlist -.Ek .Ar pkg-name .Sh DESCRIPTION The @@ -158,8 +116,6 @@ Fetch long description for package from file or, if preceded by .Cm - , the argument itself. -.It Fl E -Add an empty views file to the package. .It Fl F Ar compression Use .Ar compression diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.1 b/pkgtools/pkg_install/files/delete/pkg_delete.1 index 73fae81a1fe..ab3563dc6f8 100644 --- a/pkgtools/pkg_install/files/delete/pkg_delete.1 +++ b/pkgtools/pkg_install/files/delete/pkg_delete.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_delete.1,v 1.30 2010/02/25 06:56:23 wiz Exp $ +.\" $NetBSD: pkg_delete.1,v 1.31 2014/12/30 15:13:20 wiz Exp $ .\" .\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. @@ -17,7 +17,7 @@ .\" .\" from FreeBSD: @(#)pkg_delete.1 .\" -.Dd January 20, 2010 +.Dd December 27, 2014 .Dt PKG_DELETE 1 .Os .Sh NAME @@ -221,12 +221,6 @@ script is called as: .Bd -filled -offset indent -compact .Cm deinstall .Aq Ar pkg-name -.Ar VIEW-DEINSTALL -.Ed -before removing the package from a view, and as: -.Bd -filled -offset indent -compact -.Cm deinstall -.Aq Ar pkg-name .Ar DEINSTALL .Ed before deleting all files and as: @@ -237,8 +231,7 @@ before deleting all files and as: .Ed after deleting them. Passing the keywords -.Ar VIEW-DEINSTALL , -.Ar DEINSTALL , +.Ar DEINSTALL and .Ar POST-DEINSTALL lets you potentially write only one program/script that handles all diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.c b/pkgtools/pkg_install/files/delete/pkg_delete.c index fa343c411f8..1f3fe33a086 100644 --- a/pkgtools/pkg_install/files/delete/pkg_delete.c +++ b/pkgtools/pkg_install/files/delete/pkg_delete.c @@ -34,7 +34,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: pkg_delete.c,v 1.12 2011/09/29 23:30:21 wiz Exp $"); +__RCSID("$NetBSD: pkg_delete.c,v 1.13 2014/12/30 15:13:20 wiz Exp $"); #if HAVE_ERR_H #include <err.h> @@ -398,58 +398,14 @@ find_preserve_pkgs(lpkg_head_t *pkgs) } /* - * Remove package from view. This is calling pkg_deinstall again. - */ -static int -remove_pkg_from_view(const char *pkg) -{ - char line[MaxPathSize], *fname, *eol; - FILE *fp; - - fname = pkgdb_pkg_file(pkg, VIEWS_FNAME); - if (isemptyfile(fname)) { - free(fname); - return 0; - } - if ((fp = fopen(fname, "r")) == NULL) { - warn("Unable to open `%s', aborting", fname); - free(fname); - return 1; - } - free(fname); - while (fgets(line, sizeof(line), fp) != NULL) { - if ((eol = strrchr(line, '\n')) != NULL) - *eol = '\0'; - if (Verbose || Fake) - printf("Deleting package `%s' instance from `%s' view\n", - pkg, line); - if (Fake) - continue; - if (fexec_skipempty(BINDIR "/pkg_delete", "-K", line, - Fake ? "-n" : "", - (Force > 1) ? "-f" : "", - (Force > 0) ? "-f" : "", - pkg, NULL) != 0) { - warnx("Unable to delete package `%s' from view `%s'", - pkg, line); - fclose(fp); - return 1; - } - } - fclose(fp); - return 0; -} - -/* * Run the +DEINSTALL script. Depending on whether this is - * a depoted package and whether this pre- or post-deinstall phase, - * different arguments are passed down. + * pre- or post-deinstall phase, different arguments are passed down. */ static int run_deinstall_script(const char *pkg, int do_postdeinstall) { const char *target, *text; - char *fname, *fname2, *pkgdir; + char *fname, *pkgdir; int rv; fname = pkgdb_pkg_file(pkg, DEINSTALL_FNAME); @@ -458,23 +414,13 @@ run_deinstall_script(const char *pkg, int do_postdeinstall) return 0; } - fname2 = pkgdb_pkg_file(pkg, DEPOT_FNAME); - if (fexists(fname2)) { - if (do_postdeinstall) { - free(fname); - free(fname2); - return 0; - } - target = "VIEW-DEINSTALL"; - text = "view deinstall"; - } else if (do_postdeinstall) { + if (do_postdeinstall) { target = "POST-DEINSTALL"; text = "post-deinstall"; } else { target = "DEINSTALL"; text = "deinstall"; } - free(fname2); if (Fake) { printf("Would execute %s script with argument %s now\n", @@ -541,57 +487,6 @@ remove_line(const char *fname, const char *fname_tmp, const char *text) } /* - * Unregister the package from the depot it is registered in. - */ -static int -remove_pkg_from_depot(const char *pkg) -{ - FILE *fp; - char line[MaxPathSize], *eol; - char *fname, *fname2; - int rv; - - fname = pkgdb_pkg_file(pkg, DEPOT_FNAME); - if (isemptyfile(fname)) { - free(fname); - return 0; - } - - if (Verbose) - printf("Attempting to remove the `%s' registration " - "on package `%s'\n", fname, pkg); - - if (Fake) { - free(fname); - return 1; - } - - if ((fp = fopen(fname, "r")) == NULL) { - warn("Unable to open `%s' file", fname); - free(fname); - return 1; - } - if (fgets(line, sizeof(line), fp) == NULL) { - fclose(fp); - warnx("Empty depot file `%s'", fname); - free(fname); - return 1; - } - if ((eol = strrchr(line, '\n')) != NULL) - *eol = '\0'; - fclose(fp); - free(fname); - - fname = pkgdb_pkg_file(pkg, VIEWS_FNAME); - fname2 = pkgdb_pkg_file(pkg, VIEWS_FNAME_TMP); - rv = remove_line(fname, fname2, line); - free(fname2); - free(fname); - - return rv; -} - -/* * remove_depend is used as iterator function below. * The passed-in package name should be removed from the * +REQUIRED_BY list of the dependency. Such an entry @@ -627,7 +522,7 @@ remove_pkg(const char *pkg) char *fname, *pkgdir; package_t plist; plist_t *p; - int is_depoted_pkg, rv, late_error; + int rv, late_error; if (pkgdb_update_only) return pkgdb_remove_pkg(pkg) ? 0 : 1; @@ -640,15 +535,6 @@ remove_pkg(const char *pkg) } free(fname); - /* +REQUIRED_BY and +PRESERVE already checked */ - if (remove_pkg_from_view(pkg)) - return 1; - - /* - * The views related code has bad error handling, if e.g. - * the deinstall script fails, the package remains unregistered. - */ - fname = pkgdb_pkg_file(pkg, CONTENTS_FNAME); if ((fp = fopen(fname, "r")) == NULL) { warnx("Failed to open `%s'", fname); @@ -712,37 +598,23 @@ remove_pkg(const char *pkg) * processing. */ - fname = pkgdb_pkg_file(pkg, DEPOT_FNAME); - if (fexists(fname)) { - late_error |= remove_pkg_from_depot(pkg); - /* XXX error checking */ - } else { - for (p = plist.head; p; p = p->next) { - if (p->type != PLIST_PKGDEP) - continue; - if (Verbose) - printf("Attempting to remove dependency " - "on package `%s'\n", p->name); - if (Fake) - continue; - match_installed_pkgs(p->name, remove_depend, - __UNCONST(pkg)); - } + for (p = plist.head; p; p = p->next) { + if (p->type != PLIST_PKGDEP) + continue; + if (Verbose) + printf("Attempting to remove dependency " + "on package `%s'\n", p->name); + if (Fake) + continue; + match_installed_pkgs(p->name, remove_depend, + __UNCONST(pkg)); } - free(fname); free_plist(&plist); if (!no_deinstall && !unregister_only) late_error |= run_deinstall_script(pkg, 1); - fname = pkgdb_pkg_file(pkg, VIEWS_FNAME); - if (fexists(fname)) - is_depoted_pkg = TRUE; - else - is_depoted_pkg = FALSE; - free(fname); - if (Fake) return 0; @@ -755,8 +627,6 @@ remove_pkg(const char *pkg) rv = 1; if (isemptydir(pkgdir)&& rmdir(pkgdir) == 0) rv = 0; - else if (is_depoted_pkg) - warnx("Depot directory `%s' is not empty", pkgdir); else if (!Force) warnx("Couldn't remove package directory in `%s'", pkgdir); else if (recursive_remove(pkgdir, 1)) diff --git a/pkgtools/pkg_install/files/info/info.h b/pkgtools/pkg_install/files/info/info.h index f8b6b4d1cd5..8718da209d6 100644 --- a/pkgtools/pkg_install/files/info/info.h +++ b/pkgtools/pkg_install/files/info/info.h @@ -1,4 +1,4 @@ -/* $NetBSD: info.h,v 1.21 2009/09/11 18:00:13 joerg Exp $ */ +/* $NetBSD: info.h,v 1.22 2014/12/30 15:13:20 wiz Exp $ */ /* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */ @@ -68,7 +68,6 @@ struct pkg_meta { char *meta_install; char *meta_deinstall; char *meta_preserve; - char *meta_views; char *meta_installed_info; int is_installed; }; diff --git a/pkgtools/pkg_install/files/info/perform.c b/pkgtools/pkg_install/files/info/perform.c index 82781584a86..f227b85c395 100644 --- a/pkgtools/pkg_install/files/info/perform.c +++ b/pkgtools/pkg_install/files/info/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.61 2010/02/20 04:40:03 joerg Exp $ */ +/* $NetBSD: perform.c,v 1.62 2014/12/30 15:13:20 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -13,7 +13,7 @@ #if HAVE_SYS_WAIT_H #include <sys/wait.h> #endif -__RCSID("$NetBSD: perform.c,v 1.61 2010/02/20 04:40:03 joerg Exp $"); +__RCSID("$NetBSD: perform.c,v 1.62 2014/12/30 15:13:20 wiz Exp $"); /*- * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -110,9 +110,8 @@ __RCSID("$NetBSD: perform.c,v 1.61 2010/02/20 04:40:03 joerg Exp $"); #define LOAD_SIZE_PKG (1 << 9) #define LOAD_SIZE_ALL (1 << 10) #define LOAD_PRESERVE (1 << 11) -#define LOAD_VIEWS (1 << 12) -#define LOAD_REQUIRED_BY (1 << 13) -#define LOAD_INSTALLED_INFO (1 << 14) +#define LOAD_REQUIRED_BY (1 << 12) +#define LOAD_INSTALLED_INFO (1 << 13) static const struct pkg_meta_desc { size_t entry_offset; @@ -144,8 +143,6 @@ static const struct pkg_meta_desc { LOAD_SIZE_ALL, 0 }, { offsetof(struct pkg_meta, meta_preserve), PRESERVE_FNAME, LOAD_PRESERVE, 0 }, - { offsetof(struct pkg_meta, meta_views), VIEWS_FNAME, - LOAD_VIEWS, 0 }, { offsetof(struct pkg_meta, meta_required_by), REQUIRED_BY_FNAME, LOAD_REQUIRED_BY, 0 }, { offsetof(struct pkg_meta, meta_installed_info), INSTALLED_INFO_FNAME, diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h index f79de966aed..85bcf1f02e7 100644 --- a/pkgtools/pkg_install/files/lib/lib.h +++ b/pkgtools/pkg_install/files/lib/lib.h @@ -1,4 +1,4 @@ -/* $NetBSD: lib.h,v 1.64 2010/06/16 23:02:49 joerg Exp $ */ +/* $NetBSD: lib.h,v 1.65 2014/12/30 15:13:21 wiz Exp $ */ /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */ @@ -116,9 +116,6 @@ enum { #define SIZE_PKG_FNAME "+SIZE_PKG" #define SIZE_ALL_FNAME "+SIZE_ALL" #define PRESERVE_FNAME "+PRESERVE" -#define VIEWS_FNAME "+VIEWS" -#define VIEWS_FNAME_TMP "+VIEWS.tmp" -#define DEPOT_FNAME "+DEPOT" /* The names of special variables */ #define AUTOMATIC_VARNAME "automatic" @@ -363,7 +360,6 @@ const char *pkgdb_get_dir(void); * 1 config file * 2 environment * 3 command line - * 4 destdir/views reset */ void pkgdb_set_dir(const char *, int); char *pkgdb_pkg_dir(const char *); diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index 8c92b87919d..15d2d4df3ac 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.166 2013/09/02 10:28:44 jperkin Exp $ */ +/* $NetBSD: version.h,v 1.167 2014/12/30 15:13:21 wiz Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -27,6 +27,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION 20130902 +#define PKGTOOLS_VERSION 20141227 #endif /* _INST_LIB_VERSION_H_ */ diff --git a/pkgtools/pkg_install/files/view/Makefile.in b/pkgtools/pkg_install/files/view/Makefile.in deleted file mode 100644 index 4a79ca8422d..00000000000 --- a/pkgtools/pkg_install/files/view/Makefile.in +++ /dev/null @@ -1,43 +0,0 @@ -# $NetBSD: Makefile.in,v 1.7 2013/09/12 11:03:10 jperkin Exp $ - -prefix= @prefix@ -exec_prefix= @exec_prefix@ -sbindir= @sbindir@ -mandir= @mandir@ -datarootdir= @datarootdir@ - -man1dir= $(mandir)/man1 -cat1dir= $(mandir)/cat1 - -INSTALL= @INSTALL@ - -SCRIPTS= linkfarm pkg_view - -all: - @true # do nothing - -clean: - @true # do nothing - -install: - $(INSTALL) -m 755 -d ${DESTDIR}$(sbindir) - $(INSTALL) -m 755 -d ${DESTDIR}$(man1dir) - $(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir) - @for script in $(SCRIPTS); do \ - echo "$(INSTALL) $$script.sh ${DESTDIR}$(sbindir)/$$script"; \ - $(INSTALL) $$script.sh ${DESTDIR}$(sbindir)/$$script; \ - done - @for script in $(SCRIPTS); do \ - echo "$(INSTALL) -m 444 $$script.1 ${DESTDIR}$(man1dir)/$$script.1"; \ - $(INSTALL) -m 444 $$script.1 ${DESTDIR}$(man1dir)/$$script.1; \ - case "$(CATMAN_SECTION_SUFFIX)" in \ - [Yy][Ee][Ss]) \ - echo "$(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.1"; \ - $(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.1; \ - ;; \ - *) \ - echo "$(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0"; \ - $(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0; \ - ;; \ - esac; \ - done diff --git a/pkgtools/pkg_install/files/view/linkfarm.1 b/pkgtools/pkg_install/files/view/linkfarm.1 deleted file mode 100644 index d284baede14..00000000000 --- a/pkgtools/pkg_install/files/view/linkfarm.1 +++ /dev/null @@ -1,148 +0,0 @@ -.\" $NetBSD: linkfarm.1,v 1.7 2013/07/20 21:50:53 wiz Exp $ -.\" -.\" Copyright (c) 2003 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd September 2, 2003 -.Dt LINKFARM 1 -.Os -.Sh NAME -.Nm linkfarm -.Nd manage symbolic links to package files -.Sh SYNOPSIS -.Nm -.Op Fl cDnRVv -.Op Fl d Ar stowdir -.Op Fl s Ar subdir -.Op Fl t Ar target -.Ar package -.Sh DESCRIPTION -The -.Nm -command is used to manage a "linkfarm", a directory tree of symbolic links in -.Ar target -to the files in the -.Ar package -sub-directory of -.Ar stowdir . -The default action is to create a linkfarm to a package. -.Pp -The following command-line options are supported: -.Bl -tag -width indent -.It Fl c -Check whether a package contains a linkfarm in -.Ar target . -If -.Ar package -has no symbolic links in -.Ar target -that correspond to its files, then return 0, otherwise return 1. -.It Fl D -Delete the linkfarm for -.Ar package . -.It Fl d Ar stowdir -Set -.Ar stowdir -as the directory in which -.Ar package -can be found. -The default -.Ar stowdir -is the -.Pa packages -sub-directory in the default -.Ar target -directory. -.It Fl n -Don't actually execute the commands for removing and creating the symbolic -links and directories. -.It Fl R -Delete and re-create the linkfarm for -.Ar package . -.It Fl s Ar subdir -The root of the package hierarchy for the linkfarm is the -.Ar subdir -sub-directory in the package. -By default, assume the root of the package hierarchy is simply the -.Ar package -directory. -.It Fl t Ar target -Set -.Ar target -as the directory in which to create and delete the linkfarm for -.Ar package . -The default -.Ar target -directory is -.Pa /usr/pkg -but may be overridden by the -.Ev LOCALBASE -environment variable. -.It Fl V -Print version number and exit. -.It Fl v -Turn on verbose output. -Specifying -.Fl v -multiple times increases the level of verbosity. -.El -.Sh ENVIRONMENT -.Bl -tag -width indent -.It Ev LOCALBASE -The standard packages directory, -.Pa /usr/pkg , -can be overridden by specifying an alternative directory in the -.Ev LOCALBASE -environment variable. -This affects the default -.Ar target -and -.Ar stowdir -directories. -.It Ev PLIST_IGNORE_FILES -This can be used to specify files in -.Ar package -that should ignored when creating and deleting symbolic links in -.Ar target . -.Ev PLIST_IGNORE_FILES -is a space-separated list of shell glob patterns that match files relative -to the -.Ar package -directory, and it defaults to "info/dir *[~#] *.OLD *.orig *,v". -.El -.Sh SEE ALSO -.Xr lndir 1 , -.Xr pkg_view 1 -.Sh AUTHORS -The -.Nm -utility was written by -.An Alistair G. Crooks Aq Mt agc@NetBSD.org . diff --git a/pkgtools/pkg_install/files/view/linkfarm.cat1 b/pkgtools/pkg_install/files/view/linkfarm.cat1 deleted file mode 100644 index 950327a0a4e..00000000000 --- a/pkgtools/pkg_install/files/view/linkfarm.cat1 +++ /dev/null @@ -1,67 +0,0 @@ -LINKFARM(1) NetBSD General Commands Manual LINKFARM(1) - -NNAAMMEE - lliinnkkffaarrmm -- manage symbolic links to package files - -SSYYNNOOPPSSIISS - lliinnkkffaarrmm [--ccDDnnRRVVvv] [--dd _s_t_o_w_d_i_r] [--ss _s_u_b_d_i_r] [--tt _t_a_r_g_e_t] _p_a_c_k_a_g_e - -DDEESSCCRRIIPPTTIIOONN - The lliinnkkffaarrmm command is used to manage a "linkfarm", a directory tree of - symbolic links in _t_a_r_g_e_t to the files in the _p_a_c_k_a_g_e sub-directory of - _s_t_o_w_d_i_r. The default action is to create a linkfarm to a package. - - The following command-line options are supported: - - --cc Check whether a package contains a linkfarm in _t_a_r_g_e_t. If - _p_a_c_k_a_g_e has no symbolic links in _t_a_r_g_e_t that correspond to its - files, then return 0, otherwise return 1. - - --DD Delete the linkfarm for _p_a_c_k_a_g_e. - - --dd _s_t_o_w_d_i_r - Set _s_t_o_w_d_i_r as the directory in which _p_a_c_k_a_g_e can be found. The - default _s_t_o_w_d_i_r is the _p_a_c_k_a_g_e_s sub-directory in the default - _t_a_r_g_e_t directory. - - --nn Don't actually execute the commands for removing and creating the - symbolic links and directories. - - --RR Delete and re-create the linkfarm for _p_a_c_k_a_g_e. - - --ss _s_u_b_d_i_r - The root of the package hierarchy for the linkfarm is the _s_u_b_d_i_r - sub-directory in the package. By default, assume the root of the - package hierarchy is simply the _p_a_c_k_a_g_e directory. - - --tt _t_a_r_g_e_t - Set _t_a_r_g_e_t as the directory in which to create and delete the - linkfarm for _p_a_c_k_a_g_e. The default _t_a_r_g_e_t directory is _/_u_s_r_/_p_k_g - but may be overridden by the LOCALBASE environment variable. - - --VV Print version number and exit. - - --vv Turn on verbose output. Specifying --vv multiple times increases - the level of verbosity. - -EENNVVIIRROONNMMEENNTT - LOCALBASE - The standard packages directory, _/_u_s_r_/_p_k_g, can be overridden by - specifying an alternative directory in the LOCALBASE environment - variable. This affects the default _t_a_r_g_e_t and _s_t_o_w_d_i_r directo- - ries. - - PLIST_IGNORE_FILES - This can be used to specify files in _p_a_c_k_a_g_e that should ignored - when creating and deleting symbolic links in _t_a_r_g_e_t. - PLIST_IGNORE_FILES is a space-separated list of shell glob pat- - terns that match files relative to the _p_a_c_k_a_g_e directory, and it - defaults to "info/dir *[~#] *.OLD *.orig *,v". - -SSEEEE AALLSSOO - lndir(1), pkg_view(1) - -AAUUTTHHOORRSS - The lliinnkkffaarrmm utility was written by Alistair G. Crooks <agc@NetBSD.org>. - -NetBSD 5.0 September 2, 2003 NetBSD 5.0 diff --git a/pkgtools/pkg_install/files/view/linkfarm.sh.in b/pkgtools/pkg_install/files/view/linkfarm.sh.in deleted file mode 100644 index a1b1049e572..00000000000 --- a/pkgtools/pkg_install/files/view/linkfarm.sh.in +++ /dev/null @@ -1,232 +0,0 @@ -#! /bin/sh - -# $NetBSD: linkfarm.sh.in,v 1.4 2004/08/20 20:09:53 jlam Exp $ - -# -# Copyright (c) 2002 Alistair G. Crooks. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by Alistair G. Crooks. -# 4. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# set -x - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -sbindir="@sbindir@" - -# set up program definitions -findprog="@FIND@" -grepprog="@GREP@" -lnprog="@LN@" -mkdirprog="@MKDIR@" -pkginfoprog="@sbindir@/pkg_info" -rmprog="@RM@" -rmdirprog="@RMDIR@" -sedprog="@SED@" -sortprog="@SORT@" - -usage() { - echo 'Usage: linkfarm [options] package' - exit 1 -} - -version() { - $pkginfoprog -V - exit 0 -} - -checkdir() { - if [ ! -d "$1" ]; then - echo "linkfarm: \`$1' doesn't exist" - exit 1 - fi -} - -ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"} -linktype=-s - -# default action: create a linkfarm in $target from $stowdir/$1 -# i.e. linkfarm --target=${prefix}/${view} --dir=${prefix}/packages $1 -# -doit="" -target=${LOCALBASE:-/usr/pkg} -stowdir=${target}/packages -subdir="" -verbose=0 - -# default action is to create -check=no -delete=no -create=yes - -# process args - can't use getopt(1) because of '--' style args -while [ $# -gt 0 ]; do - case "$1" in - -D) delete=yes; create=no ;; - -R) delete=yes; create=yes ;; - -V) version ;; - -c) check=yes; doit=":" ;; - -d) stowdir=$2; shift ;; - -d*) stowdir=`echo $1 | $sedprog -e 's|-d||'` ;; - -s) subdir=$2; shift ;; - -s*) subdir=`echo $1 | $sedprog -e 's|-s||'` ;; - -t) target=$2; shift ;; - -t*) target=`echo $1 | $sedprog -e 's|-t||'` ;; - -n) doit=":" ;; - -v) verbose=`expr $verbose + 1` ;; - - --delete) delete=yes; create=no ;; - --dir=*) stowdir=`echo $1 | $sedprog -e 's|--dir=||'` ;; - --restow) delete=yes; create=yes ;; - --subdir=*) subdir=`echo $1 | $sedprog -e 's|--subdir=||'` ;; - --target=*) target=`echo $1 | $sedprog -e 's|--target=||'` ;; - --version) version ;; - - --) shift; break ;; - *) break ;; - esac - shift -done - -# set the package name -package=$1 - -# make sure stowdir has a full pathname -case $stowdir in -/*) ;; -*) stowdir=`pwd`/$stowdir ;; -esac - -# Set the directory from which we symlink. -case $subdir in -"") fromdir=$stowdir/$package ;; -*) fromdir=$stowdir/$package/$subdir ;; -esac - -# Set the directory to which we symlink. -case $target in -/*) todir=$target ;; -*) todir=`pwd`/$target ;; -esac - -# if we're checking the entries, check, then exit -case $check in -yes) - checkdir $fromdir - (cd $fromdir - ex=0 - $findprog . ! -type d -print | \ - $sedprog -e 's|^\./||' | \ - while read f; do - if [ -e $todir/$f ]; then - ignore=no - for i in $ignorefiles; do - case $f in - $i) ignore=yes; break ;; - esac - done - case $ignore in - no) - echo "${f}"; ex=1 ;; - esac - fi - done - exit $ex) || exit 1 - ;; -esac - -# if we need to get rid of old linkfarms, do it -case $delete in -yes) - checkdir $fromdir - (cd $fromdir - $findprog . ! -type d -print | \ - $sedprog -e 's|^\./||' | \ - while read f; do - ignore=no - for i in $ignorefiles; do - case $f in - $i) ignore=yes; break ;; - esac - done - case $ignore in - no) - if [ $verbose -gt 0 ]; then - echo "$rmprog -f $todir/$f" - fi - $doit $rmprog -f $todir/$f ;; - esac - done - $findprog . -type d -print | \ - $sedprog -e 's|^\./||' | \ - $sortprog -r | \ - while read d; do - if [ $verbose -gt 0 ]; then - echo "$rmdirprog $todir/$d" - fi - $doit $rmdirprog $todir/$d > /dev/null 2>&1 - done) - ;; -esac - -# if we need to create new linkfarms, do it -case $create in -yes) - checkdir $fromdir - (cd $fromdir - $findprog . -type d -print | \ - $sedprog -e 's|^\./||' | \ - while read d; do - case "$d" in - "") continue ;; - esac - if [ $verbose -gt 0 ]; then - echo "$mkdirprog -p $todir/$d" - fi - $doit $mkdirprog -p $todir/$d > /dev/null 2>&1 - done - $findprog . ! -type d -print | \ - $sedprog -e 's|^\./||' | \ - while read f; do - ignore=no - for i in $ignorefiles; do - case $f in - $i) ignore=yes; break ;; - esac - done - case $ignore in - no) - if [ $verbose -gt 0 ]; then - echo "$lnprog ${linktype} $fromdir/$f $todir/$f" - fi - $doit $lnprog ${linktype} $fromdir/$f $todir/$f ;; - esac - done) - ;; -esac - -exit 0 diff --git a/pkgtools/pkg_install/files/view/pkg_view.1 b/pkgtools/pkg_install/files/view/pkg_view.1 deleted file mode 100644 index 7f31e290dd6..00000000000 --- a/pkgtools/pkg_install/files/view/pkg_view.1 +++ /dev/null @@ -1,276 +0,0 @@ -.\" $NetBSD: pkg_view.1,v 1.14 2013/07/20 21:50:53 wiz Exp $ -.\" -.\" Copyright (c) 2003 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd September 8, 2003 -.Dt PKG_VIEW 1 -.Os -.Sh NAME -.Nm pkg_view -.Nd add and delete instances of depoted packages in views -.Sh SYNOPSIS -.Nm -.Op Fl nVv -.Op Fl d Ar stowdir -.Op Fl i Ar ignore -.Op Fl k Ar pkg_dbdir -.Op Fl W Ar viewbase -.Op Fl w Ar view -.Ar command -.Ar package ... -.Sh DESCRIPTION -The -.Nm -command is used to add and delete instances of depoted packages in -.Ar stowdir -in a -.Ar view -in the -.Ar viewbase -directory. -.Sh WARNING -.Bf -emphasis -Since the -.Nm -command may execute scripts or programs provided by a package file, -your system may be susceptible to -.Dq Trojan horses -or other subtle -attacks from miscreants who create dangerous package files. -.Pp -You are advised to verify the competence and identity of those who -provide installable package files. -For extra protection, examine all the package control files in the -package database directory -.Pa ( /usr/pkg/packages/\*[Lt]pkg-name\*[Gt]/ ) . -Pay particular attention to any -.Pa +INSTALL -or -.Pa +DEINSTALL -files, and inspect the -.Pa +CONTENTS -file for -.Cm @cwd , -.Cm @mode -(check for setuid), -.Cm @dirrm , -.Cm @exec , -and -.Cm @unexec -directives, and/or use the -.Xr pkg_info 1 -command to examine the installed package control files. -.Ef -.Sh OPTIONS -The following command-line options are supported: -.Bl -tag -width indent -.It Fl d Ar stowdir -Set -.Ar stowdir -as the directory in which the depoted packages can be found. -If this option isn't specified, then the -.Ar stowdir -is taken from the value of the environment variable -.Ev DEPOTBASE -if it's set, otherwise the default -.Ar stowdir -is the path to the -.Pa packages -directory under -.Ar viewbase . -.It Fl i Ar ignore -Add -.Ar ignore -to the list of files in -.Ar package -that should ignored when adding or removing the package instance from -.Ar view . -.It Fl k Ar pkg_dbdir -Override the value of the -.Dv PKG_DBDIR -configuration option with the value -.Ar pkg_dbdir . -This is used as as the package database directory for the -default (empty) view. -.It Fl n -Don't actually execute the commands for manipulating the package instances. -.It Fl V -Print the version number and exit. -.It Fl v -Turn on verbose output. -Specifying -.Fl v -multiple times increases the level of verbosity. -.It Fl W Ar viewbase -Set -.Ar viewbase -as the directory in which all the views are managed. -The default -.Ar viewbase -directory is -.Pa /usr/pkg -but may be overridden by the -.Ev LOCALBASE -environment variable. -.It Fl w Ar view -Set -.Ar view -as the directory in -.Ar viewbase -in which the package instances should be added or deleted. -The default -.Ar view -is the empty view but may be overridden by the -.Ev PKG_VIEW -environment variable. -.El -.Pp -The following commands are supported: -.Bl -tag -width indent -.It Cm add -Add the listed package instances into -.Ar view . -.It Cm check -Check whether the listed package instances are present in -.Ar view . -If they are not present, then return 0, otherwise return 1. -.It Cm delete -Delete the listed package instances from -.Ar view . -.El -.Sh ENVIRONMENT -.Bl -tag -width indent -.It Ev DEPOTBASE -This is the location of the -.Ar stowdir -directory inside which all depoted packages are kept. -The default -.Ar stowdir -is the -.Pa packages -directory under -.Ar viewbase . -.It Ev LOCALBASE -This is the location of the -.Ar viewbase -directory in which all the views are managed. -The default -.Ar viewbase -directory is -.Pa /usr/pkg . -.It Ev PKG_DBDIR -If the -.Fl k -flag isn't given, then the value of the environment variable -.Ev PKG_DBDIR -is the package database directory for the default view, -otherwise it defaults to -.Pa /var/db/pkg . -.It Ev PLIST_IGNORE_FILES -This can be used to specify files in -.Ar package -that should ignored when adding or removing the package instance from -.Ar view . -.Ev PLIST_IGNORE_FILES -is a space-separated list of shell glob patterns that match files relative -to the -.Ar package -depot directory, and it defaults to "info/dir *[~#] *.OLD *.orig *,v". -This is overridden by any -.Ev _PLIST_IGNORE_FILES -setting in a package's -.Ar build-info-file -(see -.Xr pkg_create 1 ) -if it exists. -.It Ev PKG_VIEW -The default view can be specified in the -.Ev PKG_VIEW -environment variable. -.El -.Sh FILES -.Bl -tag -width indent -.It Pa \*[Lt]pkg-dbdir\*[Gt]/\*[Lt]package\*[Gt]/+INSTALL -If the package contains an -.Ar install -script (see -.Xr pkg_create 1 ) , -then after the package instance is added into a view, the script is -executed with the following arguments: -.Bl -tag -width package -.It Ar package -The name of the package instance being added. -.It Cm VIEW-INSTALL -Keyword denoting that the script is to perform any actions needed after -the package instance is added to a view. -.El -.Pp -If the -.Ar install -script exits with a non-zero status code, the installation is terminated. -.It Pa \*[Lt]pkg-dbdir\*[Gt]/\*[Lt]package\*[Gt]/+DEINSTALL -If the package contains an -.Ar deinstall -script (see -.Xr pkg_create 1 ) , -then before the package instance is deleted from a view, the script is -executed with the following arguments: -.Bl -tag -width package -.It Ar package -The name of the package instance being deleted. -.It Cm VIEW-DEINSTALL -Keyword denoting that the script is to perform any actions needed before -the package instance is deleted from a view. -.El -.Pp -If the -.Ar deinstall -script exits with a non-zero status code, the de-installation is terminated. -.El -.Pp -The -.Ar install -and -.Ar deinstall -scripts are called with the environment variable -.Ev PKG_PREFIX -set to the path to the -.Ar view -directory. -.Sh SEE ALSO -.Xr linkfarm 1 , -.Xr pkg_delete 1 -.Sh AUTHORS -The -.Nm -utility was written by -.An Alistair G. Crooks Aq Mt agc@NetBSD.org . diff --git a/pkgtools/pkg_install/files/view/pkg_view.sh.in b/pkgtools/pkg_install/files/view/pkg_view.sh.in deleted file mode 100644 index 2d05b717074..00000000000 --- a/pkgtools/pkg_install/files/view/pkg_view.sh.in +++ /dev/null @@ -1,276 +0,0 @@ -#! /bin/sh - -# $NetBSD: pkg_view.sh.in,v 1.7 2006/06/27 23:36:14 hubertf Exp $ - -# -# Copyright (c) 2001 Alistair G. Crooks. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by Alistair G. Crooks. -# 4. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# set -x - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -sbindir="@sbindir@" - -# set up program definitions -chmodprog="@CHMOD@" -cmpprog="@CMP@" -cpprog="@CP@" -envprog="@ENV@" -findprog="@FIND@" -grepprog="@GREP@" -linkfarmprog="@sbindir@/linkfarm" -lnprog="@LN@" -mkdirprog="@MKDIR@" -paxprog="@pax@" -pkgadminprog="@sbindir@/pkg_admin" -pkginfoprog="@sbindir@/pkg_info" -rmprog="@RM@" -rmdirprog="@RMDIR@" -sedprog="@SED@" -touchprog="@TOUCH@" - -usage() { - echo 'Usage: pkg_view [-nVv] [-d stowdir] [-i ignore] [-k pkg_dbdir] [-W viewbase]' - echo ' [-w viewname] add|check|delete pkgname...' - exit 1 -} - -version() { - $pkginfoprog -V - exit 0 -} - -checkpkg() { - if [ ! -d "$2/$1" ]; then - echo "pkg_view: \`$1' doesn't exist in \`$2'" 1>&2 - exit 1 - fi -} - -######################################### -# Initialization and Options Processing # -######################################### - -doit="" -stowdir="" -viewbase=${LOCALBASE:-/usr/pkg} -view=${PKG_VIEW:-""} -dflt_ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"} -dflt_pkg_dbdir=${PKG_DBDIR:-/var/db/pkg} -ignorefiles="" -verbose=0 - -while [ $# -gt 0 ]; do - case "$1" in - -d) stowdir=$2; shift ;; - -d*) stowdir=`echo $1 | $sedprog -e 's|^-d||'` ;; - -i) ignorefiles="$ignorefiles $2"; shift ;; - -i*) ignorefiles="$ignorefiles `echo $1 | $sedprog -e 's|^-i||'`" ;; - -k) dflt_pkg_dbdir="$2"; shift ;; - -k*) dflt_pkg_dbdir=`echo $1 | $sedprog -e 's|^-k||'` ;; - -n) doit=":" ;; - -V) version ;; - -v) verbose=`expr $verbose + 1` ;; - -W) viewbase=$2; shift ;; - -W*) viewbase=`echo $1 | $sedprog -e 's|^-p||'` ;; - -w) view=$2; shift ;; - --view=*) view=`echo $1 | $sedprog -e 's|--view=||'` ;; - --) shift; break ;; - *) break ;; - esac - shift -done - -if [ $# -lt 1 ]; then - usage -fi - -# echoN will actually give output if ${verbose} > N. -echo1=":" -echo2=":" -if [ ${verbose} -gt 0 ]; then echo1=echo; fi -if [ ${verbose} -gt 1 ]; then echo2=echo; fi - -action="" -case "$1" in -add) action=add ;; -check) action=check ;; -delete|rm) action=delete ;; -*) usage ;; -esac -shift - -# if standard view, put package info into ${dflt_pkg_dbdir} -# if not standard view, put package info into view's pkgdb -case "$view" in -"") - pkg_dbdir=${dflt_pkg_dbdir} - targetdir=${viewbase} - viewstr="the standard view" - ;; -*) - pkg_dbdir=${viewbase}/${view}/.pkgdb - targetdir=${viewbase}/${view} - viewstr="view \"${view}\"" - ;; -esac - -# Use stowdir if it's given, else fall back to ${DEPOTBASE} or else -# default to ${viewbase}/packages. -# -depot_pkg_dbdir=${stowdir:-${DEPOTBASE:-${viewbase}/packages}} - -case "${depot_pkg_dbdir}" in -${pkg_dbdir}) - echo "pkg_view: the depot and the view package database directories are the same" 1>&2 - exit 1 - ;; -esac - -########################## -# Shell helper functions # -########################## - -# symlinks check|add|delete <pkg> -# -# Calls linkfarm(1) to check, add or delete the symlink farm in -# ${targetdir}. We also ignore the right set of files when doing the -# linkfarm operations. -# -symlinks() { - pkg=$2 - case "$1" in - add) linkfarmflags="" ;; - check) linkfarmflags="-c" ;; - delete) linkfarmflags="-D" ;; - esac - if [ -f ${depot_pkg_dbdir}/$pkg/+BUILD_INFO ]; then - ignore=`$grepprog "^_PLIST_IGNORE_FILES=" ${depot_pkg_dbdir}/$pkg/+BUILD_INFO | $sedprog -e 's|^_PLIST_IGNORE_FILES=[ ]*||'` - fi - case "$ignore" in - "") ignore="${dflt_ignorefiles}" ;; - esac - dbs=`(cd ${depot_pkg_dbdir}/$pkg; echo +*)` - ignore="${ignore} ${ignorefiles} $dbs" - $doit $envprog PLIST_IGNORE_FILES="${ignore}" $linkfarmprog $linkfarmflags --target=${targetdir} --dir=${depot_pkg_dbdir} $pkg -} - -############# -# Main Loop # -############# - -while [ $# -gt 0 ]; do - case $action in - add) - checkpkg $1 ${depot_pkg_dbdir} - if [ -f ${pkg_dbdir}/$1/+DEPOT ]; then - echo "pkg_view: \`$1' already exists in $viewstr" 1>&2 - exit 1 - fi - $echo1 "Adding $1 to ${targetdir}." - symlinks add $1 - $doit $mkdirprog -p ${depot_pkg_dbdir}/$1 - temp=${depot_pkg_dbdir}/$1/+VIEWS.$$ - $doit $touchprog ${depot_pkg_dbdir}/$1/+VIEWS - $doit $cpprog ${depot_pkg_dbdir}/$1/+VIEWS ${temp} - case "$doit" in - "") ($grepprog -v '^'${pkg_dbdir}'$' ${temp} || true; echo ${pkg_dbdir}) > ${depot_pkg_dbdir}/$1/+VIEWS ;; - esac - $doit $rmprog ${temp} - $doit $mkdirprog -p ${pkg_dbdir}/$1 - # - # Copy all of the metadata files except for +VIEWS, - # which is only for the depoted package, and - # +REQUIRED_BY, which is irrelevant for a package in - # a view. - # - case "$doit" in - "") (cd ${depot_pkg_dbdir}/$1; $paxprog -rwpe '-s|\./+VIEWS$||' '-s|\./+REQUIRED_BY$||' ./+* ${pkg_dbdir}/$1) - $sedprog -e 's|'${depot_pkg_dbdir}/$1'|'${targetdir}'|g' < ${depot_pkg_dbdir}/$1/+CONTENTS > ${pkg_dbdir}/$1/+CONTENTS - echo "${depot_pkg_dbdir}/$1" > ${pkg_dbdir}/$1/+DEPOT - ;; - esac - $doit $pkgadminprog -K ${pkg_dbdir} add $1 - if [ -f ${pkg_dbdir}/$1/+INSTALL ]; then - $doit $chmodprog +x ${pkg_dbdir}/$1/+INSTALL - $doit $envprog -i PKG_PREFIX=${targetdir} ${pkg_dbdir}/$1/+INSTALL $1 VIEW-INSTALL - ec=$? - if [ $ec != 0 ]; then - echo "pkg_view: install script returned an error." 1>&2 - exit $ec - fi - fi - ;; - check) - checkpkg $1 ${depot_pkg_dbdir} - $echo1 "Checking $1 in ${targetdir}." - symlinks check $1 - exit $? - ;; - delete) - checkpkg $1 ${depot_pkg_dbdir} - if [ ! -f ${pkg_dbdir}/$1/+DEPOT ]; then - echo "pkg_view: \`$1' doesn't exist in $viewstr" 1>&2 - exit 1 - fi - $echo1 "Deleting $1 from ${targetdir}." - if [ -f ${pkg_dbdir}/$1/+REQUIRED_BY ]; then - if $cmpprog -s ${pkg_dbdir}/$1/+REQUIRED_BY /dev/null; then - : # not really required by another pkg - else - (echo "pkg_view: \`$1' is required by other packages:" - $sedprog -e 's|^| |' ${pkg_dbdir}/$1/+REQUIRED_BY) 1>&2 - exit 1 - fi - fi - if [ -f ${pkg_dbdir}/$1/+DEINSTALL ]; then - $doit $chmodprog +x ${pkg_dbdir}/$1/+DEINSTALL - $doit $envprog -i PKG_PREFIX=${targetdir} ${pkg_dbdir}/$1/+DEINSTALL $1 VIEW-DEINSTALL - ec=$? - if [ $ec != 0 ]; then - echo "pkg_view: de-install script returned an error." 1>&2 - exit $ec - fi - fi - symlinks delete $1 - temp=${depot_pkg_dbdir}/$1/+VIEWS.$$ - $doit $cpprog ${depot_pkg_dbdir}/$1/+VIEWS ${temp} - case "$doit" in - "") ($grepprog -v '^'${pkg_dbdir}'$' ${temp} || true) > ${depot_pkg_dbdir}/$1/+VIEWS ;; - esac - $doit $rmprog ${temp} - $doit $rmprog -rf ${pkg_dbdir}/$1 - $doit $pkgadminprog -K ${pkg_dbdir} delete $1 - ;; - esac - shift -done - -exit 0 |