aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xedit-urpm-sources.pl5
-rwxr-xr-xrpmdrake7
-rw-r--r--rpmdrake.pm9
3 files changed, 20 insertions, 1 deletions
diff --git a/edit-urpm-sources.pl b/edit-urpm-sources.pl
index 5af94d02..5973d152 100755
--- a/edit-urpm-sources.pl
+++ b/edit-urpm-sources.pl
@@ -29,6 +29,11 @@ require_root_capability();
use rpmdrake;
+eval { require ugtk2; ugtk2->import(qw(:all)) };
+if ($@) {
+ print "This program cannot be run in console mode.\n";
+ c::_exit(0); #- skip ugtk2::END
+}
$::isStandalone = 1;
diff --git a/rpmdrake b/rpmdrake
index f29f7b52..87053405 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -43,6 +43,13 @@ use gurpm;
require_root_capability();
+eval { require ugtk2; ugtk2->import(qw(:all)) };
+if ($@) {
+ print "This program cannot be run in console mode.\n";
+ c::_exit(0); #- skip ugtk2::END
+}
+
+
$MODE = 'install';
$0 =~ m|/rpmdrake-remove$| and $MODE = 'remove';
$0 =~ m|/MandrakeUpdate$| and $MODE = 'update';
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 2d4e2452..e17cc93c 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -19,6 +19,8 @@
#
# $Id$
+package rpmdrake;
+
use lib qw(/usr/lib/libDrakX);
use standalone; #- warning, standalone must be loaded very first, for 'explanations'
@@ -28,12 +30,17 @@ use URPM;
use URPM::Resolve;
use packdrake;
use strict;
-use vars qw($configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $typical_width);
+use vars qw(@ISA @EXPORT $configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $typical_width);
use log;
use c;
use curl_download;
+@ISA = qw(Exporter);
+@EXPORT = qw($configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $typical_width
+ N translate myexit readconf writeconf interactive_msg interactive_packtable interactive_list fatal_msg wait_msg remove_wait_msg but but_ slow_func mirrors choose_mirror show_urpm_progress update_sources update_sources_interactive add_medium_and_check);
+
+
eval { require ugtk2; ugtk2->import(qw(:all)) };
if ($@) {
print "This program cannot be run in console mode.\n";