2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
8 * This is the create module.
10 * $FreeBSD: src/usr.sbin/pkg_install/create/main.c,v 1.35 2004/06/29 18:56:59 eik Exp $
11 * $DragonFly: src/usr.sbin/pkg_install/create/Attic/main.c,v 1.4 2004/07/30 04:46:12 dillon Exp $
18 static char Options[] = "YNOhjvyzf:p:P:C:c:d:i:I:k:K:r:t:X:D:m:s:S:o:b:";
27 char *PostInstall = NULL;
28 char *DeInstall = NULL;
29 char *PostDeInstall = NULL;
30 char *Contents = NULL;
32 char *ExcludeFrom = NULL;
35 char *Conflicts = NULL;
37 char *InstalledPkg = NULL;
38 char PlayPen[FILENAME_MAX];
39 int Dereference = FALSE;
40 int PlistOnly = FALSE;
41 enum zipper Zipper = GZIP;
43 static void usage(void);
46 main(int argc, char **argv)
49 char **pkgs, **start, *tmp;
52 while ((ch = getopt(argc, argv, Options)) != -1)
103 PostInstall = optarg;
111 PostDeInstall = optarg;
119 strlcpy(PlayPen, optarg, sizeof(PlayPen));
123 ExcludeFrom = optarg;
156 InstalledPkg = optarg;
157 while ((tmp = strrchr(optarg, (int)'/')) != NULL) {
160 * If character after the '/' is alphanumeric, then we've
161 * found the package name. Otherwise we've come across
162 * a trailing '/' and need to continue our quest.
180 /* Get all the remaining package names, if any */
184 /* If no packages, yelp */
185 if ((pkgs == start) && (InstalledPkg == NULL))
186 warnx("missing package name"), usage();
188 if ((start[0] != NULL) && (start[1] != NULL)) {
189 warnx("only one package name allowed ('%s' extraneous)", start[1]);
192 if (start[0] == NULL)
193 start[0] = InstalledPkg;
194 if (!pkg_perform(start)) {
196 warnx("package creation failed");
206 fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
207 "usage: pkg_create [-YNOhvyz] [-P pkgs] [-C conflicts] [-p prefix] ",
208 " [-i iscript] [-I piscript] [-k dscript] [-K pdscript] ",
209 " [-r rscript] [-t template] [-X excludefile] ",
210 " [-D displayfile] [-m mtreefile] [-o origin] ",
211 " [-s srcdir] [-S basedir] ",
212 " -c comment -d description -f packlist pkg-filename",
213 " pkg_create [-YNhvyz] -b pkg-name [pkg-filename]");