diff options
author | y0169.zhang <y0169.zhang@samsung.com> | 2016-08-19 10:29:11 +0900 |
---|---|---|
committer | SoonKyu Park <sk7.park@samsung.com> | 2016-09-23 13:07:34 +0900 |
commit | 23bd45d0a4a885918f7830d0875ef4c6b1f96f86 (patch) | |
tree | a530c837e65755e2dd666365e93885f656b43df1 | |
parent | b45c1b0ca47713d3b1f8f3923b3d7d3ebdcf4ffb (diff) | |
download | build-23bd45d0a4a885918f7830d0875ef4c6b1f96f86.tar.gz build-23bd45d0a4a885918f7830d0875ef4c6b1f96f86.tar.bz2 build-23bd45d0a4a885918f7830d0875ef4c6b1f96f86.zip |
Revert gbs install package policy, add use higher version option
Change-Id: I5b1596e12f0ee45a46adf041f6cb9630ad319d3a
-rwxr-xr-x | build | 8 | ||||
-rwxr-xr-x | expanddeps | 32 | ||||
-rwxr-xr-x | init_buildsystem | 7 |
3 files changed, 42 insertions, 5 deletions
@@ -97,6 +97,7 @@ RUN_SHELL= CCACHE= DLNOSIGNATURE= CACHE_DIR=/var/cache/build +USEHIGHERDEPS= # This is for insserv @@ -930,6 +931,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[@]}" @@ -1000,7 +1004,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 @@ -1140,7 +1144,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 @@ -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(<F>) { } } 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(<F>) { $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 |