bugGNU Octave - Bugs: bug #64263, [octave-forge](matgeom) fails...

 
 

bug #64263: [octave-forge](matgeom) fails renaming verLessThan.m

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Mon 29 May 2023 11:13:02 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 8.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 20 Mar 2024 10:42:19 AM UTC, comment #4: 

I thought that I remembered looking into this at some point in the past. And indeed, we apply the following patch in MXE Octave:
https://hg.octave.org/mxe-octave/file/tip/src/of-matgeom-1-move-verLessThan.patch

From c0de561fee4b5fc2efd6dae79ec5ae2c78761ac6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de>
Date: Sun, 17 Sep 2023 17:10:19 +0200
Subject: [PATCH] Add dummy verLessThan only to path for older Octave versions.

---
 .../inst/__matgeom_package_register__.m       | 19 ++++++++-----------
 .../inst/{ => before-octave-6}/verLessThan.m  |  0
 2 files changed, 8 insertions(+), 11 deletions(-)
 rename inst/{ => before-octave-6}/verLessThan.m (100%)

diff --git a/inst/__matgeom_package_register__.m b/inst/__matgeom_package_register__.m
index 1258759..afe9d62 100644
--- a/inst/__matgeom_package_register__.m
+++ b/inst/__matgeom_package_register__.m
@@ -33,22 +33,19 @@ function subdir_paths = __matgeom_package_register__ (loading = 0)

   if (loading > 0)

-    ## Disable dummy verLessThan.m
-    if compare_versions (version, '6.0.0', '>=')
-      ## Check if this package still has varLessThan
-      pkgverchecker = fullfile (base_pkg_path, 'verLessThan.');
-      if exist ([pkgverchecker, 'm'], 'file')
-        warning ('Octave:deprecated-function',
-            'Permanently renaming verLessThan.m since it is already present');
-        ## The change is permanent and done only once
-        ## Means that if testing in older version of Octave, needs re-install
-        rename([pkgverchecker, 'm'], [pkgverchecker, 'deprecated']);
-      endif
+    if compare_versions (version, '6.0.0', '<')
+      ## Add path to dummy verLessThan.m only for older versions of Octave
+      addpath (fullfile (base_pkg_path, "before-octave-6"));
     endif

     addpath (subdir_paths{:});

   elseif (loading < 0)
+    if compare_versions (version, '6.0.0', '<')
+      ## Path to dummy verLessThan.m only added for older versions of Octave
+      rmpath (fullfile (base_pkg_path, "before-octave-6"));
+    endif
+
     rmpath (subdir_paths{:});
   endif

diff --git a/inst/verLessThan.m b/inst/before-octave-6/verLessThan.m
similarity index 100%
rename from inst/verLessThan.m
rename to inst/before-octave-6/verLessThan.m
--
2.38.0.windows.1


A similar patch would probably also work in the repository.

Markus Mützel <mmuetzel>
Group administrator
Tue 19 Mar 2024 06:42:44 PM UTC, comment #3: 

Ok, that could be a solution. What folder can be safely assume to exist in all platforms, the .octave folder in the user home?

Juan Pablo Carbajal <juanpi>
Group Member
Mon 18 Mar 2024 07:35:52 AM UTC, comment #2: 

This issue is probably not Windows-specific. It should be happening on any platform if matgeom is installed in a location that is read-only for the user that is running Octave.

A possible fix could be to move the affected files to a separate folder that is only added to the load path for Octave versions that need those files.

The "statistics" package is using that approach for some files:
https://github.com/gnu-octave/statistics/blob/59151d5631669bfe32e6dcfa6abd111a1a6ca1ff/inst/PKG_ADD#L1

Markus Mützel <mmuetzel>
Group administrator
Fri 15 Mar 2024 07:35:50 PM UTC, comment #1: 

Is there a workaround this issue?
What alternative solution can there be that is platform independent?
I do not have access to Windows machine, so I cannot try this directly.

Thanks

Juan Pablo Carbajal <juanpi>
Group Member
Mon 29 May 2023 11:13:02 PM UTC, original submission:  

matgeon on the first run tries to rename its own verLessThan.m
file if it already present in the octave proper.
This would fail if octave (on windows) installed with admin privileges ("for everyone using this computer").

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code