summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2016-08-25 14:58:44 +0000
committerMarc Espie <espie@cvs.openbsd.org>2016-08-25 14:58:44 +0000
commit657e5a452da0968462c51bebe95373069c27e883 (patch)
tree977f8e9382518dd0c2498f3a3b533042d4290a0a /usr.sbin
parent002e0b9fad2b408ec16f73a68180c2db27c5f1ec (diff)
make the full filesystem check optional, by popular demand.
doubling -q removes the plist thorough check.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCheck.pm19
-rw-r--r--usr.sbin/pkg_add/pkg_check.813
2 files changed, 21 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm
index 27782aa7b24..437fde7b486 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCheck.pm,v 1.59 2016/06/15 15:40:13 espie Exp $
+# $OpenBSD: PkgCheck.pm,v 1.60 2016/08/25 14:58:43 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -309,10 +309,11 @@ sub handle_options
$self->{no_exports} = 1;
$self->add_interactive_options;
- $self->SUPER::handle_options('fB:q',
- '[-fIimnqvx] [-B pkg-destdir] [-D value]');
+ $self->SUPER::handle_options('fFB:q',
+ '[-fFIimnqvx] [-B pkg-destdir] [-D value]');
$self->{force} = $self->opt('f');
$self->{quick} = $self->opt('q');
+ $self->{filesystem} = $self->opt('F');
if (defined $self->opt('B')) {
$self->{destdir} = $self->opt('B');
}
@@ -908,10 +909,14 @@ sub run
$state->log->dump;
$self->reverse_dependencies_check($state, \@list);
$state->log->dump;
- $self->package_files_check($state, \@list);
- $state->log->dump;
- $self->filesystem_check($state);
- $state->progress->next;
+ if ($state->{quick} < 2) {
+ $self->package_files_check($state, \@list);
+ $state->log->dump;
+ }
+ if ($state->{filesystem}) {
+ $self->filesystem_check($state);
+ $state->progress->next;
+ }
}
sub parse_and_run
diff --git a/usr.sbin/pkg_add/pkg_check.8 b/usr.sbin/pkg_add/pkg_check.8
index ec0445d9d7e..be23d0c0fa3 100644
--- a/usr.sbin/pkg_add/pkg_check.8
+++ b/usr.sbin/pkg_add/pkg_check.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_check.8,v 1.6 2014/02/11 08:58:34 sthen Exp $
+.\" $OpenBSD: pkg_check.8,v 1.7 2016/08/25 14:58:43 espie Exp $
.\"
.\" Copyright (c) 2010 Marc Espie <espie@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: February 11 2014 $
+.Dd $Mdocdate: August 25 2016 $
.Dt PKG_CHECK 8
.Os
.Sh NAME
@@ -23,7 +23,7 @@
.Sh SYNOPSIS
.Nm pkg_check
.Bk -words
-.Op Fl fIimnqvx
+.Op Fl fFIimnqvx
.Op Fl D Ar name Ns Op = Ns Ar value
.Ek
.Sh DESCRIPTION
@@ -59,7 +59,7 @@ Checks that all direct dependencies have corresponding reverse dependencies.
.It Files from packages
Checks that each file, link or directory in those packing-lists actually exist,
and that their checksum matches what's recorded in the packing-list.
-.It Other files
+.It Other files Po option Fl F Pc
Checks that there are no other random objects under
.Pa /usr/local .
.El
@@ -87,6 +87,8 @@ do not check digital signatures.
.El
.It Fl f
Force the removal of bogus package information.
+.It Fl F
+Check the filesystem for random objects.
.It Fl I
Force non-interactive mode.
Default is to be interactive when run from a tty.
@@ -100,6 +102,9 @@ to always display the progress meter in cases it would not do so by default.
Don't actually modify packages, just perform checks.
.It Fl q
Don't verify checksums for files, just check for their existence.
+Doubling
+.Fl q
+will bypass that check entirely.
.It Fl v
Turn on verbose output.
Several