summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrh <rh@pkgsrc.org>2004-04-11 06:56:11 +0000
committerrh <rh@pkgsrc.org>2004-04-11 06:56:11 +0000
commitc7e5425240bc37044c351b2dc79fac39a30eae2e (patch)
tree007ee288d10896157639440fa78bce0a6610f361 /pkgtools
parentbffc80c64f9340c19886dee3c621ccf9d8701629 (diff)
downloadpkgsrc-c7e5425240bc37044c351b2dc79fac39a30eae2e.tar.gz
Update pkg_install to 20040411, pulling up the changes in the NetBSD source
tree: Make pkg_add recognise binary packages built with ignored recommendations (IGNORE_RECOMMENDED set in the presence of RECOMMENDED pre-requisites). This change is fully backward-compatible: binary packages have set the corresponding BUILD_INFO since RECOMMENDED was implemented. Packages built before that time will install as before. Bump PKGTOOLS_VERSION to 20040411. This closes PR pkg/24712 by Thomas Klausner.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/README6
-rw-r--r--pkgtools/pkg_install/files/add/perform.c31
-rw-r--r--pkgtools/pkg_install/files/add/pkg_add.114
-rw-r--r--pkgtools/pkg_install/files/add/pkg_add.cat124
-rw-r--r--pkgtools/pkg_install/files/lib/lib.h5
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
6 files changed, 64 insertions, 20 deletions
diff --git a/pkgtools/pkg_install/files/README b/pkgtools/pkg_install/files/README
index 4ab6524ee98..7debe4873fd 100644
--- a/pkgtools/pkg_install/files/README
+++ b/pkgtools/pkg_install/files/README
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.4 2003/10/29 23:00:27 jlam Exp $
+# $NetBSD: README,v 1.5 2004/04/11 06:56:11 rh Exp $
# Original from FreeBSD, no rcs id.
This is the pkg_install suite of tools for doing maintainance of
@@ -11,8 +11,8 @@ FreeBSD again by Jordan, who then proceeded to add another couple
of dozen features on top. Whee! :-)
In another round of enhancements, NetBSD changes were added by
-Alistair Crooks, Hubert Feyrer, Thorsten Frueauf, Christian E. Hopps,
-Thomas Klausner, Johnny Lam, and Matthias Scheler.
+Alistair Crooks, Hubert Feyrer, Thorsten Frueauf, Rene Hexel,
+Christian E. Hopps, Thomas Klausner, Johnny Lam, and Matthias Scheler.
When making snapshots, please modify PKGTOOLS_VERSION in lib/version.h
to that day's date.
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 0f580466256..cbbee2c2474 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.19 2004/04/09 18:38:12 tv Exp $ */
+/* $NetBSD: perform.c,v 1.20 2004/04/11 06:56:11 rh Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.19 2004/04/09 18:38:12 tv Exp $");
+__RCSID("$NetBSD: perform.c,v 1.20 2004/04/11 06:56:11 rh Exp $");
#endif
#endif
@@ -51,6 +51,9 @@ __RCSID("$NetBSD: perform.c,v 1.19 2004/04/09 18:38:12 tv Exp $");
#if HAVE_STRING_H
#include <string.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
@@ -326,6 +329,23 @@ pkg_do(const char *pkg)
}
}
+ /* Check if IGNORE_RECOMMENDED was set when this package was built. */
+
+ if (buildinfo[BI_IGNORE_RECOMMENDED] != NULL &&
+ strcasecmp(buildinfo[BI_IGNORE_RECOMMENDED], "NO") != 0) {
+ warnx("Package `%s' has", pkg);
+ warnx("IGNORE_RECOMMENDED set: This package was built with");
+ warnx("dependency recommendations ignored. It may have been");
+ warnx("built against a set of installed packages that is");
+ warnx("different from the recommended set of pre-requisites.");
+ warnx("As a cconsequence, this package may not work on this");
+ warnx("or other systems with a different set of packages.");
+ if (!Force && !getenv("PKG_IGNORE_RECOMMENDED")) {
+ warnx("aborting.");
+ goto bomb;
+ }
+ }
+
/*
* If we have a prefix, delete the first one we see and add this
* one in place of it.
@@ -966,7 +986,10 @@ read_buildinfo(char **buildinfo)
if (line[0] == ' ')
line += sizeof(char);
- /* we only care about opsys, arch and version */
+ /*
+ * we only care about opsys, arch, version, and
+ * dependency recommendations
+ */
if (line[0] != '\0') {
if (strcmp(key, "OPSYS") == 0)
buildinfo[BI_OPSYS] = strdup(line);
@@ -974,6 +997,8 @@ read_buildinfo(char **buildinfo)
buildinfo[BI_OS_VERSION] = strdup(line);
else if (strcmp(key, "MACHINE_ARCH") == 0)
buildinfo[BI_MACHINE_ARCH] = strdup(line);
+ else if (strcmp(key, "IGNORE_RECOMMENDED") == 0)
+ buildinfo[BI_IGNORE_RECOMMENDED] = strdup(line);
}
}
if (buildinfo[BI_OPSYS] == NULL ||
diff --git a/pkgtools/pkg_install/files/add/pkg_add.1 b/pkgtools/pkg_install/files/add/pkg_add.1
index 23d6470ff29..d0e368d5b50 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.7 2003/12/20 04:23:05 grant Exp $
+.\" $NetBSD: pkg_add.1,v 1.8 2004/04/11 06:56:11 rh Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -370,6 +370,18 @@ This behavior is overridable with the
.Fl f
flag.
.It
+The package build information from
+.Pa +BUILD_INFO
+is then checked for
+.Ev IGNORE_RECOMMENDED .
+If the package was built with dependency recommendations ignored,
+installation will be aborted.
+This behavior is overridable with the
+.Fl f
+flag and the
+.Ev PKG_IGNORE_RECOMMENDED
+environment variable.
+.It
If the package contains a
.Ar require
script (see
diff --git a/pkgtools/pkg_install/files/add/pkg_add.cat1 b/pkgtools/pkg_install/files/add/pkg_add.cat1
index b1663a19e22..a46791605de 100644
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1
@@ -207,7 +207,13 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
from that of the host, installation is aborted. This behavior
is overridable with the --ff flag.
- 7. If the package contains a _r_e_q_u_i_r_e script (see pkg_create(1)),
+ 7. The package build information from _+_B_U_I_L_D___I_N_F_O is then checked
+ for IGNORE_RECOMMENDED. If the package was built with depen-
+ dency recommendations ignored, installation will be aborted.
+ This behavior is overridable with the --ff flag and the
+ PKG_IGNORE_RECOMMENDED environment variable.
+
+ 8. If the package contains a _r_e_q_u_i_r_e script (see pkg_create(1)),
it is executed with the following arguments:
_p_k_g_-_n_a_m_e The name of the package being installed
@@ -220,7 +226,7 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
If the _r_e_q_u_i_r_e script exits with a non-zero status code, the
installation is terminated.
- 8. If the package contains an _i_n_s_t_a_l_l script, it is executed with
+ 9. 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.
@@ -232,19 +238,19 @@ 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
+ 10. 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.
- 10. If the package contains an _m_t_r_e_e_f_i_l_e file (see pkg_create(1)),
+ 11. If the package contains an _m_t_r_e_e_f_i_l_e file (see pkg_create(1)),
then mtree is invoked as:
mmttrreeee --uu --ff _m_t_r_e_e_f_i_l_e --dd --ee --pp _p_r_e_f_i_x
where _p_r_e_f_i_x is either the prefix specified with the --pp flag
or, if no --pp flag was specified, the name of the first direc-
tory named by a @@ccwwdd directive within this package.
- 11. If an _i_n_s_t_a_l_l script exists for the package, it is executed
+ 12. 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.
@@ -253,7 +259,7 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
any actions needed after the package has been
installed.
- 12. After installation is complete, a copy of the packing list,
+ 13. 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
@@ -261,12 +267,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).
- 13. If the package is a depoted package, then add it to the
+ 14. If the package is a depoted package, then add it to the
default view.
- 14. The staging area is deleted and the program terminates.
+ 15. The staging area is deleted and the program terminates.
- 15. Finally, if we were upgrading a package, any _+_R_E_Q_U_I_R_E_D___B_Y file
+ 16. 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.
diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h
index e4c48f3ed3c..24e21cf157c 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.10 2004/04/09 18:38:12 tv Exp $ */
+/* $NetBSD: lib.h,v 1.11 2004/04/11 06:56:11 rh Exp $ */
/* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
@@ -198,7 +198,8 @@ typedef enum bi_ent_t {
BI_OPSYS, /* 0 */
BI_OS_VERSION, /* 1 */
BI_MACHINE_ARCH, /* 2 */
- BI_ENUM_COUNT, /* 3 */
+ BI_IGNORE_RECOMMENDED, /* 3 */
+ BI_ENUM_COUNT, /* 4 */
} bi_ent_t;
/* Types */
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 0e42d017b1f..cddf8faa9be 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.25 2004/04/09 18:38:12 tv Exp $ */
+/* $NetBSD: version.h,v 1.26 2004/04/11 06:56:11 rh Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -33,6 +33,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION "20040409"
+#define PKGTOOLS_VERSION "20040411"
#endif /* _INST_LIB_VERSION_H_ */