From d5d330fbf094691ea47a984ed15ac8935b0e7e64 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Mon, 22 Oct 2018 10:29:07 +0000 Subject: 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) --- usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 11 ++++++++++- usr.sbin/pkg_add/OpenBSD/Tracker.pm | 8 +++++++- 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 # @@ -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 # @@ -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; -- cgit v1.2.3