diff options
Diffstat (limited to 'usr.sbin/pkg_install/create')
| -rw-r--r-- | usr.sbin/pkg_install/create/create.h | 3 | ||||
| -rw-r--r-- | usr.sbin/pkg_install/create/main.c | 29 | ||||
| -rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 12 | ||||
| -rw-r--r-- | usr.sbin/pkg_install/create/pkg_create.1 | 3 |
4 files changed, 29 insertions, 18 deletions
diff --git a/usr.sbin/pkg_install/create/create.h b/usr.sbin/pkg_install/create/create.h index 6d3b21aa2bb..3d2e26757cb 100644 --- a/usr.sbin/pkg_install/create/create.h +++ b/usr.sbin/pkg_install/create/create.h @@ -1,4 +1,4 @@ -/* $NetBSD: create.h,v 1.10 1999/01/19 17:01:59 hubertf Exp $ */ +/* $NetBSD: create.h,v 1.11 1999/03/22 05:02:40 hubertf Exp $ */ /* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */ @@ -48,7 +48,6 @@ extern int RelativeLinks; extern int ReorderDirs; void check_list(char *, package_t *, const char *); -int pkg_perform(char **); void copy_plist(char *, package_t *); #endif /* _INST_CREATE_H_INCLUDE */ diff --git a/usr.sbin/pkg_install/create/main.c b/usr.sbin/pkg_install/create/main.c index d0924cc401a..534422fa66f 100644 --- a/usr.sbin/pkg_install/create/main.c +++ b/usr.sbin/pkg_install/create/main.c @@ -1,11 +1,11 @@ -/* $NetBSD: main.c,v 1.12 1999/01/19 17:01:59 hubertf Exp $ */ +/* $NetBSD: main.c,v 1.13 1999/03/22 05:02:40 hubertf Exp $ */ #include <sys/cdefs.h> #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.12 1999/01/19 17:01:59 hubertf Exp $"); +__RCSID("$NetBSD: main.c,v 1.13 1999/03/22 05:02:40 hubertf Exp $"); #endif #endif @@ -65,9 +65,9 @@ int main(int argc, char **argv) { int ch; - char **pkgs, **start; + lpkg_head_t pkgs; + lpkg_t *lpp; - pkgs = start = argv; while ((ch = getopt(argc, argv, Options)) != -1) switch(ch) { case 'v': @@ -163,18 +163,25 @@ main(int argc, char **argv) argc -= optind; argv += optind; + TAILQ_INIT(&pkgs); + /* Get all the remaining package names, if any */ - while (*argv) - *pkgs++ = *argv++; + while (*argv) { + lpp = alloc_lpkg(*argv); + TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); + argv++; + } /* If no packages, yelp */ - if (pkgs == start) + lpp = TAILQ_FIRST(&pkgs); + if (lpp == NULL) warnx("missing package name"), usage(); - *pkgs = NULL; - if (start[1]) - warnx("only one package name allowed ('%s' extraneous)", start[1]), + lpp = TAILQ_NEXT(lpp, lp_link); + if (lpp != NULL) + warnx("only one package name allowed ('%s' extraneous)", + lpp->lp_name), usage(); - if (!pkg_perform(start)) { + if (!pkg_perform(&pkgs)) { if (Verbose) warnx("package creation failed"); return 1; diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 724145bb2fd..0d7a3705959 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -1,11 +1,11 @@ -/* $NetBSD: perform.c,v 1.16 1999/03/09 11:10:40 agc Exp $ */ +/* $NetBSD: perform.c,v 1.17 1999/03/22 05:02:40 hubertf Exp $ */ #include <sys/cdefs.h> #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.16 1999/03/09 11:10:40 agc Exp $"); +__RCSID("$NetBSD: perform.c,v 1.17 1999/03/22 05:02:40 hubertf Exp $"); #endif #endif @@ -187,13 +187,17 @@ cleanup(int sig) } int -pkg_perform(char **pkgs) +pkg_perform(lpkg_head_t *pkgs) { - char *pkg = *pkgs; /* Only one arg to create */ + char *pkg; char *cp; FILE *pkg_in, *fp; package_t plist; char *suffix; /* What we tack on to the end of the finished package */ + lpkg_t *lpp; + + lpp = TAILQ_FIRST(pkgs); + pkg = lpp->lp_name; /* Only one arg to create */ /* Preliminary setup */ sanity_check(); diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1 index 4a438ac602e..42e48dd11e5 100644 --- a/usr.sbin/pkg_install/create/pkg_create.1 +++ b/usr.sbin/pkg_install/create/pkg_create.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_create.1,v 1.14 1999/03/07 11:58:28 mycroft Exp $ +.\" $NetBSD: pkg_create.1,v 1.15 1999/03/22 05:02:40 hubertf Exp $ .\" .\" FreeBSD install - a package for the installation and maintainance .\" of non-core utilities. @@ -430,6 +430,7 @@ and so cannot co-exist on the same system. .El .Sh SEE ALSO .Xr pkg_add 1 , +.Xr pkg_admin 1 , .Xr pkg_delete 1 , .Xr pkg_info 1 , .Xr sysconf 3 . |
