diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-12-03 22:15:13 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-12-03 22:15:13 +0100 |
commit | 724e64f07bcdce36529949f525a05038529b7965 (patch) | |
tree | b154ad3718057c0d75b3a95487d230ebfe5f6be5 /lib/AdminPanel/Rpmdragora | |
parent | 765fc307767d8dabc19c8e76759c7c0b30e01e95 (diff) | |
download | colin-keep-724e64f07bcdce36529949f525a05038529b7965.tar colin-keep-724e64f07bcdce36529949f525a05038529b7965.tar.gz colin-keep-724e64f07bcdce36529949f525a05038529b7965.tar.bz2 colin-keep-724e64f07bcdce36529949f525a05038529b7965.tar.xz colin-keep-724e64f07bcdce36529949f525a05038529b7965.zip |
Removed drakx common dependency
Diffstat (limited to 'lib/AdminPanel/Rpmdragora')
-rw-r--r-- | lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm | 16 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/formatting.pm | 2 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/gui.pm | 88 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/gurpm.pm | 2 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/icon.pm | 9 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/init.pm | 3 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/localization.pm | 35 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/open_db.pm | 12 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/pkg.pm | 24 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/rpmnew.pm | 5 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/widgets.pm | 52 |
11 files changed, 62 insertions, 186 deletions
diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm index 584da65..7ea1d93 100644 --- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm +++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm @@ -28,8 +28,11 @@ use strict; use File::ShareDir ':ALL'; use File::HomeDir qw(home); -use lib qw(/usr/lib/libDrakX); -use common; +use MDK::Common::Math qw(max); +use MDK::Common::File qw(cat_ output); +use MDK::Common::DataStructure qw(member put_in_hash uniq); +use MDK::Common::Various qw(to_bool); + use AdminPanel::Shared; use AdminPanel::Shared::Locales; use AdminPanel::rpmdragora; @@ -38,16 +41,13 @@ use AdminPanel::Rpmdragora::open_db; use AdminPanel::Rpmdragora::formatting; use AdminPanel::Shared::GUI; use URPM::Signature; -use MDK::Common::Math qw(max); -use MDK::Common::File; -use MDK::Common::DataStructure qw(member put_in_hash); use urpm::media; use urpm::download; use urpm::lock; use Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw(run); +our @EXPORT_OK = qw(run); my $urpm; @@ -435,7 +435,7 @@ sub options_callback() { my $verify_rpm = $factory->createComboBox($hbox, "", 0); $verify_rpm->setWeight($yui::YD_HORIZ, 2); my @verif = ($loc->N("never"), $loc->N("always")); - my $verify_rpm_value = $urpm->{global_config}{'verify-rpm'}; + my $verify_rpm_value = $urpm->{global_config}{'verify-rpm'} || 0; my $itemColl = new yui::YItemCollection; my $cnt = 0; @@ -1985,7 +1985,7 @@ sub OLD_mainwindow() { [ $loc->N("/_Help") . $loc->N("/_Report Bug"), undef, sub { run_drakbug('edit-urpm-sources.pl') }, undef, '<Item>' ], [ $loc->N("/_Help") . $loc->N("/_Help"), undef, sub { rpmdragora::open_help('sources') }, undef, '<Item>' ], [ $loc->N("/_Help") . $loc->N("/_About..."), undef, sub { - my $license = formatAlaTeX(translate($::license)); + my $license = MDK::Common::String::formatAlaTeX(translate($::license)); $license =~ s/\n/\n\n/sg; # nicer formatting my $w = gtknew('AboutDialog', name => $loc->N("Rpmdragora"), version => $rpmdragora::distro_version, diff --git a/lib/AdminPanel/Rpmdragora/formatting.pm b/lib/AdminPanel/Rpmdragora/formatting.pm index feeca73..b484455 100644 --- a/lib/AdminPanel/Rpmdragora/formatting.pm +++ b/lib/AdminPanel/Rpmdragora/formatting.pm @@ -27,9 +27,9 @@ package AdminPanel::Rpmdragora::formatting; use strict; use utf8; use POSIX qw(strftime); +use MDK::Common::Various qw(internal_error); use AdminPanel::Shared::Locales; use AdminPanel::rpmdragora; -use MDK::Common::Various; # included for internal_error subroutine use urpm::msg; diff --git a/lib/AdminPanel/Rpmdragora/gui.pm b/lib/AdminPanel/Rpmdragora/gui.pm index cd6ba4b..6fe64dc 100644 --- a/lib/AdminPanel/Rpmdragora/gui.pm +++ b/lib/AdminPanel/Rpmdragora/gui.pm @@ -30,29 +30,32 @@ package AdminPanel::Rpmdragora::gui; ############################################################ use strict; -our @ISA = qw(Exporter); -use lib qw(/usr/lib/libDrakX); -use common; +use Sys::Syslog; use utf8; -use HTML::Entities; -# TO WORKAROUND LOCALIZATION ISSUE -use AdminPanel::Rpmdragora::localization; +use MDK::Common::Func qw(before_leaving find any if_); +use MDK::Common::DataStructure qw(difference2 member intersection); +use MDK::Common::Various qw(chomp_ to_bool); +use MDK::Common::String qw(formatAlaTeX); +use MDK::Common::Math qw(sum); use AdminPanel::rpmdragora; use AdminPanel::Rpmdragora::open_db; use AdminPanel::Rpmdragora::formatting; use AdminPanel::Rpmdragora::init; -use AdminPanel::Rpmdragora::icon; +use AdminPanel::Rpmdragora::icon qw(get_icon_path); use AdminPanel::Rpmdragora::pkg; use AdminPanel::Shared; use AdminPanel::Shared::GUI; use AdminPanel::Shared::Locales; +use AdminPanel::Shared::RunProgram qw(get_stdout raw); use yui; use feature 'state'; use Carp; +use Exporter; +our @ISA = qw(Exporter); our @EXPORT = qw( $descriptions $find_entry @@ -191,13 +194,13 @@ sub get_main_text { my ($medium, $fullname, $name, $summary, $is_update, $update_descr) = @_; my $txt = get_string_from_keywords($medium, $fullname); - my $notice = if_($txt, format_field($loc->N("Notice: ")) . $txt . "\n"); + my $notice = MDK::Common::Func::if_($txt, format_field($loc->N("Notice: ")) . $txt . "\n"); ensure_utf8($notice); my $hdr = format_header(join(' - ', $name, $summary)) . "\n"; ensure_utf8($hdr); - my $update = if_($is_update, # is it an update? + my $update = MDK::Common::Func::if_($is_update, # is it an update? format_field($loc->N("Importance: ")) . format_update_field($update_descr->{importance}) . "\n", format_field($loc->N("Reason for update: ")) . format_update_field(rpm_description($update_descr->{pre})) . "\n", ); @@ -1024,57 +1027,12 @@ sub ask_browse_tree_given_widgets_for_rpmdragora { yui::YUI::app()->normalCursor(); }; -# $common->{display_info} = sub { -# gtktext_insert($w->{info}, get_info($_[0], $w->{tree}->window)); -# $w->{info}->scroll_to_iter($w->{info}->get_buffer->get_start_iter, 0, 0, 0, 0); -# 0; -# }; - - my $fast_toggle = sub { - my ($item) = @_; - #gtkset_mousecursor_wait($w->{w}{rwindow}->window); - #my $_cleaner = before_leaving { gtkset_mousecursor_normal($w->{w}{rwindow}->window) }; - my $name = $common->{table_item_list}[$item->index()]; - my $urpm_obj = $pkgs->{$name}{pkg}; - - if ($urpm_obj->flag_base) { - interactive_msg($loc->N("Warning"), - $loc->N("Removing package %s would break your system", $name)); - return ''; - } - - if ($urpm_obj->flag_skip) { - interactive_msg($loc->N("Warning"), $loc->N("The \"%s\" package is in urpmi skip list.\nDo you want to select it anyway?", $name), yesno => 1) or return ''; - $urpm_obj->set_flag_skip(0); - } - - if ($AdminPanel::Rpmdragora::pkg::need_restart && !$priority_up_alread_warned) { - $priority_up_alread_warned = 1; - interactive_msg($loc->N("Warning"), '<b>' . $loc->N("Rpmdragora or one of its priority dependencies needs to be updated first. Rpmdragora will then restart.") . '</b>' . "\n\n"); - } - - # toggle_nodes($w->{tree}->window, $w->{detail_list_model}, \&set_leaf_state, $w->{detail_list_model}->get($iter, $pkg_columns{state}), - toggle_nodes($w->{tree}->window, $w->{detail_list_model}, \&set_leaf_state, $item->selected, $common->{table_item_list}[$item->index()]); - update_size($common); - }; - #$w->{detail_list}->get_selection->signal_connect(changed => sub { - #my ($model, $iter) = $_[0]->get_selected; - #$model && $iter or return; - # $common->{display_info}($model->get($iter, $pkg_columns{text})); - #}); - # WARNING: รจ interessante! - #($w->{detail_list}->get_column(0)->get_cell_renderers)[0]->signal_connect(toggled => sub { - # my ($_cell, $path) = @_; #text_ - # my $iter = $w->{detail_list_model}->get_iter_from_string($path); - # $fast_toggle->($iter) if $iter; - # 1; - #}); $common->{rebuild_tree}->(); update_size($common); $common->{initial_selection} and toggle_nodes($w->{tree}->window, $w->{detail_list}, \&set_leaf_state, undef, @{$common->{initial_selection}}); my $_b = before_leaving { $clear_all_caches->() }; $common->{init_callback}->() if $common->{init_callback}; - #OLD $w->{w}->main; + $w->{w}; } @@ -1148,7 +1106,7 @@ sub pkgs_provider { my @media = keys %$descriptions; [ grep { my ($name) = split_fullname($_); - my $medium = find { $descriptions->{$_}{$name} } @media; + my $medium = MDK::Common::Func::find { $descriptions->{$_}{$name} } @media; $medium && $descriptions->{$medium}{$name}{importance} eq $importance } @{$h->{updates}} ]; }; } @@ -1406,7 +1364,7 @@ sub toggle_nodes { my ($msg) = @_; statusbar_msg_remove($bar_id); deps_msg($loc->N("Some additional packages need to be removed"), - formatAlaTeX($msg) . "\n\n", + MDK::Common::String::formatAlaTeX($msg) . "\n\n", \@nodes, \@nodes_with_deps) or @nodes_with_deps = (); }; @@ -1455,7 +1413,7 @@ sub toggle_nodes { @nodes_with_deps = map { urpm_name($_) } @requested; statusbar_msg_remove($bar_id); if (!deps_msg($loc->N("Additional packages needed"), - formatAlaTeX($loc->N("To satisfy dependencies, the following package(s) also need to be installed:\n\n")) . "\n\n", + MDK::Common::String::formatAlaTeX($loc->N("To satisfy dependencies, the following package(s) also need to be installed:\n\n")) . "\n\n", \@nodes, \@nodes_with_deps)) { @nodes_with_deps = (); $urpm->disable_selected(open_rpm_db(), $urpm->{state}, @requested); @@ -1474,7 +1432,7 @@ sub toggle_nodes { my @ask_unselect = urpm::select::unselected_packages($urpm->{state}); my @reasons = map { my $cant = $_; - my $unsel = find { $_ eq $cant } @ask_unselect; + my $unsel = MDK::Common::Func::find { $_ eq $cant } @ask_unselect; $unsel ? join("\n", urpm::select::translate_why_unselected($urpm, $urpm->{state}, $unsel)) : ($pkgs->{$_}{pkg}->flag_skip ? $loc->N("%s (belongs to the skip list)", $cant) : $cant); @@ -1517,7 +1475,7 @@ sub toggle_nodes { exists $pkgs->{$_} or next; if (!$pkgs->{$_}{pkg}) { #- can't be removed # FIXME; what about next packages in the loop? undef $pkgs->{$_}{selected}; - log::explanations("can't be removed: $_"); + Sys::Syslog::syslog('info|local1', "can't be removed: $_"); } else { $pkgs->{$_}{selected} = $new_state; } @@ -1555,7 +1513,7 @@ sub do_action__real { interactive_msg($loc->N("You need to select some packages first."), $loc->N("You need to select some packages first.")); return 1; } - my $size_added = sum(map { if_($_->flag_selected && !$_->flag_installed, $_->size) } @{$urpm->{depslist}}); + my $size_added = MDK::Common::Math::sum(map { MDK::Common::Func::if_($_->flag_selected && !$_->flag_installed, $_->size) } @{$urpm->{depslist}}); if ($MODE eq 'install' && $size_free - $size_added/1024 < 50*1024) { interactive_msg($loc->N("Too many packages are selected"), $loc->N("Warning: it seems that you are attempting to add so many @@ -1569,7 +1527,7 @@ Do you really want to install all the selected packages?"), yesno => 1) my $res = $callback_action->($urpm, $pkgs); if (!$res) { $force_rebuild = 1; - pkgs_provider($options->{tree_mode}, if_($AdminPanel::Rpmdragora::pkg::probe_only_for_updates, pure_updates => 1), skip_updating_mu => 1); + pkgs_provider($options->{tree_mode}, MDK::Common::Func::if_($AdminPanel::Rpmdragora::pkg::probe_only_for_updates, pure_updates => 1), skip_updating_mu => 1); reset_search(); $size_selected = 0; (undef, $size_free) = MDK::Common::System::df('/usr'); @@ -1701,7 +1659,7 @@ or you already installed all of them.")); # inlining part of MDK::Common::Data::difference2(): my %l; @l{map { $_->[0] } @_} = (); my @pkgs_times = ('rpm', '-q', '--qf', '%{name}-%{version}-%{release}.%{arch} %{installtime}\n', - map { chomp_($_) } run_program::get_stdout('urpmi_rpm-find-leaves')); + map { chomp_($_) } AdminPanel::Shared::RunProgram::get_stdout('urpmi_rpm-find-leaves')); sort { $b->[1] <=> $a->[1] } grep { exists $l{$_->[0]} } map { chomp; [ split ] } run_rpm(@pkgs_times); }, flat => sub { no locale; sort { uc($a->[0]) cmp uc($b->[0]) } @_ }, @@ -1772,7 +1730,7 @@ sub run_help_callback { my (undef, $url) = @_; my ($user) = grep { $_->[2] eq $ENV{USERHELPER_UID} } list_passwd(); local $ENV{HOME} = $user->[7] if $user && $ENV{USERHELPER_UID}; - run_program::raw({ detach => 1, as_user => 1 }, 'www-browser', $url); + AdminPanel::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'www-browser', $url); } #============================================================= @@ -1795,7 +1753,7 @@ sub run_browser { my ($user) = grep { $_->[2] eq $ENV{USERHELPER_UID} } list_passwd(); local $ENV{HOME} = $user->[7] if $user && $ENV{USERHELPER_UID}; - run_program::raw({ detach => 1, as_user => 1 }, 'www-browser', $url); + AdminPanel::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'www-browser', $url); } #============================================================= diff --git a/lib/AdminPanel/Rpmdragora/gurpm.pm b/lib/AdminPanel/Rpmdragora/gurpm.pm index 0c7dd6f..386c5ba 100644 --- a/lib/AdminPanel/Rpmdragora/gurpm.pm +++ b/lib/AdminPanel/Rpmdragora/gurpm.pm @@ -26,7 +26,7 @@ package AdminPanel::Rpmdragora::gurpm; # $Id: gurpm.pm 255450 2009-04-03 16:00:16Z tv $ use strict; -use lib qw(/usr/lib/libDrakX); + use yui; use Time::HiRes; use feature 'state'; diff --git a/lib/AdminPanel/Rpmdragora/icon.pm b/lib/AdminPanel/Rpmdragora/icon.pm index 282555d..b4a97c0 100644 --- a/lib/AdminPanel/Rpmdragora/icon.pm +++ b/lib/AdminPanel/Rpmdragora/icon.pm @@ -25,17 +25,16 @@ package AdminPanel::Rpmdragora::icon; # $Id: icon.pm 237459 2008-02-26 14:20:47Z tv $ use strict; -our @ISA = qw(Exporter); -use lib qw(/usr/lib/libDrakX); -use POSIX; -use common; +use POSIX qw (isdigit); use AdminPanel::rpmdragora; use AdminPanel::Shared::Locales; my $loc = AdminPanel::rpmdragora::locale(); -our @EXPORT = qw(get_icon_path); +use Exporter; +our @ISA = qw(Exporter); +our @EXPORT_OK = qw(get_icon_path); #- /usr/share/rpmlint/config (duplicates are normal, so that we are not too far away from .py) my %group_icons = ( $loc->N("All") => 'system_section', diff --git a/lib/AdminPanel/Rpmdragora/init.pm b/lib/AdminPanel/Rpmdragora/init.pm index 18b7905..c25af78 100644 --- a/lib/AdminPanel/Rpmdragora/init.pm +++ b/lib/AdminPanel/Rpmdragora/init.pm @@ -27,11 +27,10 @@ package AdminPanel::Rpmdragora::init; use strict; use MDK::Common::Func 'any'; -use lib qw(/usr/lib/libDrakX); -use common; use English; BEGIN { $::no_global_argv_parsing = 1 } require urpm::args; +use MDK::Common::Various qw(chomp_); use AdminPanel::Privileges; use AdminPanel::Shared::Locales; diff --git a/lib/AdminPanel/Rpmdragora/localization.pm b/lib/AdminPanel/Rpmdragora/localization.pm deleted file mode 100644 index fb199d9..0000000 --- a/lib/AdminPanel/Rpmdragora/localization.pm +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/perl -# vim: set et ts=4 sw=4: -package AdminPanel::Rpmdragora::localization; -#***************************************************************************** -# -# Copyright (c) 2013 Matteo Pasotti <matteo.pasotti@gmail.com> -# -# 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. -# -#***************************************************************************** -use strict; -use warnings; -use diagnostics; -use lib qw(/usr/lib/libDrakX); -use common; - -Locale::gettext::bind_textdomain_codeset($_, 'UTF8') foreach 'libDrakX', if_(!$::isInstall, 'libDrakX-standalone'), - if_($::isRestore, 'draksnapshot'), if_($::isInstall, 'urpmi'), - 'drakx-net', 'drakx-kbd-mouse-x11', # shared translation - @::textdomains; - -#========= UGLY WORKAROUND ============ -push @::textdomains, 'rpmdrake'; -#========= UGLY WORKAROUND ============ diff --git a/lib/AdminPanel/Rpmdragora/open_db.pm b/lib/AdminPanel/Rpmdragora/open_db.pm index 615e841..b8239d9 100644 --- a/lib/AdminPanel/Rpmdragora/open_db.pm +++ b/lib/AdminPanel/Rpmdragora/open_db.pm @@ -25,13 +25,17 @@ package AdminPanel::Rpmdragora::open_db; # $Id: open_db.pm 268344 2010-05-06 13:06:08Z jvictor $ use strict; -use common; +use Sys::Syslog; + +use MDK::Common::File qw(cat_ mkdir_p); +use MDK::Common::Func; use AdminPanel::rpmdragora; use URPM; use urpm; use urpm::args; use urpm::select; use urpm::media; +use urpm::mirrors; use feature 'state'; use Exporter; @@ -52,7 +56,7 @@ my $loc = AdminPanel::rpmdragora::locale(); sub open_rpm_db { my ($o_force) = @_; my $host; - log::explanations("opening the RPM database"); + Sys::Syslog::syslog('info|local1', "opening the RPM database"); if ($::rpmdragora_options{parallel} && ((undef, $host) = @{$::rpmdragora_options{parallel}})) { state $done; my $dblocation = "/var/cache/urpmi/distantdb/$host"; @@ -125,7 +129,7 @@ sub is_it_a_devel_distro() { my $path = '/etc/product.id'; $path = $::rpmdragora_options{'urpmi-root'}[0] . $path if defined($::rpmdragora_options{'urpmi-root'}[0]); - $res = common::parse_LDAP_namespace_structure(cat_($path))->{branch} eq 'Devel'; + $res = urpm::mirrors::parse_LDAP_namespace_structure(cat_($path))->{branch} eq 'Devel'; return $res; } @@ -158,7 +162,7 @@ sub open_urpmi_db { $urpm->{lock} = urpm::lock::urpmi_db($urpm, undef, wait => $urpm->{options}{wait_lock}) if !$::env; my $previous = $::rpmdragora_options{'previous-priority-upgrade'}; urpm::select::set_priority_upgrade_option($urpm, (ref $previous ? join(',', @$previous) : ())); - urpm::media::configure($urpm, media => $media, if_($searchmedia, searchmedia => $searchmedia), %urpmi_options); + urpm::media::configure($urpm, media => $media, MDK::Common::Func::if_($searchmedia, searchmedia => $searchmedia), %urpmi_options); $urpm; } diff --git a/lib/AdminPanel/Rpmdragora/pkg.pm b/lib/AdminPanel/Rpmdragora/pkg.pm index 634bf69..56cdbb8 100644 --- a/lib/AdminPanel/Rpmdragora/pkg.pm +++ b/lib/AdminPanel/Rpmdragora/pkg.pm @@ -25,11 +25,13 @@ package AdminPanel::Rpmdragora::pkg; # $Id: pkg.pm 270160 2010-06-22 19:55:40Z jvictor $ use strict; -use MDK::Common::Func 'any'; -use MDK::Common::DataStructure; -use MDK::Common::System; -use MDK::Common::File; -use MDK::Common::Various; +use Sys::Syslog; + +use MDK::Common::Func; #qw(before_leaving any); +use MDK::Common::DataStructure; # qw (uniq difference2 member add2hash put_in_hash); +use MDK::Common::System qw(arch); +use MDK::Common::File; # qw(cat_); +use MDK::Common::Various qw(chomp_); use POSIX qw(_exit ceil); use URPM; @@ -39,7 +41,7 @@ use AdminPanel::Rpmdragora::open_db; use AdminPanel::Rpmdragora::gurpm; use AdminPanel::Rpmdragora::formatting; use AdminPanel::Rpmdragora::rpmnew; - +use AdminPanel::Shared::RunProgram qw(run get_stdout); use AdminPanel::rpmdragora; use urpm; use urpm::lock; @@ -90,7 +92,7 @@ sub run_rpm { foreach (qw(LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL)) { local $ENV{$_} = $ENV{$_} . '.UTF-8' if $ENV{$_} && $ENV{$_} !~ /UTF-8/; } - my @l = map { ensure_utf8($_); $_ } run_program::get_stdout(@_); + my @l = map { ensure_utf8($_); $_ } AdminPanel::Shared::RunProgram::get_stdout(@_); wantarray() ? @l : join('', @l); } @@ -271,7 +273,7 @@ Is it ok to continue?"), yesno => 1 update_sources($urpm, noclean => 1, medialist => [ map { $_->{name} } @update_medias ]); } } else { - if (any { $_->{update} } @{$urpm->{media}}) { + if (MDK::Common::Func::any { $_->{update} } @{$urpm->{media}}) { interactive_msg($loc->N("Already existing update media"), $loc->N("You already have at least one update medium configured, but all of them are currently disabled. You should run the Software @@ -470,7 +472,7 @@ sub get_pkgs { my $_unused = $loc->N("Please wait, finding available packages..."); - # find out installed packages: +# # find out installed packages: init_progress_bar($urpm); @@ -696,7 +698,7 @@ sub perform_parallel_install { my @pkgs = map { MDK::Common::Func::if_($_->flag_requested, urpm_name($_)) } @{$urpm->{depslist}}; my @error_msgs; - my $res = !run_program::run('urpmi', '2>', \@error_msgs, '-v', '--X', '--parallel', $group, @pkgs); + my $res = !AdminPanel::Shared::RunProgram::run('urpmi', '2>', \@error_msgs, '-v', '--X', '--parallel', $group, @pkgs); if ($res) { $$statusbar_msg_id = statusbar_msg( @@ -975,7 +977,7 @@ you may now inspect some in order to take actions:"), #- restart rpmdragora if needed, keep command line for that. if ($need_restart && !$exit_code && $something_installed) { - log::explanations("restarting rpmdragora"); + Sys::Syslog::syslog('info|local1', "restarting rpmdragora"); #- it seems to work correctly with exec instead of system, provided we stop timers #- added --previous-priority-upgrade to allow checking if yet if #- priority-upgrade list has changed. and make sure we don't uselessly restart diff --git a/lib/AdminPanel/Rpmdragora/rpmnew.pm b/lib/AdminPanel/Rpmdragora/rpmnew.pm index 3ab242f..97e2b7a 100644 --- a/lib/AdminPanel/Rpmdragora/rpmnew.pm +++ b/lib/AdminPanel/Rpmdragora/rpmnew.pm @@ -26,8 +26,9 @@ package AdminPanel::Rpmdragora::rpmnew; use strict; use Text::Diff; -use MDK::Common::Math; -use MDK::Common::File; +use MDK::Common::Math qw(sum); +use MDK::Common::File qw(renamef); +use MDK::Common::Various qw(chomp_); use AdminPanel::rpmdragora; use AdminPanel::Rpmdragora::init; diff --git a/lib/AdminPanel/Rpmdragora/widgets.pm b/lib/AdminPanel/Rpmdragora/widgets.pm deleted file mode 100644 index 8484406..0000000 --- a/lib/AdminPanel/Rpmdragora/widgets.pm +++ /dev/null @@ -1,52 +0,0 @@ -# vim: set et ts=4 sw=4: -package Gtk2::Mdv::TextView; -#***************************************************************************** -# -# Copyright (c) 2002 Guillaume Cottenceau -# Copyright (c) 2002-2007 Thierry Vignaud <tvignaud@mandriva.com> -# Copyright (c) 2003, 2004, 2005 MandrakeSoft SA -# Copyright (c) 2005-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: widgets.pm 233986 2008-02-06 14:14:06Z tv $ - -use strict; -use MDK::Common::Func 'any'; -use lib qw(/usr/lib/libDrakX); - -use Time::HiRes; -use feature 'state'; - - -sub new { - my ($_class) = @_; - my $w = gtknew('TextView', editable => 0); - state $time; - $w->signal_connect(size_allocate => sub { - my ($w, $requisition) = @_; - return if !ref($w->{anchors}); - return if Time::HiRes::clock_gettime() - $time < 0.200; - $time = Time::HiRes::clock_gettime(); - foreach my $anchor (@{$w->{anchors}}) { - $_->set_size_request($requisition->width-30, -1) foreach $anchor->get_widgets; - } - 1; - }); - $w; -} - -1; |