bugGNU Octave - Bugs: bug #36830, Create pkg prefix directory, if it...

 
 

bug #36830: Create pkg prefix directory, if it does not exist

Submitter:  None
Submitted:  Thu 12 Jul 2012 04:48:37 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  jordigh
Originator Name:  Rafael Laboissiere Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 12 Jul 2012 03:21:29 PM UTC, comment #1: 

Thanks. I edited your patch's metadata a little (fixed your name and slightly reworded the commit message), and I pushed it, along with my own fix for checking if the prefix directory can be created:

http://hg.savannah.gnu.org/hgweb/octave/rev/7371e127c351
http://hg.savannah.gnu.org/hgweb/octave/rev/a82fcd612c8f

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 12 Jul 2012 04:48:37 AM UTC, original submission:  

The pkg.m script is smart enough to create the archprefix directory when it is not present in the system (the examples below are run in a Debian GNU/Linux system with Octave 3.6.2 installed):


$ sudo rmdir /usr/lib/i386-linux-gnu/octave/packages/
$ sudo octave --silent --no-history --no-init-file --no-window-system --eval "pkg ('rebuild');"
warning: creating the directory /usr/lib/i386-linux-gnu/octave/packages/


This is not the case for the prefix directory:


$ sudo rmdir /usr/share/octave/packages
$ sudo octave --silent --no-history --no-init-file --no-window-system --eval "pkg ('rebuild');"
error: could not find the file or path /usr/share/octave/packages
error: called from:
error:   /usr/share/octave/3.6.2/m/pkg/pkg.m at line 1234, column 5
error:   /usr/share/octave/3.6.2/m/pkg/pkg.m at line 418, column 16
error:   /usr/share/octave/3.6.2/m/startup/octaverc at line 26, column 1


The trivial patch attached to this bug report fixes this issue.

Note that this problem has been reported as Bug##681064 against the Debian package octave.  In the discussion around that bug report in Debian, Jordi GutiĆ©rrez suggested that the code has to be improved anyway ("What if creating the directory fails? Or do we know at that point that this is a writable location?").  I think I agree with him, but the changes need to be done to both the prefix- and the archprefix-related code in pkg.m

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #26182:  create-pkg-prefix-dir.diff added by None (897B - text/x-patch - Patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by None (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.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-12 jordigh StatusNone Fixed
        Assigned toNone jordigh
        Open/ClosedOpen Closed
    2012-07-12 None Attached File- Added create-pkg-prefix-dir.diff, #26182

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code