packit / dist-git-to-source-git

Converting dist-git to source-git
MIT License
4 stars 9 forks source link

Patch can't be applied due to $id$ expansion #111

Open jpopelka opened 3 years ago

jpopelka commented 3 years ago

When creating SRPM from a freeradius source-git repo one patch can't be applied

Patch #5 (freeradius-fixes-to-python3-module-since-v3.0.20.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p1 --fuzz=0
patching file raddb/mods-available/python
patching file raddb/mods-available/python3
patching file src/include/conf.h
patching file src/main/modules.c
patching file src/modules/rlm_python3/configure
patching file src/modules/rlm_python3/configure.ac
patching file src/modules/rlm_python3/radiusd_test.py
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] n
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/modules/rlm_python3/radiusd_test.py.rej

The original dist-git patch (as well as the code in the freeradius tarball) contains expanded $Id$ $Id: 8582716ccbf340be00ce081ecf5ab078e93d1183 $. In the conversion, this was "un-expanded" (to $Id$) from the base code (the very first commit) and the corresponding apply-patch commit in the source-git repo. So when packit creates a patch to be included in SRPM it contains $Id$ which can't be applied to the tarball code any more.

TomasTomecek commented 3 years ago

I am trying to wrap my head around this. Can you see an easy solution here?

If not, I'd just turn it into a hard package and make it a single-commit repo.

jpopelka commented 3 years ago

I'd just turn it into a hard package and make it a single-commit repo.

which is what I did already: https://git.stg.centos.org/source-git/freeradius/commits/c8s-stream-3.0

TomasTomecek commented 3 years ago

thanks!