New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #17076 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

Being in a soon-to-be-deactivated directory causes port to error

Reported by: blb@… Owned by: macports-tickets@…
Priority: Low Milestone: MacPorts 1.8.0
Component: base Version: 1.7.0
Keywords: cwd Cc: ryandesign@…
Port:

Description

This is an extremely esoteric bug, but for tracking purposes (while sitting in /opt/local/lib/erlang, which is exclusively from the erlang port):

$ sudo port deactivate erlang
Password:
--->  Deactivating erlang
cd
couldn't change working directory to "/opt/local/lib/erlang": no such file or directory
    while executing
"cd $savedir"
    (procedure "foreachport" line 17)
    invoked from within
"foreachport $portlist {
        if { [catch {portimage::deactivate $portname [composite_version $portversion [array get variations]] [array get option..."
    (procedure "action_deactivate" line 6)
    invoked from within
"$action_proc $action $portlist [array get global_options]"
    (procedure "process_cmd" line 86)
    invoked from within
"process_cmd $remaining_args"
    invoked from within
"if { [llength $remaining_args] > 0 } {

    # If there are remaining arguments, process those as a command

    # Exit immediately, by default, unless..."
    (file "/opt/local/bin/port" line 3225)

Change History

comment:1 Changed 5 years ago by ryandesign@…

  • Cc ryandesign@… added

It's not so esoteric IMHO. I often find myself in a port's work directory when I try to install it again, which deletes the work directory, so when the port command is done, the above error occurs.

comment:2 Changed 4 years ago by toby@…

  • Milestone changed from MacPorts base bugs to MacPorts Future

Milestone MacPorts base bugs deleted

comment:3 Changed 4 years ago by blb@…

  • Summary changed from Being in an soon-to-be-deactivated directory causes port to error to Being in a soon-to-be-deactivated directory causes port to error

comment:4 Changed 4 years ago by jmr@…

I think this may have been fixed with the gsoc08-privileges merge?

comment:5 Changed 4 years ago by blb@…

  • Status changed from new to closed
  • Resolution set to fixed

It no longer errors out, but does leave you in that now-removed directory. Probably not worth it trying to detect that case and to cd someplace else, so I call it fixed.

comment:6 Changed 3 years ago by jmr@…

  • Milestone changed from MacPorts Future to MacPorts 1.8.0
Note: See TracTickets for help on using tickets.