patch and ChangeLog for load-path.cc

Ben Abbott bpabbott at mac.com
Sun Jan 6 22:15:22 CST 2008


On Jan 5, 2008, at 11:33 AM, Ben Abbott wrote:

>
> On Jan 5, 2008, at 4:06 AM, John W. Eaton wrote:
>
>>
>> Yes, please send the complete proposed patch.
>>
>> Thanks,
>>
>> jwe
>
>
> The patch for the modified files is attached. All new files belong  
> in .../octave/scripts/path/
>
> Should the patch include changes to the "SOURCES" in .../octave/ 
> scripts/path/Makefile.in?
>
> The one remaining change is to .../<octave-version>/m/startup/ 
> octaverc. This file needs to have the line below added, but I  
> couldn't determine how to do that.
>
> atexit ('__finish__');
>
> Perhaps it is more appropriate to add that line to .../site/m/ 
> startup/octaverc, but I'm not familar with why these two files exist.
>
> <path.patch>
>
> <ChangeLog>
> <path-scripts.tar.gz>

I found how to patch the octaverc file's content, and rebuilt my local  
version using the attached patch, and decided it best to add more  
detail so as to reduce the effort required to apply these changes ...  
To be clear the "changes" did not change from the prior patch. I've  
just tried to be more clear and thorough.

This was my procedure for applying the changes to my local project:
	* Patch existing sources with "existing-files.patch". The files
	patched are listed below, no changes for either Makefile.in.
		- src/laod-save.cc
		- scripts/startup/main-rcfile
		- scripts/path/savepath.m
	* Build and install octave
	* Add the new files
		- scripts/startup/__finish__.m
		- scripts/path/__extractpath__.m
		- scripts/path/matlabroot.m
		- scripts/path/pathdef.m

If I understand correctly, the cvs will also require changes to the  
pair Makefile.in files  below.
	* Additional changes to cvs include
		- scripts/path/Makefile.in: add __extractpath__.m,
		matlabroot.m, and pathdef.m to SOURCES
		- scripts/startup/Makefile.in: add __finish__.m to SOURCES
		
Upon running my patched octave, I received the errors associated with  
having used "savepath" from my earlier version, the 3.0.0 release.

> warning: addpath: /sw/lib/octave/3.0.0/oct/i386-apple-darwin9.1.0:  
> No such file or directory
> warning: addpath: /sw/share/octave/3.0.0/m: No such file or directory
> [...]
> warning: addpath: /sw/share/octave/3.0.0/m/testfun: No such file or  
> directory
> warning: addpath: /sw/share/octave/3.0.0/m/time: No such file or  
> directory

Issuing "restoredefaultpath" fixed the path.

To avoid this problem in the next session, I typed "savepath" which  
replied

> warning: savepath: current path saved to /Users/bpabbott/.octaverc

I then manuvered to a directory withe a finish.m script containing a  
single line "disp('Good-Bye!')", and typed "exit" ... octave exited  
cleanly and replied "Good-Bye!"

When starting octave again, the path showed up correctly.

Some additional checks;

> octave:2> matlabroot
> ans = /sw
> octave:3> pathdef
> ans = .:/sw/share/octave/site/m:/sw/share/octave/site/m/startup:/sw/ 
> lib/octave/3.0.0+/oct/i386-apple-darwin9.1.0:/sw/share/octave/3.0.0+/ 
> m: [...] :/sw/share/octave/3.0.0+/m/time

All appears to work as intended. The ChangeLog is below, and the patch  
is attached. Again this patch is the same as the prior, but with the  
change to main-rcfile (octaverc) included.

2008-01-07  Ben Abbott <bpabbott at mac.com>

	* load-path.cc (F__pathorig__): Rename from Fpathdef.
	(Frestoredefaultpath): New function.
	* path/savepath.m: Added a warning in the event the file
	modified is not explicitly specified by the user.
	* scripts/startup/main-rcfile: Modified to add a call to
	__finish__.m upon a clean exit from Octave.
	finish.m if it exists in the path.
	* path/pathdef.m: New script, which returns the default
	path.
	* path/__extractpath__.m: New script.
	* scripts/startup/__finish__.m: New function which runs
	* path/matlabroot.m: New script.

Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: existing-files.patch
Type: application/octet-stream
Size: 3128 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080107/79136e45/attachment-0001.obj 
-------------- next part --------------



More information about the Octave-maintainers mailing list