Opened 10 years ago

Closed 10 years ago

#43717 closed defect (invalid)

./port -d sync fails when using "file:" protocol

Reported by: joe.dipol@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.2.1
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port:

Description (last modified by mf2k (Frank Schima))

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]]

Change History (2)

comment:1 Changed 10 years ago by mf2k (Frank Schima)

Component: portsbase
Description: modified (diff)

In the future, please use WikiFormatting.

comment:2 in reply to:  description Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Resolution: invalid
Status: newclosed

Replying to 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/
Note: See TracTickets for help on using tickets.