From: y0169.zhang Date: Fri, 19 Aug 2016 01:29:11 +0000 (+0900) Subject: Revert gbs install package policy, add use higher version option X-Git-Tag: upstream/20160629~5^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb2a3cc363850d2751058d34c90d5fe00bc80cbc;p=tools%2Fbuild.git Revert gbs install package policy, add use higher version option Change-Id: I5b1596e12f0ee45a46adf041f6cb9630ad319d3a --- diff --git a/build b/build index ea39ae0..3ad644a 100755 --- a/build +++ b/build @@ -97,6 +97,7 @@ RUN_SHELL= CCACHE= DLNOSIGNATURE= CACHE_DIR=/var/cache/build +USEHIGHERDEPS= # This is for insserv @@ -923,6 +924,9 @@ while test -n "$1"; do echo "$ARG does not take an argument" cleanup_and_exit ;; + -use-higher-deps) + USEHIGHERDEPS="--use-higher-deps" + ;; -*) if vm_parse_options "$@" ; then set -- "${nextargs[@]}" @@ -993,7 +997,7 @@ if test -n "$LIST_STATE" ; then recipe_unpack_srcrpm RECIPEFILE="$MYSRCDIR/$RECIPEFILE" fi - init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $KEEP_PACKS $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS + init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $KEEP_PACKS $USEHIGHERDEPS $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS ERR=$? rm -rf "$BUILD_ROOT" cleanup_and_exit $ERR @@ -1133,7 +1137,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do test "$BUILDTYPE" = mock && CREATE_BUILD_BINARIES=--create-build-binaries test "$BUILDTYPE" = debootstrap && CREATE_BUILD_BINARIES=--create-build-binaries test "$BUILDTYPE" = livebuild && CREATE_BUILD_BINARIES=--create-build-binaries - set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $KEEP_PACKS $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS + set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $KEEP_PACKS $USEHIGHERDEPS $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS echo "$* ..." start_time=`date +%s` "$@" || cleanup_and_exit 1 diff --git a/expanddeps b/expanddeps index 387daf7..7e3b795 100755 --- a/expanddeps +++ b/expanddeps @@ -29,7 +29,7 @@ use strict; use Build; use File::Basename; -my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $installonly, $noinstall); +my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $installonly, $noinstall, $usehigherdeps); $configdir = ($::ENV{'BUILD_DIR'} || '/usr/lib/build') . '/configs'; @@ -77,6 +77,11 @@ while (@ARGV) { Build::define("_without_$def --without-$def"); next; } + if ($ARGV[0] eq '--usehigherdeps') { + shift @ARGV; + $usehigherdeps = 1; + next; + } last; } @@ -194,16 +199,36 @@ while() { } } elsif (/^P:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgP = $2; + next if $prov{$1}; + $prov{$1} = $2; } elsif (/^R:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgR = $2; + next if $req{$1}; + $req{$1} = $2; } elsif (/^C:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgC = $2; + next if $con{$1}; + $con{$1} = $2; } elsif (/^O:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgO = $2; + next if $obs{$1}; + $obs{$1} = $2; } elsif (/^I:(.*?)-\d+\/\d+\/\d+: (.*)$/) { + my $r = 0; + if ($usehigherdeps) { + $r = 1; + } else { + if ($packs_done{$1}) { + $r = 0; + } else { + $r = 1; + } + } + + next unless ($r); my ($i, $newid) = ($1, $2); undef $i unless !$ids{$i} || $verscmp->($ids{$i}, $newid) < 0; - undef $i unless defined($pkgF) && defined($pkgP); + undef $i unless defined($pkgF) && defined($pkgP) && defined($pkgR); if (defined $i) { $i =~ /^(.*)\.([^\.]+)$/ or die; push @{$packs_arch{$2}}, $1; @@ -216,6 +241,9 @@ while() { $req{$i} = $pkgR; $con{$i} = $pkgC if defined $pkgC; $obs{$i} = $pkgO if defined $pkgO; + } else { + next if $ids{$1}; + $ids{$1} = $2; } undef $pkgF; undef $pkgP; diff --git a/init_buildsystem b/init_buildsystem index 1b3170f..55b6416 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -59,6 +59,7 @@ CLEAN_BUILD= CREATE_BUILD_BINARIES= DLNOSIGNATURE= CACHE_DIR=/var/cache/build +USEHIGHERDEPS= while test -n "$1" ; do case "$1" in @@ -112,6 +113,10 @@ while test -n "$1" ; do shift DLNOSIGNATURE="--nosignature" ;; + --use-higher-deps) + shift + USEHIGHERDEPS="--usehigherdeps" + ;; *) break ;; @@ -574,7 +579,7 @@ else # RPMLIST=$BUILD_ROOT/.init_b_cache/rpmlist test -z "$LIST_STATE" && echo "expanding package dependencies..." - if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then + if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD $USEHIGHERDEPS "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then rm -f $BUILD_IS_RUNNING cleanup_and_exit 1 fi