summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-05-18 12:13:38 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-05-18 12:13:38 +0000
commit964064b30ef76c78fcbc3596ae26cd6ddc0a4f0a (patch)
tree2e81b5a14dd80d89c92242780b992441da9818d8 /usr.sbin/pkg_add
parent7e0bbbf9f3acaaae01181874561fe6f27050deca (diff)
just warn if files from the *etc sets are missing. This will remind
people to run sysmerge, and is generally not a good hint things are out of synch. prompted by naddy@ and sthen@
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_mklocatedb14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_mklocatedb b/usr.sbin/pkg_add/pkg_mklocatedb
index 82c0fe7158e..f2088d3f8c4 100644
--- a/usr.sbin/pkg_add/pkg_mklocatedb
+++ b/usr.sbin/pkg_add/pkg_mklocatedb
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (c) 2005-2010 Marc Espie <espie@openbsd.org>
-# $OpenBSD: pkg_mklocatedb,v 1.34 2012/05/08 10:54:43 espie Exp $
+# $OpenBSD: pkg_mklocatedb,v 1.35 2012/05/18 12:13:37 espie Exp $
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -128,6 +128,16 @@ sub open_output
}
}
+sub sync_error
+{
+ my ($state, $e, $set) = @_;
+ if ($set =~ m/etc/) {
+ $state->errsay("Couldn't find #1 from set #2:\n\tDid you run sysmerge recently ?", $e, $set);
+ } else {
+ $state->fatal("Couldn't find #1 from set #2:\n\tsrc and installation out of synch ?", $e, $set);
+ }
+}
+
sub do_source
{
my ($state, $src, $tag, @sets) = @_;
@@ -142,7 +152,7 @@ sub do_source
chomp $e;
$e =~ s/^\.//;
if ($state->{check} && !-e $e) {
- $state->fatal("Couldn't find #1 from set #2:\n\tsrc and installation out of synch ?", $e, $f);
+ sync_error($state, $e, $set);
}
print {$state->{out}} "$tag:$e\n";
$output = 1;