summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2018-10-22 10:29:07 +0000
committerMarc Espie <espie@cvs.openbsd.org>2018-10-22 10:29:07 +0000
commitd5d330fbf094691ea47a984ed15ac8935b0e7e64 (patch)
tree9cdd745ecb5ec3f40f93c3db71a252adc6347c7e
parent24255b7a3e4cad3d23277a608886077c08c30218 (diff)
start erroring out based on unfilled tracker entries
(to be specified more later... right now it doesn't even warn if you have packages installed that are MORE recent than the mirror)
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm11
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Tracker.pm8
2 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index 2eb84359fd9..da3d719c324 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.104 2018/07/10 10:37:59 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.105 2018/10/22 10:29:06 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -1039,11 +1039,20 @@ sub inform_user_of_problems
$state->say("Couldn't find updates for #1",
join(' ', sort @cantupdate)) if @cantupdate > 0;
+ if (@cantupdate > 0) {
+ $state->{bad}++;
+ }
}
if (defined $state->{issues}) {
$state->say("There were some ambiguities. ".
"Please run in interactive mode again.");
}
+ my @install = $state->tracker->cant_install_list;
+ if (@install > 0) {
+ $state->say("Couldn't install #1",
+ join(' ', sort @install));
+ $state->{bad}++;
+ }
}
# if we already have quirks, we update it. If not, we try to install it.
diff --git a/usr.sbin/pkg_add/OpenBSD/Tracker.pm b/usr.sbin/pkg_add/OpenBSD/Tracker.pm
index 1b019879819..0b043bccdda 100644
--- a/usr.sbin/pkg_add/OpenBSD/Tracker.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Tracker.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Tracker.pm,v 1.28 2015/08/13 16:34:11 espie Exp $
+# $OpenBSD: Tracker.pm,v 1.29 2018/10/22 10:29:06 espie Exp $
#
# Copyright (c) 2009 Marc Espie <espie@openbsd.org>
#
@@ -214,4 +214,10 @@ sub cant_list
return keys %{$self->{cant_update}};
}
+sub cant_install_list
+{
+ my $self = shift;
+ return keys %{$self->{cant_install}};
+}
+
1;