bugGNU Octave - Bugs: bug #39392, geometry package:...

 
 

bug #39392: geometry package: loading/unloading the package may clobber user variables

Submitted by:  Rafael Laboissiere <rlaboiss>
Submitted on:  Tue 02 Jul 2013 06:40:56 AM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sun 28 Jul 2013 09:23:33 PM UTC, comment #5:

It is a good idea.
I will do this asap.

Cheers

Juan Pablo Carbajal <juanpi>
Sun 28 Jul 2013 06:50:40 PM UTC, comment #4:

Yes, this is an elegant solution. I would just suggest to use "internal" names like _pkg_add_geometry_ and __pkg_del_geometry.

Rafael Laboissiere <rlaboiss>
Sun 28 Jul 2013 06:33:26 PM UTC, comment #3:

The function would be in the very own PKG_ADD script. All of it could be turned into a functin which is then called at the end, i.e., the PKG_ADD file becomes

Carnë Draug <carandraug>
Project Member
Wed 03 Jul 2013 05:45:56 PM UTC, comment #2:

I have thought about this, but where would such a function be placed?

Rafael Laboissiere <rlaboiss>
Wed 03 Jul 2013 03:46:47 PM UTC, comment #1:

Maybe an even "cleaner" alternative could be to place the whole code in PKG_ADD into a function, which is just called at the end of it?

Carnë Draug <carandraug>
Project Member
Tue 02 Jul 2013 06:40:56 AM UTC, original submission:

When loading/unloading the geometry package, some variables defined by the users may be clobbered, like in the example below:

This happens because the scripts PKG_{ADD,DEL} use and clear a series of variables. One possible solution for the problem is provided in the patch attached to this bug report. This patch is pretty minimal and just wraps the commands in both PKG_ADD and PKG_DEL inside functions with quite "unlikely" names _geometry_pkg{add,del}__, which are called afterwards. These functions are cleared at the end of the scripts.

This problem also affects other Octave-Forge packages. I will try to track them down soon.

Rafael Laboissiere <rlaboiss>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #28475:  unintrusive-pkg-add-del.patch added by rlaboiss (1kB - text/x-patch - Patch for PKG_ADD and PKG_DEL)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by juanpi (Posted a comment)
  • -unavailable- added by carandraug (maintainer of geometry package)
  • -unavailable- added by rlaboiss (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 03 Jul 2013 03:44:13 PM UTCcarandraugCarbon-Copy-=>Added -unavailable-
    Tue 02 Jul 2013 06:40:56 AM UTCrlaboissAttached File-=>Added unintrusive-pkg-add-del.patch, #28475

    Back to the top


    Powered by Savane 3.1-cleanup