From ea153cc43d871c3ad1608f57c9bcca0f138e2a74 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 16 Jun 2007 12:16:43 +0000 Subject: introduce new stuff: @tag, to be used to tag files and other objects. Only one tag for now: no checksum. Will supersede @comment no checksum eventually. Benefit: errors out in case of a typo. --- usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'usr.sbin/pkg_add/OpenBSD') diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 717ea1f6e5c..1fdebd0c067 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.137 2007/06/16 11:50:49 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.138 2007/06/16 12:16:42 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -568,6 +568,22 @@ sub add return; } +package OpenBSD::PackingElement::tag; +our @ISA=qw(OpenBSD::PackingElement::Annotation); + +__PACKAGE__->register_with_factory('tag'); + +sub add +{ + my ($class, $plist, $args) = @_; + + if ($args eq 'no checksum') { + $plist->{state}->{lastfile}->{nochecksum} = 1; + } else { + die "Unknown tag $args"; + } +} + package OpenBSD::PackingElement::symlink; our @ISA=qw(OpenBSD::PackingElement::Annotation); -- cgit v1.2.3