Pkg_add refused to process package whose packing list contains @exec/@unexec

before any file names.  This change makes pkg_add to process those
packages if @exec/@unexec commands don't contain any %[fFB].  Also
enable @exec/@unexec that have %D if the installation prefix is known to
pkg_add.
Reviewed by:	jkh
This commit is contained in:
Masafumi Max NAKANE 1997-10-24 08:32:06 +00:00
parent 60add4e38d
commit cb48519127
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30686

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: extract.c,v 1.16 1997/07/01 06:13:35 jkh Exp $";
"$Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp $";
#endif
/*
@ -189,9 +189,13 @@ extract_plist(char *home, Package *pkg)
break;
case PLIST_CMD:
if (last_file == NULL)
if ((strstr(p->name, "%B") || strstr(p->name, "%F") ||
strstr(p->name, "%f")) && last_file == NULL)
cleanup(0), errx(2, "no last file specified for '%s' command",
p->name);
if (strstr(p->name, "%D") && Directory == NULL)
cleanup(0), errx(2, "no directory specified for '%s' command",
p->name);
format_cmd(cmd, p->name, Directory, last_file);
PUSHOUT(Directory);
if (Verbose)