[macports-base] 14/18: fetch: Remove svn.method option

Rainer Müller raimue at macports.org
Tue Mar 20 11:42:53 UTC 2018


On 2018-03-20 02:32, Ryan Schmidt wrote:
> Note: this commit is to the vcs-fetch branch, not to master.
> 
> On Mar 18, 2018, at 19:20, Rainer Müller wrote:
> 
>> Rainer Müller (raimue) pushed a commit to branch vcs-fetch
>> in repository macports-base.
>>
>>
>> https://github.com/macports/macports-base/commit/718a2072dad40298b01285de418edf5d9682b5da
>>
>> commit 718a2072dad40298b01285de418edf5d9682b5da
>>
>> Author: Rainer Müller
>> AuthorDate: Mon Mar 19 00:37:00 2018 +0100
>>
>>     fetch: Remove svn.method option
>>     
>>     The executed command should not be configurable, as it is defined by the
>>     fetch code. Other methods could interfere the tarball creation.
> 
> Obviously, this will break the ports that currently override svn.method.
>
> $ find . -name Portfile|xargs grep -E '^[[:space:]]*svn\.((pre_|post_)?args|method)(-append|-delete|-replace)?'
> ./games/PCLauncher/Portfile:svn.method                  checkout
> ./graphics/netpbm/Portfile:svn.method          checkout
> ./graphics/netpbm/Portfile:svn.post_args-append \
> ./graphics/netpbm/Portfile:    svn.args-replace    ${svn.method} update
> ./graphics/netpbm/Portfile:    svn.args-replace    ${svn.url} -r${svn.revision}
> ./graphics/netpbm/Portfile:    svn.args-append     advanced userguide
> ./graphics/netpbm/Portfile:    svn.post_args-delete \
> ./irc/irssi-devel/Portfile:svn.method          checkout
> ./lang/rpcgen-mt/Portfile:svn.pre_args-append --ignore-keywords
> ./science/emergent/Portfile:svn.args        --username anonymous --password emergent
> ./science/emergent/Portfile:svn.method      checkout
> ./science/flashdot/Portfile:svn.method        checkout


Indeed, I am aware of that. Some ports chose checkout over export
because they want to calculate the version number from the working copy.
As we will no longer have a working copy, that has to be solved with
patches anyway.

Some ports are also using special flags in svn.args, which still need to
be addressed by new options in the Portfile.

Maybe even some option to prevent generating a tarball and use the plain
checkout/export, which would also already be done if the requested
revision is HEAD.

> netpbm is the most complicated one, tweaking the arguments and commands in order to first check out a sparse working copy and then to update only the two directories we want. I do intend to switch netpbm over to downloading from a GitHub mirror instead, which will leave only a few much simpler cases to deal with, but I'll be sad to see the flexibility of fetching from svn in MacPorts reduced.

Thanks for pointing me to the netpbm port, I had not discovered it yet
during testing.

I thought about supporting multiple repositories/URLs initially, but
then dismissed it as it gets a lot more complicated to specify which
revision is needed from which repository URL with which additional options.

However, supporting sparse checkouts for svn would be possible as Mojca
pointed out in her mail.


In general, the branch is not fully finished yet, as I still want to
make some tweaks:

* Exclude special directories of the VCS from tarball (.bzr/.hg)
* Replace usage of /tmp with temporary directory inside ${workpath}
  (for automatic clean up)
* Check when we need a dependency on libarchive (for bsdtar)
* Add new options for special cases:
    - svn.ignore_keywords
    - svn.username
    - svn.password

And of course, then it needs more testing with our existing ports.

As this switch cannot be done in a fully backwards compatible way, we
will have to introduce some conditionals to support both MacPorts 2.4
and 2.5 (master) at the same time.

svn.url ...
if {[vercmp $macports_version 2.5.0] < 0} {
   svn.method ...
   svn.args --username ... --password ...
} else {
   svn.username ...
   svn.password ...
}

Rainer


More information about the macports-dev mailing list