any impacts of adding this line to default .octaverc ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

any impacts of adding this line to default .octaverc ?

NJank
(related to bug 51632, about Windows users not knowing they have to run a pkg rebuild if they use the (sort of portable) zip installer:

would it ever cause problems if Octave was set to run a 'pkg rebuild' on startup if it detected there was no global octave_packages file?  Seems to be the simplest way to modify that build to remove the need for the manual operation.

something like:

if (isempty(file_in_path(fullfile(OCTAVE_HOME(), "share", "octave", "packages"), "octave_packages")))
  pkg rebuild;
endif


or

if (exist(pkg("global_list"),"file") == 0)
  pkg rebuild;
endif
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

Philip Nienhuis
NJank wrote
(related to bug 51632, about Windows users not knowing they have to run a
pkg rebuild if they use the (sort of portable) zip installer:

would it ever cause problems if Octave was set to run a 'pkg rebuild' on
startup if it detected there was no global octave_packages file?  Seems to
be the simplest way to modify that build to remove the need for the manual
operation.

something like:

if (isempty(file_in_path(fullfile(OCTAVE_HOME(), "share", "octave",
"packages"), "octave_packages")))
  pkg rebuild;
endif


or

if (exist(pkg("global_list"),"file") == 0)
  pkg rebuild;
endif


https://savannah.gnu.org/bugs/index.php?51632
There's always a remote possibility that the unzipped Octave installation is in a read-only location. In that case octave_packages cannot be created in OCTAVE_HOME. A simple try-catch around the "pkg rebuild" line could serve as a band-aid.

Philip
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

NJank
> A simple try-catch around the "pkg rebuild" line could serve as a band-aid.

so something like:

if (exist(pkg("global_list"),"file") == 0)
  try
    pkg rebuild;
  catch
  end_try_catch
endif

would take care of it? the point just being to avoid a nagging error on startup.  I did notice that whenever I do a pkg rebuild I get four "skipping line" messages, and that will come up every time if the case you mentioned occurs. Didn't see a 'quiet' option in pkg help.

I guess the only other problem would be if someone made manual changes to octave_packages that would be overwritten by a 'pkg rebuild'. 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

PhilipNienhuis
NJank wrote
> A simple try-catch around the "pkg rebuild" line could serve as a
band-aid.

so something like:

if (exist(pkg("global_list"),"file") == 0)
  try
    pkg rebuild;
  catch
  end_try_catch
endif

would take care of it? the point just being to avoid a nagging error on
startup.  I did notice that whenever I do a pkg rebuild I get four
"skipping line" messages, and that will come up every time if the case you
mentioned occurs. Didn't see a 'quiet' option in pkg help.

I guess the only other problem would be if someone made manual changes to
octave_packages that would be overwritten by a 'pkg rebuild'.
AFAIK octave_packages is not to be manually edited. So any user / hacker attempting that would do so at his/her own risk anyway.

Philip
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

NJank
Thoughts on whether a patch adding

if (exist(pkg("global_list"),"file") == 0)
  try
    pkg rebuild;
  catch
  end_try_catch
endif

to .octaverc should be something just limited to mxe-octave zip-distribution? all windows builds? Octave as a whole? or "that's a horrible idea come up with something better",  ?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

Rik-4
In reply to this post by NJank
On 08/02/2017 11:35 AM, [hidden email] wrote:
Subject:
Re: any impacts of adding this line to default .octaverc ?
From:
Nicholas Jankowski [hidden email]
Date:
08/02/2017 11:02 AM
To:
PhilipNienhuis [hidden email]
CC:
octave-maintainers [hidden email]
List-Post:
[hidden email]
Precedence:
list
MIME-Version:
1.0
References:
[hidden email] [hidden email] [hidden email] [hidden email]
In-Reply-To:
[hidden email]
Message-ID:
[hidden email]
Content-Type:
multipart/alternative; boundary="001a113acab235a6d40555c912c8"
Message:
2

Thoughts on whether a patch adding

if (exist(pkg("global_list"),"file") == 0)
  try
    pkg rebuild;
  catch
  end_try_catch
endif

to .octaverc should be something just limited to mxe-octave zip-distribution? all windows builds? Octave as a whole? or "that's a horrible idea come up with something better",  ?

I would make the minimal change necessary to fix the problem.  If other systems, like Linux, don't need this line then let's not include it just in case it might cause a problem.  Maybe start out with just applying it to the zip-distribution and see if that is enough.

--Rik



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

Mike Miller-4
In reply to this post by NJank
On Wed, Aug 02, 2017 at 14:02:05 -0400, Nicholas Jankowski wrote:

> Thoughts on whether a patch adding
>
> if (exist(pkg("global_list"),"file") == 0)
>   try
>     pkg rebuild;
>   catch
>   end_try_catch
> endif
>
> to .octaverc should be something just limited to mxe-octave
> zip-distribution? all windows builds? Octave as a whole? or "that's a
> horrible idea come up with something better",  ?
At a minimum, "pkg rebuild" should be "pkg rebuild -global" to match the
test for the "global_list" file.

This should not be put into Octave's default octaverc. It could be added
to the zip distribution to act as a surrogate for a postinstall action,
but even that seems like an unfortunate hack.

If I were a user of the zip distribution, I wouldn't want it to have any
different configuration from an archive of the default package.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

NJank


On Aug 2, 2017 9:03 PM, "Mike Miller" <[hidden email]> wrote:


At a minimum, "pkg rebuild" should be "pkg rebuild -global" to match the
test for the "global_list" file.


Easy enough

This should not be put into Octave's default octaverc. It could be added
to the zip distribution to act as a surrogate for a postinstall action,
but even that seems like an unfortunate hack.

Agreed. 


If I were a user of the zip distribution, I wouldn't want it to have any
different configuration from an archive of the default package.


have yet to come up with another passive solution, which it seems is needed. A lot of people refer to the zip distro as a portable distro. It currently is far from it. If it was made "portable" and marked as such, I don't think mild differences would be upsetting. But we'd have to turn off local user hooks and hard path locations, the latter requirement being the current octave_packages problem.

I played around with whether the provided octave_packages could be written referencing %OCTAVE_HOME%, but didn't get anywhere. Might require pkg patching.

Other suggestions welcome. 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: any impacts of adding this line to default .octaverc ?

NJank
to avoid duplication, conversation moved back to bug tracker.

https://savannah.gnu.org/bugs/index.php?51632
Loading...