summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-04-22 14:55:07 +0000
committerjkh <jkh@FreeBSD.org>1995-04-22 14:55:07 +0000
commit06e78f687343fb135a8f65bad8fa7254edd8f3ed (patch)
tree85e22ff9edfe41dcd6bd2ed22f0384f192feecac /usr.sbin
parentd3abd00ffec4e327d8ad0d9d1401caf10752f449 (diff)
downloadFreeBSD-src-06e78f687343fb135a8f65bad8fa7254edd8f3ed.zip
FreeBSD-src-06e78f687343fb135a8f65bad8fa7254edd8f3ed.tar.gz
Stage almost nothing through the playpen now - this should speed pkg_creates
up by a couple of factors, as well as decrease the amount of temporary space required to build a package down to almost nothing.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_install/create/perform.c62
1 files changed, 38 insertions, 24 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index 951ccce..9a11c46 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -26,6 +26,7 @@ static const char *rcsid = "$Id: perform.c,v 1.19 1995/04/22 01:20:13 jkh Exp $"
#include "create.h"
#include <signal.h>
+#include <limits.h>
static void sanity_check(void);
static void make_dist(char *, char *, char *, Package *);
@@ -110,8 +111,8 @@ pkg_perform(char **pkgs)
check_list(home, &plist);
(void) umask(022); /* make sure gen'ed directories, files don't have
group or other write bits. */
- copy_plist(home, &plist);
- mark_plist(&plist);
+ /* copy_plist(home, &plist); */
+ /* mark_plist(&plist); */
/* Now put the release specific items in */
add_plist(&plist, PLIST_CWD, ".");
@@ -151,9 +152,9 @@ pkg_perform(char **pkgs)
}
/* Run through the list again, picking up extra "local" items */
- check_list(".", &plist);
- copy_plist(".", &plist);
- mark_plist(&plist);
+ /* check_list(".", &plist); */
+ /* copy_plist(".", &plist); */
+ /* mark_plist(&plist); */
/* Finally, write out the packing list */
fp = fopen(CONTENTS_FNAME, "w");
@@ -174,41 +175,54 @@ pkg_perform(char **pkgs)
return TRUE; /* Success */
}
-/*
- * This is evil. It is the command executed inline on tar's command line
- * to presort file arguments in such a way as to put the all-important
- * +* files at the front. I'm sure there's a way of doing this that's
- * a hundred times more efficient, but I'm in a hurry right now and I don't
- * have the time to think more about it.. -jkh
- */
-#define SORTED_NAMES "`find . | sed -e 's/^\\.\\///' -e '/^\\.$/D' | sort`"
-
static void
make_dist(char *home, char *pkg, char *suffix, Package *plist)
{
char tball[FILENAME_MAX];
- char args[10];
+ char cmd[_POSIX_ARG_MAX];
int ret;
+ PackingList p;
- args[0] = '\0';
+ strcpy(cmd, "tar ");
if (*pkg == '/')
sprintf(tball, "%s.%s", pkg, suffix);
else
sprintf(tball, "%s/%s.%s", home, pkg, suffix);
if (index(suffix, 'z')) /* Compress/gzip? */
- strcat(args, "z");
+ strcat(cmd, "-z");
if (Dereference)
- strcat(args, "h");
+ strcat(cmd, "h");
if (Verbose)
printf("Creating gzip'd tar ball in '%s'\n", tball);
- strcat(args, "cf");
+ strcat(cmd, "cf ");
+ strcat(cmd, tball);
if (ExcludeFrom)
- ret = vsystem("tar %sX %s %s %s", args, tball, ExcludeFrom,
- SORTED_NAMES);
- else
- ret = vsystem("tar %s %s %s", args, tball, SORTED_NAMES);
+ sprintf(&cmd[strlen(cmd)], " -X %s", ExcludeFrom);
+ sprintf(&cmd[strlen(cmd)], " %s %s %s", CONTENTS_FNAME,
+ COMMENT_FNAME, DESC_FNAME);
+ if (Install)
+ sprintf(&cmd[strlen(cmd)], " %s", INSTALL_FNAME);
+ if (DeInstall)
+ sprintf(&cmd[strlen(cmd)], " %s", DEINSTALL_FNAME);
+ if (Require)
+ sprintf(&cmd[strlen(cmd)], " %s", REQUIRE_FNAME);
+ if (Display)
+ sprintf(&cmd[strlen(cmd)], " %s", DISPLAY_FNAME);
+ if (Mtree)
+ sprintf(&cmd[strlen(cmd)], " %s", MTREE_FNAME);
+ for (p = plist->head; p; p = p->next) {
+ if (p->type == PLIST_FILE)
+ sprintf(&cmd[strlen(cmd)], " %s", p->name);
+ else if (p->type == PLIST_CWD)
+ sprintf(&cmd[strlen(cmd)], " -C %s", p->name);
+ else if (p->type == PLIST_SRC)
+ sprintf(&cmd[strlen(cmd)], " -C %s", p->name);
+ else if (p->type == PLIST_IGNORE)
+ p = p->next;
+ }
+ ret = vsystem(cmd);
if (ret)
- barf("tar command failed with code %d", ret);
+ barf("tar command `%s' failed with code %d", cmd, ret);
}
static void
OpenPOWER on IntegriCloud