continue;
case PLIST_CMD:
- if (format_cmd(cmd, sizeof(cmd), p->name, pkg->prefix, last_file))
+ if (format_cmd(cmd, sizeof(cmd), p->name, pkg->install_prefix, last_file))
return -1;
printf("Executing '%s'\n", cmd);
if (!Fake && system(cmd))
int fail = SUCCESS;
Boolean preserve;
char tmp[MaxPathSize];
+ char cmd[MaxPathSize];
const char *prefix = NULL, *name = NULL;
if (!pkgdb_open(ReadWrite)) {
case PLIST_UNEXEC:
if (NoDeleteFiles)
break;
- format_cmd(tmp, sizeof(tmp), p->name, prefix, last_file);
- printf("Executing `%s'\n", tmp);
- if (!Fake && system(tmp)) {
- warnx("unexec command for `%s' failed", tmp);
+ (void) snprintf(tmp, sizeof(tmp), "%s%s%s",
+ destdir ? destdir : "", destdir ? "/" : "", prefix);
+ format_cmd(cmd, sizeof(cmd), p->name, tmp, last_file);
+ printf("Executing `%s'\n", cmd);
+ if (!Fake && system(cmd)) {
+ warnx("unexec command for `%s' failed", cmd);
fail = FAIL;
}
break;