tags:

views:

334

answers:

2

I am trying to add a port to my local repo in MacPorts.

I know the guide.

I run at /Users/Masi/bin/MacPorts/ports/Git unsuccessfully

portindex
Creating software index in /Users/Masi/bin/MacPorts/ports/Git

Total number of ports parsed:   0 
Ports successfully parsed:  0  
Ports failed:     0

My port-file is the following

PortSystem          1.0

name                git-svn 
version             1.0 
categories          git 
maintainers         sl 
description         svn for Git 
long_description    Git-svn is a tool which allows Git to use svn 
homepage            http://www.kernel.org/pub/software/scm/git/docs/git-svn.html 
platforms           darwin
master_sites        http://git-scm.com/ 

checksums           md5 

depends_lib         
                    port:syfi-dev\ 
                    port:syfi-doc\ 
                    port:python-syfi0\ 
                    port:libcln5\ 
                    port:libsyfi0\ 
                    port:libginac1.4\ 
                    port:libsyfi0-dev\
                    port:syfi-bin\

#I do not know what these are: I leave them as they are by default
configure.args      --enable-perl-site-install \
                    --mandir=${prefix}/share/man

My sources.conf

#  MacPorts system wide sources configuration file
#  $Id: sources.conf 42662 2008-11-28 23:18:50Z [email protected] $

#  To setup a local ports repository, insert a "file://" entry following
#  the example below that points to your local ports directory:
#  Example: file:///Users/landonf/misc/MacPorts/ports
file:///Users/Masi/bin/MacPorts/ports
rsync://rsync.macports.org/release/ports


#  The default MacPorts repository should always be tagged [default]
#  for proper functionality of various resources (port groups, mirror
#  sites, etc).  If you switch it from the rsync:// URL, be sure to keep
#  it tagged [default].

#  To prevent a source from synchronizing when `port sync` is used,
#  append [nosync] at the end as shown in this example:
#  Example: file:///Users/landonf/misc/MacPorts/ports [nosync]

#  NOTE: The port command parses source URLs in order and installs the
#        first occurrance when a port appears in multiple repositories.
#        So keep "file://" URLs above other URL types.


#  To get the ports tree from the master MacPorts server in California, USA use:
#      rsync://rsync.macports.org/release/ports/
#  To get it from the mirror in Trondheim, Norway use:
#      rsync://trd.no.rsync.macports.org/release/ports/
#  A current list of mirrors is available at http://trac.macports.org/wiki/Mirrors
rsync://rsync.macports.org/release/ports/ [default]

How can you add a port to your local MacPorts successfully?

+1  A: 

I'm not sure but I think you need to change your directory structure to this format: portcategory/portname/Portfile. In your case that would be /Users/Masi/bin/MacPorts/ports/git/git-svn/Portfile

Then try to run portindex from the root of you local repo (/Users/Masi/bin/MacPorts/ports)

Patjoh
It gives me the same result after running $ portindex.
Masi
+2  A: 

Portfiles must be organized in the following fashion:

$LOCAL_PORT_DIR/{category}/{portname}/

All files, including Portfile, go under that directory.

In your case, your local port dir is /Users/Masi/bin/MacPorts/ports, and your port, git-svn, is in the category git, so your directory structure should look like this:

/Users/Masi/bin/MacPorts/ports/git/git-svn/Portfile

(In the special case of git-svn, though, you can always install the port git-core with the variant +svn, like so: $ sudo port install git-core +svn.)

(Also, as another side note, Git-related ports are typically organized under the category "devel", not "git".)

mipadi
What do you call the option +? I have tried to find more documentation about such options unsuccessfully. My MacPorts tabCompletion does not find such options.
Masi
I get the following error message: http://dpaste.com/35580/
Masi
You specify port variants using the + sign. Also, the error is caused by the fact that you already have git-core installed -- uninstall git-core first, and then reinstall using sudo port install git-core +svn.
mipadi
@mipadi: Do you have a list where you can see all those variants? In other words, how did you find the option +svn?
Masi
port variants $portname will list all the variants for a port, along with a description. port info $portname also lists the variants for a port (with no description). In general, the port manpage ($ man port) explains the complete usage of the port command.
mipadi