Opened 10 years ago
Last modified 10 years ago
#43717 closed defect
./port -d sync fails when using "file:" protocol — at Initial Version
Reported by: | joe.dipol@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | base | Version: | 2.2.1 |
Keywords: | Cc: | ||
Port: |
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]]