diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2017-03-03 14:06:33 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2017-03-03 14:06:33 +0000 |
commit | ccabfbe16e57581adf992e2ced5c600499e26d99 (patch) | |
tree | 351e6dcd81910e7b67cdc595ef87322c42f26580 /usr.sbin/pkg_add | |
parent | 186405727436351054e1d240e68a7df1c49dfce0 (diff) |
pass @sysctl into old stuff
okay sthen@
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 28 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 27 |
2 files changed, 3 insertions, 52 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 530f23ec8f1..196c872850b 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.172 2016/08/27 18:17:46 espie Exp $ +# $OpenBSD: Add.pm,v 1.173 2017/03/03 14:06:32 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -385,32 +385,6 @@ sub build_args $self->add_entry($l, '-g', $self->{gid}); } -package OpenBSD::PackingElement::Sysctl; -use OpenBSD::Error; - -sub install -{ - my ($self, $state) = @_; - - my $name = $self->name; - $self->SUPER::install($state); - open(my $pipe, '-|', OpenBSD::Paths->sysctl, '-n', '--', $name); - my $actual = <$pipe>; - chomp $actual; - if ($self->{mode} eq '=' && $actual eq $self->{value}) { - return; - } - if ($self->{mode} eq '>=' && $actual >= $self->{value}) { - return; - } - if ($state->{not}) { - $state->say("sysctl -w #1 =! #2", - $name, $self->{value}) if $state->verbose >= 2; - return; - } - $state->vsystem(OpenBSD::Paths->sysctl, '--', $name.'='.$self->{value}); -} - package OpenBSD::PackingElement::FileBase; use OpenBSD::Error; use File::Basename; diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 94e64afd208..9c514de4ab8 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.244 2016/06/25 18:02:59 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.245 2017/03/03 14:06:32 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -1313,29 +1313,6 @@ sub destate } } -package OpenBSD::PackingElement::Sysctl; -our @ISA=qw(OpenBSD::PackingElement::Action); - -sub keyword() { 'sysctl' } -__PACKAGE__->register_with_factory; - -sub new - -{ - my ($class, $args) = @_; - if ($args =~ m/^\s*(.*)\s*(\=|\>=)\s*(.*)\s*$/o) { - bless { name => $1, mode => $2, value => $3}, $class; - } else { - die "Bad syntax for \@sysctl"; - } -} - -sub stringize -{ - my $self = shift; - return $self->{name}.$self->{mode}.$self->{value}; -} - package OpenBSD::PackingElement::ExeclikeAction; use File::Basename; use OpenBSD::Error; @@ -1920,7 +1897,7 @@ sub register_old_keyword } for my $k (qw(src display mtree ignore_inst dirrm pkgcfl pkgdep newdepend - libdepend endfake ignore vendor incompatibility md5)) { + libdepend endfake ignore vendor incompatibility md5 sysctl)) { __PACKAGE__->register_old_keyword($k); } |