summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-07-20 18:58:42 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-07-20 18:58:42 +0000
commit2293af38b04a2de14fa3de145fda2821bcbcc105 (patch)
tree7d66ff430b59466dadc2f07a59caef26fb2c1c85 /usr.sbin/pkg_add/OpenBSD
parenta76bb0b2cfc88cd076be31dcc6aad7102686f557 (diff)
support for gnu-info, with @info keyword.
- modify pkg_create so that it will look for info-[0-9]+ and add them to the packing-list. - deal with installing the info file/de-installing it at pkg_add/pkg_delete time. tested by naddy@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm25
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm4
2 files changed, 25 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index df427f770bf..41222ed8aaf 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.11 2004/07/14 10:44:03 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.12 2004/07/20 18:58:41 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -150,6 +150,8 @@ sub expand
}
sub IsFile() { 0 }
+sub NoDuplicateNames() { 0 }
+
sub fullname($)
{
return $_[0]->{fullname};
@@ -161,12 +163,18 @@ use File::Spec;
use OpenBSD::PackageInfo qw(is_info_name);
__PACKAGE__->setKeyword('file');
+sub needs_keyword
+{
+ my $self = shift;
+ return $self->stringize() =~ m/\^@/;
+}
+
sub write
{
my ($self, $fh) = @_;
print $fh "\@ignore\n" if defined $self->{ignore};
print $fh "\@comment no checksum\n" if defined $self->{nochecksum};
- if ($self->stringize() =~ m/^\@/) {
+ if ($self->needs_keyword()) {
$self->SUPER::write($fh);
} else {
print $fh $self->stringize(), "\n";
@@ -245,6 +253,15 @@ sub make_hardlink
sub IsFile() { 1 }
+sub NoDuplicateNames() { 1 }
+
+package OpenBSD::PackingElement::InfoFile;
+our @ISA=qw(OpenBSD::PackingElement::File);
+__PACKAGE__->setKeyword('info');
+sub keyword() { "info" }
+
+sub needs_keyword { 1 }
+
package OpenBSD::PackingElement::Ignore;
our @ISA=qw(OpenBSD::PackingElement);
__PACKAGE__->setKeyword('ignore');
@@ -571,6 +588,8 @@ sub destate
package OpenBSD::PackingElement::Dirs;
+sub NoDuplicateNames() { 1 }
+
package OpenBSD::PackingElement::DirRm;
our @ISA=qw(OpenBSD::PackingElement::Dirs OpenBSD::PackingElement);
@@ -617,6 +636,8 @@ sub add_md5
$self->{md5} = $md5;
}
+sub needs_keyword { 0 }
+
sub write
{
&OpenBSD::PackingElement::File::write;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index d52b97dc449..60972e84aa1 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.11 2004/07/14 10:44:03 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.12 2004/07/20 18:58:41 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/^\@/;
+ next unless m/^\@cwd\b/ || m/^\@name\b/ || m/^\@info\b/ || !m/^\@/;
&$cont($_);
}
}