First step to killing the require script heritage: remove support

in pkg_create for them and complain in pkg_add and pkg_info.
This commit is contained in:
joerg 2007-03-08 15:36:57 +00:00
parent fc6d83e38e
commit eafde1f2ac
6 changed files with 17 additions and 39 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: perform.c,v 1.121 2006/07/20 08:34:32 gson Exp $ */
/* $NetBSD: perform.c,v 1.122 2007/03/08 15:36:57 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.121 2006/07/20 08:34:32 gson Exp $");
__RCSID("$NetBSD: perform.c,v 1.122 2007/03/08 15:36:57 joerg Exp $");
#endif
#endif
@ -824,6 +824,7 @@ ignore_replace_depends_check:
/* Look for the requirements file */
if (fexists(REQUIRE_FNAME)) {
warnx("package %s uses obsoleted require scripts", PkgName);
(void) fexec(CHMOD_CMD, "+x", REQUIRE_FNAME, NULL); /* be sure */
if (Verbose)
printf("Running requirements file first for %s.\n", PkgName);

View File

@ -1,4 +1,4 @@
/* $NetBSD: create.h,v 1.20 2007/03/08 00:52:04 joerg Exp $ */
/* $NetBSD: create.h,v 1.21 2007/03/08 15:36:57 joerg Exp $ */
/* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */
@ -32,7 +32,6 @@ extern char *Display;
extern char *Install;
extern char *DeInstall;
extern char *Contents;
extern char *Require;
extern char *Mtree;
extern char *Pkgdeps;
extern char *Pkgcfl;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.31 2007/03/08 00:52:04 joerg Exp $ */
/* $NetBSD: main.c,v 1.32 2007/03/08 15:36:57 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp";
#else
__RCSID("$NetBSD: main.c,v 1.31 2007/03/08 00:52:04 joerg Exp $");
__RCSID("$NetBSD: main.c,v 1.32 2007/03/08 15:36:57 joerg Exp $");
#endif
#endif
@ -41,7 +41,6 @@ char *Display = NULL;
char *Install = NULL;
char *DeInstall = NULL;
char *Contents = NULL;
char *Require = NULL;
char *Mtree = NULL;
char *Pkgdeps = NULL;
char *Pkgcfl = NULL;
@ -153,10 +152,6 @@ main(int argc, char **argv)
SrcDir = optarg;
break;
case 'r':
Require = optarg;
break;
case 't':
strlcpy(PlayPen, optarg, sizeof(PlayPen));
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: perform.c,v 1.46 2007/03/08 00:52:04 joerg Exp $ */
/* $NetBSD: perform.c,v 1.47 2007/03/08 15:36:57 joerg 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.38 1997/10/13 15:03:51 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.46 2007/03/08 00:52:04 joerg Exp $");
__RCSID("$NetBSD: perform.c,v 1.47 2007/03/08 15:36:57 joerg Exp $");
#endif
#endif
@ -100,9 +100,6 @@ make_dist(const char *home, const char *pkg, const char *suffix, const package_t
if (DeInstall) {
fprintf(totar, "%s\n", DEINSTALL_FNAME);
}
if (Require) {
fprintf(totar, "%s\n", REQUIRE_FNAME);
}
if (Display) {
fprintf(totar, "%s\n", DISPLAY_FNAME);
}
@ -341,11 +338,6 @@ pkg_perform(lpkg_head_t *pkgs)
add_plist(&plist, PLIST_IGNORE, NULL);
add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME);
}
if (Require) {
copy_file(Home, Require, REQUIRE_FNAME);
add_plist(&plist, PLIST_IGNORE, NULL);
add_plist(&plist, PLIST_FILE, REQUIRE_FNAME);
}
if (Display) {
copy_file(Home, Display, DISPLAY_FNAME);
add_plist(&plist, PLIST_IGNORE, NULL);

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pkg_create.1,v 1.43 2007/03/08 15:20:18 joerg Exp $
.\" $NetBSD: pkg_create.1,v 1.44 2007/03/08 15:36:57 joerg Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@ -73,9 +73,6 @@
.Op Fl p Ar prefix
.Ek
.Bk -words
.Op Fl r Ar rscript
.Ek
.Bk -words
.Op Fl S Ar size-all-file
.Ek
.Bk -words
@ -260,15 +257,6 @@ the package.
Re-order any directories in the pkg/PLIST file into reverse alphabetic
order, so that child directories will automatically be removed before
parent directories.
.It Fl r Ar rscript
Set
.Ar rscript
to be the
.Pq requirements
procedure for the package.
This can be any executable program (or shell script).
It will be invoked automatically at installation/deinstallation time to
determine whether or not installation/deinstallation should proceed.
.It Fl S Ar size-all-file
Store the given file for later querying with the
.Xr pkg_info 1

View File

@ -1,4 +1,4 @@
/* $NetBSD: perform.c,v 1.70 2006/07/01 19:31:23 dillo Exp $ */
/* $NetBSD: perform.c,v 1.71 2007/03/08 15:36:58 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.23 1997/10/13 15:03:53 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.70 2006/07/01 19:31:23 dillo Exp $");
__RCSID("$NetBSD: perform.c,v 1.71 2007/03/08 15:36:58 joerg Exp $");
#endif
#endif
@ -276,9 +276,12 @@ pkg_do(char *pkg)
show_file(pkg, "De-Install script:\n",
DEINSTALL_FNAME, TRUE);
}
if ((Flags & SHOW_REQUIRE) && fexists(REQUIRE_FNAME)) {
show_file(pkg, "Require script:\n",
REQUIRE_FNAME, TRUE);
if (fexists(REQUIRE_FNAME)) {
warnx("package %s uses obsoleted require scripts", pkg);
if (Flags & SHOW_REQUIRE) {
show_file(pkg, "Require script:\n",
REQUIRE_FNAME, TRUE);
}
}
if ((Flags & SHOW_MTREE) && fexists(MTREE_FNAME)) {
show_file(pkg, "mtree file:\n", MTREE_FNAME, TRUE);