#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.142 2023/06/27 11:11:46 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.143 2023/07/03 19:12:08 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
if ($state->{received}) {
die "interrupted";
}
+ if (!$set->{quirks}) {
+ $state->{did_something} = 1;
+ }
}
sub newer_has_errors($set, $state)
{
my $add_hints = $state->{fuzzy} ? "add_hints" : "add_hints2";
+ $state->{did_something} = 0;
+
# match against a list
if ($state->{pkglist}) {
open my $f, '<', $state->{pkglist} or
# update existing stuff
if ($state->{update}) {
-
if (@ARGV == 0) {
@ARGV = sort(installed_packages());
}
$self->process_setlist($state);
}
+sub exit_code($self, $state)
+{
+ my $rc = $self->SUPER::exit_code($state);
+ if ($rc == 0 && $state->defines("SYSPATCH_LIKE")) {
+ if (!$state->{did_something}) {
+ $rc = 2;
+ }
+ }
+ return $rc;
+}
sub new_state($self, $cmd)
{