[Bug 204725] Mk/bsd.port.mk: makepatch inserts context junk after r401709
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Nov 22 09:18:29 UTC 2015
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204725
--- Comment #9 from commit-hook at freebsd.org ---
A commit references this bug:
Author: marino
Date: Sun Nov 22 09:18:07 UTC 2015
New revision: 402220
URL: https://svnweb.freebsd.org/changeset/ports/402220
Log:
Mk/Scripts/smart_makepatch.sh: Fix multi-patch file and locals bug
There were two issues with the new smart_makepatch script.
1) use of "local" declaration
All function variables were declared "local" during the review. This
caused the script to break, at least on FreeBSD 9.2. Given that it's
not being seen on 9.3R or later, it might be a bug in Bourne shell that
has since been fixed.
e.g. This resulted in stderr error on second iteration:
local contains=$(grep "^+++ " ${existing_patch} | awk '{x++; print x}')
however, this works fine:
local contains
contains=$(grep "^+++ " ${existing_patch} | awk '{x++; print x}')
To be safe, all local variables are assigned with $(<shell cmd>) on
separate lines now.
2) The comment extraction was flawed for files that contain multiple
patches. It was not counting the hunk lines properly which caused some
portion of a patch to be considered as a comment for the next patch. The
hunk traversal algorithm has been fixed.
Since 1) involved the introduction of local declarations that broke the
script and since only Scripts/smart_makepatch.sh is touched, I will
piggy-back on the original approval. The fix was tested with devel/nspr,
the port listed in the PR, which uses multi-patch files.
Approved by: portmgr
Differential Revision: D4136
PR: 204725
Changes:
head/Mk/Scripts/smart_makepatch.sh
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-ports-bugs
mailing list