From cd0a9a3c9cfd44dc0cb3a7f6e67a34e95ba3007c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20Schr=C3=B6der?= Date: Thu, 5 Apr 2007 13:48:19 +0000 Subject: [PATCH] - fix typo in createrpmdeps - support submodule selection --- Build.pm | 35 ++++++++++++++++++++++++----------- createrpmdeps | 4 ++-- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Build.pm b/Build.pm index c01c535..e18ea80 100644 --- a/Build.pm +++ b/Build.pm @@ -1,13 +1,26 @@ package Build; -our $expand_dbg; - use strict; use Digest::MD5; - use Build::Rpm; -use Build::Deb; + +our $expand_dbg; +our $strip_versions; + +our $do_rpm; +our $do_deb; + +sub import { + for (@_) { + $do_rpm = 1 if $_ eq ':rpm'; + $do_deb = 1 if $_ eq ':deb'; + } + $do_rpm = $do_deb = 1 if !$do_rpm && !$do_deb; + if ($do_deb) { + require Build::Deb; + } +} my $std_macros = q{ @@ -269,7 +282,7 @@ sub readdeps { } push @ss, shift @s; if (@s && $s[0] =~ /^[<=>]/) { - $ss[-1] .= " $s[0] $s[1]"; + $ss[-1] .= " $s[0] $s[1]" unless $strip_versions; shift @s; shift @s; } @@ -500,8 +513,8 @@ sub add_all_providers { sub parse { my ($cf, $fn, @args) = @_; - return Build::Rpm::parse($cf, $fn, @args) if $fn =~ /\.spec$/; - return Build::Deb::parse($cf, $fn, @args) if $fn =~ /\.dsc$/; + return Build::Rpm::parse($cf, $fn, @args) if $do_rpm && $fn =~ /\.spec$/; + return Build::Deb::parse($cf, $fn, @args) if $do_deb && $fn =~ /\.dsc$/; return undef; } @@ -512,15 +525,15 @@ sub query { $handle = $binname->[1]; $binname = $binname->[0]; } - return Build::Rpm::query($handle, $withevra) if $binname =~ /\.rpm$/; - return Build::Deb::query($handle, $withevra) if $binname =~ /\.deb$/; + return Build::Rpm::query($handle, $withevra) if $do_rpm && $binname =~ /\.rpm$/; + return Build::Deb::query($handle, $withevra) if $do_deb && $binname =~ /\.deb$/; return undef; } sub queryhdrmd5 { my ($binname) = @_; - return Build::Rpm::queryhdrmd5($binname) if $binname =~ /\.rpm$/; - return Build::Deb::queryhdrmd5($binname) if $binname =~ /\.deb$/; + return Build::Rpm::queryhdrmd5($binname) if $do_rpm && $binname =~ /\.rpm$/; + return Build::Deb::queryhdrmd5($binname) if $do_deb && $binname =~ /\.deb$/; return undef; } diff --git a/createrpmdeps b/createrpmdeps index 81787a4..0ab5158 100755 --- a/createrpmdeps +++ b/createrpmdeps @@ -155,8 +155,8 @@ while ($redo) { if ($path =~ /\.rpm$/) { my %res = Build::Rpm::rpmq($path, 1000, 1022, 1047, 1049, 1048, 1050, 1112, 1113); next unless %res; - Build::Rpm::rpmq_add_flagsvers(\%res, 1047, 1112, 1113); - Build::Rpm::rpmq_add_flagsvers(\%res, 1049, 1048, 1050); + Build::Rpm::add_flagsvers(\%res, 1047, 1112, 1113); + Build::Rpm::add_flagsvers(\%res, 1049, 1048, 1050); my $id = $known; $id =~ s/.*-//; if ($known ne "$res{1000}->[0].$res{1022}->[0]-$id") { -- 2.7.4