commit b665b715ded154b2cc7ea290c0cfa75429ee152b
Author: Scott Kostyshak <[email protected]>
Date:   Mon Mar 17 12:24:20 2025 +0100

    lyx-tester poly switch: account for parallel TLs
    
    install-tl-ubuntu (which lyx-tester uses) makes it easy to have
    multiple TeX Live installations, both within year and across year.
    For the polyglossia switches, now we archive accoridng to the
    particular TL directory so we do not accidentally confound different
    polyglossia directories.
---
 development/lyx-tester/switches | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/development/lyx-tester/switches b/development/lyx-tester/switches
index 4b6ddcbe59..3141edbc24 100644
--- a/development/lyx-tester/switches
+++ b/development/lyx-tester/switches
@@ -25,15 +25,19 @@ function switch-polyglossia-to-dev ()
   # location of TL version
   polyglossia_tl_f="$(/opt/texbin/kpsewhich polyglossia.sty)"
   polyglossia_tl_d="$(dirname "${polyglossia_tl_f}")"
+
+  # e.g., "TL25_2025-03-16"
+  tl_dirname="$( basename "$( dirname "$( kpsewhich -var-value TEXMFDIST )")")"
   # this is the dir outside of the TL tree where we store the TL polyglossia
   # dir when we replace it with a symlink to the dev dir.
-  polyglossia_tl_bu_d="/home/$(logname)/polyglossia_tl"
+  polyglossia_tl_bu_d="/home/$(logname)/polyglossia_tl/${tl_dirname}"
+
   # check whether link or not link to see whether current is tl or dev.
   if [ -L "${polyglossia_tl_d}" ]; then
     echo "Link exists, so you are already using polyglossia-dev."
     return 0
   else
-    # TODO: need to account for different TL versions.
+
     if [ -e "${polyglossia_tl_bu_d}" ]; then
       echo "ERROR: The polyglossia backup dir already exists: 
${polyglossia_tl_bu_d}" >&2
       return 1
@@ -54,7 +58,10 @@ function switch-polyglossia-to-stable ()
 {
   polyglossia_tl_f="$(/opt/texbin/kpsewhich polyglossia.sty)"
   polyglossia_tl_d="$(dirname "${polyglossia_tl_f}")"
-  polyglossia_tl_bu_d="/home/$(logname)/polyglossia_tl"
+  tl_dirname="$( basename "$( dirname "$( kpsewhich -var-value TEXMFDIST )")")"
+  # this is the dir outside of the TL tree where we store the TL polyglossia
+  # dir when we replace it with a symlink to the dev dir.
+  polyglossia_tl_bu_d="/home/$(logname)/polyglossia_tl/${tl_dirname}"
   if [ -L "${polyglossia_tl_d}" ]; then
     sudo rm "${polyglossia_tl_d}"
     sudo mv "${polyglossia_tl_bu_d}" "${polyglossia_tl_d}"
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to