From 46034630cfb319b0eee56df2f6f9176dc2fce9a2 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 16 May 2023 14:31:26 +0000 Subject: [PATCH] ditch subclasses for PackingList: I ended up never using this anywhere --- usr.sbin/pkg_add/OpenBSD/OldLibs.pm | 4 +-- usr.sbin/pkg_add/OpenBSD/PackingList.pm | 40 ++----------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/OldLibs.pm b/usr.sbin/pkg_add/OpenBSD/OldLibs.pm index 003fa24cf2c..94c4057b478 100644 --- a/usr.sbin/pkg_add/OpenBSD/OldLibs.pm +++ b/usr.sbin/pkg_add/OpenBSD/OldLibs.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: OldLibs.pm,v 1.13 2022/04/27 15:04:11 espie Exp $ +# $OpenBSD: OldLibs.pm,v 1.14 2023/05/16 14:31:26 espie Exp $ # # Copyright (c) 2004-2010 Marc Espie # @@ -154,7 +154,7 @@ sub split_some_libs my $c1 = {}; my $c2 = {}; $plist->separate_element($libs, $c1, $c2); - my $p1 = OpenBSD::PackingList::OldLibs->new; + my $p1 = OpenBSD::PackingList->new; $p1->set_infodir($plist->infodir); $plist->special_deep_copy($p1, $c1, {}); my $p2 = $plist->make_shallow_copy($c2); diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index 39c11a943a5..08b16257c31 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingList.pm,v 1.149 2022/06/06 07:21:17 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.150 2023/05/16 14:31:26 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -177,10 +177,7 @@ sub read if (ref $a) { $plist = $a; } else { - $plist = new $a; - } - if (defined $subclass->{$code}) { - bless $plist, "OpenBSD::PackingList::".$subclass->{$code}; + $plist = $a->new; } &$code($u, sub { @@ -562,37 +559,4 @@ sub signature return OpenBSD::Signature->from_plist($self); } -$subclass = { - \&defaultCode => 'Full', - \&SharedItemsOnly => 'SharedItems', - \&DirrmOnly => 'SharedItems', - \&LibraryOnly => 'Libraries', - \&FilesOnly => 'Files', - \&PrelinkStuffOnly => 'Prelink', - \&DependOnly => 'Depend', - \&ExtraInfoOnly => 'ExtraInfo', - \&UpdateInfoOnly => 'UpdateInfo', - \&ConflictOnly => 'Conflict' }; - -package OpenBSD::PackingList::OldLibs; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::Full; -our @ISA = qw(OpenBSD::PackingList::OldLibs); -package OpenBSD::PackingList::SharedItems; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::Libraries; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::Files; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::Prelink; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::Depend; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::ExtraInfo; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::UpdateInfo; -our @ISA = qw(OpenBSD::PackingList); -package OpenBSD::PackingList::Conflict; -our @ISA = qw(OpenBSD::PackingList); - 1; -- 2.20.1