Skip to content

Commit

Permalink
- support 'binarytype' so that we can have different package creation…
Browse files Browse the repository at this point in the history
… frontends
  • Loading branch information
mlschroe committed Jun 8, 2012
1 parent 45eef08 commit 570f1d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
14 changes: 11 additions & 3 deletions Build.pm
Expand Up @@ -267,8 +267,10 @@ sub read_config {
}
} elsif ($l0 eq 'repotype:') { #type of generated repository data
$config->{'repotype'} = [ @l ];
} elsif ($l0 eq 'type:') { #kind of packaging system (spec, dsc or kiwi)
} elsif ($l0 eq 'type:') { #kind of packaging system (spec,dsc,arch,kiwi,...)
$config->{'type'} = $l[0];
} elsif ($l0 eq 'binarytype:') { #rpm,deb,arch,...
$config->{'binarytype'} = $l[0];
} elsif ($l0 eq 'patterntype:') { #kind of generated patterns in repository
$config->{'patterntype'} = [ @l ];
} elsif ($l0 eq 'release:') {
Expand Down Expand Up @@ -307,6 +309,12 @@ sub read_config {
$config->{'type'} = 'UNDEFINED';
}
}
if (!$config->{'binarytype'}) {
$config->{'binarytype'} = 'rpm' if $config->{'type'} eq 'spec' || $config->{'type'} eq 'kiwi';
$config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc';
$config->{'binarytype'} = 'arch' if $config->{'type'} eq 'arch';
$config->{'binarytype'} ||= 'UNDEFINED';
}
# add rawmacros to our macro list
if ($config->{'rawmacros'} ne '') {
for my $rm (split("\n", $config->{'rawmacros'})) {
Expand Down Expand Up @@ -576,7 +584,7 @@ sub addproviders {
if ($pp eq $rn) {
# debian: unversioned provides do not match
# kiwi: supports only rpm, so we need to hand it like it
next if $config->{'type'} eq 'dsc';
next if $config->{'binarytype'} eq 'deb';
push @p, $rp;
last;
}
Expand All @@ -597,7 +605,7 @@ sub addproviders {
$rr &= 5 unless $pf & 2;
# verscmp for spec and kiwi types
my $vv;
if ($config->{'type'} eq 'dsc') {
if ($config->{'binatytype'} eq 'deb') {

This comment has been minimized.

Copy link
@Conan-Kudo

Conan-Kudo Jun 27, 2012

Member

Spelling error. I think you mean 'binarytype'?

This comment has been minimized.

Copy link
@mlschroe

mlschroe Jun 27, 2012

Author Member

Yeah, already fixed in the commit #106a3de0, though.

$vv = Build::Deb::verscmp($pv, $rv, 1);
} else {
$vv = Build::Rpm::verscmp($pv, $rv, 1);
Expand Down
4 changes: 2 additions & 2 deletions gettype
Expand Up @@ -32,5 +32,5 @@ while (@ARGV) {
die("Usage: gettype --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;

my $cf = Build::read_config_dist($dist, $archs, $configdir);
exit 0 unless $cf->{'type'};
print "$cf->{'type'}\n";
exit 0 unless $cf->{'binarytype'};
print "$cf->{'binarytype'}\n";
9 changes: 3 additions & 6 deletions init_buildsystem
Expand Up @@ -732,12 +732,9 @@ else

echo "$GUESSED_DIST" > $BUILD_ROOT/.guessed_dist
test -n "$BUILD_DIST" || BUILD_DIST="$GUESSED_DIST"
DIST_TYPE=`gettype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH"`
case "$DIST_TYPE" in
spec) PSUF=rpm ;;
dsc) PSUF=deb ;;
arch) PSUF=arch ;;
*)
PSUF=`gettype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH"`
case "$PSUF" in
UNKNOWN|'')
# auto detect from packages
PSUF=rpm
test -L $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
Expand Down

0 comments on commit 570f1d5

Please sign in to comment.