summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2006-10-15 09:32:53 +0000
committerMarc Espie <espie@cvs.openbsd.org>2006-10-15 09:32:53 +0000
commitd6eabfc08119b6a1f30e570208c003e4a3134076 (patch)
tree7186ea8c74bf14432a43fb0b46f9350e10b20b81
parent3f8f541069373458f0426ba024e20e44b1737467 (diff)
Normalize query options: make them not stop the package generation unless
-n is also mentioned. Do some devious speed tricks in case -n && -[qQ] (forgetting to checksum files, for instance), so that it can be used for batch jobs.
-rw-r--r--usr.sbin/pkg_add/pkg_create8
-rw-r--r--usr.sbin/pkg_add/pkg_create.116
2 files changed, 18 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index 923d47b6bfc..d8c4e6ed099 100644
--- a/usr.sbin/pkg_add/pkg_create
+++ b/usr.sbin/pkg_add/pkg_create
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_create,v 1.45 2006/01/09 12:15:23 espie Exp $
+# $OpenBSD: pkg_create,v 1.46 2006/10/15 09:32:52 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -521,7 +521,7 @@ if ($plist->{need_modules}) {
}
-if (!defined $opt_q) {
+unless (defined $opt_q && defined $opt_n) {
if ($regen_package) {
$plist->checksum($base);
} else {
@@ -552,7 +552,7 @@ if (defined $opt_q) {
} else {
$plist->write(\*STDOUT);
}
- exit(0);
+ exit 0 if defined $opt_n;
}
my $wname;
if ($regen_package) {
@@ -566,7 +566,7 @@ unshift(@extra_files, CONTENTS);
if ($opt_n) {
for my $special (@extra_files) {
- print "Adding $special\n";
+ print "Adding $special\n" unless defined $opt_q;
}
$plist->archive(undef, $base, 1);
} else {
diff --git a/usr.sbin/pkg_add/pkg_create.1 b/usr.sbin/pkg_add/pkg_create.1
index 36c5fcfb8ad..d01a5061d24 100644
--- a/usr.sbin/pkg_add/pkg_create.1
+++ b/usr.sbin/pkg_add/pkg_create.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_create.1,v 1.29 2006/01/12 11:33:59 espie Exp $
+.\" $OpenBSD: pkg_create.1,v 1.30 2006/10/15 09:32:52 espie Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Nm pkg_create
.Bk -words
-.Op Fl hnv
+.Op Fl hnqQv
.Op Fl A Ar arches
.Op Fl B Ar pkg-destdir
.Oo Fl D Ar name
@@ -171,6 +171,18 @@ as the initial directory
.Dq base
to start from in selecting files for
the package, and to record as the base for installing the package.
+.It Fl q
+Print out the actual packing-list of the package being generated
+(query mode),
+Most often used in combination with
+.Fl n .
+.It Fl Q
+Print out the files in the actual packing-list of the package being
+generated, with explicit typing
+.Po e.g.,
+.Cm @file ,
+.Cm @lib ...
+.Pc
.It Fl r Ar rscript
Set
.Ar rscript