Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2016 05:53:51 +0200
From:      Jan Beich <jbeich@vfemail.net>
To:        abi <abi@abinet.ru>
Cc:        "Bradley T. Hughes" <bradleythughes@fastmail.fm>, freebsd-ports@freebsd.org
Subject:   Re: Fetch branch from github
Message-ID:  <k2ga-2x0w-wny@vfemail.net>
In-Reply-To: <5795273A.40701@abinet.ru> (abi@abinet.ru's message of "Sun, 24 Jul 2016 23:38:18 %2B0300")
References:  <5794EB7E.4090006@abinet.ru> <D572A744-84E5-4BC8-9232-06DC95EE5E06@fastmail.fm> <5795273A.40701@abinet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain

abi <abi@abinet.ru> writes:

> On 24.07.2016 22:15, Bradley T. Hughes wrote:
>>> On 24 Jul 2016, at 18:23, abi <abi@abinet.ru> wrote:
>>>
>>> Hello,
>>>
>>> is it possible to fetch specific branch+commit from GitHub in port
>>> makefile? I found only release fetch or master+commit one.
>> Yes, it's possible. The Porter's handbook has a great explanation of it:
>>
>> https://www.freebsd.org/doc/en/books/porters-handbook/makefile-distfiles.html#makefile-master_sites-github-description
>
> It is not. I read handbook - and I found no explanation how to fetch
> branch and failed to achieve results tinkering options randomly :P
>
> Here is example
> https://github.com/ZoneMinder/ZoneMinder
>
> 1. Account is ZoneMinder
> 2. Project is ZoneMinder
>
> I need a branch here, they have plenty of them. |GH_TAGNAME is working
> only for releases or for commit id. The latter tries master branch.|

Just pin a commit within a branch or pull request and adjust variables.
Repeat the procedure for every update. For one,

1. Pick the desired branch
2. Pick the desired commit
3. Put the commit into GH_TAGNAME
4. Annotate GH_TAGNAME with a branch name
5. Construct PORTVERSION with the commit at the end
6. Execute |make makesum|

would produce something like

  PORTVERSION=	0.4.s20160725
  ...
  GH_TAGNAME=	abcdef1 # mybranch

If |git describe --tags| returns something useful this can be simplified.
For one,

  $ git describe --tags origin/release-0.4
  0.4-7-gabcdef1

can be converted into (no explicit GH_TAGNAME)

  DISTVERSION=	0.4-7
  DISTVERSIONSUFFIX=	-gabcdef1

where tag offset becomes part of version

  $ make -V PKGVERSION
  0.4.7

A more concrete example for multimedia/zoneminder

  DISTVERSION=	1.30.0-rc2-476 # feature-h264-videostorage
  DISTVERSIONPREFIX=v
  DISTVERSIONSUFFIX=-gd929231
  PORTEPOCH=	1

Note, when switching branches always check resulting PKGVERSION and bump
PORTEPOCH if the version goes backwards.

  $ pkg version -t 1.30.0_1 1.30.0.r2.476
  >

  $ pkg version -t 1.30.0_1 1.30.0.r2.476,1
  <

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQF8BAEBCgBmBQJXlY1PXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF
NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3b01oH/Aw5rOLtrKDY9g4rJoxi1rdZ
H82SNzTdCNwGFu5GKmCNVpMvshxLDMkPxGQpXL+/32T5AJ3zjIhseF+fymH/K92s
HrF2XQZnWQWdXwFKuhepwlempKc4UUM/YoCsM39tCNeFaS9/KLpwrpNLruCgtgKp
zSHSzpyDQ3w4F9uIAgscTyWrRaYbOAdq7RPc46nOXibGL1nVF8+072IDGVUP3dNK
doMeYjTMgqCF1ZHxoQf7hGZempUD2GFr04KlJhQcaRLKGb9NqL1hcrjGzq9GU0iv
rT8ufwjS/vTiUkzN6zwy60UmfABxbbaGQmkkLuen3JneRycbOQ5xkGrlBfbzLMM=
=JRLy
-----END PGP SIGNATURE-----
--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?k2ga-2x0w-wny>