summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/args.pm24
-rw-r--r--urpm/download.pm20
2 files changed, 13 insertions, 31 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index c81942d3..4d3d971a 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -8,6 +8,10 @@ no warnings 'once';
use Getopt::Long;# 2.33;
use urpm::download;
use urpm::msg;
+use Exporter;
+
+our @ISA = 'Exporter';
+our @EXPORT = ('%options');
(our $VERSION) = q($Revision$) =~ /(\d+)/;
@@ -27,14 +31,6 @@ my $urpm;
# stores the values of the command-line options
our %options;
-sub import {
- if (@_ > 1 && $_[1] eq 'options') {
- # export the global %options hash
- no strict 'refs';
- *{caller() . '::options'} = \%options;
- }
-}
-
# used by urpmf
sub add_param_closure {
my (@tags) = @_;
@@ -49,17 +45,7 @@ my %options_spec = (
"help|h" => sub {
if (defined &::usage) { ::usage() } else { die "No help defined\n" }
},
- "no-locales" => sub {
- undef *::N;
- undef *urpm::N;
- undef *urpm::msg::N;
- undef *urpm::args::N;
- undef *urpm::cfg::N;
- undef *urpm::download::N;
- *::N = *urpm::N = *urpm::msg::N = *urpm::args::N
- = *urpm::cfg::N = *urpm::download::N
- = sub { my ($f, @p) = @_; sprintf($f, @p) };
- },
+ "no-locales" => sub { $urpm::msg::no_translation = 1 },
update => \$::update,
'media|mediums=s' => \$::media,
'excludemedia|exclude-media=s' => \$::excludemedia,
diff --git a/urpm/download.pm b/urpm/download.pm
index 7655c141..f860064f 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -7,6 +7,14 @@ use urpm::msg;
use urpm::cfg;
use urpm::util;
use Cwd;
+use Exporter;
+
+our @ISA = 'Exporter';
+our @EXPORT = qw(get_proxy
+ propagate_sync_callback
+ sync_file sync_wget sync_curl sync_rsync sync_ssh
+ set_proxy_config dump_proxy_config
+);
(our $VERSION) = q($Revision$) =~ /(\d+)/;
@@ -17,18 +25,6 @@ my $proxy_config;
#- Timeout for curl connection and wget operations
our $CONNECT_TIMEOUT = 60; #- (in seconds)
-sub import () {
- my $c = caller;
- no strict 'refs';
- foreach my $symbol (qw(get_proxy
- propagate_sync_callback
- sync_file sync_wget sync_curl sync_rsync sync_ssh
- set_proxy_config dump_proxy_config
- )) {
- *{$c . '::' . $symbol} = *$symbol;
- }
-}
-
#- parses proxy.cfg (private)
sub load_proxy_config () {
return if defined $proxy_config;