#11602: install_scripts should use "$@" instead of $*
------------------------------+---------------------------------------------
   Reporter:  Stefan          |          Owner:  jason                          
  
       Type:  defect          |         Status:  positive_review                
  
   Priority:  minor           |      Milestone:  sage-4.7.2                     
  
  Component:  misc            |       Keywords:  install_scripts, hg, command 
line
Work_issues:                  |       Upstream:  N/A                            
  
   Reviewer:  Leif Leonhardy  |         Author:  John Palmieri                  
  
     Merged:                  |   Dependencies:                                 
  
------------------------------+---------------------------------------------

Comment(by jhpalmieri):

 I could add these changes:
 {{{
 #!diff
 diff --git a/sage/misc/dist.py b/sage/misc/dist.py
 --- a/sage/misc/dist.py
 +++ b/sage/misc/dist.py
 @@ -133,7 +133,7 @@ def install_scripts(directory=None, igno
          else:
              o = open(target,'w')
              o.write('#!/bin/sh\n')
 -            o.write('sage -%s "$@"\n'%cmd)
 +            o.write('exec sage --%s "$@"\n'%cmd)
              o.close()
              print "Created script '%s'"%target
              os.system('chmod a+rx %s'%target)
 diff --git a/sage/misc/sage_ostools.py b/sage/misc/sage_ostools.py
 --- a/sage/misc/sage_ostools.py
 +++ b/sage/misc/sage_ostools.py
 @@ -34,8 +34,12 @@ def have_program(program, path=None):
      import os
      try:
          if path:
 +            # env is a copy of the current environment, so modifying
 +            # it won't affect os.environ.
 +            env = os.environ.copy()
 +            env['PATH'] = path
              return not call('command -v %s' % program, shell=True,
 -                            stdout=PIPE, env = {'PATH': path})
 +                            stdout=PIPE, env=env)
          else:
              return not call('command -v %s' % program, shell=True,
                              stdout=PIPE)
 }}}

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