Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Nov 2015 09:18:29 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 204725] Mk/bsd.port.mk: makepatch inserts context junk after r401709
Message-ID:  <bug-204725-13-6nbnYA1a8c@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-204725-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-204725-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204725

--- Comment #9 from commit-hook@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-204725-13-6nbnYA1a8c>