Opened 17 years ago

Closed 15 years ago

#14809 closed defect (fixed)

MacPorts-1.6.0 installer postflight script

Reported by: lailoken3@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.8.0
Component: base Version: 1.6.0
Keywords: installer postflight Cc: raimue (Rainer Müller), ryandesign (Ryan Carsten Schmidt), blb@…
Port:

Description

this is Leopard 10.5.2

1) line 36 assumes that the install is to the boot drive,

it does not take the selected installation drive into account

2) if there is no .profile &c

the script does not recognize the shell, an appropriate error message would be helpful.

3) saying to set up the environment manually isn't meaningful to a lot of people.

Change History (7)

comment:1 Changed 17 years ago by jmroot (Joshua Root)

The failure when there is no .profile is fixed in the updated script that will ship in 1.6.1. Could you please check whether the other points apply to the trunk version?

comment:2 Changed 17 years ago by raimue (Rainer Müller)

postflight in trunk is still broken. It was fixed on release_1_6 but not merged back into trunk.

comment:3 in reply to:  2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: raimue@… added

Replying to raimue@…:

postflight in trunk is still broken. It was fixed on release_1_6 but not merged back into trunk.

Rainer copied postflight from the 1.6 branch to trunk in r38037.

comment:4 in reply to:  description Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Replying to 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.

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Milestone: MacPorts base bugsMacPorts 1.7.0

comment:6 Changed 16 years ago by blb@…

Cc: blb@… added
Milestone: MacPorts 1.7.0MacPorts 1.8.0

Unless done manually, this will require some work to package1.0/portpkg.tcl as it currently just sets various values (proc write_info_plist) in the package's Info.plist (IFPkgFlagRootVolumeOnly being the one we want set to true). The best method being to allow some kind of pkg.flag RootVolumeOnly=true in the Portfile, or something to that effect.

comment:7 Changed 15 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Changed IFPkgFlagRootVolumeOnly to always be true in r53250. I think the rest of this has been addressed now.

Note: See TracTickets for help on using tickets.