Opened 12 years ago

Last modified 10 years ago

#11021 closed defect

clean up sage-spkg — at Version 5

Reported by: John Palmieri Owned by: tbd
Priority: major Milestone: sage-5.3
Component: packages: standard Keywords: SPKG.txt SAGE.txt -info BUILD sage-env sage-sage sage-spkg
Cc: David Kirkby, Leif Leonhardy, François Bissey Merged in:
Authors: Leif Leonhardy Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Kelvin Li)

One of the patches at #9960 did a lot of clean-up to the file sage-spkg: quoting environment variables, replacing tabs with spaces, etc. Since those changes were not related to the issue at #9960, I've split them off and put them here instead. The main change of any content is to look at the file SPKG.txt rather than SAGE.txt when the "-info" flag is passed so sage-spkg.


  1. trac_11021-sage-spkg-cleanup-v2.patch to scripts repo

Change History (5)

comment:1 Changed 12 years ago by John Palmieri

Status: newneeds_review

comment:2 Changed 11 years ago by Kelvin Li

Patch has been rebased to sage 4.7. However, there is a problem on lines 136-143 in sage-spkg (after patch has been applied). The return code check doesn't do anything after the statement echo "", because that overwrites $? to 0. I can't figure out the intent of the preceding tar command, so I don't know how to fix this problem. Could someone help me?

comment:3 Changed 11 years ago by Kelvin Li

Description: modified (diff)

comment:4 Changed 11 years ago by Leif Leonhardy

Well, the code is a bit weird anyway; there should be an exit 1 if the package ($PKG_SRC) does not exist:

if [ "$INFO" -ne 0 ]; then
    if [ ! -f "$PKG_SRC" ]; then
        echo "Package $PKG_NAME not found"
        # EXIT HERE

I don't think we really need the echo "", since SPKG.txt files should be newline-terminated. (The tar commands extract this file to stdout.)

As far as I know, there are indeed (at least some old, optional) packages that do have a short SAGE.txt (rather than SPKG.txt), so I'm not sure if we shouldn't check for both.

Also, typical SPKG.txt files are quite long, so we might omit some parts or e.g. "cut" them where the Changelog section starts.

comment:5 Changed 11 years ago by Kelvin Li

Description: modified (diff)

Leif, I have updated the patch according to your first two suggestions. I don't know what to do with SAGE.txt or truncating long SPKG.txt files. I'm thinking that we should put those "real" changes in another ticket (or does one already exist?).

Note: See TracTickets for help on using tickets.