diff --git a/usr.sbin/pkg_install/add/Makefile b/usr.sbin/pkg_install/add/Makefile index 2887d05706fb..e0fdcffb3101 100644 --- a/usr.sbin/pkg_install/add/Makefile +++ b/usr.sbin/pkg_install/add/Makefile @@ -1,7 +1,14 @@ PROG= pkg_add CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib -LDADD+= -L${.CURDIR}/../lib -L${.CURDIR}/../lib/obj -linstall + +.if exists(${.CURDIR}/../lib/obj) +LDADD+= -L${.CURDIR}/../lib/obj -linstall +DPADD+= ${.CURDIR}/../lib/obj/libinstall.a +.else +LDADD+= -L${.CURDIR}/../lib -linstall +DPADD+= ${.CURDIR}/../lib/libinstall.a +.endif SRCS= main.c perform.c futil.c extract.c diff --git a/usr.sbin/pkg_install/create/Makefile b/usr.sbin/pkg_install/create/Makefile index 2f52910f7cc2..ff33874a11f7 100644 --- a/usr.sbin/pkg_install/create/Makefile +++ b/usr.sbin/pkg_install/create/Makefile @@ -1,7 +1,14 @@ PROG= pkg_create CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib -LDADD+= -L${.CURDIR}/../lib -L${.CURDIR}/../lib/obj -linstall + +.if exists(${.CURDIR}/../lib/obj) +LDADD+= -L${.CURDIR}/../lib/obj -linstall +DPADD+= ${.CURDIR}/../lib/obj/libinstall.a +.else +LDADD+= -L${.CURDIR}/../lib -linstall +DPADD+= ${.CURDIR}/../lib/libinstall.a +.endif SRCS= main.c perform.c pl.c diff --git a/usr.sbin/pkg_install/create/create.h b/usr.sbin/pkg_install/create/create.h index e64cf29366ac..8f4db25b06fe 100644 --- a/usr.sbin/pkg_install/create/create.h +++ b/usr.sbin/pkg_install/create/create.h @@ -1,4 +1,4 @@ -/* $Id: create.h,v 1.6 1994/12/06 00:51:35 jkh Exp $ */ +/* $Id: create.h,v 1.7 1995/04/09 15:04:57 jkh Exp $ */ /* * FreeBSD install - a package for the installation and maintainance @@ -36,6 +36,7 @@ extern char *ExcludeFrom; extern char *Mtree; extern char *Pkgdeps; extern int Dereference; +extern int PlistOnly; void check_list(char *, Package *); void usage(const char *, const char *, ...); diff --git a/usr.sbin/pkg_install/create/main.c b/usr.sbin/pkg_install/create/main.c index e3058dd3c392..4ab6b7483d71 100644 --- a/usr.sbin/pkg_install/create/main.c +++ b/usr.sbin/pkg_install/create/main.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: main.c,v 1.8 1994/12/06 00:51:36 jkh Exp $"; +static const char *rcsid = "$Id: main.c,v 1.9 1995/04/09 15:04:58 jkh Exp $"; #endif /* @@ -16,7 +16,7 @@ static const char *rcsid = "$Id: main.c,v 1.8 1994/12/06 00:51:36 jkh Exp $"; #include "lib.h" #include "create.h" -static char Options[] = "YNhvf:p:P:c:d:i:k:r:t:X:D:m:"; +static char Options[] = "YNOhvf:p:P:c:d:i:k:r:t:X:D:m:"; char *Prefix = NULL; char *Comment = NULL; @@ -31,6 +31,7 @@ char *ExcludeFrom = NULL; char *Mtree = NULL; char *Pkgdeps = NULL; int Dereference = 0; +int PlistOnly = 0; int main(int argc, char **argv) @@ -54,6 +55,10 @@ main(int argc, char **argv) AutoAnswer = YES; break; + case 'O': + PlistOnly = YES; + break; + case 'p': Prefix = optarg; break; @@ -166,5 +171,6 @@ usage(const char *name, const char *fmt, ...) fprintf(stderr, "-v verbose\n"); fprintf(stderr, "-Y assume `yes' answer to all questions\n"); fprintf(stderr, "-N assume `no' answer to all questions\n"); + fprintf(stderr, "-O print a revised packing list and exit\n"); exit(1); } diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index f83f3091b54d..06d517e9242a 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.15 1995/04/09 15:05:00 jkh Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.16 1995/04/10 08:01:52 jkh Exp $"; #endif /* @@ -41,7 +41,7 @@ pkg_perform(char **pkgs) /* Preliminary setup */ sanity_check(); - if (Verbose) + if (Verbose && !PlistOnly) printf("Creating package %s\n", pkg); get_dash_string(&Comment); get_dash_string(&Desc); @@ -92,6 +92,15 @@ pkg_perform(char **pkgs) if (find_plist(&plist, PLIST_NAME) == NULL) add_plist_top(&plist, PLIST_NAME, basename_of(pkg)); + /* + * We're just here for to dump out a revised plist for the FreeBSD ports + * hack. It's not a real create in progress. + */ + if (PlistOnly) { + write_plist(&plist, stdout); + exit(0); + } + /* Make a directory to stomp around in */ home = make_playpen(PlayPen, 0); signal(SIGINT, cleanup); diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1 index e5424a9e85b7..cd98bf0101b9 100644 --- a/usr.sbin/pkg_install/create/pkg_create.1 +++ b/usr.sbin/pkg_install/create/pkg_create.1 @@ -15,11 +15,15 @@ .\" .\" .\" @(#)pkg_create.8 -.\" $Id: pkg_create.1,v 1.12 1995/01/05 10:37:09 jkh Exp $ +.\" $Id: pkg_create.1,v 1.13 1995/04/09 15:05:01 jkh Exp $ +.\" .\" hacked up by John Kohl for NetBSD--fixed a few bugs, extended keywords, .\" added dependency tracking, etc. .\" -.Dd November 25, 1994 +.\" [jkh] Took John's changes back and made some additional extensions for +.\" better integration with FreeBSD's new ports collection. +.\" +.Dd April 21, 1995 .Dt pkg_create 8 .Os FreeBSD 2.0 .Sh NAME @@ -27,7 +31,7 @@ .Nd a utility for creating software package distributions. .Sh SYNOPSIS .Nm -.Op Fl YNhv +.Op Fl YNOhv .Op Fl P Ar pkgs .Op Fl p Ar prefix .Op Fl f Ar contents @@ -86,6 +90,12 @@ Assume a default answer of `Yes' for any questions asked. .Em "Optional." .It Fl N Assume a default answer of `No' for any questions asked. +.It Fl O +Go into a `packing list Only' mode. This is a custom hack for the +.Em "FreeBSD Ports Collection" +and is used to do `fake pkg_add' operations when a port is installed. +In such cases, it is necessary to know what the final, adjusted packing +list will look like. .Em "Optional." .It Fl v Turns on verbose output. diff --git a/usr.sbin/pkg_install/delete/Makefile b/usr.sbin/pkg_install/delete/Makefile index 942f524410e0..cd1598dae12e 100644 --- a/usr.sbin/pkg_install/delete/Makefile +++ b/usr.sbin/pkg_install/delete/Makefile @@ -1,8 +1,14 @@ PROG= pkg_delete CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib -LDADD+= -L${.CURDIR}/../lib -L${.CURDIR}/../lib/obj -linstall +.if exists(${.CURDIR}/../lib/obj) +LDADD+= -L${.CURDIR}/../lib/obj -linstall +DPADD+= ${.CURDIR}/../lib/obj/libinstall.a +.else +LDADD+= -L${.CURDIR}/../lib -linstall +DPADD+= ${.CURDIR}/../lib/libinstall.a +.endif SRCS= main.c perform.c diff --git a/usr.sbin/pkg_install/info/Makefile b/usr.sbin/pkg_install/info/Makefile index b7344f3f2acb..a5a75c5e7414 100644 --- a/usr.sbin/pkg_install/info/Makefile +++ b/usr.sbin/pkg_install/info/Makefile @@ -1,8 +1,14 @@ PROG= pkg_info CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib -LDADD+= -L${.CURDIR}/../lib -L${.CURDIR}/../lib/obj -linstall +.if exists(${.CURDIR}/../lib/obj) +LDADD+= -L${.CURDIR}/../lib/obj -linstall +DPADD+= ${.CURDIR}/../lib/obj/libinstall.a +.else +LDADD+= -L${.CURDIR}/../lib -linstall +DPADD+= ${.CURDIR}/../lib/libinstall.a +.endif SRCS= main.c perform.c show.c