aboutsummaryrefslogtreecommitdiff
path: root/link_versions.sh
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-05-11 15:01:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-05-11 15:01:09 -0400
commit761a483e28935f0bdee4658c37dfaa4606c2660a (patch)
tree2e0b76801f2838d568ebd7b9c76884599ada0744 /link_versions.sh
parent84c29ce5facc166515b80abf79f33b2ea21bf9fa (diff)
Add new system for tracking versions.
Diffstat (limited to 'link_versions.sh')
-rw-r--r--link_versions.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/link_versions.sh b/link_versions.sh
new file mode 100644
index 00000000..3fadbe4f
--- /dev/null
+++ b/link_versions.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+TOMO_PREFIX="$(awk -F= '/PREFIX/{print $2}' config.mk)"
+cd "$TOMO_PREFIX/bin"
+
+commands="$(ls | awk -F '[v.]' '
+ /^tomo_v/{
+ if ($2 >= max_major) max_major=$2;
+ if ($3 >= max_minor[$2]) max_minor[$2] = $3;
+ link_tomo=1
+ }
+ END {
+ for (major in max_minor) {
+ if (max_major > 0) print "ln -fvs tomo_v"major"."max_minor[major]" tomo"major
+ }
+ if (link_tomo) print "ln -fvs tomo_v"max_major"."max_minor[max_major]" tomo"
+ }')"
+eval "$commands"