bugGNU Octave - Bugs: bug #45872, default site octaverc file still...

 
 

bug #45872: default site octaverc file still executed even if OCTAVE_SITE_INITFILE is defined

Submitted by:  John W. Eaton <jwe>
Submitted on:  Thu 03 Sep 2015 11:25:56 PM UTC  
 
Category: InterpreterSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: jweOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 04 Sep 2015 07:28:59 PM UTC, comment #4:

Works great, including the --verbose option. Closing report.

Rik <rik5>
Project Administrator
Fri 04 Sep 2015 05:47:13 PM UTC, comment #3:

I checked in this change:

http://hg.savannah.gnu.org/hgweb/octave/rev/ac0f7acdc3fd

Also, Octave will tell you which startup files it is executing if you use the --verbose option, though I suppose if there were a bug in that code, inserting the printf statements would help. :-)

John W. Eaton <jwe>
Project Administrator
Fri 04 Sep 2015 04:35:38 PM UTC, comment #2:

Thanks. I agree with renaming the files so the correspondence to the environment variables is clear.

Probably all we need to do to fix the problem I was seeing is also define OCTAVE_VERSION_INITFILE in the run-octave script.

I'll make these changes.

John W. Eaton <jwe>
Project Administrator
Fri 04 Sep 2015 12:32:37 PM UTC, comment #1:

Confirmed.

I instrumented all the rc files including scripts/startup/main-rcfile, scripts/startup/local-rcfile, <OCTAVE_INSTALL_DIR>/share/octave/4.1.0+/m/startup/octaverc, <OCTAVE_INSTALL_DIR>/share/site/m/startup/octaverc, ~/.octaverc, ./.octaverc with the following code:

If I now use the run-octave script I get the following:

This seems to be expected behavior, although not necessarily correct. The run-octave script overrides OCTAVE_SITE_INITFILE which is startup/main-rcfile. But 'make install' places main-rcfile into the versioned site file octave/4.1.0+/m/startup/octaverc. To eliminate running main-rcfile twice the variable OCTAVE_VERSION_INITFILE needs to be pointing somewhere else.

Or, we have had this wrong for several years and the local-rcfile should be placed into the versioned directory and the main-rcfile should be placed in the startup directory.

For clarity, I think it would be a good idea to rename the files from [main|local]-rcfile to [site|version]-rcfile. At least then it will be clear what we are doing with these files.

Rik <rik5>
Project Administrator
Thu 03 Sep 2015 11:25:56 PM UTC, original submission:

If OCTAVE_SITE_INITFILE is defined in the environment, Octave uses that as the site startup file but will also execute the default site init file. I see this problem when using the run-octave script in my build tree when I also have the same development version installed.

I first noticed this when working on bug #45869 because finish.m was being executed twice. I traced that to having _finish_ added twice to the list of atexit functions, once from the octaverc file in the build tree and once from the directory where I had previously installed a copy of Octave from the same sources.

John W. Eaton <jwe>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Sep 2015 07:28:59 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Fri 04 Sep 2015 05:47:13 PM UTCjweStatusConfirmed=>Ready For Test
    Fri 04 Sep 2015 12:32:37 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1