[macports-ports] branch master updated: flyway: new port

Ryan Schmidt ryandesign at macports.org
Sat Dec 23 13:26:42 UTC 2017


On Dec 23, 2017, at 01:15, Enrico Maria Crisostomo wrote:

> Mojca Miklavec (mojca) pushed a commit to branch master
> in repository macports-ports.
> 
> 
> https://github.com/macports/macports-ports/commit/ba175af7fc6e712f4455a5472ffb77191f8243b0
> 
> The following commit(s) were added to refs/heads/master by this push:
> 
>      new ba175af  flyway: new port
> 
> ba175af is described below
> 
> 
> commit ba175af7fc6e712f4455a5472ffb77191f8243b0
> 
> Author: Enrico M. Crisostomo
> AuthorDate: Thu Nov 30 07:37:37 2017 +0100
> 
>     flyway: new port
>     
>     Flyway is an open-source database migration tool.
>     It strongly favors simplicity and convention over
>     configuration.
> 
> ---
>  java/flyway/Portfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)


> +destroot {
> +    set flywaydir ${destroot}${prefix}/share/java/${name}
> +
> +    # Create the target directory if it does not exist
> +    xinstall -m 755 -d ${flywaydir}
> +
> +    # Copy over the needed elements of our directory tree
> +    foreach f [glob -dir ${worksrcpath} *] {
> +        file copy $f ${flywaydir}
> +    }

You don't need to use a foreach loop to install several files. You can use the expansion operator ("{*}") to expand the list returned by the glob into individual arguments. You can also simplify to using "copy" instead of "file copy".

copy {*}[glob -dir ${worksrcpath} *] ${flywaydir}

But is there a specific reason why you're going out of your way to copy the files individually, instead of just copying whole the directory?

xinstall -d ${destroot}${prefix}/share/java
copy ${worksrcpath} ${destroot}${prefix}/share/java/${name}





More information about the macports-dev mailing list