diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-08-02 12:12:37 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-08-02 12:12:37 +0000 |
commit | fe1130822ba2906b4cb487c90b4d6055c81250a5 (patch) | |
tree | 858f436b1af7857c22ea961a7980a2c1c917871c /usr.sbin/pkg_add/OpenBSD | |
parent | efa379bc32ae3c2e62eda2303fc862a8739b5025 (diff) |
@man type file for manpages.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 22 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingList.pm | 4 |
2 files changed, 23 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index cf93270fed5..7b09db64202 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,4 +1,4 @@ -# $OpenBSD: PackingElement.pm,v 1.14 2004/08/02 12:08:25 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.15 2004/08/02 12:12:36 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -279,6 +279,26 @@ sub keyword() { "info" } sub needs_keyword { 1 } +package OpenBSD::PackingElement::Manpage; +our @ISA=qw(OpenBSD::PackingElement::File); +__PACKAGE__->setKeyword('man'); +sub keyword() { "man" } +sub needs_keyword { 1 } + +sub destate +{ + my ($self, $state) = @_; + $self->SUPER::destate($state); + my $fname = $self->fullname(); + if ($fname =~ m,^(.*/man)/(?:man|cat).*?/,) { + my $d = $1; + $state->{mandirs} = {} unless defined $state->{mandirs}; + $state->{mandirs}->{$d} = [] + unless defined $state->{mandirs}->{$d}; + push(@{$state->{mandirs}->{$d}}, $fname); + } +} + package OpenBSD::PackingElement::Ignore; our @ISA=qw(OpenBSD::PackingElement); __PACKAGE__->setKeyword('ignore'); diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index 9e05c37e8b6..b12b1ac136c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,4 +1,4 @@ -# $OpenBSD: PackingList.pm,v 1.13 2004/07/22 23:53:53 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.14 2004/08/02 12:12:36 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -83,7 +83,7 @@ sub FilesOnly my ($fh, $cont) = @_; local $_; while (<$fh>) { - next unless m/^\@cwd\b/ || m/^\@name\b/ || m/^\@info\b/ || !m/^\@/; + next unless m/^\@cwd\b/ || m/^\@name\b/ || m/^\@info\b/ || m/^\@man\b/ || !m/^\@/; &$cont($_); } } |