#9433: Put more files under revision control.
------------------------------+---------------------------------------------
   Reporter:  jhpalmieri      |       Owner:  tbd         
       Type:  enhancement     |      Status:  needs_review
   Priority:  major           |   Milestone:  sage-4.6.1  
  Component:  distribution    |    Keywords:              
     Author:  John Palmieri   |    Upstream:  N/A         
   Reviewer:  Leif Leonhardy  |      Merged:              
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by leif):

 Replying to [comment:67 jhpalmieri]:
 > Replying to [comment:64 leif]:
 > > We '''have to''' download `spkg/install` (and I'd prefer the rest,
 too) in `sage-update` (the Python script).
 >
 > I'm not sure what "the rest" refers to here.

 Well, the files that were previously downloaded (`deps` and
 `newest_version`, too). But also downloading `sage-env` (and e.g. `sage-
 spkg`) is not a bad idea.

 (I also plan to download `upgrade-notes.txt` and `pre-upgrade-script.sh`
 first, such that the user (and we) can make an informed choice.)

 [[BR]]
 > > What's currently newly made in `sage-upgrade` should be moved to that
 file, which is in any case the fresh, downloaded one. ''There'' we have to
 make a distinction on if we are upgrading.
 >
 > Okay, I think I can do that.
 >
 > > If so, `spkg/install` should then install the root repo (preferably
 without overwriting itself, but the root repo should, i.e. must, contain
 exactly the same file), since our "real" Makefile `spkg/standard/deps`
 doesn't (though I don't know why you don't want to put the root spkg
 there).
 >
 > I don't want to put it there because in a non-upgrade, it's already
 installed as part of the download.

 Well, then `hg pull` would simply be a no-op. But we should check the exit
 codes of the commands in `root-spkg-install` (`hg` and `cp`) anyway.

 `hg incoming <source repo>` returns 1 if there's nothing to pull, 0 if
 there are changes to pull, other values on errors, so you could change it
 to:
 {{{
 #!sh
 ...
 if [ -d "$TARGET"/.hg ]; then

     # Merge the repository, rather than overwrite changes that the
     # user may have made.
     cd "$TARGET"
     hg ci  # Don't know if we should check in unconditionally,
            # so perhaps move this below the if-elif-fi.
     # should check for errors here

     hg incoming "$CUR"  # perhaps redirect output
     if [ $? -eq 1 ]; then
         # No changes to pull
         exit 0
     elif [ $? -ne 0 ]; then
         # Some error, report...
         exit 1
     fi
     # $? = 0: Changes to pull...
     hg pull "$CUR"
     hg merge tip
     hg ci -m "Check-in during upgrade of Sage."
     hg update
     # Add error checks above, too.

 else
     ...
 }}}

 (Or you could add a rule to `deps` that tests its presence / the need to
 pull first, before calling `sage-spkg`. But if we one day generate `deps`,
 this would be less optimal.)

 [[BR]]
 > > Btw, it would be better to also have `sage-spkg` in the root rather
 than the scripts repo; or download an identical copy (from the scripts
 repo) along with `install`, `deps` etc.
 >
 > That's not a bad idea, but it should go on another ticket.  What about
 the other scripts in spkg/base, for example sage-env?

 Yes, see above. Once we have this ticket in, it will be easier (or at
 least safer) to make such changes. :-)


 P.S.: I wonder if the presence of `$SAGE_ROOT/.hg` guarantees us a
 functional Mercurial... ;-)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9433#comment:68>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to