# ex:ts=8 sw=4:
-# $OpenBSD: Paths.pm,v 1.28 2014/04/18 10:00:48 schwarze Exp $
+# $OpenBSD: Paths.pm,v 1.29 2014/07/14 08:47:49 espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
sub library_dirs() { ("/usr", "/usr/X11R6") }
sub master_keys() { ("/etc/master_key") }
sub pkgconf() { "/etc/pkg.conf" }
+sub srclocatedb() { "/usr/lib/locate/src.db" }
+sub xlocatedb() { "/usr/X11R6/lib/locate/xorg.db" }
sub font_cruft() { ("fonts.alias", "fonts.dir", "fonts.cache-1", "fonts.scale") }
sub man_cruft() { ("whatis.db", "mandoc.db", "mandoc.index") }
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCheck.pm,v 1.52 2014/07/13 17:17:21 espie Exp $
+# $OpenBSD: PkgCheck.pm,v 1.53 2014/07/14 08:47:49 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
{
my ($self, $state) = @_;
open(my $cmd, '-|', 'locate',
- '-d', '/usr/lib/locate/src.db',
- '-d', '/usr/X11R6/lib/locate/xorg.db', ':');
+ '-d', OpenBSD::Paths->srclocatedb,
+ '-d', OpenBSD::Paths->xlocatedb, ':');
while (<$cmd>) {
chomp;
my ($set, $path) = split(':', $_, 2);
} else {
$plist->thorough_check($state);
}
- $state->{known}{$plist->infodir}{OpenBSD::PackageInfo::REQUIRED_BY} = 1;
- $state->{known}{$plist->infodir}{OpenBSD::PackageInfo::REQUIRING} = 1;
$plist->mark_available_lib($plist->pkgname, $state);
});
}
'/etc/mtree/BSD.x11.dist', 1);
}
-sub localbase_check
+sub filesystem_check
{
my ($self, $state) = @_;
$state->{known} //= {};
$state->progress->set_header("Checking file system");
find(sub {
$state->progress->working(1024);
+ if (-d $_) {
+ for my $i ('/dev', '/home', OpenBSD::Paths->pkgdb, '/var/log', '/var/backups', '/var/cron', '/var/run', '/tmp', '/var/tmp') {
+ if ($File::Find::name eq $state->destdir($i)) {
+ $File::Find::prune = 1;
+ }
+ }
+ }
if (defined $state->{basesystem}{$File::Find::name}) {
delete $state->{basesystem}{$File::Find::name};
return;
return;
}
# some directories we've got to ignore
- for my $i ('/dev', '/home', OpenBSD::Paths->pkgdb, '/var/log', '/var/backups', '/var/cron', '/var/run', '/tmp', '/var/tmp') {
- if ($File::Find::name eq $state->destdir($i)) {
- $File::Find::prune = 1;
- }
- }
if (! -r -x _) {
$File::Find::prune = 1;
$state->errsay("can't enter #1",
$state->log->dump;
$self->package_files_check($state, \@list);
$state->log->dump;
- $self->localbase_check($state);
+ $self->filesystem_check($state);
$state->progress->next;
}