diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-07-25 11:26:02 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-07-25 11:26:02 +0000 |
commit | feaeb3098c8d2cf817e6d6495a57acab64caa2a5 (patch) | |
tree | fdb9f8bfee1b72f5da0c804885b9b117a752007b /usr.sbin | |
parent | bc24aeae8a4710d25c7c1a33311fe06ddf41e2f9 (diff) |
common code for all device handling.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Ustar.pm | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm index 8224b80e6c2..c0647155059 100644 --- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm +++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Ustar.pm,v 1.30 2005/07/20 15:35:33 espie Exp $ +# $OpenBSD: Ustar.pm,v 1.31 2005/07/25 11:26:01 espie Exp $ # # Copyright (c) 2002-2004 Marc Espie <espie@openbsd.org> # @@ -476,31 +476,29 @@ sub create sub isFifo() { 1 } sub type() { OpenBSD::Ustar::FIFO } -package OpenBSD::Ustar::BlockDevice; +package OpenBSD::UStar::Device; our @ISA=qw(OpenBSD::Ustar::Object); sub create { my $self = shift; $self->make_basedir($self->{name}); - system('/sbin/mknod', 'mknod', '-m', $self->{mode}, $self->{destdir}.$self->{name}, 'b', $self->{major}, $self->{minor}); + system('/sbin/mknod', 'mknod', '-m', $self->{mode}, $self->{destdir}.$self->{name}, $self->devicetype(), $self->{major}, $self->{minor}); } sub isDevice() { 1 } + +package OpenBSD::Ustar::BlockDevice; +our @ISA=qw(OpenBSD::Ustar::Device); + sub type() { OpenBSD::Ustar::BLOCKDEVICE } +sub devicetype() { 'b' } package OpenBSD::Ustar::CharDevice; -our @ISA=qw(OpenBSD::Ustar::Object); - -sub create -{ - my $self = shift; - $self->make_basedir($self->{name}); - system('/sbin/mknod', 'mknod', '-m', $self->{mode}, $self->{destdir}.$self->{name}, 'b', $self->{major}, $self->{minor}); -} +our @ISA=qw(OpenBSD::Ustar::Device); -sub isDevice() { 1 } sub type() { OpenBSD::Ustar::BLOCKDEVICE } +sub devicetype() { 'c' } package OpenBSD::CompactWriter; |