Skip to content

Commit

Permalink
Autodetect binary type for snapcraft
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Jun 30, 2016
1 parent 94db8d3 commit 96713ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@ sub read_config {
$config->{'binarytype'} = 'rpm' if $config->{'type'} eq 'spec' || $config->{'type'} eq 'kiwi';
$config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc' || $config->{'type'} eq 'collax' || $config->{'type'} eq 'livebuild';
$config->{'binarytype'} = 'arch' if $config->{'type'} eq 'arch';
if ($config->{'type'} eq 'snapcraft') {
if (grep {$_ eq 'rpm'} @{$config->{'preinstall'} || []}) {
$config->{'binarytype'} = 'rpm';
} elsif (grep {$_ eq 'debianutils'} @{$config->{'preinstall'} || []}) {
$config->{'binarytype'} = 'deb';
} elsif (grep {$_ eq 'pacman'} @{$config->{'preinstall'} || []}) {
$config->{'binarytype'} = 'arch';
}
}
$config->{'binarytype'} ||= 'UNDEFINED';
}
# add rawmacros to our macro list
Expand Down

0 comments on commit 96713ff

Please sign in to comment.