From 4394a9d20454725de32194400d2a5b75e910b07e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 15 Mar 2012 08:20:13 +0000 Subject: simplify using cat_or_die() --- pm/MGATools/rpmsrate.pm | 6 ++---- 1 file 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*$//; -- cgit v1.2.1