diff options
-rw-r--r-- | lib/AdminPanel/Module/Services.pm | 10 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm | 1 | ||||
-rw-r--r-- | lib/AdminPanel/Shared.pm | 27 | ||||
-rw-r--r-- | lib/AdminPanel/Shared/Services.pm | 6 |
4 files changed, 9 insertions, 35 deletions
diff --git a/lib/AdminPanel/Module/Services.pm b/lib/AdminPanel/Module/Services.pm index 365f3e18..84a46245 100644 --- a/lib/AdminPanel/Module/Services.pm +++ b/lib/AdminPanel/Module/Services.pm @@ -62,9 +62,9 @@ use strict; # TODO same translation atm use lib qw(/usr/lib/libDrakX); use MDK::Common::String qw(formatAlaTeX); +use MDK::Common::DataStructure qw(member); use yui; -use AdminPanel::Shared qw(member); use AdminPanel::Shared::GUI; use AdminPanel::Shared::Locales; use AdminPanel::Shared::Services qw( @@ -297,7 +297,7 @@ sub _serviceStatusString { my $started; - if (AdminPanel::Shared::member($serviceName, $self->all_xinetd_services)) { + if (MDK::Common::DataStructure::member($serviceName, $self->all_xinetd_services)) { $started = $self->loc->N("Start when requested"); } else { @@ -344,7 +344,7 @@ sub _fillServiceTable { my $cell = new yui::YTableCell($started); $item->addCell($cell); - $item->check(AdminPanel::Shared::member($serviceName, $self->all_on_services)); + $item->check(MDK::Common::DataStructure::member($serviceName, $self->all_on_services)); $item->setLabel($serviceName); $itemCollection->push($item); $item->DISOWN(); @@ -420,7 +420,7 @@ sub _servicePanel { my $item = $serviceTbl->selectedItem(); if ($item) { $self->_serviceInfo($item->label(), $infoPanel); - if (AdminPanel::Shared::member($item->label(), $self->all_xinetd_services)) { + if (MDK::Common::DataStructure::member($item->label(), $self->all_xinetd_services)) { $stopButton->setDisabled(); $startButton->setDisabled(); } @@ -475,7 +475,7 @@ sub _servicePanel { $item = $serviceTbl->selectedItem(); if ($item) { $self->_serviceInfo($item->label(), $infoPanel); - if (AdminPanel::Shared::member($item->label(), $self->all_xinetd_services)) { + if (MDK::Common::DataStructure::member($item->label(), $self->all_xinetd_services)) { $stopButton->setDisabled(); $startButton->setDisabled(); } diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm index 038d1a4c..eb2b25dd 100644 --- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm +++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm @@ -37,6 +37,7 @@ use AdminPanel::Shared::GUI; use URPM::Signature; use MDK::Common::Math qw(max); use MDK::Common::File; +use MDK::Common::DataStructure qw(member); use urpm::media; use urpm::download; use urpm::lock; diff --git a/lib/AdminPanel/Shared.pm b/lib/AdminPanel/Shared.pm index 7963d47e..f435c6ac 100644 --- a/lib/AdminPanel/Shared.pm +++ b/lib/AdminPanel/Shared.pm @@ -84,7 +84,6 @@ use base qw(Exporter); # TODO move GUI dialogs to Shared::GUI our @EXPORT = qw( trim - member md5sum pathList2hash ); @@ -127,33 +126,7 @@ sub trim { return $st; } -#============================================================= - -=head2 member - -=head3 INPUT - - $e: Array element to be found into array - @_: any array - -=head3 OUTPUT - - 1 or 0: if $e is a member of the given array -=head3 DESCRIPTION - -This function look for an element into an array - -=cut - -#============================================================= -sub member { - my $e = shift; - foreach (@_) { - $e eq $_ and return 1; - } - 0; -} #============================================================= diff --git a/lib/AdminPanel/Shared/Services.pm b/lib/AdminPanel/Shared/Services.pm index c6de77aa..1870e046 100644 --- a/lib/AdminPanel/Shared/Services.pm +++ b/lib/AdminPanel/Shared/Services.pm @@ -84,12 +84,12 @@ use diagnostics; use Sys::Syslog; use File::Basename qw( basename ); -use AdminPanel::Shared qw(member); use AdminPanel::Shared::Locales; use lib qw(/usr/lib/libDrakX); use MDK::Common::Func qw(find); use MDK::Common::File qw(cat_); +use MDK::Common::DataStructure qw(member); use run_program qw(rooted); use base qw(Exporter); @@ -292,7 +292,7 @@ sub set_service { my @xinetd_services = map { $_->[0] } xinetd_services(); - if (AdminPanel::Shared::member($service, @xinetd_services)) { + if (MDK::Common::DataStructure::member($service, @xinetd_services)) { $ENV{PATH} = "/usr/bin:/usr/sbin"; run_program::rooted($::prefix, "/usr/sbin/chkconfig", $enable ? "--add" : "--del", $service); } elsif (_running_systemd() || _has_systemd()) { @@ -705,7 +705,7 @@ This function returns if the given service starts at boot sub starts_on_boot { my ($service) = @_; my (undef, $on_services) = services(); - AdminPanel::Shared::member($service, @$on_services); + MDK::Common::DataStructure::member($service, @$on_services); } #============================================================= |