# ex:ts=8 sw=4:
-# $OpenBSD: Log.pm,v 1.3 2010/06/30 10:51:04 espie Exp $
+# $OpenBSD: Log.pm,v 1.4 2010/08/03 14:10:12 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
push(@{$self->{erroutput}}, $self->f(@_)."\n");
}
+sub specialsort
+{
+ return ((sort grep { /^\-/ } @_), (sort grep { /^\+/} @_),
+ (sort grep { !/^[\-+]/ } @_));
+}
+
sub dump
{
my $self = shift;
- for my $ctxt (sort keys %{$self->{errmessages}}) {
+ for my $ctxt (specialsort keys %{$self->{errmessages}}) {
my $msgs = $self->{errmessages}->{$ctxt};
if (@$msgs > 0) {
$self->{p}->errsay("--- #1 -------------------", $ctxt);
}
}
$self->{errmessages} = {};
- for my $ctxt (sort keys %{$self->{messages}}) {
+ for my $ctxt (specialsort keys %{$self->{messages}}) {
my $msgs = $self->{messages}->{$ctxt};
if (@$msgs > 0) {
$self->{p}->say("--- #1 -------------------", $ctxt);
# ex:ts=8 sw=4:
-# $OpenBSD: SharedItems.pm,v 1.27 2010/08/01 10:03:24 espie Exp $
+# $OpenBSD: SharedItems.pm,v 1.28 2010/08/03 14:10:12 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
my $realname = $state->{destdir}.$d;
for my $i (@{$h->{$d}}) {
- $state->log->set_context($i->{pkgname});
+ $state->log->set_context('-'.$i->{pkgname});
$i->cleanup($state);
}
if (!rmdir $realname) {
my $realname = $state->{destdir}.$d;
if ($remaining->{dirs}->{$realname}) {
for my $i (@{$h->{$d}}) {
- $state->log->set_context($i->{pkgname});
+ $state->log->set_context('-'.$i->{pkgname});
$i->reload($state);
}
} else {
$state->system(OpenBSD::Paths->userdel, '--',
$user);
} else {
- $state->log->set_context($pkgname);
+ $state->log->set_context('-'.$pkgname);
$state->log("You should also run /usr/sbin/userdel #1", $user);
}
$done++;
$state->system(OpenBSD::Paths->groupdel, '--',
$group);
} else {
- $state->log->set_context($pkgname);
+ $state->log->set_context('-'.$pkgname);
$state->log("You should also run /usr/sbin/groupdel #1", $group);
}
$done++;