summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-11-03 13:22:05 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-11-03 13:22:05 +0000
commit4c739cb2352af8f2102464714b4563ce2c53912f (patch)
treefb20c8b2dc54d07c4389c878e69850b9d8f50fb1
parent8d5bf10babad2dc4b8ffac76636dde1c594f51dc (diff)
downloadurpmi-4c739cb2352af8f2102464714b4563ce2c53912f.tar
urpmi-4c739cb2352af8f2102464714b4563ce2c53912f.tar.gz
urpmi-4c739cb2352af8f2102464714b4563ce2c53912f.tar.bz2
urpmi-4c739cb2352af8f2102464714b4563ce2c53912f.tar.xz
urpmi-4c739cb2352af8f2102464714b4563ce2c53912f.zip
Don't use MDK::Common
-rw-r--r--gurpmi10
-rw-r--r--t/cfg.t8
2 files changed, 10 insertions, 8 deletions
diff --git a/gurpmi b/gurpmi
index 66140279..dfafff94 100644
--- a/gurpmi
+++ b/gurpmi
@@ -11,12 +11,10 @@ BEGIN { #- set up a safe path and environment
}
use Gtk2;
-use MDK::Common::Func qw(partition);
-
use gurpmi;
#- globals
-my ($srpms, $rpms);
+my ($srpms, $rpms) = ([], []);
my ($mainw, $mainbox);
my @all_rpms = gurpmi::parse_command_line();
@@ -39,9 +37,13 @@ sub all_descriptions {
join '', qx(rpm -qp --qf '%{name}-%{version}-%{release}: %{summary}\\n' @_);
}
+foreach (@all_rpms) {
+ warn "$_";
+ /\.src\.rpm$/ ? push(@$srpms, $_) : push(@$rpms, $_);
+}
+
#- Ask question: save or install ?
#- change depending on the number of rpms, and on the presence of srpms
-($srpms, $rpms) = partition { /\.src\.rpm$/ } @all_rpms;
{
my $msg = (
@$srpms > 0
diff --git a/t/cfg.t b/t/cfg.t
index 77c831ff..28a65d1c 100644
--- a/t/cfg.t
+++ b/t/cfg.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use Test::More 'no_plan';
-use MDK::Common;
+use File::Slurp;
BEGIN { use_ok 'urpm::cfg' }
BEGIN { use_ok 'urpm::download' }
@@ -49,7 +49,7 @@ $cfgtext =~ s/\bkey_ids\b/key-ids/g;
$cfgtext =~ s/"123"/123/g;
$cfgtext =~ s/'kernel'/kernel/g;
-my $cfgtext2 = cat_($file.2);
+my $cfgtext2 = read_file($file.2);
$cfgtext2 =~ s/# generated.*\n//;
is( $cfgtext, $cfgtext2, 'config is the same' )
or system qw( diff -u ), $file, $file.2;
@@ -70,12 +70,12 @@ is( $p->{http_proxy}, 'http://yoyodyne:8080/', 'read media proxy' );
is( $p->{user}, 'rafael', 'proxy user' );
is( $p->{pwd}, 'richard', 'proxy password' );
ok( dump_proxy_config(), 'dump_proxy_config' );
-$cfgtext2 = cat_($proxyfile);
+$cfgtext2 = read_file($proxyfile);
$cfgtext2 =~ s/# generated.*\n//;
is( $cfgtext, $cfgtext2, 'dumped correctly' );
set_proxy_config(http_proxy => '');
ok( dump_proxy_config(), 'dump_proxy_config erased' );
-$cfgtext2 = cat_($proxyfile);
+$cfgtext2 = read_file($proxyfile);
$cfgtext2 =~ s/# generated.*\n//;
$cfgtext =~ s/^http_proxy.*\n//;
is( $cfgtext, $cfgtext2, 'dumped correctly' );