Portfile: fetching/verifying a single file

Eric F (iEFdev) eric at iefdev.se
Sat Aug 29 14:45:20 UTC 2020


On 8/29/20 5:52 , Ryan Schmidt wrote:
> On Aug 28, 2020, at 21:52, Eric F wrote:
>> When downloading/fetching a single (script) file from a Git repo. If I use:
>>
>> // ...
>>
>> That works, and I can verify against the checksums, etc. But is that an ok method? …or is there a better &/or preferred way?
> No, that's not ok. Let MacPorts fetch the files for you. Set master_sites and distfiles as needed. For unversioned distfiles, set dist_subdir; consult PortfileRecipes wiki page.
>
> Don't populate the worksrcpath in the checksum phase. That's what the extract phase is for.
Thanks! Yes, I had a feeling that it wasn't, so that's why I wanted to ask. It is a versioned file (last commit of the file) - otherwise I can't use a checksum to verify it against. I do grep the rolling file though, for the version number to use with livecheck.


On 8/29/20 5:53 , Ryan Schmidt wrote:
> On Aug 28, 2020, at 22:24, Jason Liu wrote:
>> If you're fetching a single script file from a Git repo, then can't you simply use the built-in fetch keywords, set 'fetch.type git', and then set the extract phase to be empty?
> Don't use fetch.type git unless fetching a distfile would not work.
I tried using this (earlier), but I think it wanted the full repo, or at least an archive.


On 8/29/20 5:24 , Jason Liu wrote:
> If you're fetching a single script file from a Git repo, then can't you simply use the built-in fetch keywords, set 'fetch.type git', and then set the extract phase to be empty?
>
> -- 
> Jason Liu
Thanks Jason. I've been using `fetch.type none` now, but I will explore that empty extract phase.


- - -

· Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20200829/88578f89/attachment.htm>


More information about the macports-dev mailing list