Opened 7 years ago

Closed 7 years ago

#14303 closed enhancement (fixed)

"sage -i" should only run sage-location if it exists

Reported by: jhpalmieri Owned by: GeorgSWeber
Priority: minor Milestone: sage-5.9
Component: build Keywords: sage-location
Cc: jdemeyer Merged in: sage-5.9.beta1
Authors: John Palmieri Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jhpalmieri)

During Sage installation, I sometimes see an spkg fail to build, for example zn_poly. Then I run

$ ./sage -i spkg/standard/zn_poly-0.9.p10.spkg

If this installs successfully, it still has a return code of 127 (on OS X, at least), because the installation runs sage-location at the end, which hasn't been installed yet. So perhaps sage -i ... should only run sage-location if it already exists. This way something like

$ make || ./sage -i spkg/standard/zn_poly-0.9.p10.spkg && make ptestlong

might work the way I want, and building Sage would require less babysitting.

Attachments (1)

trac_14303-location.patch (825 bytes) - added by jhpalmieri 7 years ago.
root repo

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by jhpalmieri

  • Status changed from new to needs_review

Here's a first patch. I wouldn't be surprised if there were better ways of doing this.

comment:2 Changed 7 years ago by jdemeyer

You should check Python also. I would go for

if [ -x "$SAGE_LOCAL/bin/python" -a -x "$SAGE_LOCAL/bin/sage-location" ]

comment:3 Changed 7 years ago by jdemeyer

Just for completeness, you could also use the more "Pythonic"

sage-location
status=$?
if [ $status -eq 126 -o $status -eq 127 ]; then
    # Python or sage-location doesn't exist
    exit 0
fi
exit $status

but I wouldn't, since it might use system Python if Sage's Python isn't installed and you would still an error message if it fails to run sage-location.

Changed 7 years ago by jhpalmieri

root repo

comment:4 Changed 7 years ago by jhpalmieri

  • Description modified (diff)

Here's a new patch, using if [ -x "$SAGE_LOCAL/bin/python" -a -x "$SAGE_LOCAL/bin/sage-location" ]....

comment:5 Changed 7 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to positive_review

comment:6 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.9.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.