ignatenkobrain reported a new issue against the project: `releng` that you are following: `` ```python #!/usr/bin/python3 import re import sys
replace = False out = [] with open(sys.argv[1], "r"): for l in open(sys.argv[1], "r"): out.append(l) if l.startswith("%changelog"): replace = True continue if not replace: continue if l.startswith("%"): replace = False continue if l.startswith("*"): # XXX: HACK continue out[-1] = re.sub(r"([^%])%([^% \n\d])", r"\1%%\2", l)
with open(sys.argv[1], "w") as f: f.writelines(out) ```
This is something I've been using for automatic fix myself. I think we should either prohibit pushing this or have git-hook which would fix it automatically. ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
pingou added a new comment to an issue you are following: `` I'd go for the preventing the push just because it's potentially less error-prone to have a human apply the fix. ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
praiskup added a new comment to an issue you are following: `` I'm not sure fixing by server-side hook is even possible, so +1 for push reject here. ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
zbyszek added a new comment to an issue you are following: `` Why ` if l.startswith("*"): continue`? This is very likely to be an error too, e.g.:
dracut/dracut.spec 1385:* Fri May 20 2011 Harald Hoyer harald@redhat.com 011-0.1%{?rdist}
``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
zbyszek added a new comment to an issue you are following: `` ... I'd rather see a whitelist of macros allowed in the changelog, if there are any that can be legitimately used. ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
praiskup added a new comment to an issue you are following: `` I guess there already is some `pre-receive` hook in each rpm repo. So here [1] is possible script which could be run like `./no-macro-in-changelog test.spec oldhash newhash`. For local testing, there's also pre-receive hook.
[1] https://github.com/praiskup/pre-receive-hooks ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
syeghiay added a new comment to an issue you are following: `` @ignatenkobrain is still this an issue? ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
ignatenkobrain added a new comment to an issue you are following: `` that's RFE. ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
The status of the issue: `Deny push / Implement git hook for unescaped macro in %changelog` of project: `releng` has been updated to: Closed as Can't Fix by syeghiay.
syeghiay added a new comment to an issue you are following: `` Sorry but this can't be fixed at this time. ``
To reply, visit the link below or just reply to this email https://pagure.io/releng/issue/7300
rel-eng@lists.fedoraproject.org