aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/create
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-12-16 13:59:31 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-12-16 13:59:31 +0000
commit0440e20b71e2ba6346ea5e3308f0ada86fe8e822 (patch)
treec7f5293caf7d222fac747f409fef057373a0e290 /usr.sbin/pkg_install/create
parenta2c8d39884adb6aa6ca8b5934b7d942b50355ec0 (diff)
Notes
Diffstat (limited to 'usr.sbin/pkg_install/create')
-rw-r--r--usr.sbin/pkg_install/create/create.h4
-rw-r--r--usr.sbin/pkg_install/create/main.c23
-rw-r--r--usr.sbin/pkg_install/create/perform.c16
-rw-r--r--usr.sbin/pkg_install/create/pkg_create.153
4 files changed, 82 insertions, 14 deletions
diff --git a/usr.sbin/pkg_install/create/create.h b/usr.sbin/pkg_install/create/create.h
index eab822a371e9..45b90b10ed17 100644
--- a/usr.sbin/pkg_install/create/create.h
+++ b/usr.sbin/pkg_install/create/create.h
@@ -1,4 +1,4 @@
-/* $Id: create.h,v 1.12 1997/06/06 12:19:11 jkh Exp $ */
+/* $Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -28,7 +28,9 @@ extern char *Comment;
extern char *Desc;
extern char *Display;
extern char *Install;
+extern char *PostInstall;
extern char *DeInstall;
+extern char *PostDeInstall;
extern char *Contents;
extern char *Require;
extern char *SrcDir;
diff --git a/usr.sbin/pkg_install/create/main.c b/usr.sbin/pkg_install/create/main.c
index 38fff8a66b0f..55810c2b2531 100644
--- a/usr.sbin/pkg_install/create/main.c
+++ b/usr.sbin/pkg_install/create/main.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.16 1997/06/06 12:19:11 jkh Exp $";
+ "$Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp $";
#endif
/*
@@ -18,7 +18,7 @@ static const char rcsid[] =
#include "lib.h"
#include "create.h"
-static char Options[] = "YNOhvf:p:P:c:d:i:k:r:t:X:D:m:s:";
+static char Options[] = "YNOhvf:p:P:c:d:i:I:k:K:r:t:X:D:m:s:";
char *Prefix = NULL;
char *Comment = NULL;
@@ -26,7 +26,9 @@ char *Desc = NULL;
char *SrcDir = NULL;
char *Display = NULL;
char *Install = NULL;
+char *PostInstall = NULL;
char *DeInstall = NULL;
+char *PostDeInstall = NULL;
char *Contents = NULL;
char *Require = NULL;
char *ExcludeFrom = NULL;
@@ -87,10 +89,18 @@ main(int argc, char **argv)
Install = optarg;
break;
+ case 'I':
+ PostInstall = optarg;
+ break;
+
case 'k':
DeInstall = optarg;
break;
+ case 'K':
+ PostDeInstall = optarg;
+ break;
+
case 'r':
Require = optarg;
break;
@@ -151,10 +161,11 @@ main(int argc, char **argv)
static void
usage()
{
- fprintf(stderr, "%s\n%s\n%s\n%s\n",
+ fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
"usage: pkg_create [-YNOhv] [-P pkgs] [-p prefix] [-f contents] [-i iscript]",
-" [-k dscript] [-r rscript] [-t template] [-X excludefile]",
-" [-D displayfile] [-m mtreefile] -c comment -d description",
-" -f packlist pkg-name");
+" [-I piscript] [-k dscript] [-K pdscript] [-r rscript] ",
+" [-t template] [-X excludefile] [-D displayfile] ",
+" [-m mtreefile] -c comment -d description -f packlist ",
+" pkg-name");
exit(1);
}
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index d68cc0073b45..5e7443d9a396 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.45 1998/09/11 07:26:57 jkh Exp $";
+ "$Id: perform.c,v 1.46 1998/12/05 06:28:58 asami Exp $";
#endif
/*
@@ -156,11 +156,21 @@ pkg_perform(char **pkgs)
add_plist(&plist, PLIST_IGNORE, NULL);
add_plist(&plist, PLIST_FILE, INSTALL_FNAME);
}
+ if (PostInstall) {
+ copy_file(home, PostInstall, POST_INSTALL_FNAME);
+ add_plist(&plist, PLIST_IGNORE, NULL);
+ add_plist(&plist, PLIST_FILE, POST_INSTALL_FNAME);
+ }
if (DeInstall) {
copy_file(home, DeInstall, DEINSTALL_FNAME);
add_plist(&plist, PLIST_IGNORE, NULL);
add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME);
}
+ if (PostDeInstall) {
+ copy_file(home, PostDeInstall, POST_DEINSTALL_FNAME);
+ add_plist(&plist, PLIST_IGNORE, NULL);
+ add_plist(&plist, PLIST_FILE, POST_DEINSTALL_FNAME);
+ }
if (Require) {
copy_file(home, Require, REQUIRE_FNAME);
add_plist(&plist, PLIST_IGNORE, NULL);
@@ -270,8 +280,12 @@ make_dist(char *home, char *pkg, char *suffix, Package *plist)
if (Install)
fprintf(totar, "%s\n", INSTALL_FNAME);
+ if (PostInstall)
+ fprintf(totar, "%s\n", POST_INSTALL_FNAME);
if (DeInstall)
fprintf(totar, "%s\n", DEINSTALL_FNAME);
+ if (PostDeInstall)
+ fprintf(totar, "%s\n", POST_DEINSTALL_FNAME);
if (Require)
fprintf(totar, "%s\n", REQUIRE_FNAME);
if (Display)
diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1
index eaec8fb1143a..8596261907b3 100644
--- a/usr.sbin/pkg_install/create/pkg_create.1
+++ b/usr.sbin/pkg_install/create/pkg_create.1
@@ -15,7 +15,7 @@
.\"
.\"
.\" @(#)pkg_create.1
-.\" $Id: pkg_create.1,v 1.25 1998/05/24 03:11:17 steve Exp $
+.\" $Id: pkg_create.1,v 1.26 1998/06/26 07:15:37 jkoshy Exp $
.\"
.\" hacked up by John Kohl for NetBSD--fixed a few bugs, extended keywords,
.\" added dependency tracking, etc.
@@ -36,7 +36,9 @@
.Op Fl p Ar prefix
.Op Fl f Ar contents
.Op Fl i Ar iscript
+.Op Fl I Ar piscript
.Op Fl k Ar dscript
+.Op Fl K Ar pdscript
.Op Fl r Ar rscript
.Op Fl s Ar srcdir
.Op Fl t Ar template
@@ -102,9 +104,28 @@ are dumped, rather than the links themselves.
.It Fl i Ar iscript
Set
.Ar iscript
-to be the install procedure for the package. This can be any
+to be the pre-install procedure for the package. This can be any executable
+program (or shell script). It will be invoked automatically when the
+package is later installed. It will be passed the package's name as the
+first argument.
+
+.Cm Note:
+if the
+.Cm Fl I
+option is not given, this script will serve as both the pre-install and the
+post-install script for the package, differentiating between the
+functionality by passing the keywords
+.Ar PRE-INSTALL
+and
+.Ar POST-INSTALL
+respectively, along with the package's name.
+.It Fl I Ar piscript
+Set
+.Ar piscript
+to be the post-install procedure for the package. This can be any
executable program (or shell script). It will be invoked automatically
-when the package is later installed.
+when the package is later installed. It will be passed the package's name as
+the first argument.
.It Fl P Ar pkgs
Set the initial package dependency list to
.Ar pkgs .
@@ -120,9 +141,29 @@ the package.
.It Fl k Ar dscript
Set
.Ar dscript
-to be the de-install procedure for the package. This can be any
-executable program (or shell script). It will be invoked automatically
-when the package is later (if ever) de-installed.
+to be the de-install procedure for the package. This can be any executable
+program (or shell script). It will be invoked automatically when the
+package is later (if ever) de-installed. It will be passed the package's
+name as the first argument.
+
+.Cm Note:
+if the
+.Cm Fl K
+option is not given, this script will serve as both the de-install and the
+post-deinstall script for the package, differentiating between the
+functionality by passing the keywords
+.Ar DEINSTALL
+and
+.Ar POST-DEINSTALL
+respectively, along with the package's name.
+.It Fl K Ar pdscript
+Set
+.Ar pdscript
+to be the post-deinstall procedure for the package. This can be any
+executable program (or shell script). It will be invoked automatically when
+the package is later de-installed. It will be passed the package's name as
+the first argument.
+
.It Fl r Ar rscript
Set
.Ar rscript