changeset 5650:6805ab42c8aa

Don't convert to short paths for default-octave target (bug #59923). * installer-files/octave-no-shortpath.patch, installer-files/octave-bat-no-shortpath.patch, installer-files/cmdshell-no-shortpath.patch: Add patches that remove conversion of path to short file names from scripts. * binary-dist-rules.mk: Apply new patches for default-octave target. * dist-files.mk: Add new files to build system.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 31 Jan 2021 18:38:38 +0100
parents 27b4f385c45d
children 2d57e8e16bbb
files binary-dist-rules.mk dist-files.mk installer-files/cmdshell-no-short-path.patch installer-files/octave-bat-no-short-path.patch installer-files/octave-no-short-path.patch
diffstat 5 files changed, 144 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/binary-dist-rules.mk	Sun Jan 31 18:10:25 2021 +0100
+++ b/binary-dist-rules.mk	Sun Jan 31 18:38:38 2021 +0100
@@ -118,11 +118,21 @@
       cp $(TOP_DIR)/installer-files/octave-firsttime.vbs $(OCTAVE_DIST_DIR)/
       cp $(TOP_DIR)/installer-files/fc_update.bat $(OCTAVE_DIST_DIR)/
       cp $(TOP_DIR)/installer-files/post-install.bat $(OCTAVE_DIST_DIR)/
+      # This patch can be dropped as soon as those lines are removed from
+      # the startup scripts for all targets (including stable and release).
+      if [ "$(OCTAVE_TARGET)" = "default-octave" ]; then \
+        (cd '$(OCTAVE_DIST_DIR)' && $(PATCH) -p1 -u) < $(TOP_DIR)/installer-files/octave-no-short-path.patch; \
+      fi
       cp $(TOP_BUILD_DIR)/HG-ID $(OCTAVE_DIST_DIR)/
       echo "  updating octave .exe to script files..."
       rm -f $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave.exe
       rm -f $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave-$($(OCTAVE_TARGET)_VERSION).exe
       cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave.bat
+      # This patch can be dropped as soon as those lines are removed from
+      # "octave.bat" for all targets (including stable and release).
+      if [ "$(OCTAVE_TARGET)" = "default-octave" ]; then \
+        (cd '$(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin' && $(PATCH) -p1 -u) < $(TOP_DIR)/installer-files/octave-bat-no-short-path.patch; \
+      fi
       cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave-$($(OCTAVE_TARGET)_VERSION).bat
       echo "  updating libtool references..."
       find '$(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/' -type f -name "*.la" \
@@ -132,6 +142,9 @@
         -exec $(SED) -i 's|$(HOST_PREFIX)|/usr|g;s|$(BUILD_TOOLS_PREFIX)|/usr|g' {} \; ;
       if [ "$(ENABLE_DEVEL_TOOLS)" = "yes" ]; then \
         cp $(TOP_DIR)/installer-files/cmdshell.bat $(OCTAVE_DIST_DIR)/; \
+        if [ "$(OCTAVE_TARGET)" = "default-octave" ]; then \
+          (cd '$(OCTAVE_DIST_DIR)' && $(PATCH) -p1 -u) < $(TOP_DIR)/installer-files/cmdshell-no-short-path.patch; \
+        fi; \
       fi
       echo "  updating script tool references..."
       #find '$(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin' -type f ! -name "*.*" \
--- a/dist-files.mk	Sun Jan 31 18:10:25 2021 +0100
+++ b/dist-files.mk	Sun Jan 31 18:38:38 2021 +0100
@@ -1072,15 +1072,18 @@
 
 INSTALL_FILES_1 := \
   cmdshell.bat \
+  cmdshell-no-short-path.patch \
   post-install.bat \
   fc_update.bat \
   gpl-3.0.txt \
   octave.bat \
   octave.bmp \
   octave.vbs \
+  octave-bat-no-short-path.patch \
   octave-firsttime.vbs \
   octave-hdr.bmp \
   octave-logo.ico \
+  octave-no-short-path.patch \
   post-install.bat \
   README.html
 INSTALL_FILES := $(addprefix installer-files/, $(INSTALL_FILES_1))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/installer-files/cmdshell-no-short-path.patch	Sun Jan 31 18:38:38 2021 +0100
