summaryrefslogtreecommitdiff
path: root/Build.pm
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-07-17 13:40:31 +0200
committerMichael Schroeder <mls@suse.de>2014-07-17 13:42:56 +0200
commitf39aa4ffe016e54db729e004ab1c142754353137 (patch)
treebed024c7c505462af18ad4ffb8e883cc46ed643d /Build.pm
parent92cf0dbb1d265a5676e625ded7326405e5a7c4b7 (diff)
add parse_typed helper, to be used in OBS
This is do decouple the on-disk filename from the internal filename. You can call recipe2buildtype to get the type and then parse_typed to get the file parsed.
Diffstat (limited to 'Build.pm')
-rw-r--r--Build.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Build.pm b/Build.pm
index f97c0da..eaa86a7 100644
--- a/Build.pm
+++ b/Build.pm
@@ -1011,6 +1011,18 @@ sub parse {
return undef;
}
+sub parse_typed {
+ my ($cf, $fn, $buildtype, @args) = @_;
+ $buildtype ||= '';
+ return Build::Rpm::parse($cf, $fn, @args) if $do_rpm && $buildtype eq 'spec';
+ return Build::Deb::parse($cf, $fn, @args) if $do_deb && $buildtype eq 'dsc';
+ return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $buildtype eq 'kiwi';
+ return Build::LiveBuild::parse($cf, $fn, @args) if $do_livebuild && $buildtype eq 'livebuild';
+ return Build::Arch::parse($cf, $fn, @args) if $do_arch && $buildtype eq 'arch';
+ return parse_preinstallimage($cf, $fn, @args) if $buildtype eq 'preinstallimage';
+ return undef;
+}
+
sub query {
my ($binname, %opts) = @_;
my $handle = $binname;