aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-11-15 19:44:39 +0000
committerFrancois Pons <fpons@mandriva.com>2003-11-15 19:44:39 +0000
commit8bbe233e474ef694baececdb7ce4c6d10377be89 (patch)
tree02a4bc98793571f148e38e27d11232c0b654fae6 /URPM
parentd4b0a478aebaa9db4a1627a3cc72f932a086b55d (diff)
downloadperl-URPM-8bbe233e474ef694baececdb7ce4c6d10377be89.tar
perl-URPM-8bbe233e474ef694baececdb7ce4c6d10377be89.tar.gz
perl-URPM-8bbe233e474ef694baececdb7ce4c6d10377be89.tar.bz2
perl-URPM-8bbe233e474ef694baececdb7ce4c6d10377be89.tar.xz
perl-URPM-8bbe233e474ef694baececdb7ce4c6d10377be89.zip
fixed indentation and reworked code to be simpler
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Build.pm44
1 files changed, 18 insertions, 26 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm
index 797d5f0..02e5866 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -48,14 +48,14 @@ sub parse_rpms_build_headers {
$filename = $cache{$key}{file};
} else {
($id, undef) = $urpm->parse_rpm($_);
- defined $id or do {
- if ($options{dontdie}) {
- print STDERR "bad rpm $_\n";
- next;
- } else {
- die "bad rpm $_\n";
- }
- };
+ unless (defined $id) {
+ if ($options{dontdie}) {
+ print STDERR "bad rpm $_\n";
+ next;
+ } else {
+ die "bad rpm $_\n";
+ }
+ }
my $pkg = $urpm->{depslist}[$id];
@@ -339,18 +339,14 @@ sub compute_deps {
#- split : split ratio (default 400000).
sub build_hdlist {
my ($urpm, %options) = @_;
- my ($dir, $start, $end, $ratio, $split, @idlist);
+ my ($dir, $ratio, $split, @idlist);
$dir = $options{dir} || ($ENV{TMPDIR} || "/tmp") . "/.build_hdlist";
-d $dir or die "no directory $dir\n";
- if (@{$options{idlist}}) {
- @idlist = @{$options{idlist}};
- } else {
- $start = $options{start} || 0;
- $end = $options{end} || $#{$urpm->{depslist}};
- @idlist = ($start .. $end);
- }
+ @idlist = @{$options{idlist}} > 0 ? @{$options{idlist}} :
+ ($options{start} || 0 .. $options{end} || $#{$urpm->{depslist}});
+ @idlist or return;
#- compression ratio are not very high, sample for cooker
#- gives the following (main only and cache fed up):
@@ -385,16 +381,12 @@ sub build_hdlist {
#- ratio : compression ratio (default 9).
sub build_synthesis {
my ($urpm, %options) = @_;
- my ($start, $end, $ratio, @idlist);
-
- if (@{$options{idlist}} > 0) {
- @idlist = @{$options{idlist}};
- } else {
- $start = $options{start} || 0;
- $end = $options{end} || $#{$urpm->{depslist}};
- $start > $end and return;
- @idlist = ($start .. $end);
- }
+ my ($ratio, @idlist);
+
+ @idlist = @{$options{idlist}} > 0 ? @{$options{idlist}} :
+ ($options{start} || 0 .. $options{end} || $#{$urpm->{depslist}});
+ @idlist or return;
+
$ratio = $options{ratio} || 9;
$options{synthesis} || defined $options{fd} or die "invalid parameters given";