freebsd-ports/Mk/Scripts
John Marino 6819d5d636 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
2015-11-22 09:18:07 +00:00
..
actual-package-depends.sh - Remove dead function from find-lib.sh 2015-04-10 08:45:09 +00:00
check-stagedir.sh Add some work-in-progress scripts for splitting symbols out into PREFIX/lib/debug. 2015-10-19 17:04:33 +00:00
check_leftovers.sh Don't hardcode CCACHE_DIR. 2015-11-06 20:18:35 +00:00
depends-list.sh - Combine clean-depends-list.sh into depends-list.sh 2015-10-19 19:23:53 +00:00
dialog4ports.sh
do-depends.sh - Only consider missing dependency origins to be fatal if they were not 2015-11-13 18:00:34 +00:00
find-lib.sh - Provide a check/warning/fix for users that upgraded from an older release and missed UPDATING 20150213 2015-07-07 06:03:35 +00:00
functions.sh Fix partial tree checkouts with 'all-depends-list', 'make clean', etc, after 2015-11-09 18:52:19 +00:00
generate-symbols.sh Add some work-in-progress scripts for splitting symbols out into PREFIX/lib/debug. 2015-10-19 17:04:33 +00:00
plist_sub_sed_sort.sh Fix plist_sub_sed_sort.sh when value contains spaces 2014-04-20 23:47:25 +00:00
ports_env.sh Follow-up r399170 with a script, ports_env.sh, that can be used for the purpose. 2015-10-13 00:03:10 +00:00
qa.sh Switch strip test to using readelf(1) instead of file(1) to identify symbols. 2015-10-19 16:59:49 +00:00
security-check.awk - Move security-check.awk to Mk/Scripts where it is more proper these days. 2014-05-09 22:35:50 +00:00
smart_makepatch.sh Mk/Scripts/smart_makepatch.sh: Fix multi-patch file and locals bug 2015-11-22 09:18:07 +00:00