Opened 15 years ago
Closed 15 years ago
#23626 closed defect (fixed)
Logging: Useless log file on failed activate during upgrade
Reported by: | raimue (Rainer Müller) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 1.9.0 |
Component: | base | Version: | 1.8.99 |
Keywords: | logging log | Cc: | jmroot (Joshua Root) |
Port: |
Description
In a special case the logging procedure writes a useless log file. Here a port has to be activated in order to build a dependent port. But the activation fails and results in a useless, self-referencing log file.
The following example is a demonstration of the bug in the wild:
$ port -v outdated py26-docutils The following installed ports are outdated: py26-docutils 0.5_1 < 0.6_0 $ port -v installed py26-roman The following ports are currently installed: py26-roman @1.4.0_0 $ sudo port upgrade py26-docutils ---> Computing dependencies for py26-docutils ---> Activating py26-roman @1.4.0_0 Log for py26-roman is at: /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_python_py26-roman/main.log Error: The following dependencies failed to build: py26-roman Error: Unable to upgrade port: 1 To report a bug, see <http://guide.macports.org/#project.tickets>
The resulting log file:
$ port log py26-roman ---> Activating py26-roman @1.4.0_0 Log for py26-roman is at: /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_python_py26-roman/main.log
$ cat /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_python_py26-roman/main.log version:1 :msg:main ---> Activating py26-roman @1.4.0_0 :msg:main Log for py26-roman is at: /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_python_py26-roman/main.log
Change History (6)
comment:1 Changed 15 years ago by raimue (Rainer Müller)
Component: | ports → base |
---|
comment:2 Changed 15 years ago by raimue (Rainer Müller)
comment:3 Changed 15 years ago by jmroot (Joshua Root)
Probably ending up in the dependent's log due to a missing push_log?
comment:5 Changed 15 years ago by raimue (Rainer Müller)
I reproduced the issue with a new port foo
which has a dependency on less:
sudo port deactivate less sudo touch /opt/local/bin/less
$ sudo port install foo ---> Computing dependencies for foo.. ---> Activating less @436_0 Error: activating less @436_0 failed: Image error: /opt/local/bin/less already exists and does not belong to a registered port. Unable to activate port less. Use 'port -f activate less' to force the activation. Log for less is at: /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_textproc_less/main.log Error: The following dependencies failed to build: less Error: Status 1 encountered during processing. To report a bug, see <http://guide.macports.org/#project.tickets>
$ port log less DEBUG: Attempting ln -sf /opt/local/var/macports/build/_Users_raim_src_macports_trunk_dports_textproc_less/work /Users/raim/src/macports/trunk/dports/textproc/less/work ---> Activating less @436_0 DEBUG: Image error: /opt/local/bin/less already exists and does not belong to a registered port. Unable to activate port less. Use 'port -f activate less' to force the activation. Error: activating less @436_0 failed: Image error: /opt/local/bin/less already exists and does not belong to a registered port. Unable to activate port less. Use 'port -f activate less' to force the activation. Log for less is at: /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_textproc_less/main.log
$ cat /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_textproc_less/main.log version:1 :debug:main Attempting ln -sf /opt/local/var/macports/build/_Users_raim_src_macports_trunk_dports_textproc_less/work /Users/raim/src/macports/trunk/dports/textproc/less/work :msg:main ---> Activating less @436_0 :debug:main Image error: /opt/local/bin/less already exists and does not belong to a registered port. Unable to activate port less. Use 'port -f activate less' to force the activation. while executing "_activate_contents $name $imagefiles $imagedir" (procedure "portimage::activate" line 105) invoked from within "registry_activate $name ${version}_${revision}${portvariants} [array get user_options]" :error:main activating less @436_0 failed: Image error: /opt/local/bin/less already exists and does not belong to a registered port. Unable to activate port less. Use 'port -f activate less' to force the activation. :msg:main Log for less is at: /opt/local/var/macports/logs/_Users_raim_src_macports_trunk_dports_textproc_less/main.log
Looks much better now.
But is the "Log for $port is at:" message supposed to be in the log file?
comment:6 Changed 15 years ago by jmroot (Joshua Root)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Here is additional debug output: