[MacPorts] #14809: MacPorts-1.6.0 installer postflight script

MacPorts noreply at macports.org
Mon Nov 10 17:03:19 PST 2008


#14809: MacPorts-1.6.0 installer postflight script
------------------------------------+---------------------------------------
  Reporter:  lailoken3 at verizon.net  |       Owner:  macports-tickets at lists.macosforge.org
      Type:  defect                 |      Status:  new                                  
  Priority:  Normal                 |   Milestone:  MacPorts base bugs                   
 Component:  base                   |     Version:  1.6.0                                
Resolution:                         |    Keywords:  installer postflight                 
      Port:                         |  
------------------------------------+---------------------------------------
Changes (by ryandesign at macports.org):

 * cc: ryandesign at macports.org (added)


Comment:

 Replying to [ticket:14809 lailoken3@…]:
 > 1)  line 36 assumes that the install is to the boot drive,
 >       it does not take the selected installation drive into account

 Line 36 of `postflight` in 1.6.0 is:

 {{{
 BINPATH=$PREFIX/bin
 }}}

 That is correct, since that's what we want to write into the `.profile`.
 The part that may appear incorrect is where we later use that to set the
 path to run `port selfupdate`:

 {{{
 export PATH=$BINPATH:$PATH
 port -v selfupdate || {
     echo "An attempt to synchronize your recent MacPorts installation with
 the project's rsync server failed!"
     echo "Please run 'port -d selfupdate' manually to find out the cause
 of the error."
     exit 1
 }
 }}}

 This has changed substantially in the `postflight` that's now in trunk.
 Now we have a function `update_macports` which does this:

 {{{
     if ! ${BINPATH}/port -v selfupdate; then
         echo "An attempt to synchronize your recent MacPorts installation
 with the project's rsync server failed!"
         echo "Please run 'sudo port -d selfupdate' manually to find out
 the cause of the error."
     else
         echo "Successful!"
     fi
 }}}

 This would be just as unsuccessful if you're not installing MacPorts on
 the boot drive.

 Even if we change it at this point to prepend "`$2`" to `${BINPATH}` to
 use the selected install drive instead of the boot drive, the selfupdate
 wouldn't work. There's no abstraction in `port` that would let it know to
 prepend some prefix to its own during install time. Even if there were,
 the selfupdate may download and compile a new version of MacPorts. If so,
 we would want that compilation to run on the destination operating system.

 So in conclusion, the simplest correct thing to do at this point would be
 to prevent the disk image installer from installing on anything other than
 the boot drive.

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


More information about the macports-tickets mailing list