Opened 9 years ago

Closed 9 years ago

#48965 closed defect (invalid)

Add subport as a dependency

Reported by: tiagofrepereira2012 (Tiago Freitas Pereira) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: ryandesign@…
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hi,

I'm creating a Portfile which contains several subports.

I would like to add these subports as a dependency of my main Portfile, but it seems not possible. When I try to install I have the following error.

--->  Dependencies to be installed: py-bob.blitz py-bob.core py-bob.io.base
Error: The following dependencies were not installed: py-bob.blitz py-bob.core py-bob.io.base

Those packages "py-bob.blitz py-bob.core py-bob.io.base" are my subports. The dependencies are defined in the line 64 of the attached file.

Thank you very much in advance!!

Attachments (1)

Portfile.current (17.3 KB) - added by tiagofrepereira2012 (Tiago Freitas Pereira) 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Attachment: Portfile.current added

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Description: modified (diff)
Resolution: invalid
Status: newclosed

In the Portfile you've written

depends_run \
    port:py-bob.blitz \
    port:py-bob.core \
    port:py-bob.io.base

outside of any blocks or conditionals. That means it applies to all ports, both the "main" port and all the subports. So, for example, you've asked the subport py-bob.blitz to have a dependency on itself, which of course can't work. If you only want the main port to have those dependencies, say that:

if {${subport} eq ${name}} {
    depends_run \
        port:py-bob.blitz \
        port:py-bob.core \
        port:py-bob.io.base
}

But there are additional problems here. You're using the python portgroup, whose purpose is to let you create one port (named py-something) and it will create subports for you (named py26-something, py27-something, py33-something, py34-something, etc.) based on how you set python.versions. But then you're trying to create additional py-somethingelse subports as well. The python portgroup doesn't know anything about these other subports you've created, and will not create py26-somethingelse etc. subports for you, so that won't work right. Furthermore, these subports are all for different software, which have their own version numbers, master_sites, distfiles and checksums. I think you'll find things will work correctly if you create a separate portfile for each software, and not try to put them all into the same portfile.

If you need further help developing portfiles, please write to the macports-dev mailing list rather than filing tickets in the issue tracker.

Note: See TracTickets for help on using tickets.