Opened 7 years ago

Closed 7 years ago

#41768 closed submission (fixed)

py-radical-utils @0.5.0: new port

Reported by: petrrr Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py-radical-utils

Description

This new port is necessary for the update of py-saga which introduces this dependences in 0.9.14/0.9.15. The package is documented to work with Python 2.5, 2.6 & 2.7, this port provides only support for Python 2.6 and 2.7.

Sub-ports:            py26-radical-utils, py27-radical-utils

Description:          This Python package contains shared code and tools for various Radical Group projects. Sometimes we call it the Radical Kitchen Sink.
Homepage:             https://github.com/saga-project/radical.utils/

Library Dependencies: py27-radical-utils
Platforms:            darwin
License:              MIT
Maintainers:          Peter.Danecek@bo.ingv.it, openmaintainer@macports.org

Attachments (1)

Portfile (1.9 KB) - added by petrrr 7 years ago.
Portfile for python/py-radical-utils

Download all attachments as: .zip

Change History (6)

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

Thanks.

    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            CHANGES.md \
            LICENSE.md \
            README.md \
                ${dest_doc}

        delete ${dest_doc}/examples
        copy ${worksrcpath}/examples ${dest_doc}/examples
    }
}

I was wondering why you did "delete ${dest_doc}/examples" but I see now it's to delete the directory the portgroup creates.

set dot_count       [regexp -all \\. $version]

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     ">${_name}-(\\d+(\\.\\d+){${dot_count}})\\${extract.suffix}<"

The problem with this is that this will only find versions that have the same number of components as the current version. The current version is "0.5.0" so dot_count will be 2 so livecheck.regex will contain "(\\d+(\\.\\d+){2})" and you won't find any versions that have more or fewer components, at which point you may as well just write "2" into livecheck.regex and dispense with the dot_count calculation. If that's not what you intended—if you want to match an arbitrary number of version number components, which I recommend since you never know what future version numbers will be—then try "+" (meaning "one or more of the preceding") instead of "{${dot_count}}".

comment:2 in reply to:  1 Changed 7 years ago by petrrr

Replying to ryandesign@…:

Thanks.

    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            CHANGES.md \
            LICENSE.md \
            README.md \
                ${dest_doc}

        delete ${dest_doc}/examples
        copy ${worksrcpath}/examples ${dest_doc}/examples
    }
}

I was wondering why you did "delete ${dest_doc}/examples" but I see now it's to delete the directory the portgroup creates.

Well, this is something I already addressed on the list. I personally do not thing it is really helpful that this directory is created by the portgroup. From what I have seen so far, there is often a examples directory you just would like to copy, but this leads to somewhat unexpected results, ie. leaving you with directory hierarchy like ${prefix}/share/${subport}/doc/examples/examples/

But, I imaging changing this now might break some python ports.

set dot_count       [regexp -all \\. $version]

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     ">${_name}-(\\d+(\\.\\d+){${dot_count}})\\${extract.suffix}<"

The problem with this is that this will only find versions that have the same number of components as the current version. The current version is "0.5.0" so dot_count will be 2 so livecheck.regex will contain "(\\d+(\\.\\d+){2})" and you won't find any versions that have more or fewer components, at which point you may as well just write "2" into livecheck.regex and dispense with the dot_count calculation. If that's not what you intended—if you want to match an arbitrary number of version number components, which I recommend since you never know what future version numbers will be—then try "+" (meaning "one or more of the preceding") instead of "{${dot_count}}".

Okay, I see your point. My assumption here was really that the versioning scheme would not change and I used to hardcode the regex to match exactly the same scheme. The idea was if the scheme changes there also might be a some discontinuity in numbering which couldn't be handled automatically anyway. Now I wanted a generic template which would take care of this with less changes.

But your are probably right, this might be an overkill and there is no point in doing so. One could just match anything from 1 to n dots and that's it.

comment:3 Changed 7 years ago by ryandesign (Ryan Schmidt)

A lot of ports use (\\d+(\\.\\d+)+) in their livecheck.regex

When I'm writing it I usually go for the less precise but shorter (\[0-9.\]+)

Changed 7 years ago by petrrr

Attachment: Portfile added

Portfile for python/py-radical-utils

comment:4 Changed 7 years ago by petrrr

I simplified the livecheck regex and updated the Portfile.

comment:5 Changed 7 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed

Committed in r115024.

Note: See TracTickets for help on using tickets.