davsclaus commented on code in PR #29428:
URL: https://github.com/apache/camel/pull/29428#discussion_r4511988713
##########
dsl/camel-jbang/camel-launcher/src/main/java/org/apache/camel/dsl/jbang/launcher/selfupdate/SelfUpdateCommand.java:
##########
@@ -86,23 +93,42 @@ public Integer doCall() throws Exception {
// only within its selector, so an explicit --version, which could
leave it, is refused as well.
Optional<String> pinned = InstallDetector.pinnedVersion();
Pin pin = pinned.map(Pin::parse).orElse(null);
- if (pin != null && !pin.tracksAlias()) {
+ if (pin != null && !pin.tracksAlias() && !pin.followsNightlies()) {
printer().printErr("this install is pinned to version " +
pinned.get() + " - remove "
+ InstallDetector.pinnedVersionFile() + " to
resume tracking new releases");
return 1;
}
- if (pin != null && version != null) {
+ if (pin != null && pin.tracksAlias() && version != null) {
Review Comment:
Fixed in 33edc54e72fe by allowing the switch in both directions, as
`install.sh` does. An explicit `--version` now switches every pin that `camel
self-update` writes itself (LTS, X.Y, SNAPSHOT, X.Y.Z-SNAPSHOT, one nightly
build) to another selector, and the new pin is written once the install
succeeds.
Only `--version X.Y.Z` on an LTS or X.Y pin is still refused, because
`self-update` installs an exact version without a pin. `selectorPinRefusal` is
only reached for an X.Y.Z now, so it always quotes the installer command with
that version. The "pin an exact version" advice no longer shows for
SNAPSHOT/LTS/X.Y. The exact X.Y.Z pin that only the installer writes still
never moves, as before this PR.
Tests: `ltsPinSwitchesToTheNightlyBuildsOfMain` (your LTS -> SNAPSHOT case),
`linePinSwitchesToLts` and `nightlyBuildPinSwitchesToTheNightlyBuildsOfMain`.
The docs and the footer say that `--version` switches the pin.
_Claude Code on behalf of davsclaus_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]