#10156: Rename makefile to Makefile
--------------------------------------------------------+-------------------
   Reporter:  jdemeyer                                  |       Owner:  tbd     
         
       Type:  enhancement                               |      Status:  
needs_work       
   Priority:  minor                                     |   Milestone:  
sage-4.6.1       
  Component:  distribution                              |    Keywords:  scripts 
makefile 
     Author:  Jeroen Demeyer                            |    Upstream:  N/A     
         
   Reviewer:                                            |      Merged:  
sage-4.6.1.alpha0
Work_issues:  copy makefile to Makefile during upgrade  |  
--------------------------------------------------------+-------------------

Comment(by jhpalmieri):

 Replying to [comment:14 jdemeyer]:
 > Replying to [comment:13 leif]:
 > > Replying to [comment:12 jdemeyer]:
 > > > I don't understand the fine details of upgrading, but would it be
 possible to copy {{{makefile}}} to {{{Makefile}}} during the ''upgrade''?
 > >
 > > Of course. But I would ''rename'' it because (POSIX) `make` gives
 `makefile` precedence over `Makefile` and we don't want to cause
 confusion.
 >
 > On the other hand, if {{{makefile}}} and {{{Makefile}}} are identical
 files, it shouldn't matter.  It seems just dangerous to delete
 {{{makefile}}} during a Sage build/upgrade.

 Note that on OS X, you can't have files called both "makefile" and
 "Makefile" in the same directory.  Also, "makefile" is not used at all
 during an upgrade, so it should be safe to rename it.

 > Can any of you implement this?

 It's taken care of by #9433.  If we want to implement it here, I think it
 should be done in the sage-upgrade script, after running "./install" and
 checking its exit status:
 {{{
 #!diff
 diff -r 4047e578febc sage-upgrade
 --- a/sage-upgrade      Sat Oct 30 16:05:33 2010 -0700
 +++ b/sage-upgrade      Tue Nov 09 10:57:40 2010 -0800
 @@ -36,3 +36,13 @@
      exit 1
  fi

 +cd "$SAGE_ROOT"
 +
 +if [ -f makefile ]; then
 +    mv makefile Makefile
 +fi
 +
 +if [ $? -ne 0 ]; then
 +    echo "Error renaming 'makefile' to 'Makefile'.
 +    exit 1
 +fi
 }}}
 Another option would also check for the existence of 'Makefile' before
 doing the move:
 {{{
 #!diff
 diff -r 4047e578febc sage-upgrade
 --- a/sage-upgrade      Sat Oct 30 16:05:33 2010 -0700
 +++ b/sage-upgrade      Tue Nov 09 10:58:47 2010 -0800
 @@ -36,3 +36,16 @@
      exit 1
  fi

 +cd "$SAGE_ROOT"
 +
 +if [ -f makefile ]; then
 +    if [ -f Makefile ]; then
 +       mv Makefile Makefile.old
 +    fi
 +    mv makefile Makefile
 +fi
 +
 +if [ $? -ne 0 ]; then
 +    echo "Error renaming 'makefile' to 'Makefile'.
 +    exit 1
 +fi
 }}}
 Opinions either way?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10156#comment:15>
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