From: Michael Schroeder Date: Fri, 8 Jun 2012 10:33:27 +0000 (+0200) Subject: - support 'binarytype' so that we can have different package creation frontends X-Git-Tag: upstream/20120927~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=570f1d52cb1935dbd8fd6ea39232269de5a1a4bd;p=platform%2Fupstream%2Fbuild.git - support 'binarytype' so that we can have different package creation frontends --- diff --git a/Build.pm b/Build.pm index 8c35ac6..44f097f 100644 --- a/Build.pm +++ b/Build.pm @@ -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:') { @@ -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'})) { @@ -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; } @@ -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') { $vv = Build::Deb::verscmp($pv, $rv, 1); } else { $vv = Build::Rpm::verscmp($pv, $rv, 1); diff --git a/gettype b/gettype index e07483a..1ceb746 100755 --- a/gettype +++ b/gettype @@ -32,5 +32,5 @@ while (@ARGV) { die("Usage: gettype --dist --archpath [--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"; diff --git a/init_buildsystem b/init_buildsystem index 1eca42b..0d309f5 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -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