lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master f15cb36 04/15: Refactor, handling "root name"


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f15cb36 04/15: Refactor, handling "root name" more naturally
Date: Fri, 9 Oct 2020 12:05:26 -0400 (EDT)

branch: master
commit f15cb36c1355b75470d2c69e144163fe991a2d93
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Refactor, handling "root name" more naturally
---
 install_msw.sh | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/install_msw.sh b/install_msw.sh
index c94529c..3084474 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -343,11 +343,23 @@ for z in company_logo.png group_quote_banner.png ; do
 done
 
 # Configurable settings.
-#
-# Tailored to msw; for POSIX, s|C:||.
 
 mkdir --parents /opt/lmi/print
 
+# Like std::filesystem::root_name().
+root_name=C:
+
+# Don't use "C:" for wine: it designates the "wine prefix" directory.
+# "Z:" could be used instead, because that's where wine maps the
+# apparent root, but that wouldn't work with posix builds. Instead,
+# therefore, symlink the directories lmi uses as described in
+# 'README.schroot'.
+
+if [ "Cygwin" != "$platform" ] && [ "WSL" != "$platform" ]
+then
+    root_name=
+fi
+
 cat >/opt/lmi/data/configurable_settings.xml <<EOF
 <?xml version="1.0"?>
 <configurable_settings version="2">
@@ -358,10 +370,10 @@ cat >/opt/lmi/data/configurable_settings.xml <<EOF
   <custom_input_1_filename>custom.inix</custom_input_1_filename>
   <custom_output_0_filename>custom.out0</custom_output_0_filename>
   <custom_output_1_filename>custom.out1</custom_output_1_filename>
-  <default_input_filename>C:/etc/opt/lmi/default.ill</default_input_filename>
+  
<default_input_filename>${root_name}/etc/opt/lmi/default.ill</default_input_filename>
   <libraries_to_preload/>
   <offer_hobsons_choice>0</offer_hobsons_choice>
-  <print_directory>C:/opt/lmi/print</print_directory>
+  <print_directory>${root_name}/opt/lmi/print</print_directory>
   <seconds_to_pause_between_printouts>10</seconds_to_pause_between_printouts>
   <skin_filename>skin.xrc</skin_filename>
   <spreadsheet_file_extension>.tsv</spreadsheet_file_extension>
@@ -369,17 +381,6 @@ cat >/opt/lmi/data/configurable_settings.xml <<EOF
 </configurable_settings>
 EOF
 
-# Remove "C:" for wine: it designates the "wine prefix" directory.
-# "Z:" could be used instead, because that's where wine maps the
-# apparent root, but that wouldn't work with posix builds. Instead,
-# therefore, symlink the directories lmi uses as described in
-# 'README.schroot'.
-
-if [ "Cygwin" != "$platform" ] && [ "WSL" != "$platform" ]
-then
-    sed -i /opt/lmi/data/configurable_settings.xml -e's/C://g'
-fi
-
 # Restore any preexisting source directory that had been preserved
 # above, renaming the pristine checkout that had replaced it.
 #



reply via email to

[Prev in Thread] Current Thread [Next in Thread]