@@ -0,0 +1,28 @@
+# HG changeset patch
+# User Markus Mützel <markus.muetzel@gmx.de>
+# Date 1612087592 -3600
+#      Sun Jan 31 11:06:32 2021 +0100
+# Node ID f08191da8e416c32d950679a78fe194e2753372e
+# Parent  fea266f67443b890a67f80336aee03c40d3a1faa
+Don't use short paths (bug #59923).
+
+diff -r fea266f67443 -r f08191da8e41 cmdshell.bat
+--- a/cmdshell.bat	Sun Jan 31 10:59:32 2021 +0100
++++ b/cmdshell.bat	Sun Jan 31 11:06:32 2021 +0100
+@@ -2,16 +2,11 @@
+ 
+ set OCTAVE_HOME=%~dp0
+ Rem NOTE: OCTAVE_HOME has a end \
+-Rem convert to 8.3 format
+-for %%I in ("%OCTAVE_HOME%") do set OCTAVE_HOME=%%~sI
+ 
+ Rem set home if not already set
+ if "%HOME%"=="" set HOME=%USERPROFILE%
+ if "%HOME%"=="" set HOME=%HOMEDRIVE%%HOMEPATH%
+ 
+-Rem set HOME to 8.3 format
+-for %%I in ("%HOME%") do set HOME=%%~sI
+-
+ set MSYSDIR=%OCTAVE_HOME%
+ set MSYSTEM=MSYS
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/installer-files/octave-bat-no-short-path.patch	Sun Jan 31 18:38:38 2021 +0100
@@ -0,0 +1,30 @@
+# HG changeset patch
+# User Markus Mützel <markus.muetzel@gmx.de>
+# Date 1612087592 -3600
+#      Sun Jan 31 11:06:32 2021 +0100
+# Node ID f08191da8e416c32d950679a78fe194e2753372e
+# Parent  fea266f67443b890a67f80336aee03c40d3a1faa
+Don't use short paths (bug #59923).
+
+diff -r fea266f67443 -r f08191da8e41 octave.bat
+--- a/octave.bat	Sun Jan 31 10:59:32 2021 +0100
++++ b/octave.bat	Sun Jan 31 11:06:32 2021 +0100
+@@ -8,9 +8,6 @@
+ Rem   Note: the result ends with a backslash.
+ set OCT_HOME=%~dp0\.\..\
+ set ROOT_PATH=%~dp0\.\..\..\
+-Rem Convert to 8.3 format so we don't have to worry about spaces.
+-for %%I in ("%OCT_HOME%") do set OCT_HOME=%%~sI
+-for %%I in ("%ROOT_PATH%") do set ROOT_PATH=%%~sI
+ 
+ set MSYSTEM=MSYS
+ set MSYSPATH=%OCT_HOME%
+@@ -44,8 +41,6 @@
+ Rem set home if not already set
+ if "%HOME%"=="" set HOME=%USERPROFILE%
+ if "%HOME%"=="" set HOME=%HOMEDRIVE%%HOMEPATH%
+-Rem set HOME to 8.3 format
+-for %%I in ("%HOME%") do set HOME=%%~sI
+ 
+ Rem   Check for args to determine if GUI (--gui, --force-gui)
+ Rem   or CLI (--no-gui) should be started.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/installer-files/octave-no-short-path.patch	Sun Jan 31 18:38:38 2021 +0100
@@ -0,0 +1,70 @@
+# HG changeset patch
+# User Markus Mützel <markus.muetzel@gmx.de>
+# Date 1612087592 -3600
+#      Sun Jan 31 11:06:32 2021 +0100
+# Node ID f08191da8e416c32d950679a78fe194e2753372e
+# Parent  fea266f67443b890a67f80336aee03c40d3a1faa
+Don't use short paths (bug #59923).
+
+diff -r fea266f67443 -r f08191da8e41 octave-firsttime.vbs
+--- a/octave-firsttime.vbs	Sun Jan 31 10:59:32 2021 +0100
++++ b/octave-firsttime.vbs	Sun Jan 31 11:06:32 2021 +0100
+@@ -21,11 +21,6 @@
+   OctavePath = OctavePath & "\mingw32" 
+ End If
+ 
+-' get path as a 8.3 path
+-Set fo = fso.GetFolder(OctavePath)
+-OctavePath = fo.ShortPath
+-Set fo = Nothing
+-
+ ' set up path to ensure octave bin comes first
+ Set wshSystemEnv = wshShell.Environment( "PROCESS" )
+ if OctavePath <> MSysPath Then
+@@ -42,9 +37,6 @@
+ 
+ If wshShell.ExpandEnvironmentStrings("%HOME%") = "%HOME%" Then
+   Home = wshSystemEnv("USERPROFILE")
+-  Set fo = fso.GetFolder(Home)
+-  wshSystemEnv("HOME") = fo.ShortPath
+-  Set fo = Nothing
+ End If
+ 
+ ' set Qt plugin directory and path 
+diff -r fea266f67443 -r f08191da8e41 octave.vbs
+--- a/octave.vbs	Sun Jan 31 10:59:32 2021 +0100
++++ b/octave.vbs	Sun Jan 31 11:06:32 2021 +0100
+@@ -21,11 +21,6 @@
+   OctavePath = OctavePath & "\mingw32" 
+ End If
+ 
+-' get path as a 8.3 path
+-Set fo = fso.GetFolder(OctavePath)
+-OctavePath = fo.ShortPath
+-Set fo = Nothing
+-
+ ' set up path to ensure octave bin comes first
+ Set wshSystemEnv = wshShell.Environment( "PROCESS" )
+ if OctavePath <> MSysPath Then
+@@ -43,9 +38,6 @@
+ 
+ If wshShell.ExpandEnvironmentStrings("%HOME%") = "%HOME%" Then
+   Home = wshSystemEnv("USERPROFILE")
+-  Set fo = fso.GetFolder(Home)
+-  wshSystemEnv("HOME") = fo.ShortPath
+-  Set fo = Nothing
+ End If
+ 
+ ' set Qt plugin directory and path 
+diff -r fea266f67443 -r 64ff1a717a28 post-install.bat
+--- a/post-install.bat	Sun Jan 31 10:59:32 2021 +0100
++++ b/post-install.bat	Sun Jan 31 11:16:33 2021 +0100
+@@ -1,8 +1,6 @@
+ @echo off
+ Rem   Run on initial install /update
+ set ROOT_DIR=%~dp0
+-Rem Convert to 8.3 format so we don't have to worry about spaces.
+-for %%I in ("%ROOT_DIR%") do set ROOT_DIR=%%~sI
+ 
+ set MSYSDIR=%ROOT_DIR%
+ set MSYSTEM=MSYS