Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update developer guide for SPKGs #12609

Closed
jdemeyer opened this issue Feb 29, 2012 · 18 comments
Closed

Update developer guide for SPKGs #12609

jdemeyer opened this issue Feb 29, 2012 · 18 comments

Comments

@jdemeyer
Copy link

This ticket is about updating the developer guide for #10492.

The developer guide suggests (http://sagemath.org/doc/developer/producing_spkgs.html#the-file-spkg-txt)

      If your package depends on another package, say boehmgc, then you should check that this other package has been installed. Your spkg-install script should check that it exists, with code like the following:

      BOEHM_GC=`cd $SAGE_ROOT/spkg/standard/; ./newest_version boehm_gc`
      if [ $? -ne 0 ]; then
          echo "Failed to find boehm_gc.  Please install the boehm_gc spkg"
          exit 1
      fi

This is totally wrong. It only checks that a spkg exists, not that it has been installed. See #12608 for removing this wrong checking from PPL.

The patches below also include various fixes to "Producing New Sage Packages".

Apply attachment: trac_12609-doc-developer.patch and attachment: 12609_review.patch to the main Sage library.

Depends on #10492

Component: documentation

Author: John Palmieri, Jeroen Demeyer

Reviewer: Jeroen Demeyer, John Palmieri

Merged: sage-5.0.beta10

Issue created by migration from https://trac.sagemath.org/ticket/12609

@jdemeyer

This comment has been minimized.

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri

This comment has been minimized.

@jdemeyer
Copy link
Author

jdemeyer commented Mar 6, 2012

comment:3

This is almost good, but you should also provide a way to check that a package has been installed, regardless of its version number. I was thinking along the lines of (not tested!)

if ! ls "$SAGE_ROOT"/spkg/installed/PACKAGE-* &>/dev/null; then
    echo >&2 "Package PACKAGE is required; please install it."
    exit 1
fi

@jhpalmieri
Copy link
Member

comment:4

Here's a new version which uses grep. The fricas example works in my testing.

@jdemeyer
Copy link
Author

jdemeyer commented Mar 6, 2012

comment:5

I guess you're missing a negation there (you're failing if the package is found).

Don't use grep -q, it's not portable. Instead use grep >/dev/null. Finally, your regular expression is probably too complicated, I think

grep '^fricas-.*' >/dev/null

should suffice. Your counterexample fricasaldor-1.0.9 doesn't match it!

To be very safe, use ls -1 instead of a plain ls.

@jhpalmieri
Copy link
Member

comment:6

Okay, fixed.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

jdemeyer commented Mar 7, 2012

comment:7

Attachment: trac_12609-doc-developer.patch.gz

@jdemeyer
Copy link
Author

jdemeyer commented Mar 7, 2012

Changed author from John Palmieri to John Palmieri, Jeroen Demeyer

@jdemeyer
Copy link
Author

jdemeyer commented Mar 7, 2012

Reviewer: Jeroen Demeyer

@jdemeyer
Copy link
Author

jdemeyer commented Mar 7, 2012

comment:8

Reviewer patch (apply on top of first patch) needs review.

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:9

I wouldn't mind a change like the following, but with or with this the reviewer patch gets a positive review.

diff --git a/doc/en/developer/producing_spkgs.rst b/doc/en/developer/producing_spk
--- a/doc/en/developer/producing_spkgs.rst
+++ b/doc/en/developer/producing_spkgs.rst
@@ -34,7 +34,8 @@ Sage packages are distributed as ``.spkg
 to discourage confusion. Although Sage packages are packed using tar
 and/or bzip2, note that ``.spkg`` files contain control information
 (installation scripts and metadata) that are necessary for building
-and installing them.  When you compile Sage from a source distribution,
+and installing them.  When you compile Sage from a source
+distribution, or when you run ``sage -i <pkg>`` or ``sage -f <pkg>``,
 the file ``SAGE_ROOT/spkg/bin/sage-spkg`` takes care of the unpacking,
 compilation, and installation of Sage packages for you. You can
 type

@jhpalmieri
Copy link
Member

Changed reviewer from Jeroen Demeyer to Jeroen Demeyer, John Palmieri

@jdemeyer
Copy link
Author

jdemeyer commented Mar 8, 2012

Dependencies: #10492

@jdemeyer jdemeyer removed this from the sage-5.0 milestone Mar 8, 2012
@jdemeyer
Copy link
Author

comment:11

Attachment: 12609_review.patch.gz

@jdemeyer
Copy link
Author

Merged: sage-5.0.beta10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants