[MacPorts] #31225: expect: mkpasswd: can't find package Expect

MacPorts noreply at macports.org
Wed May 2 19:25:52 PDT 2012


#31225: expect: mkpasswd: can't find package Expect
---------------------------------------+------------------------------------
  Reporter:  arnaud.fortier@…          |       Owner:  markd@…           
      Type:  defect                    |      Status:  closed            
  Priority:  Normal                    |   Milestone:                    
 Component:  ports                     |     Version:  2.0.3             
Resolution:  fixed                     |    Keywords:                    
      Port:  expect                    |  
---------------------------------------+------------------------------------
Changes (by ryandesign@…):

  * status:  new => closed
 * cc: kobayos@…, ryandesign@… (added)
  * resolution:  => fixed


Comment:

 I'm not sure why this problem occurs when running with the MacPorts tclsh,
 but I don't think we want to "fix" it by using the system tclsh, for all
 the usual reasons why we don't want to use system components.

 Based on the [comment:4 above information] that loading the script
 directly into expect (rather than running it through tclsh) works, I
 decided the fix would be to modify the scripts' shebang (#!) lines to
 reference /opt/local/bin/expect directly. It was then that I discovered
 that the scripts' shebang lines are rather convoluted:

 {{{
 #!/bin/sh
 # -*- tcl -*-
 # The next line is executed by /bin/sh, but not tcl \
 exec tclsh "$0" ${1+"$@"}
 }}}

 This means the script is initially run with sh, and is then relaunched
 with tclsh. I don't understand why this song and dance is performed, so I
 patched each of the scripts to just call expect directly, tried a few of
 the scripts and verified that they no longer exhibit this problem, and
 committed it as r92644.

 It was only after committing this that I realized that during the destroot
 process some of the scripts' shebang lines got transformed again, now
 looking like:

 {{{
 #!/bin/sh
 # \
 exec expect "$0" ${1+"$@"}
 }}}

 I don't know where in the destroot process that's happening, and I didn't
 intend for that to happen. It's not really a problem though, unless the
 user doesn't have /opt/local/bin in their $PATH, so I'm not too concerned
 about it.

 Note that these changes basically undo the fix for
 [https://sourceforge.net/tracker/?func=detail&aid=562621&group_id=13179&atid=113179
 this ten-year-old upstream bug]. It only affected users who don't actually
 have a binary called "expect", and that's not the case in MacPorts, so it
 should be ok for us.

-- 
Ticket URL: <https://trac.macports.org/ticket/31225#comment:7>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list