On Feb 26, 2018, at 00:57, Jan Stary wrote:
> On Feb 22 19:04:41, Jan Stary wrote:
>> On Feb 22 17:09:22, Rainer Mueller wrote:
>>> On 2018-02-21 20:14, Jan Stary wrote:
If I am reading https://guide.macports.org/chunked/reference.phases.html
right, there is are no "fetch dependencies". Would it make sense
to introduce fetch dependencies just like we have build dependencies
and run dependencies, so that the affected ports could specify e.g. curl,
and MP vuld use _that_ for those ports?
>>>
>>> depends_fetch exists, but apparently is not documented in the guide.
>>
>> Thanks for the insight. Currently, nothing is using it,
>> except: these explicitly clear it (why?)
>>
>> ./editors/HexFiend/Portfile:depends_fetch
>> ./editors/textmate2/Portfile:depends_fetch
>> ./python/py-pyobjc-cocoa/Portfile:depends_fetch
>> ./python/py-pyobjc-fsevents/Portfile:depends_fetch
I will answer this below.
>> and this one declares 'git' as its fetch dependency:
>>
>> ./multimedia/mplayer-devel/Portfile:depends_fetch-append bin:git:git
>>
>> (why don't other git-downloading ports declare it too?)
>>
>> If it is this much unused, wuld it be better to remove it,
>> as opposed to document it and keep it for this one port?
>
> Seriously, this is a dep_* feature used by one port.
> Would it be better to simplify base by removing it?
depends_fetch is used by MacPorts base for ports that use a nonstandard
fetch.type. For example, if a port uses "fetch.type git", this causes MacPorts
base to automatically add something like "depends_fetch-append bin:git:git". So
of course this feature should not be removed from MacPorts base.
> Or should other git-fetching ports do what mplayer-devel does?
mplayer-devel is unique. If you look at the portfile, it overrides the fetch
phase and fetches both from an svn repository and from a git repository. It
sets "fetch.type svn" which causes MacPorts base to add something like
"depends_fetch-append bin:svn:subversion". Then the port manually adds the git
dependency.
As to why some ports clear depends_fetch or other dependencies, it's because
some ports do not work on all macOS versions. Some of those ports include a
block that errors out with a message to that effect. And some of those ports
clear their dependencies in that case. It can be annoying to a user when they
request to install a port, and lots of dependencies get installed, and then the
actual port they wanted to use errors out saying it can never work on their OS
version anyway. It wastes user time, bandwidth and disk space.
This is what textmate2 is doing. textmate2 uses "fetch.type git", and therefore
has a git fetch dependency automatically added. If the user is on an old OS
version textmate2 doesn't support, it clears its dependencies so the user
doesn't have to wait before seeing the message that what they wanted to install
can't be installed.
py-pyobjc-cocoa used to conditionally use "fetch.type svn" for its Python 2.4
subport, which is why it cleared depends_fetch on Tiger, since it requires
Leopard or later. py-pyobjc-fsevents was originally copied from py-pyobjc-cocoa
and this code was left in, although it started off with only Python 2.6 and
later subports, so it never had a Python 2.4 subport and never used "fetch.type
svn". I've removed the clearing of depends_fetch from these ports now.
In the case of HexFiend, I seem to have erroneously copied the
dependency-clearing code from another port. HexFiend has no dependencies, so
clearing the dependencies does nothing. I've removed the dependency-clearing
code from HexFiend now.