From 1bb96bf0e126b01b7f62c92ead98c66458dc442a Mon Sep 17 00:00:00 2001 From: jkh Date: Sat, 18 Sep 1993 03:38:48 +0000 Subject: Make sure permissions on registry location are readable by pkg_info. Add new % sequence expansion for command execution. --- usr.sbin/pkg_install/add/extract.c | 12 +++++++----- usr.sbin/pkg_install/add/perform.c | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'usr.sbin/pkg_install') diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c index c9978cd..d5db041 100644 --- a/usr.sbin/pkg_install/add/extract.c +++ b/usr.sbin/pkg_install/add/extract.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: extract.c,v 1.5 1993/09/04 05:06:26 jkh Exp $"; +static const char *rcsid = "$Id: extract.c,v 1.4 1993/09/06 23:26:21 jkh Exp $"; #endif /* @@ -40,6 +40,8 @@ extract_plist(char *home, Package *pkg) /* Do it */ while (p) { + char cmd[FILENAME_MAX]; + switch(p->type) { case PLIST_NAME: PkgName = p->name; @@ -75,11 +77,11 @@ extract_plist(char *home, Package *pkg) break; case PLIST_CMD: + format_cmd(cmd, p->name, Directory, last_file); if (Verbose) - printf("extract: exec cmd '%s' (lastfile = %s)\n", p->name, - last_file); - if (!Fake && vsystem(p->name, Directory, last_file)) - whinge("Command '%s' failed.", p->name); + printf("extract: execute '%s'\n", cmd); + if (!Fake && system(cmd)) + whinge("Command '%s' failed.", cmd); break; case PLIST_CHMOD: diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index d285c0e..be7b507 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.8 1993/09/04 05:06:29 jkh Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.3 1993/09/05 04:53:50 jkh Exp $"; #endif /* @@ -168,6 +168,8 @@ pkg_do(char *pkg) code = 1; goto success; /* close enough for government work */ } + /* Make sure pkg_info can read the entry */ + vsystem("chmod a+rx %s", LogDir); if (fexists(DEINSTALL_FNAME)) copy_file(".", DEINSTALL_FNAME, LogDir); if (fexists(REQUIRE_FNAME)) -- cgit v1.1