[openwrt/openwrt] scripts: getver.sh: approximate version from date
LEDE Commits
lede-commits at lists.infradead.org
Thu Jun 26 01:29:54 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e56845fae3c05463a57ba8e0e104d6d8d8cd96ed
commit e56845fae3c05463a57ba8e0e104d6d8d8cd96ed
Author: Eric Fahlgren <ericfahlgren at gmail.com>
AuthorDate: Sat Feb 1 08:12:07 2025 -0800
scripts: getver.sh: approximate version from date
When doing package support and management it is often the case that
knowing the corresponding openwrt repo's release version is useful.
For example, when adding package changes to the ASU server, the
openwrt revision is used as the cutoff for applying those changes.
Knowing a package change's hash in its remote feed repo allows us
to look up its change date, which we can now use with getver.sh
to approximate the revision in openwrt at which it was made.
Signed-off-by: Eric Fahlgren <ericfahlgren at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17817
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
scripts/getver.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/getver.sh b/scripts/getver.sh
index 0659d8004a..e9a5cca074 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -23,6 +23,9 @@ try_git() {
BASE_REV="$(git rev-list ${REBOOT}..HEAD 2>/dev/null | wc -l | awk '{print $1}')"
[ $((BASE_REV - GET_REV)) -ge 0 ] && REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))"
;;
+ *-*-*) # ISO date format - for approximating when packages were removed or renamed
+ GET_REV="$(git log -n 1 --format="%h" --until "$GET_REV")"
+ ;& # FALLTHROUGH
*)
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
ORIGIN="$(git rev-parse --verify --symbolic-full-name ${BRANCH}@{u} 2>/dev/null)"
More information about the lede-commits
mailing list