pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GITHUB_PROJECT assignment



On 25.05.2018 08:19, Frédéric Fauberteau wrote:
> Le 2018-05-25 07:27, Kamil Rytarowski a écrit :
>> On 24.05.2018 13:06, Frédéric Fauberteau wrote:
>>> Hi folks,
>>>
>>> Imagine we would package the foo program hosted by the jsmith github
>>> account. Unfortunately, the repository is named foo-dev. I would to
>>> write:
>>> DISTNAME=       foo-dev-1.2.3
>>> PKGNAME=        ${DISTNAME:S/-dev//}
>>> MASTER_SITES=   ${MASTER_SITE_GITHUB:=jsmith/}
>>>
>>> But it doesn't work because GITHUB_PROJECT?= ${PKGBASE}:
>>> Requesting https://github.com/jsmith/foo/archive/1.2.3.tar.gz
>>> ftp: Error retrieving file `404 Not Found'
>>>
>>> If I write the followings:
>>> DISTNAME=       foo-1.2.3
>>> MASTER_SITES=   ${MASTER_SITE_GITHUB:=jsmith/}
>>> GITHUB_PROJECT= ${PKGBASE}-dev
>>> It doesn't work because WRKSRC?=
>>> ${WRKDIR}/${DISTNAME:U${PKGNAME_NOREV}}. WRKSRC=work/foo-1.2.3 but
>>> actually, the extraction of archive produces work/foo-dev-1.2.3:
>>> patch: **** can't cd to /usr/pkgsrc/xxx/foo/work/foo-1.2.3: No such file
>>> or directory
>>>
>>> A working solution is:
>>> DISTNAME=       foo-dev-1.2.3
>>> PKGNAME=        ${DISTNAME:S/-dev//}
>>> MASTER_SITES=   ${MASTER_SITE_GITHUB:=jsmith/}
>>> GITHUB_PROJECT= ${PKGBASE}-dev
>>>
>>> What about the following solution?
>>
>> No. We can (and certainly will) break real packages with this assumption.
> 
> I know it will break packages. My question was about the consistency: it
> seems to me that GITHUB_PROJECT is assigned according to PKGBASE since
> _GITHUB_DEFAULT_DISTFILES is according to DISTNAME. For sure, such a
> change would apply I write a script to check which packages are impacted
> and how. Otherwise, it would be reckless.
> 

It might be a matter of taste, but I prefer to set explicit value like
GITHUB_PROJECT=foo-dev. It is immune to PKGNAME changes, like for the
need to namespace packages with different versions. In this version, no
changes are needed.

>> The proper approach is to define GITHUB_PROJECT.
>>
>>> +++ fetch/github.mk     2018-05-24 12:56:25.000000000 +0200
>>> @@ -39,7 +39,7 @@
>>>
>>>  .if defined(_USE_GITHUB) && !empty(_USE_GITHUB:M[yY][eE][sS])
>>>
>>> -GITHUB_PROJECT?=       ${PKGBASE}
>>> +GITHUB_PROJECT?=       ${DISTNAME:C/-[^-]*$//}
>>>  GITHUB_TAG?=           ${PKGVERSION_NOREV}
>>>
>>>  .  if !empty(GITHUB_TAG:Mmaster)
>>>


Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index