Portfiles with fetch.type git ... can one add arguments to git?

Clemens Lang cal at macports.org
Sat Aug 16 14:04:57 PDT 2014


Hi,

> > I'm whipping up a portfile for kdevplatform-devel and kdevelop-devel,
> > aiming to follow the git repo. KDevplatform has a rather big repo, which
> > is re-fetched each time I modify the portfile. It'd be useful to do a `git
> > clone --depth=1` to avoid downloading the entire commit history for what
> > might be just a single build ... is that possible?
> 
> The blunt answer is no.

That's not entirely correct. Due to some weird quoting issues you can use the
ugly hack I used in the mplayer2 port:

fetch.type     git
# This is a hack b/c the mplayer2.git is HUGE and takes AGES to fetch; let's
# hope nobody makes more than 100 commits before I update the port.
git.url        --depth 100 git://git.mplayer2.org/mplayer2.git
git.branch     2c378c71a4d9b1df382db9aa787b646628b4e3f9

Note that is exactly what the comment says: an utterly ugly hack. It will
break horribly if upstream suddenly decides to do 100 commits on top of their
current head so the value you list in ${git.branch} is no longer cloned.

This isn't a problem for mplayer2, because there's only a few commits per
year, but other projects might not be so lucky.

-- 
Clemens Lang


More information about the macports-users mailing list