summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authorjoerg <joerg>2007-08-09 23:32:59 +0000
committerjoerg <joerg>2007-08-09 23:32:59 +0000
commit872fc042989418d64fc68bab24d5c7578ad81fce (patch)
treebe35613f6028d0fa34ef9ca79f09261af683d1e9 /pkgtools/pkg_install
parentd20defd36e71b524ad3ad5df2eb57ec183d8fd7e (diff)
downloadpkgsrc-872fc042989418d64fc68bab24d5c7578ad81fce.tar.gz
Remove @option extract-in-place support for now (will be the default
later) and document @option preserve in pkg_add(1).
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r--pkgtools/pkg_install/files/add/perform.c39
-rw-r--r--pkgtools/pkg_install/files/add/pkg_add.122
-rw-r--r--pkgtools/pkg_install/files/add/pkg_add.cat135
-rw-r--r--pkgtools/pkg_install/files/create/pkg_create.111
-rw-r--r--pkgtools/pkg_install/files/create/pkg_create.cat114
5 files changed, 34 insertions, 87 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 41d5d5801a4..34f7925cebe 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.53 2007/08/09 23:18:30 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.54 2007/08/09 23:32:59 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.53 2007/08/09 23:18:30 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.54 2007/08/09 23:32:59 joerg Exp $");
#endif
#endif
@@ -224,7 +224,6 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs)
plist_t *p;
struct stat sb;
struct utsname host_uname;
- int inPlace;
int rc;
uint64_t needed;
Boolean is_depoted_pkg = FALSE;
@@ -236,7 +235,6 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs)
LogDir[0] = '\0';
strlcpy(playpen, FirstPen, sizeof(playpen));
memset(buildinfo, '\0', sizeof(buildinfo));
- inPlace = 0;
umask(DEF_UMASK);
@@ -322,31 +320,6 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs)
fclose(cfile);
if (!IS_URL(pkg)) {
- /* Extract directly rather than moving? Oh goodie! */
- if (find_plist_option(&Plist, "extract-in-place")) {
- if (Verbose)
- printf("Doing in-place extraction for %s\n", pkg);
- p = find_plist(&Plist, PLIST_CWD);
- if (p) {
- if (!(isdir(p->name) || islinktodir(p->name)) && !Fake) {
- if (Verbose)
- printf("Desired prefix of %s does not exist, creating.\n", p->name);
- (void) fexec("mkdir", "-p", p->name, NULL);
- }
- if (chdir(p->name) == -1) {
- warn("unable to change directory to `%s'", p->name);
- goto bomb;
- }
- where_to = p->name;
- inPlace = 1;
- } else {
- warnx(
- "no prefix specified in `%s' - this is a bad package!",
- pkg);
- goto bomb;
- }
- }
-
/*
* Apply a crude heuristic to see how much space the package will
* take up once it's unpacked. I've noticed that most packages
@@ -354,7 +327,7 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs)
*/
needed = 4 * (uint64_t) sb.st_size;
- if (!inPlace && min_free(playpen) < needed) {
+ if (min_free(playpen) < needed) {
warnx("projected size of %" MY_PRIu64 " bytes exceeds available free space\n"
"in %s. Please set your PKG_TMPDIR variable to point\n"
"to a location with more free space and try again.",
@@ -362,10 +335,6 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs)
goto bomb;
}
- /* If this is a direct extract and we didn't want it, stop now */
- if (inPlace && Fake)
- goto success;
-
/* Finally unpack the whole mess */
if (unpack(pkg, NULL)) {
warnx("unable to extract `%s'!", pkg);
@@ -846,7 +815,7 @@ ignore_replace_depends_check:
* We need to reset the package dbdir so that extract_plist()
* updates the correct pkgdb.byfile.db database.
*/
- if (!inPlace && !Fake) {
+ if (!Fake) {
_pkgdb_setPKGDB_DIR(dbdir);
if (!extract_plist(".", &Plist)) {
errc = 1;
diff --git a/pkgtools/pkg_install/files/add/pkg_add.1 b/pkgtools/pkg_install/files/add/pkg_add.1
index 3781a964dd6..4bd9dbe7ce4 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.24 2007/08/02 23:34:00 wiz Exp $
+.\" $NetBSD: pkg_add.1,v 1.25 2007/08/09 23:32:59 joerg Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -17,7 +17,7 @@
.\"
.\" @(#)pkg_add.1
.\"
-.Dd August 2, 2007
+.Dd August 10, 2007
.Dt PKG_ADD 1
.Os
.Sh NAME
@@ -330,15 +330,10 @@ A search is made for any
.Cm @option
directives which control how the package is added to the system.
The only currently implemented option is
-.Cm @option extract-in-place ,
-which causes the package to be extracted directly into its
-prefix directory rather than moving it through a staging area in
-.Pa /var/tmp .
-.It
-If
-.Cm @option extract-in-place
-is enabled, the package is now extracted directly into its
-final location, otherwise it is extracted into the staging area.
+.Cm @option preserve ,
+which tells pkg_add to move any existing files out of the way,
+preserving the previous contents (which are also resurrected on
+pkg_delete, so caveat emptor).
.It
The package build information is extracted from the
.Pa +BUILD_INFO
@@ -374,10 +369,7 @@ If the
.Ar install
script exits with a non-zero status code, the installation is terminated.
.It
-If
-.Cm @option extract-in-place
-is not present in the packing list,
-then it is used as a guide for moving (or copying, as necessary) files from
+It is used as a guide for moving (or copying, as necessary) files from
the staging area into their final locations.
.It
If an
diff --git a/pkgtools/pkg_install/files/add/pkg_add.cat1 b/pkgtools/pkg_install/files/add/pkg_add.cat1
index 1d94e96a93d..962d645681b 100644
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1
@@ -186,26 +186,23 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
4. A search is made for any @@ooppttiioonn directives which control how
the package is added to the system. The only currently imple-
- mented option is @@ooppttiioonn eexxttrraacctt--iinn--ppllaaccee, which causes the
- package to be extracted directly into its prefix directory
- rather than moving it through a staging area in _/_v_a_r_/_t_m_p.
+ mented option is @@ooppttiioonn pprreesseerrvvee, which tells pkg_add to move
+ any existing files out of the way, preserving the previous
+ contents (which are also resurrected on pkg_delete, so caveat
+ emptor).
- 5. If @@ooppttiioonn eexxttrraacctt--iinn--ppllaaccee is enabled, the package is now
- extracted directly into its final location, otherwise it is
- extracted into the staging area.
-
- 6. The package build information is extracted from the
+ 5. The package build information is extracted from the
_+_B_U_I_L_D___I_N_F_O file and compared against the result of uname(3).
If the operating system or architecture of the package differ
from that of the host, installation is aborted. This behavior
is overridable with the --ff flag.
- 7. The package build information from _+_B_U_I_L_D___I_N_F_O is then checked
+ 6. The package build information from _+_B_U_I_L_D___I_N_F_O is then checked
for USE_ABI_DEPENDS=NO (or IGNORE_RECOMMENDED). If the pack-
age was built with ABI dependency recommendations ignored, a
warning will be issued.
- 8. If the package contains an _i_n_s_t_a_l_l script, it is executed with
+ 7. If the package contains an _i_n_s_t_a_l_l script, it is executed with
the following arguments:
_p_k_g_-_n_a_m_e The name of the package being installed.
@@ -217,12 +214,10 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
If the _i_n_s_t_a_l_l script exits with a non-zero status code, the
installation is terminated.
- 9. If @@ooppttiioonn eexxttrraacctt--iinn--ppllaaccee is not present in the packing
- list, then it is used as a guide for moving (or copying, as
- necessary) files from the staging area into their final loca-
- tions.
+ 8. It is used as a guide for moving (or copying, as necessary)
+ files from the staging area into their final locations.
- 10. If an _i_n_s_t_a_l_l script exists for the package, it is executed
+ 9. If an _i_n_s_t_a_l_l script exists for the package, it is executed
with the following arguments:
_p_k_g___n_a_m_e The name of the package being installed.
@@ -231,7 +226,7 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
any actions needed after the package has been
installed.
- 11. After installation is complete, a copy of the packing list,
+ 10. After installation is complete, a copy of the packing list,
_d_e_i_n_s_t_a_l_l script, description, and display files are copied
into _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_> for subsequent possible use by
pkg_delete(1). Any package dependencies are recorded in the
@@ -239,12 +234,12 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
an alternate package database directory is specified, then it
overrides the _/_v_a_r_/_d_b_/_p_k_g path shown above).
- 12. If the package is a depoted package, then add it to the
+ 11. If the package is a depoted package, then add it to the
default view.
- 13. The staging area is deleted and the program terminates.
+ 12. The staging area is deleted and the program terminates.
- 14. Finally, if we were upgrading a package, any _+_R_E_Q_U_I_R_E_D___B_Y file
+ 13. Finally, if we were upgrading a package, any _+_R_E_Q_U_I_R_E_D___B_Y file
that was moved aside before upgrading was started is now moved
back into place.
@@ -346,4 +341,4 @@ BBUUGGSS
Sure to be others.
-NetBSD 4.0 August 2, 2007 NetBSD 4.0
+NetBSD 4.0 August 10, 2007 NetBSD 4.0
diff --git a/pkgtools/pkg_install/files/create/pkg_create.1 b/pkgtools/pkg_install/files/create/pkg_create.1
index 35d501e1574..70465b3bee2 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.12 2007/08/03 13:55:29 joerg Exp $
+.\" $NetBSD: pkg_create.1,v 1.13 2007/08/09 23:33:00 joerg 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 August 2, 2007
+.Dd August 10, 2007
.Dt PKG_CREATE 1
.Os
.Sh NAME
@@ -400,13 +400,8 @@ command (well, considering that it's later handed off to it, that's
no surprise).
Use without an arg to set back to default (extraction) permissions.
.It Cm @option Ar option
-Set internal package options, the only two currently supported ones
+Set internal package options, the only currently supported one
being
-.Ar extract-in-place ,
-which tells the pkg_add command not to extract the package's tarball
-into a staging area but rather directly into the target
-hierarchy (this is typically meant to be used only by distributions
-or other special package types), and
.Ar preserve ,
which tells pkg_add to move any existing files out of the way,
preserving the previous contents (which are also resurrected on
diff --git a/pkgtools/pkg_install/files/create/pkg_create.cat1 b/pkgtools/pkg_install/files/create/pkg_create.cat1
index 05bfe56b818..e453e529062 100644
--- a/pkgtools/pkg_install/files/create/pkg_create.cat1
+++ b/pkgtools/pkg_install/files/create/pkg_create.cat1
@@ -215,14 +215,10 @@ PPAACCKKIINNGG LLIISSTT DDEETTAAIILLSS
surprise). Use without an arg to set back to default (extrac-
tion) permissions.
@@ooppttiioonn _o_p_t_i_o_n
- Set internal package options, the only two currently supported
- ones being _e_x_t_r_a_c_t_-_i_n_-_p_l_a_c_e, which tells the pkg_add command not
- to extract the package's tarball into a staging area but rather
- directly into the target hierarchy (this is typically meant to be
- used only by distributions or other special package types), and
- _p_r_e_s_e_r_v_e, which tells pkg_add to move any existing files out of
- the way, preserving the previous contents (which are also resur-
- rected on pkg_delete, so caveat emptor).
+ Set internal package options, the only currently supported one
+ being _p_r_e_s_e_r_v_e, which tells pkg_add to move any existing files
+ out of the way, preserving the previous contents (which are also
+ resurrected on pkg_delete, so caveat emptor).
@@oowwnneerr _u_s_e_r
Set default ownership for all subsequently extracted files to
_u_s_e_r. Use without an arg to set back to default (extraction)
@@ -300,4 +296,4 @@ BBUUGGSS
invocations due to exec argument-space limitations (this depends on the
value returned by ssyyssccoonnff(___S_C___A_R_G___M_A_X)).
-NetBSD 4.0 August 2, 2007 NetBSD 4.0
+NetBSD 4.0 August 10, 2007 NetBSD 4.0