Bug 278262 - It should be possible to refer to Github's inter-fork diffs as PATCHFILES
Summary: It should be possible to refer to Github's inter-fork diffs as PATCHFILES
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL: https://docs.github.com/en/pull-reque...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-08 16:29 UTC by Mikhail T.
Modified: 2024-04-08 18:19 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2024-04-08 16:29:33 UTC
[This is not about an individual port, but "Invidiual Port(s)" is the only Component available on the form.]

Lots of ports enumerate individual Github-commits as PATCHFILES already -- with the "filenames" consisting of git-hash and the .diff or .patch suffix.

A similar syntax referring to differences between forks would look something like:

```
PATCH_SITES=   https://github.com/ars3niy/tdlib-purple/compare/
PATCHFILES+=   master...BenWiederhake:master.diff:-p2
```

The above means: give me the differences between ars3niy's master-branch for tdlib-purple and the contents of BenWiederhake-fork of same.

Unfortunately, bsd.port.mk chokes on that currently -- because of the ":" in the name of the file:
```
=> master...BenWiederhake doesn't seem to exist in /usr/ports/distfiles/.
eval: ${_PATCH_SITES_master....}: Bad substitution
```
Seems like the `master.diff`-part is interpreted as the name of the group...

Work-arounds exist, of course. For instance, in this case, I can switch the very GH_ACCOUNT in the net-im/tdlib-purple/Makefile to that of Ben W.. But other cases may come up, where a port's maintainer might want to combine diffs from multiple forks, for example.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2024-04-08 17:03:19 UTC
Git refs should not be used in anything that ends up in distinfo. If more commits get pushed into the BenWiederhake branch, the hash of the patch will change and the port will break.

As a workaround you can open a pull request in your own fork and then use that as PATCH_SITES.