efahl / owut

OpenWrt Upgrade Tool
15 stars 0 forks source link

Add means for offering only latest on current branch #7

Closed efahl closed 3 months ago

efahl commented 4 months ago

https://github.com/openwrt/packages/pull/24324#issuecomment-2148595500 item 5

It'd be cool to have a way to tell upgrade command to remain within the currently running branch. Ie. only update from 24.08.0 to 24.08.1, but don't jump to 25.04.0. Similarly if 23.05-SNAPSHOT is currently running, only upgrade to a more recent 23.05-SNAPSHOT build but refrain from jumping to main-branch SNAPSHOT build.

efahl commented 3 months ago

@dangowrt

Behavior implemented as of https://github.com/efahl/owut/blob/286d7940d962ab28441619d467ac4443644993c7/files/owut#L880

User specifies --version-to explicitly

If the user specifies a full version, then the input is checked against the available versions and left untouched: --version-to 23.05.3 -> 23.05.3 --version-to 23.05.0-rc2 -> 23.05.0-rc2 --version-to 23.05-snapshot -> 23.05-SNAPSHOT --version-to snapshot -> SNAPSHOT

If user specifies only a branch, then the "version-to" is set to the latest on that branch: --version-to 23.05 -> 23.05.3 --version-to SNAPSHOT -> SNAPSHOT

No --version-to is specified

If the user does not specify a "version-to" value, then the default behavior is now to stay on the installed branch, i.e., grab the branch from the installed version and set "version-to" to the latest on the branch: installed 23.05.0-rc1 -> 23.05.3 installed 21.02.2 -> 21.02.7

The exception to this is if the installed version is a release or main snapshot, in which case, "version-to" is set to the installed version: installed 22.03-SNAPSHOT -> 22.03-SNAPSHOT installed SNAPSHOT -> SNAPSHOT

efahl commented 3 months ago

Tested on many versions, final update in https://github.com/efahl/owut/commit/9108cde48797807ba39b220794fe0da844a686e1