[MacPorts] #25075: MacPorts 1.9.0-rc1 installer may overwrite conf files
#25075: MacPorts 1.9.0-rc1 installer may overwrite conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: MacPorts 1.9.0 Component: ports | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Using the disk image installer to install MacPorts 1.9.0-rc1 over the top of MacPorts current 1.8 it looks like my <prefix>/etc/macports/sources.conf was overwritten by the installer. Installing MacPorts 1.9.0-rc1 from source over the top of MacPorts 1.9.0-rc1 <prefix>/etc/macports/sources.conf was not overwritten. In my searches I could not determine the expected behavior. -- Ticket URL: <http://trac.macports.org/ticket/25075> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: MacPorts 1.9.0-rc1 installer may overwrite conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Changes (by macsforever2000@…): * component: ports => base * milestone: MacPorts 1.9.0 => -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: MacPorts 1.9.0-rc1 installer may overwrite conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Comment(by jmr@…): The intended behaviour is to overwrite *.conf.default and copy those to *.conf if they don't already exist. The [source:tags/release_1_9_0-rc1/base/portmgr/dmg/postflight#L55 postflight code] used in the pkg should do that AFAICT. The only other thing that touches sources.conf is [source:tags/release_1_9_0-rc1/base/src/upgrade_sources_conf_default.tcl the script that adds a default tag] if there isn't one, and it should behave identically whether run from the makefile or the postflight script. -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: MacPorts 1.9.0-rc1 installer may overwrite conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Comment(by jmr@…): I tested this, and the first time I saw the same incorrect result as you. However, subsequent installs using the pkg did the right thing. I have no idea what's going on here. -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: postflight script sometimes overwrites conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: postflight script sometimes overwrites conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Comment(by brad@…): I have been testing the pkg postflight and upgrade_sources_conf_default.tcl scripts and haven't been able to overwrite sources.conf again. In upgrade_sources_conf_default.tcl: if {[catch {file rename ${sourcesConf} "${sourcesConf}.mpsaved"}]} { file rename -force ${sourcesConf} "${sourcesConf}.mpsaved_[clock seconds]" } file rename ${tempfile} ${sourcesConf} eval file attributes ${sourcesConf} $attributes What conditions could cause the first two rename attempts to fail? If the first two rename attempts fail does tcl continue to the third rename? Unrelated, I noticed that InstallationCheck has this path hardcoded "/opt/local/etc/ports/dp_version". -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: postflight script sometimes overwrites conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Comment(by jmr@…): If `file rename` fails, it will throw an error. Only the first one is wrapped in a catch. I doubt that upgrade_sources_conf_default.tcl is to blame in any case, because all of my config files were overwritten the one time the installer misbehaved. -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: postflight script sometimes overwrites conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Comment(by brad@…): In postflight the update_macports function tries "port -v selfupdate" and then upgrade_sources_conf_default.tcl. Since selfupdate fails without a [default] port source why not call the script upgrade_sources_conf_default.tcl which attempts to fix missing default before "port -v selfupdate"? -- Ticket URL: <http://trac.macports.org/ticket/25075#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: postflight script sometimes overwrites conf files ------------------------------+--------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: Keywords: | Port: ------------------------------+--------------------------------------------- Comment(by brad@…): Replying to [comment:7 brad@…]:
In postflight the update_macports function tries "port -v selfupdate" and then upgrade_sources_conf_default.tcl. Since selfupdate fails without a [default] port source why not call the script upgrade_sources_conf_default.tcl which attempts to fix missing default before "port -v selfupdate"? Nevermind. My selfupdate was failing with permission errors not because of no default. I see port selfupdate uses last source as default when there is no default in sources.conf.
-- Ticket URL: <http://trac.macports.org/ticket/25075#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25075: postflight script sometimes overwrites conf files -------------------------------+-------------------------------------------- Reporter: brad@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: Resolution: worksforme | Keywords: Port: | -------------------------------+-------------------------------------------- Changes (by jmr@…): * status: new => closed * resolution: => worksforme Comment: Closing simply because I've never been able to reproduce this after that first time. If anyone figures out what's going on here or even just comes up with a reliable way to reproduce the problem, please reopen. -- Ticket URL: <https://trac.macports.org/ticket/25075#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts