diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 |
| commit | 76b5366091f76c9bc73570149ef5055648fc2c39 (patch) | |
| tree | 590d020e0f2a5bea6e09d66d951a674443b21d67 /usr.sbin/pkg_install/create | |
| parent | 4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pkg_install/create')
| -rw-r--r-- | usr.sbin/pkg_install/create/create.h | 4 | ||||
| -rw-r--r-- | usr.sbin/pkg_install/create/main.c | 23 | ||||
| -rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 40 | ||||
| -rw-r--r-- | usr.sbin/pkg_install/create/pkg_create.1 | 53 |
4 files changed, 18 insertions, 102 deletions
diff --git a/usr.sbin/pkg_install/create/create.h b/usr.sbin/pkg_install/create/create.h index 45b90b10ed17..eab822a371e9 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.13 1997/10/08 07:46:19 charnier Exp $ */ +/* $Id: create.h,v 1.12 1997/06/06 12:19:11 jkh Exp $ */ /* * FreeBSD install - a package for the installation and maintainance @@ -28,9 +28,7 @@ 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 55810c2b2531..38fff8a66b0f 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.17 1997/10/08 07:46:23 charnier Exp $"; + "$Id: main.c,v 1.16 1997/06/06 12:19:11 jkh 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:I:k:K:r:t:X:D:m:s:"; +static char Options[] = "YNOhvf:p:P:c:d:i:k:r:t:X:D:m:s:"; char *Prefix = NULL; char *Comment = NULL; @@ -26,9 +26,7 @@ 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; @@ -89,18 +87,10 @@ 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; @@ -161,11 +151,10 @@ main(int argc, char **argv) static void usage() { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: pkg_create [-YNOhv] [-P pkgs] [-p prefix] [-f contents] [-i iscript]", -" [-I piscript] [-k dscript] [-K pdscript] [-r rscript] ", -" [-t template] [-X excludefile] [-D displayfile] ", -" [-m mtreefile] -c comment -d description -f packlist ", -" pkg-name"); +" [-k dscript] [-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 5e7443d9a396..6d13be57f7eb 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.46 1998/12/05 06:28:58 asami Exp $"; + "$Id: perform.c,v 1.44 1998/09/08 10:42:24 jkh Exp $"; #endif /* @@ -45,8 +45,6 @@ pkg_perform(char **pkgs) FILE *pkg_in, *fp; Package plist; int len; - char *suf; - int compress; /* Preliminary setup */ sanity_check(); @@ -65,24 +63,10 @@ pkg_perform(char **pkgs) } plist.head = plist.tail = NULL; - /* chop suffix off if already specified, remembering if we want to compress */ + /* chop suffix off if already specified */ len = strlen(pkg); - if (len > 4) - if (!strcmp(&pkg[len - 4], ".tgz")) { - compress = TRUE; - pkg[len - 4] = '\0'; - } - else if (!strcmp(&pkg[len - 4], ".tar")) { - compress = FALSE; - pkg[len - 4] = '\0'; - } - else - /* default is to compress packages */ - compress = TRUE; - if (compress) - suf = "tgz"; - else - suf = "tar"; + if (len > 4 && !strcmp(&pkg[len - 4], ".tgz")) + pkg[len - 4] = '\0'; /* Stick the dependencies, if any, at the top */ if (Pkgdeps) { @@ -156,21 +140,11 @@ 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); @@ -202,7 +176,7 @@ pkg_perform(char **pkgs) } /* And stick it into a tar ball */ - make_dist(home, pkg, suf, &plist); + make_dist(home, pkg, "tgz", &plist); /* Cleanup */ free(Comment); @@ -280,12 +254,8 @@ 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 8596261907b3..eaec8fb1143a 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.26 1998/06/26 07:15:37 jkoshy Exp $ +.\" $Id: pkg_create.1,v 1.25 1998/05/24 03:11:17 steve Exp $ .\" .\" hacked up by John Kohl for NetBSD--fixed a few bugs, extended keywords, .\" added dependency tracking, etc. @@ -36,9 +36,7 @@ .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 @@ -104,28 +102,9 @@ are dumped, rather than the links themselves. .It Fl i Ar iscript Set .Ar iscript -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 +to be the 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. +when the package is later installed. .It Fl P Ar pkgs Set the initial package dependency list to .Ar pkgs . @@ -141,29 +120,9 @@ 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. 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. - +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 Fl r Ar rscript Set .Ar rscript |
