From cb48519127dd267a19c2995dd2bab24af28253c6 Mon Sep 17 00:00:00 2001 From: Masafumi Max NAKANE Date: Fri, 24 Oct 1997 08:32:06 +0000 Subject: [PATCH] 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 --- usr.sbin/pkg_install/add/extract.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c index 96002d093a0f..794e37749b38 100644 --- a/usr.sbin/pkg_install/add/extract.c +++ b/usr.sbin/pkg_install/add/extract.c @@ -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)