Ticket #633 (closed defect: fixed)

Opened 1 year ago

Last modified 5 months ago

spkg-[install|check] should verify that SAGE_LOCAL is defined

Reported by: mabshoff Assigned to: mabshoff
Priority: major Milestone: sage-3.1
Component: packages Keywords: spkg-install, spkg-check
Cc:

Description

When building spkgs manually by invoking spkg-install on the shell I oftern do not have sage-env sourced. Consequently odd things happen:

[mabshoff@m940 mpfr-2.2.1.p1]$ ./spkg-install
./spkg-install: line 16: [: =: unary operator expected

We ought to verify that at least SAGE_LOCAL is non-empty. If it is empty print a warning message and exit.

To fix this we need to touch every spkg-install in the tree which is more that 75 scripts. So while we are at it we should also add spkg-check scripts to each spkg while we are at it.

Cheers,

Michael

Change History

10/18/2007 06:33:20 AM changed by mabshoff

  • status changed from new to assigned.

01/26/2008 02:24:42 AM changed by mabshoff

I suggest adding the following to the top of all spkg-install and spkg-check scripts:

if [ "$SAGE_LOCAL" = "" ]; then
   echo "SAGE_LOCAL undefined ... exiting";
   exit 1
fi

Cheers,

Michael

01/27/2008 05:33:01 AM changed by was

Wouldn't it be useful to also give a hint about what the user should do, e.g., something like:

if [ "$SAGE_LOCAL" = "" ]; then
   echo "SAGE_LOCAL undefined ... exiting";
   echo "Maybe run 'sage -sh'?"
   exit 1
fi

07/30/2008 08:23:37 PM changed by mabshoff

  • status changed from assigned to closed.
  • resolution set to fixed.
  • milestone changed from sage-3.1.1 to sage-3.1.

I have been adding the above code snippet to every spkg that I have touched in the last couple month and I assume all of them have been fixed. If there is any more specific spkg with issue it should be dealt with at its own ticket.

Cheers,

Michael