Friday, October 14, 2022

Re: pkg_*: WIP say deleted/installed not i/+ in logs

On Mon, May 02, 2022 at 08:33:52AM +0000, Klemens Nanni wrote:
> For way too long I did not even see the little dashes and pluses that
> drowned in the pkg_* log noise among these dash header and the pkgname:
>
> --- -bitlbee-3.6p1 -------------------
> You should also run rm -rf /var/bitlbee/*
> You should also run /usr/sbin/userdel _bitlbee
> You should also run /usr/sbin/groupdel _bitlbee
>
> At some point I noticed them and didn't know what they meant, until
> someone hit me with the clue stick and said they'd mean
> "deleted/removed" and "added/installed".
>
> Now that makes sense, I guess, but couldn't we use regular words here?
>
> Here's a start that fixes at least messages such as the example above.
> There are more unhandled ones with "-" I could not find in the pkg_*
> sources as well as the "+" ones which still remain hidden to me.
>
> --- deleted bitlbee-3.6p1 -------------------
> You should also run rm -rf /var/bitlbee/*
> You should also run /usr/sbin/userdel _bitlbee
> You should also run /usr/sbin/groupdel _bitlbee
>
> I'd say "deleted" and "installed" since that is what pkg_delete(1) and
> pkg_add describe in their NAME section.
>
> Do you think that's an improvement?
> Could someone help out and find the missing pieces in
> /usr/src/sbin/pkg_add/?

No feeback so far.
Anyone?


Index: OpenBSD/PkgDelete.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm,v
retrieving revision 1.48
diff -u -p -r1.48 PkgDelete.pm
--- OpenBSD/PkgDelete.pm 1 Feb 2022 16:54:09 -0000 1.48
+++ OpenBSD/PkgDelete.pm 14 Oct 2022 14:10:33 -0000
@@ -246,7 +246,7 @@ sub really_remove
$set->setup_header($state);
for my $pkg ($set->older) {
$set->setup_header($state, $pkg);
- $state->log->set_context('-'.$pkg->pkgname);
+ $state->log->set_context('deleted '.$pkg->pkgname);
OpenBSD::Delete::delete_handle($pkg, $state);
}
$state->progress->next($state->ntogo);
Index: OpenBSD/SharedItems.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/SharedItems.pm,v
retrieving revision 1.33
diff -u -p -r1.33 SharedItems.pm
--- OpenBSD/SharedItems.pm 9 Jun 2019 12:16:07 -0000 1.33
+++ OpenBSD/SharedItems.pm 14 Oct 2022 14:10:33 -0000
@@ -102,7 +102,7 @@ sub cleanup
$state->progress->show($done, $total);
if (defined $remaining->{dirs}{$d}) {
for my $i (@{$h->{$d}}) {
- $state->log->set_context('-'.$i->{pkgname});
+ $state->log->set_context('deleted '.$i->{pkgname});
$i->reload($state);
}
} else {
@@ -117,7 +117,7 @@ sub cleanup
$state->system(OpenBSD::Paths->userdel, '--',
$user);
} else {
- $state->log->set_context('-'.$pkgname);
+ $state->log->set_context('deleted '.$pkgname);
$state->log("You should also run /usr/sbin/userdel #1", $user);
}
$done++;
@@ -129,7 +129,7 @@ sub cleanup
$state->system(OpenBSD::Paths->groupdel, '--',
$group);
} else {
- $state->log->set_context('-'.$pkgname);
+ $state->log->set_context('deleted '.$pkgname);
$state->log("You should also run /usr/sbin/groupdel #1", $group);
}
$done++;
@@ -155,7 +155,7 @@ sub cleanup
{
my ($self, $state) = @_;
my $fullname = $state->{destdir}.$self->fullname;
- $state->log->set_context('-'.$self->{pkgname});
+ $state->log->set_context('deleted '.$self->{pkgname});
$state->log("You may wish to remove #1 from man.conf", $fullname);
for my $f (OpenBSD::Paths->man_cruft) {
unlink("$fullname/$f");
@@ -167,7 +167,7 @@ sub cleanup
{
my ($self, $state) = @_;
my $fullname = $state->{destdir}.$self->fullname;
- $state->log->set_context('-'.$self->{pkgname});
+ $state->log->set_context('deleted '.$self->{pkgname});
$state->log("You may wish to remove #1 from your font path", $fullname);
for my $f (OpenBSD::Paths->font_cruft) {
unlink("$fullname/$f");

No comments:

Post a Comment