From e10caa54ac4d34c803c021ce4848a2a8858827de Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Fri, 29 Aug 2014 17:04:45 +0200 Subject: renamed from gurpmi.addmedia to dragora-urpm-addmedia and from edit-urpm-sources.pl to dragora-urpm-sources.pl fixed Makefile.PL and MANIFEST for all the changes --- MANIFEST | 62 +++++++++-- Makefile.PL | 19 ++-- modules/rpmdragora/dragora-urpm-addmedia | 170 +++++++++++++++++++++++++++++ modules/rpmdragora/dragora-urpm-sources.pl | 48 ++++++++ modules/rpmdragora/edit-urpm-sources.pl | 48 -------- modules/rpmdragora/gurpmi.addmedia | 170 ----------------------------- 6 files changed, 279 insertions(+), 238 deletions(-) create mode 100755 modules/rpmdragora/dragora-urpm-addmedia create mode 100755 modules/rpmdragora/dragora-urpm-sources.pl delete mode 100755 modules/rpmdragora/edit-urpm-sources.pl delete mode 100755 modules/rpmdragora/gurpmi.addmedia diff --git a/MANIFEST b/MANIFEST index b495779d..4e40ade8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,14 +1,23 @@ Changes COPYING.GPLv2 extras/conf/categories.conf -extras/conf/categories.conf.d/adminService.conf -extras/conf/categories.conf.d/adminUser.conf +extras/conf/categories.conf.d/manaservice.conf +extras/conf/categories.conf.d/manauser.conf extras/conf/settings.conf +extras/desktop/manaclock.desktop +extras/desktop/manahost.desktop +extras/desktop/manalog.desktop +extras/desktop/manaproxy.desktop +extras/desktop/manaservice.desktop +extras/desktop/manauser.desktop +extras/desktop/manauserlog.desktop extras/polkit/org.mageia.adminpanel.policy -extras/polkit/org.mageia.adminService.policy -extras/polkit/org.mageia.adminUser.policy -extras/polkit/org.mageia.hostmanager.policy -extras/polkit/org.mageia.logviewer.policy +extras/polkit/org.mageia.manaclock.policy +extras/polkit/org.mageia.manahost.policy +extras/polkit/org.mageia.manalog.policy +extras/polkit/org.mageia.manaproxy.policy +extras/polkit/org.mageia.manaservice.policy +extras/polkit/org.mageia.manauser.policy extras/README extras/setup.sh ignore.txt @@ -20,15 +29,30 @@ lib/AdminPanel/Module/AdminMouse.pm lib/AdminPanel/Module/Clock.pm lib/AdminPanel/Module/Hosts.pm lib/AdminPanel/Module/LogViewer.pm +lib/AdminPanel/Module/Proxy.pm lib/AdminPanel/Module/Services.pm lib/AdminPanel/Module/Users.pm lib/AdminPanel/Privileges.pm +lib/AdminPanel/rpmdragora.pm +lib/AdminPanel/Rpmdragora/.perl_checker +lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm +lib/AdminPanel/Rpmdragora/formatting.pm +lib/AdminPanel/Rpmdragora/gui.pm +lib/AdminPanel/Rpmdragora/gurpm.pm +lib/AdminPanel/Rpmdragora/icon.pm +lib/AdminPanel/Rpmdragora/init.pm +lib/AdminPanel/Rpmdragora/localization.pm +lib/AdminPanel/Rpmdragora/open_db.pm +lib/AdminPanel/Rpmdragora/pkg.pm +lib/AdminPanel/Rpmdragora/rpmnew.pm +lib/AdminPanel/Rpmdragora/widgets.pm lib/AdminPanel/SettingsReader.pm lib/AdminPanel/Shared.pm lib/AdminPanel/Shared/GUI.pm lib/AdminPanel/Shared/Hosts.pm lib/AdminPanel/Shared/JournalCtl.pm lib/AdminPanel/Shared/Locales.pm +lib/AdminPanel/Shared/Proxy.pm lib/AdminPanel/Shared/Services.pm lib/AdminPanel/Shared/TimeZone.pm lib/AdminPanel/Shared/Users.pm @@ -36,22 +60,36 @@ Makefile.PL MANIFEST This list of files MODULE_HACKING modules/contribfinder.py +modules/rpmdragora/dragora-urpm-addmedia +modules/rpmdragora/dragora-urpm-sources.pl +modules/rpmdragora/rpmdragora modules/test.cpp README.md -scripts/adminClock -scripts/adminService -scripts/adminUser scripts/apanel.pl -scripts/hostmanager -scripts/logviewer -scripts/mgaAddUser +scripts/manaadduser +scripts/manaclock +scripts/manahost +scripts/manalog +scripts/manaproxy +scripts/manaservice +scripts/manauser share/images/Blank16x16.png +share/images/Check.png +share/images/Check_16x16.png +share/images/Check_32x32.png +share/images/Check_8x8.png share/images/Checked_Shield_Green.png share/images/Checked_Shield_Green16x16.png share/images/Checked_Shield_Green32x32.png +share/images/Down.png +share/images/Down_16x16.png +share/images/Down_32x32.png share/images/logo_mageia.png share/images/mageia.png share/images/quit.png +share/images/Up.png +share/images/Up_16x16.png +share/images/Up_32x32.png share/images/Warning_Shield_Grey.png share/images/Warning_Shield_Grey16x16.png share/images/Warning_Shield_Grey32x32.png diff --git a/Makefile.PL b/Makefile.PL index d6ec2c24..f5277154 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -48,14 +48,17 @@ WriteMakefile( "Modern::Perl" => 1.03, "autodie" => 2.20, }, - EXE_FILES => [ qw( scripts/adminClock - scripts/adminService - scripts/adminUser - scripts/apanel.pl - scripts/hostmanager - scripts/proxymanager - scripts/logviewer - scripts/mgaAddUser + EXE_FILES => [ qw( scripts/apanel.pl + scripts/manaadduser + scripts/manaclock + scripts/manahost + scripts/manalog + scripts/manaproxy + scripts/manaservice + scripts/manauser + modules/contribfinder.py + modules/rpmdragora/dragora-urpm-addmedia + modules/rpmdragora/dragora-urpm-sources.pl ) ], dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'AdminPanel-*' }, diff --git a/modules/rpmdragora/dragora-urpm-addmedia b/modules/rpmdragora/dragora-urpm-addmedia new file mode 100755 index 00000000..3aafbf2e --- /dev/null +++ b/modules/rpmdragora/dragora-urpm-addmedia @@ -0,0 +1,170 @@ +#!/usr/bin/perl +#***************************************************************************** +# +# Copyright (c) 2004 Guillaume Cottenceau (gc at mandrakesoft dot com) +# Copyright (c) 2006-2007 Thierry Vignaud +# Copyright (c) 2004-2007 Mandriva SA +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#***************************************************************************** +# +# $Id: gurpmi.addmedia 261187 2009-10-01 14:44:34Z tv $ + +use strict; + +BEGIN { + @ARGV == 0 || "@ARGV" =~ /-h/ and do { + print "usage: gurpmi.addmedia [options] [with ] +where is one of + [file:/]/ + ftp://:\@/ + ftp:/// + http:/// + removable:// + +and [options] are from + --distrib install a set of media from a distribution + --silent-success don't show popup window on success + --update create an update medium, + or discard non-update media (when used with --distrib) + --mirrorlist is a mirror list +"; + exit(0); + }; +} +use AdminPanel::Rpmdragora::init; +use AdminPanel::Rpmdragora::open_db; +use AdminPanel::Rpmdragora::formatting; + +use AdminPanel::Privileges; + +use lib qw(/usr/lib/libDrakX); +use urpm::media; +use MDK::Common::Func; +use common qw(N); + +# +if (AdminPanel::Privileges::is_root_capability_required()) { + require AdminPanel::Shared::GUI; + my $sh_gui = AdminPanel::Shared::GUI->new(); + $sh_gui->warningMsgBox({ + title => "gurpmi.addmedia", + text => N("root privileges required"), + }); + exit (-1); +} + +use AdminPanel::rpmdragora; +use Getopt::Long; + +## TODO remove as soon as possible +$::isStandalone = 1; + +AdminPanel::rpmdragora::readconf(); + +my $fromfile; +if (@ARGV == 1 && $ARGV[0] =~ /\.urpmi-media$/) { + @ARGV = map { s/^\s*//; s/\s*$//; $_ } split /\n/, cat_($ARGV[0]); + $fromfile = 1; +} + +my ($update, $distrib, $silent_success) = (0, 0, 0); +my ($mirrorlist, $with_dir); + +GetOptions( + 'update' => \$update, + 'distrib' => \$distrib, + 'silent-success' => \$silent_success, + 'mirrorlist=s' => \$mirrorlist, + 'urpmi-root=s' => \$::rpmdragora_options{'urpmi-root'}[0], +); + +# compatibility with -update: +if ($ARGV[0] =~ /^-?-update/) { + $update = 1; + shift @ARGV; +} + +my @addmedia_args; +my @names; + +while (@ARGV) { + my ($name, $url) = @ARGV; + + if ($mirrorlist) { + ($with_dir, $url) = ($url, undef); + } elsif ($distrib) { + ($name, $url) = ('', $name); + } elsif ($url !~ m,^(([^:]*):/)?/,) { + AdminPanel::rpmdragora::interactive_msg('gurpmi.addmedia', + AdminPanel::Rpmdragora::formatting::escape_text_for_TextView_markup_format( + N("bad (for local directory, the path must be absolute)") . "\n\n$url")); + AdminPanel::rpmdragora::myexit(-1); + } + push @addmedia_args, [ $name, $url ]; + push @names, $name; + shift @ARGV foreach 1 .. 2; +} + +if ($mirrorlist && $distrib && !@addmedia_args) { + @addmedia_args = [ '' ]; +} + +$fromfile and do { + AdminPanel::rpmdragora::interactive_msg('gurpmi.addmedia', +N("%s + +Is it ok to continue?", +$distrib || !@names +? N("You are about to add new package media. +That means you will be able to add new software packages +to your system from these new media.") +: 1 < @names +? N("You are about to add new package medium, %s. +That means you will be able to add new software packages +to your system from these new media.", join ", ", @names) +: N("You are about to add a new package medium, `%s'. +That means you will be able to add new software packages +to your system from that new medium.", $names[0]) +), + yesno => 1) or AdminPanel::rpmdragora::myexit(-1); +}; + +my $urpm = AdminPanel::Rpmdragora::open_db::fast_open_urpmi_db(); +my $success = 1; +foreach (@addmedia_args) { + #- NB: that short circuits + $success = $success && AdminPanel::rpmdragora::add_medium_and_check( + $urpm, + { distrib => $distrib }, + $_->[0], + $_->[1], + MDK::Common::Func::if_(!$distrib, undef), + MDK::Common::Func::if_($update, update => $update, only_updates => $update), + mirrorlist => $mirrorlist, + MDK::Common::Func::if_($with_dir, 'with-dir' => $with_dir), + ); +} +if ($success) { + my $message = + $distrib ? N("Successfully added media.") + : @names > 1 + ? N("Successfully added media %s.", join ", ", @names) + : N("Successfully added medium `%s'.", $names[0]); + AdminPanel::rpmdragora::interactive_msg('gurpmi.addmedia', $message) if !$silent_success; + AdminPanel::rpmdragora::myexit(0); +} else { + AdminPanel::rpmdragora::myexit(-1); +} diff --git a/modules/rpmdragora/dragora-urpm-sources.pl b/modules/rpmdragora/dragora-urpm-sources.pl new file mode 100755 index 00000000..64a15e85 --- /dev/null +++ b/modules/rpmdragora/dragora-urpm-sources.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl +#***************************************************************************** +# +# Copyright (c) 2002 Guillaume Cottenceau +# Copyright (c) 2002-2007 Thierry Vignaud +# Copyright (c) 2002-2007 Mandriva Linux +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#***************************************************************************** +# +# $Id: edit-urpm-sources.pl 244763 2008-09-04 16:12:52Z tv $ + + +use AdminPanel::Rpmdragora::init; +use AdminPanel::rpmdragora; +use AdminPanel::Rpmdragora::edit_urpm_sources; +use AdminPanel::Privileges; +use AdminPanel::Shared::Locales; + +my $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake'); + +if (AdminPanel::Privileges::is_root_capability_required()) { + require AdminPanel::Shared::GUI; + my $sh_gui = AdminPanel::Shared::GUI->new(); + $sh_gui->warningMsgBox({ + title => $loc->N("Configure media"), + text => $loc->N("root privileges required"), + }); + exit (-1); +} + +AdminPanel::rpmdragora::readconf(); + +AdminPanel::Rpmdragora::edit_urpm_sources::run(); + +AdminPanel::rpmdragora::myexit 0; diff --git a/modules/rpmdragora/edit-urpm-sources.pl b/modules/rpmdragora/edit-urpm-sources.pl deleted file mode 100755 index 64a15e85..00000000 --- a/modules/rpmdragora/edit-urpm-sources.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -#***************************************************************************** -# -# Copyright (c) 2002 Guillaume Cottenceau -# Copyright (c) 2002-2007 Thierry Vignaud -# Copyright (c) 2002-2007 Mandriva Linux -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2, as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -#***************************************************************************** -# -# $Id: edit-urpm-sources.pl 244763 2008-09-04 16:12:52Z tv $ - - -use AdminPanel::Rpmdragora::init; -use AdminPanel::rpmdragora; -use AdminPanel::Rpmdragora::edit_urpm_sources; -use AdminPanel::Privileges; -use AdminPanel::Shared::Locales; - -my $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake'); - -if (AdminPanel::Privileges::is_root_capability_required()) { - require AdminPanel::Shared::GUI; - my $sh_gui = AdminPanel::Shared::GUI->new(); - $sh_gui->warningMsgBox({ - title => $loc->N("Configure media"), - text => $loc->N("root privileges required"), - }); - exit (-1); -} - -AdminPanel::rpmdragora::readconf(); - -AdminPanel::Rpmdragora::edit_urpm_sources::run(); - -AdminPanel::rpmdragora::myexit 0; diff --git a/modules/rpmdragora/gurpmi.addmedia b/modules/rpmdragora/gurpmi.addmedia deleted file mode 100755 index 3aafbf2e..00000000 --- a/modules/rpmdragora/gurpmi.addmedia +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/perl -#***************************************************************************** -# -# Copyright (c) 2004 Guillaume Cottenceau (gc at mandrakesoft dot com) -# Copyright (c) 2006-2007 Thierry Vignaud -# Copyright (c) 2004-2007 Mandriva SA -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2, as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -#***************************************************************************** -# -# $Id: gurpmi.addmedia 261187 2009-10-01 14:44:34Z tv $ - -use strict; - -BEGIN { - @ARGV == 0 || "@ARGV" =~ /-h/ and do { - print "usage: gurpmi.addmedia [options] [with ] -where is one of - [file:/]/ - ftp://:\@/ - ftp:/// - http:/// - removable:// - -and [options] are from - --distrib install a set of media from a distribution - --silent-success don't show popup window on success - --update create an update medium, - or discard non-update media (when used with --distrib) - --mirrorlist is a mirror list -"; - exit(0); - }; -} -use AdminPanel::Rpmdragora::init; -use AdminPanel::Rpmdragora::open_db; -use AdminPanel::Rpmdragora::formatting; - -use AdminPanel::Privileges; - -use lib qw(/usr/lib/libDrakX); -use urpm::media; -use MDK::Common::Func; -use common qw(N); - -# -if (AdminPanel::Privileges::is_root_capability_required()) { - require AdminPanel::Shared::GUI; - my $sh_gui = AdminPanel::Shared::GUI->new(); - $sh_gui->warningMsgBox({ - title => "gurpmi.addmedia", - text => N("root privileges required"), - }); - exit (-1); -} - -use AdminPanel::rpmdragora; -use Getopt::Long; - -## TODO remove as soon as possible -$::isStandalone = 1; - -AdminPanel::rpmdragora::readconf(); - -my $fromfile; -if (@ARGV == 1 && $ARGV[0] =~ /\.urpmi-media$/) { - @ARGV = map { s/^\s*//; s/\s*$//; $_ } split /\n/, cat_($ARGV[0]); - $fromfile = 1; -} - -my ($update, $distrib, $silent_success) = (0, 0, 0); -my ($mirrorlist, $with_dir); - -GetOptions( - 'update' => \$update, - 'distrib' => \$distrib, - 'silent-success' => \$silent_success, - 'mirrorlist=s' => \$mirrorlist, - 'urpmi-root=s' => \$::rpmdragora_options{'urpmi-root'}[0], -); - -# compatibility with -update: -if ($ARGV[0] =~ /^-?-update/) { - $update = 1; - shift @ARGV; -} - -my @addmedia_args; -my @names; - -while (@ARGV) { - my ($name, $url) = @ARGV; - - if ($mirrorlist) { - ($with_dir, $url) = ($url, undef); - } elsif ($distrib) { - ($name, $url) = ('', $name); - } elsif ($url !~ m,^(([^:]*):/)?/,) { - AdminPanel::rpmdragora::interactive_msg('gurpmi.addmedia', - AdminPanel::Rpmdragora::formatting::escape_text_for_TextView_markup_format( - N("bad (for local directory, the path must be absolute)") . "\n\n$url")); - AdminPanel::rpmdragora::myexit(-1); - } - push @addmedia_args, [ $name, $url ]; - push @names, $name; - shift @ARGV foreach 1 .. 2; -} - -if ($mirrorlist && $distrib && !@addmedia_args) { - @addmedia_args = [ '' ]; -} - -$fromfile and do { - AdminPanel::rpmdragora::interactive_msg('gurpmi.addmedia', -N("%s - -Is it ok to continue?", -$distrib || !@names -? N("You are about to add new package media. -That means you will be able to add new software packages -to your system from these new media.") -: 1 < @names -? N("You are about to add new package medium, %s. -That means you will be able to add new software packages -to your system from these new media.", join ", ", @names) -: N("You are about to add a new package medium, `%s'. -That means you will be able to add new software packages -to your system from that new medium.", $names[0]) -), - yesno => 1) or AdminPanel::rpmdragora::myexit(-1); -}; - -my $urpm = AdminPanel::Rpmdragora::open_db::fast_open_urpmi_db(); -my $success = 1; -foreach (@addmedia_args) { - #- NB: that short circuits - $success = $success && AdminPanel::rpmdragora::add_medium_and_check( - $urpm, - { distrib => $distrib }, - $_->[0], - $_->[1], - MDK::Common::Func::if_(!$distrib, undef), - MDK::Common::Func::if_($update, update => $update, only_updates => $update), - mirrorlist => $mirrorlist, - MDK::Common::Func::if_($with_dir, 'with-dir' => $with_dir), - ); -} -if ($success) { - my $message = - $distrib ? N("Successfully added media.") - : @names > 1 - ? N("Successfully added media %s.", join ", ", @names) - : N("Successfully added medium `%s'.", $names[0]); - AdminPanel::rpmdragora::interactive_msg('gurpmi.addmedia', $message) if !$silent_success; - AdminPanel::rpmdragora::myexit(0); -} else { - AdminPanel::rpmdragora::myexit(-1); -} -- cgit v1.2.1