aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatteo <matteo.pasotti@gmail.com>2014-07-05 15:12:23 +0300
committermatteo <matteo.pasotti@gmail.com>2014-07-05 15:12:23 +0300
commit96a6b704886f54314ac4eaf48f5d898ab8f93fb9 (patch)
tree6f3a7b5934636dd440b8268b108a2d481961208b
parent5777daf56328caf38f2c8aae8731e76917ea4d77 (diff)
parent8bce3d19325a0108e0b801017d48957e0a93080d (diff)
downloadcolin-keep-96a6b704886f54314ac4eaf48f5d898ab8f93fb9.tar
colin-keep-96a6b704886f54314ac4eaf48f5d898ab8f93fb9.tar.gz
colin-keep-96a6b704886f54314ac4eaf48f5d898ab8f93fb9.tar.bz2
colin-keep-96a6b704886f54314ac4eaf48f5d898ab8f93fb9.tar.xz
colin-keep-96a6b704886f54314ac4eaf48f5d898ab8f93fb9.zip
Merge branch 'master' of ssh://git.mageia.org/software/adminpanel
-rw-r--r--lib/AdminPanel/Module/Services.pm10
-rw-r--r--lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm1
-rw-r--r--lib/AdminPanel/Shared.pm27
-rw-r--r--lib/AdminPanel/Shared/Services.pm6
4 files changed, 9 insertions, 35 deletions
diff --git a/lib/AdminPanel/Module/Services.pm b/lib/AdminPanel/Module/Services.pm
index 365f3e1..84a4624 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 038d1a4..eb2b25d 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 7963d47..f435c6a 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 c6de77a..1870e04 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);
}
#=============================================================