diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2003-05-12 16:01:10 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2003-05-12 16:01:10 +0000 |
commit | e4c4b187dd9d69c422d4e7e1318104fc98034b4b (patch) | |
tree | 02a0cac5dd61d7997f4e9b07b15fb593ffec2f89 | |
parent | d99db036fdc356530e51d7fee939f75a45c4221c (diff) | |
download | rpmdrake-e4c4b187dd9d69c422d4e7e1318104fc98034b4b.tar rpmdrake-e4c4b187dd9d69c422d4e7e1318104fc98034b4b.tar.gz rpmdrake-e4c4b187dd9d69c422d4e7e1318104fc98034b4b.tar.bz2 rpmdrake-e4c4b187dd9d69c422d4e7e1318104fc98034b4b.tar.xz rpmdrake-e4c4b187dd9d69c422d4e7e1318104fc98034b4b.zip |
make rpmdrake.pm a real perl package, because of auto requires/deps on perl stuff from within rpm :/
-rwxr-xr-x | edit-urpm-sources.pl | 5 | ||||
-rwxr-xr-x | rpmdrake | 7 | ||||
-rw-r--r-- | rpmdrake.pm | 9 |
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; @@ -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"; |