From d4473b1c598525d8455312cc75a7ed5fff9310d6 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Sat, 18 Sep 1993 03:39:21 +0000 Subject: [PATCH] Doc new % sequence expansion for command execution. Fixed bad verbose message. --- usr.sbin/pkg_install/create/perform.c | 4 +- usr.sbin/pkg_install/create/pkg_create.1 | 55 +++++++++++++++++++++--- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 8b0f73be3f50..2363a385aafc 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.5 1993/09/04 05:06:33 jkh Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.6 1993/09/12 20:56:40 jkh Exp $"; #endif /* @@ -146,7 +146,7 @@ make_dist(char *home, char *pkg, char *suffix, Package *plist) if (index(suffix, 'z')) /* Compress/gzip? */ strcat(args, "z"); if (Verbose) - printf("Creating gzip'd tar ball in '%s', contents:\n", tball); + printf("Creating gzip'd tar ball in '%s'\n", tball); strcat(args, "cf"); if (ExcludeFrom) ret = vsystem("tar %sX %s %s .", args, tball, ExcludeFrom); diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1 index b4cb2853f8eb..34a548b44ff9 100644 --- a/usr.sbin/pkg_install/create/pkg_create.1 +++ b/usr.sbin/pkg_install/create/pkg_create.1 @@ -157,11 +157,56 @@ Execute .I command as part of the unpacking process. If .I command -contains a `%s/%s' sequence somewhere in it, it will be expanded to -the name of the current directory and last filename extracted. In -practice, such weird things should be unnecessary in all but the most -extenuating circumstances, but it's there should you need it -nonetheless. +contains a any of the following sequences somewhere in it, they will +be expanded inline. For the following examples, assume that +.B @cwd +is set to +.B /usr/local +and the last extracted file was +.B bin/emacs. +.TP +.I "%F" +Expands to the last filename extracted (as specified), in the example case +.B bin/emacs +.TP +.I "%D" +Expands to the current directory prefix, as set with +.B @cwd, +in the example case +.B /usr/local. +.TP +.I "%B" +Expands to the "basename" of the fully qualified filename, that +is the current directory prefix, plus the last filespec, minus +the trailing filename. In the example case, that would be +.B /usr/local/bin. +.TP +.I "%f" +Expands to the "filename" part of the fully qualified name, or +the converse of +.B %B +, being in the example case, +.B emacs. +.TP +.BI "@unexec\ " command +Execute +.I command +as part of the deinstallation process. Expansion of special +.B % +sequences is the same as for +.B @exec. +This command is not executed during the package add, as +.B @exec +is, but rather when the package is deleted. This is useful +for creating links and other ancillary files that were created +as a result of adding the package, but not directly known to +the package's table of contents (and hence not automatically +removable). The advantage of using +.B @unexec +over a deinstallation script is that you can use the "special +sequence expansion" to get at files regardless of where they've +been potentially redirected (see +.B -p) .TP .BI "@mode\ " mode Sets default permission for all subsequently extracted files to