summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-15 08:20:13 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-15 08:20:13 +0000
commit4394a9d20454725de32194400d2a5b75e910b07e (patch)
treefb8450c72d13b099201c5e896d96d2c7c14ae858
parent833b5f150c0526e8edac221f95b39893cefabde3 (diff)
downloadmgatools-4394a9d20454725de32194400d2a5b75e910b07e.tar
mgatools-4394a9d20454725de32194400d2a5b75e910b07e.tar.gz
mgatools-4394a9d20454725de32194400d2a5b75e910b07e.tar.bz2
mgatools-4394a9d20454725de32194400d2a5b75e910b07e.tar.xz
mgatools-4394a9d20454725de32194400d2a5b75e910b07e.zip
simplify using cat_or_die()
-rw-r--r--pm/MGATools/rpmsrate.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/pm/MGATools/rpmsrate.pm b/pm/MGATools/rpmsrate.pm
index 9c39b56..190dd42 100644
--- a/pm/MGATools/rpmsrate.pm
+++ b/pm/MGATools/rpmsrate.pm
@@ -1,7 +1,7 @@
package MGATools::rpmsrate;
use strict;
-use MDK::Common qw(any member);
+use MDK::Common qw(any cat_or_die member);
require Exporter;
use URPM;
@@ -45,12 +45,10 @@ sub cleanrpmsrate {
my ($rpmsrate, $output, $norpmsrate, $reprpms, $urpm) = @_;
$norpmsrate ||= [];
my $LOG; open $LOG, ">&STDERR";
- open my $A, $rpmsrate or print $LOG "ERROR: cannot open $rpmsrate\n";
my (@rpmsrate, %potloc);
# must preread to get locale guessed packages
# postfix is just used not to break the diff when checking if the result is correct
- local $_;
- while (<$A>) {
+ foreach (cat_or_die($rpmsrate)) {
chomp;
s/#.*//;
#s/\s*$//;