From: espie Date: Tue, 4 Sep 2018 14:46:12 +0000 (+0000) Subject: move readmes detection to find_extractible, so that only changed/new readmes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2cac224be3002a2afe445e292c3d17958ccb1866;p=openbsd move readmes detection to find_extractible, so that only changed/new readmes are recorded. Be more specific and list those readmes in alphabetic order at end. --- diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 2bfb909e246..2e58b3f1af2 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.176 2018/06/22 13:58:55 espie Exp $ +# $OpenBSD: Add.pm,v 1.177 2018/09/04 14:46:12 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -150,6 +150,11 @@ sub perform_extraction $file->name); } delete $wanted->{$file->name}; + my $fullname = $e->fullname; + if ($fullname =~ m,^$state->{localbase}/share/doc/pkg-readmes/,) { + push(@{$state->{readmes}}, $fullname); + } + $e->prepare_to_extract($state, $file); $e->extract($state, $file); $p->advance($e); @@ -541,10 +546,6 @@ sub install $self->SUPER::install($state); my $fullname = $self->fullname; my $destdir = $state->{destdir}; - if ($fullname =~ m,^$state->{localbase}/share/doc/pkg-readmes/,) { - $state->{readmes}++; - } - if ($state->{not}) { $state->say("moving tempfile -> #1", $destdir.$fullname) if $state->verbose >= 5; diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index df84aef443a..6355162c2c6 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.267 2018/08/03 06:49:26 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.268 2018/09/04 14:46:12 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -183,8 +183,11 @@ sub finish my ($class, $state) = @_; OpenBSD::PackingElement::Fontdir->finish($state); OpenBSD::PackingElement::RcScript->report($state); - if ($state->{readmes}) { - $state->say("Look in #1/share/doc/pkg-readmes for extra documentation.", $state->{localbase}); + if (defined $state->{readmes}) { + $state->say("New and changed readme(s):"); + for my $file (sort @{$state->{readmes}}) { + $state->say("\t#1", $file); + } } }