diff --git a/update-libstdcxx-prettyprinter.sh b/update-libstdcxx-prettyprinter.sh index 2e044a1..f508ba1 100755 --- a/update-libstdcxx-prettyprinter.sh +++ b/update-libstdcxx-prettyprinter.sh @@ -7,7 +7,7 @@ fi # Variables to set up for a new GTS update. # The latest GTS supported on this branch. -gts_major=15 +gts_major=16 # Tests that need to be synced in for this change. These are required to sync # in adjustments to tests due to changes to pretty printer output. # Occasionally, a test adjustment may be due to an ABI change, in which case @@ -32,9 +32,16 @@ branch=`git branch --show-current` if ! [[ $branch =~ ^c[0-9]+s$ ]]; then echo "Must be run on a valid centos stream branch, not '$branch'"; exit 1; fi -gtsrev=`curl -s https://gitlab.com/redhat/centos-stream/rpms/gcc-toolset-$gts_major-gcc/-/raw/$(git branch --show-current)/gcc-toolset-15-gcc.spec?ref_type=heads | sed -n 's/^%global gitrev //p'` +gtsrev=`curl -s https://gitlab.com/redhat/centos-stream/rpms/gcc-toolset-$gts_major-gcc/-/raw/$branch/gcc-toolset-$gts_major-gcc.spec?ref_type=heads | sed -n 's/^%global gitrev //p'` -echo "system at $systemrev and GTS at $gtsrev on the vendor branch" +prev_gts_major=$((gts_major - 1)) +if grep -q "^Patch.*prettyprinter-update-$prev_gts_major" gcc.spec; then + baserev=`curl -s https://gitlab.com/redhat/centos-stream/rpms/gcc-toolset-$prev_gts_major-gcc/-/raw/$branch/gcc-toolset-$prev_gts_major-gcc.spec?ref_type=heads | sed -n 's/^%global gitrev //p'` + echo "previous GTS $prev_gts_major at $baserev, GTS $gts_major at $gtsrev on the vendor branch" +else + baserev=$systemrev + echo "system at $systemrev and GTS $gts_major at $gtsrev on the vendor branch" +fi cwd=$PWD cleanup() { @@ -62,14 +69,14 @@ fi pp_patchfile=gcc$system_major-libstdc++-prettyprinter-update-$gts_major.patch tests_patchfile=gcc$system_major-libstdc++-prettyprinter-update-$gts_major-tests.patch -git fetch -q origin $systemrev $gtsrev +git fetch -q origin $baserev $gtsrev # We limit the update to just the printer, retain the system gcc hook and # make-foo. -git diff --stat --patch $systemrev..$gtsrev -- libstdc++-v3/python/libstdcxx > ../$pp_patchfile +git diff --stat --patch $baserev..$gtsrev -- libstdc++-v3/python/libstdcxx > ../$pp_patchfile echo "Updated $pp_patchfile" testfiles=$(echo "$tests" | awk '/.+/{printf "libstdc++-v3/testsuite/libstdc++-prettyprinters/%s ", $1}') -git diff --stat --patch $systemrev..$gtsrev -- $testfiles > ../$tests_patchfile +git diff --stat --patch $baserev..$gtsrev -- $testfiles > ../$tests_patchfile echo "Updated $tests_patchfile" popd