summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-05-10 00:03:14 +0000
committersobomax <sobomax@FreeBSD.org>2002-05-10 00:03:14 +0000
commit1c2894552d88ae64f4102938cbb470b80cf4b35e (patch)
treeb290773dfb222ad2c427d179b22ee05d2f2e871b /usr.sbin/pkg_install
parent1894db5ac7af64acc77acfbbc7b98c819dd70e22 (diff)
downloadFreeBSD-src-1c2894552d88ae64f4102938cbb470b80cf4b35e.zip
FreeBSD-src-1c2894552d88ae64f4102938cbb470b80cf4b35e.tar.gz
When packing installed package into a file (pkg_create -b) make sure to
include all package files into resulting tarball. PR: 34007 Submitted by: olgeni While I here: - Remove bogus comment; - ensure that we return the proper exit code in the case of -b failure. MFC after: 5 days
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/create/perform.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index d27840e..ca708ff 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -426,24 +426,31 @@ create_from_installed(const char *pkg, const char *suf)
snprintf(log_dir, sizeof(log_dir), "%s/%s", LOG_DIR, InstalledPkg);
if (!fexists(log_dir)) {
warnx("can't find package '%s' installed!", InstalledPkg);
- return 1;
+ return FALSE;
}
getcwd(homedir, sizeof(homedir));
if (chdir(log_dir) == FAIL) {
warnx("can't change directory to '%s'!", log_dir);
- return 1;
+ return FALSE;
}
/* Suck in the contents list */
plist.head = plist.tail = NULL;
fp = fopen(CONTENTS_FNAME, "r");
if (!fp) {
warnx("unable to open %s file", CONTENTS_FNAME);
- return 1;
+ return FALSE;
}
- /* If we have a prefix, add it now */
read_plist(&plist, fp);
fclose(fp);
+ Install = isfile(INSTALL_FNAME) ? INSTALL_FNAME : NULL;
+ PostInstall = isfile(POST_INSTALL_FNAME) ? POST_INSTALL_FNAME : NULL;
+ DeInstall = isfile(DEINSTALL_FNAME) ? DEINSTALL_FNAME : NULL;
+ PostDeInstall = isfile(POST_DEINSTALL_FNAME) ? POST_DEINSTALL_FNAME : NULL;
+ Require = isfile(REQUIRE_FNAME) ? REQUIRE_FNAME : NULL;
+ Display = isfile(DISPLAY_FNAME) ? DISPLAY_FNAME : NULL;
+ Mtree =isfile(MTREE_FNAME) ? MTREE_FNAME : NULL;
+
make_dist(homedir, pkg, suf, &plist);
free_plist(&plist);
OpenPOWER on IntegriCloud