aboutsummaryrefslogtreecommitdiffstats
path: root/rpmdrake.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-09-03 22:18:16 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-09-03 22:18:16 +0000
commitfde097df512296afdadd95f02d1caf3bf263f2f3 (patch)
tree992976ce557d4956674e5572607a7ae713915c7d /rpmdrake.pm
parent645ac97d01fb361313e7ad63dddde62d23b31dff (diff)
downloadrpmdrake-fde097df512296afdadd95f02d1caf3bf263f2f3.tar
rpmdrake-fde097df512296afdadd95f02d1caf3bf263f2f3.tar.gz
rpmdrake-fde097df512296afdadd95f02d1caf3bf263f2f3.tar.bz2
rpmdrake-fde097df512296afdadd95f02d1caf3bf263f2f3.tar.xz
rpmdrake-fde097df512296afdadd95f02d1caf3bf263f2f3.zip
- disable prerendered titles until I have the new banner
- don't update when no source is selected for updates... - new ugtk without BEGIN so that we can have an OK error message when X is not available - use parenthesis for as much functions as seen since when requir'ing modules sometimes a function call is considered a bareword
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r--rpmdrake.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 828a5a1d..ff7160ce 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -19,6 +19,7 @@
#
# $Id$
+use lib qw(/usr/lib/libDrakX);
use standalone; #- warning, standalone must be loaded very first, for 'explanations'
use MDK::Common;
@@ -26,14 +27,20 @@ use urpm;
use URPM;
use URPM::Resolve;
use packdrake;
-use vars qw($configfile %config $mandrakeupdate_wanted_categories $already_splashed);
-use my_gtk qw(:helpers :wrappers :ask);
-my_gtk::add_icon_path('/usr/share/rpmdrake/icons');
+use strict;
+use vars qw($configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $typical_width);
use log;
use c;
use curl_download;
+eval { require my_gtk; my_gtk->import(qw(:helpers :wrappers :ask)) };
+if ($@) {
+ print "This program cannot be run in console mode.\n";
+ c::_exit(0); #- skip my_gtk::END
+}
+my_gtk::add_icon_path('/usr/share/rpmdrake/icons');
+
sub translate {
my ($s) = @_;
$s ? c::dgettext('rpmdrake', $s) : '';
@@ -43,7 +50,7 @@ sub _ {
sprintf $t, @_;
}
sub myexit { my_gtk::exit(undef, @_) }
-
+
$ENV{HOME} ||= '/root';
sub readconf {
@@ -125,12 +132,12 @@ sub slow_func($&) {
my ($param, $func) = @_;
if (ref($param) =~ /^Gtk/) {
gtkset_mousecursor_wait($param);
- my_gtk::flush;
- &$func;
+ my_gtk::flush();
+ $func->();
gtkset_mousecursor_normal($param);
} else {
my $w = wait_msg($param);
- &$func;
+ $func->();
remove_wait_msg($w);
}
}