From 0ac28692f334dcf81eead240e22cd466b353daa9 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Wed, 4 Feb 2009 15:11:33 +0000 Subject: [PATCH] build: expanddeps: unify rpmlist printing --- expanddeps | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/expanddeps b/expanddeps index 15e3fca..f3a3e26 100755 --- a/expanddeps +++ b/expanddeps @@ -168,6 +168,19 @@ my $cf = Build::read_config_dist($dist, $archs[0], $configdir); ####################################################################### +sub print_rpmlist +{ + for (@_) { + print "$_ $fn{$packs{$_}}\n"; + print "rpmid: $_:$ids{$packs{$_}}\n" if exists $ids{$packs{$_}}; + } + print "preinstall: @{$cf->{'preinstall'} || []}\n"; + print "vminstall: @{$cf->{'vminstall'} || []}\n"; + print "runscripts: @{$cf->{'runscripts'} || []}\n"; + print "dist: $dist\n" if defined $dist; + +} + if ($useusedforbuild) { die("Need a specfile/dscfile for --usedforbuild\n") unless defined $spec; local *F; @@ -195,13 +208,7 @@ if ($useusedforbuild) { print STDERR " $_\n" for @errors; exit(1); } - for (@usedforbuild) { - print "$_ $fn{$packs{$_}}\n"; - } - print "preinstall: @{$cf->{'preinstall'} || []}\n"; - print "vminstall: @{$cf->{'vminstall'} || []}\n"; - print "runscripts: @{$cf->{'runscripts'} || []}\n"; - print "dist: $dist\n" if defined $dist; + print_rpmlist(@usedforbuild); exit(0); } @@ -239,10 +246,4 @@ if (!shift @bdeps) { exit(1); } -for (@bdeps) { - print "$_ $fn{$packs{$_}}\n"; - print "rpmid: $_:$ids{$packs{$_}}\n" if exists $ids{$packs{$_}}; -} -print "preinstall: @{$cf->{'preinstall'} || []}\n"; -print "runscripts: @{$cf->{'runscripts'} || []}\n"; -print "dist: $dist\n" if defined $dist; +print_rpmlist(@bdeps); -- 2.7.4