|
26 | 26 | # mismatch"). |
27 | 27 | # |
28 | 28 | # Asserted, every variant: the first `mcpp new && mcpp run` of the new mcpp |
29 | | -# succeeds and downloads nothing; a second run likewise; `mcpp self doctor` |
| 29 | +# succeeds and downloads nothing but the ninja this commit pins; a second run |
| 30 | +# downloads nothing at all; `mcpp self doctor` |
30 | 31 | # in the project installs nothing and names the toolchain the build uses. |
31 | 32 | # snapshot: `mcpp index update` names the newer packagings, the run after it |
32 | 33 | # still downloads nothing, and `mcpp toolchain list` offers the new one. |
@@ -116,7 +117,14 @@ run() { |
116 | 117 | echo "::endgroup::" |
117 | 118 | return $rc |
118 | 119 | } |
119 | | -downloads() { grep -o "Downloading [^ ]*" "$W/$1.log" | sort -u | tr '\n' ' '; } |
| 120 | +# The one download an upgraded home makes: the ninja this commit pins, when the |
| 121 | +# previous release pinned another (mcpp#945: the pin carries a correction, so a |
| 122 | +# home takes it with the upgrade, beside the ninja it has). It is taken once -- |
| 123 | +# `any_download` holds the runs after the first to nothing at all. |
| 124 | +PIN=$(sed -n 's/.*kNinjaVersion *= *"\([^"]*\)".*/\1/p' "$(dirname "$0")/../../src/provider/xlings/xlings.cppm" | head -1) |
| 125 | +[ -n "$PIN" ] || { echo "::error::upgrade lane: the pinned ninja is not read from xlings.cppm"; exit 1; } |
| 126 | +any_download() { grep -o "Downloading [^ ]*" "$W/$1.log" | sort -u | tr '\n' ' '; } |
| 127 | +downloads() { grep -o "Downloading [^ ]*" "$W/$1.log" | grep -vxF "Downloading xim:ninja@$PIN" | sort -u | tr '\n' ' '; } |
120 | 128 | new_project() { # <dir> <bin> |
121 | 129 | (cd "$W" && "$2" new "$1" > /dev/null 2>&1) || mkdir -p "$W/$1" |
122 | 130 | printf '\n[toolchain]\ndefault = "%s"\n' "$TC" >> "$W/$1/mcpp.toml" |
@@ -232,7 +240,7 @@ run new-run1 "$W/p-new" "$NEW" run || fail "the first run of the new mcpp failed |
232 | 240 | # revision 0 → 1`); the vendored xlings update is not one. |
233 | 241 | grep -Eq "^\s*(Updating|Reinstalling) [^ ]+@" "$W/new-run1.log" && fail "the first run replaced a payload" |
234 | 242 | run new-run2 "$W/p-new" "$NEW" run || fail "the second run failed" |
235 | | -[ -z "$(downloads new-run2)" ] || fail "the second run downloaded: $(downloads new-run2)" |
| 243 | +[ -z "$(any_download new-run2)" ] || fail "the second run downloaded: $(any_download new-run2)" |
236 | 244 | run new-run-old-project "$W/p-old" "$NEW" run || fail "the project the previous release made does not run" |
237 | 245 | [ -z "$(downloads new-run-old-project)" ] || fail "the old project's run downloaded: $(downloads new-run-old-project)" |
238 | 246 |
|
@@ -276,7 +284,9 @@ if [ "$VARIANT" = orphan ]; then |
276 | 284 | run new-provision "$W" "$NEW" toolchain install "$TC" || fail "toolchain install could not replace the payload" |
277 | 285 | grep -q "installed asset registration missing" "$W/new-provision.log" \ |
278 | 286 | && fail "the replacement was refused by the dangling record" |
279 | | - grep -qi "deactivated\|dangling" "$W/new-provision.log" \ |
| 287 | + # Said by the install that came upon it: the first run's, when this commit |
| 288 | + # pins another ninja than the previous release, else this one. |
| 289 | + grep -qi "deactivated\|dangling" "$W/new-provision.log" "$W/new-run1.log" \ |
280 | 290 | || fail "the repaired record is not reported" |
281 | 291 | run new-run-after-provision "$W/p-new" "$NEW" run || fail "the run after the replacement failed" |
282 | 292 | fi |
|
0 commit comments