[MacPorts] #43717: ./port -d sync fails when using "file:" protocol
#43717: ./port -d sync fails when using "file:" protocol -------------------------+-------------------------------- Reporter: joe.dipol@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: | Port: -------------------------+-------------------------------- Because I'm behind an http proxy I'm using svn and not rsync to synchronize. I added the following to sources.conf: file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ But when I run sync it fails because it is using a bad path (note it is preceded with /opt/local/bin): mac$ ./port -d sync ---> Updating the ports tree Synchronizing local ports tree from file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ couldn't change working directory to "/opt/local/bin/opt/local/var/macports/sources/svn.macports.org/trunk/dports": no such file or directory Command failed: /opt/local/bin/portindex /opt/local/bin/opt/local/var/macports/sources/svn.macports.org/trunk/dports Exit code: 1 Error: updating PortIndex for file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ failed I think this is caused by an off by one error in macports.tcl:proc macports::getportdir The following change seems to fix the problem: set path [file normalize [string range $url [expr [string length $protocol] + 3] end]] to set path [file normalize [string range $url [expr [string length $protocol] + 2] end]] -- Ticket URL: <https://trac.macports.org/ticket/43717> MacPorts <http://www.macports.org/> Ports system for OS X
#43717: ./port -d sync fails when using "file:" protocol --------------------------+-------------------------------- Reporter: joe.dipol@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 2.2.1 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Changes (by mf2k@…): * component: ports => base Old description:
Because I'm behind an http proxy I'm using svn and not rsync to synchronize. I added the following to sources.conf:
file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/
But when I run sync it fails because it is using a bad path (note it is preceded with /opt/local/bin):
mac$ ./port -d sync ---> Updating the ports tree Synchronizing local ports tree from file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ couldn't change working directory to "/opt/local/bin/opt/local/var/macports/sources/svn.macports.org/trunk/dports": no such file or directory Command failed: /opt/local/bin/portindex /opt/local/bin/opt/local/var/macports/sources/svn.macports.org/trunk/dports Exit code: 1 Error: updating PortIndex for file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ failed
I think this is caused by an off by one error in macports.tcl:proc macports::getportdir
The following change seems to fix the problem:
set path [file normalize [string range $url [expr [string length $protocol] + 3] end]]
to
set path [file normalize [string range $url [expr [string length $protocol] + 2] end]]
New description: Because I'm behind an http proxy I'm using svn and not rsync to synchronize. I added the following to sources.conf: {{{ file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ }}} But when I run sync it fails because it is using a bad path (note it is preceded with /opt/local/bin): {{{ mac$ ./port -d sync ---> Updating the ports tree Synchronizing local ports tree from file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ couldn't change working directory to "/opt/local/bin/opt/local/var/macports/sources/svn.macports.org/trunk/dports": no such file or directory Command failed: /opt/local/bin/portindex /opt/local/bin/opt/local/var/macports/sources/svn.macports.org/trunk/dports Exit code: 1 Error: updating PortIndex for file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ failed }}} I think this is caused by an off by one error in macports.tcl:proc macports::getportdir The following change seems to fix the problem: {{{ set path [file normalize [string range $url [expr [string length $protocol] + 3] end]] }}} to {{{ set path [file normalize [string range $url [expr [string length $protocol] + 2] end]] }}} -- Comment: In the future, please use WikiFormatting. -- Ticket URL: <https://trac.macports.org/ticket/43717#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#43717: ./port -d sync fails when using "file:" protocol --------------------------+-------------------------------- Reporter: joe.dipol@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.2.1 Resolution: invalid | Keywords: Port: | --------------------------+-------------------------------- Changes (by ryandesign@…): * cc: ryandesign@… (added) * status: new => closed * resolution: => invalid Comment: Replying to [ticket:43717 joe.dipol@…]:
Because I'm behind an http proxy I'm using svn and not rsync to synchronize. I added the following to sources.conf:
{{{ file://opt/local/var/macports/sources/svn.macports.org/trunk/dports/ }}}
You're missing a slash near the beginning of your URL. It needs to be: {{{ file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ }}} -- Ticket URL: <https://trac.macports.org/ticket/43717#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts