Bug 223545 - [exp-run] patch(1) change to reject non-matching patches with limited context
Summary: [exp-run] patch(1) change to reject non-matching patches with limited context
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kyle Evans
URL:
Keywords:
Depends on: 223446
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-08 23:19 UTC by Kyle Evans
Modified: 2018-03-19 13:08 UTC (History)
2 users (show)

See Also:
antoine: exp-run+


Attachments
patch against head (494 bytes, patch)
2017-11-08 23:19 UTC, Kyle Evans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Evans freebsd_committer freebsd_triage 2017-11-08 23:19:10 UTC
Created attachment 187868 [details]
patch against head

Attached patch against is intended to reject non-matching patches with limited context rather than apply them incorrectly. There was some fallout from this (r325365) and the commit has been converted. Please run an exp-run to figure out the extent of the fallout. =)
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-11-09 20:10:10 UTC
A commit references this bug:

Author: antoine
Date: Thu Nov  9 20:09:19 UTC 2017
New revision: 453865
URL: https://svnweb.freebsd.org/changeset/ports/453865

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/devel/cppcheck/files/patch-CMakeLists.txt
  head/devel/cppcheck/files/patch-gui_CMakeLists.txt
  head/devel/p5-Config-Auto/files/patch-Makefile.PL
  head/graphics/ImageMagick/files/patch-config_policy.xml
  head/graphics/ImageMagick7/files/patch-config_policy.xml
  head/japanese/esecanna/files/patch-README.jp
  head/lang/tcl84/files/patch-warnings
  head/www/py-gunicorn/files/patch-requirements__test.txt
  head/x11/rxvt-unicode/files/patch-src_gencompose
  head/x11/rxvt-unicode/files/patch-src_genlinedraw
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-11-09 20:18:18 UTC
A commit references this bug:

Author: antoine
Date: Thu Nov  9 20:17:22 UTC 2017
New revision: 453866
URL: https://svnweb.freebsd.org/changeset/ports/453866

Log:
  Regenerate patch-warnings so that it applies with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/devel/tcllib/files/patch-warnings
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-11-09 20:45:42 UTC
A commit references this bug:

Author: antoine
Date: Thu Nov  9 20:45:05 UTC 2017
New revision: 453869
URL: https://svnweb.freebsd.org/changeset/ports/453869

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/biology/tinker/files/patch-bench__bench1.run
  head/biology/tinker/files/patch-bench__bench2.run
  head/java/eclipse/files/patch-submodules
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-11-09 22:17:55 UTC
A commit references this bug:

Author: antoine
Date: Thu Nov  9 22:17:08 UTC 2017
New revision: 453874
URL: https://svnweb.freebsd.org/changeset/ports/453874

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/cad/meshlab/files/patch-common_common.pro
  head/cad/qcad/files/patch-src_core_RS.cpp
  head/databases/postgresql-libpqxx3/files/patch-svn_1833
  head/emulators/pcsxr/files/patch-pixmaps-Makefile.am
  head/games/blockout/Makefile
  head/graphics/dia/files/patch-app_main.c
  head/graphics/dia/files/patch-doc_fr_Makefile.in
  head/www/domoticz/files/patch-appversion.default
  head/x11-themes/murrine-configurator/files/patch-files__murrine-configurator
  head/x11-toolkits/hs-wx/Makefile
  head/x11-toolkits/hs-wx/files/patch-src_Graphics_UI_WX_Window.hs
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-11-09 23:12:49 UTC
A commit references this bug:

Author: antoine
Date: Thu Nov  9 23:12:04 UTC 2017
New revision: 453879
URL: https://svnweb.freebsd.org/changeset/ports/453879

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/comms/birda/files/patch-lib-Makefile
Comment 6 Pedro F. Giffuni freebsd_committer freebsd_triage 2017-11-09 23:17:29 UTC
(In reply to Kyle Evans from comment #0)

I have a small concern here: patch(1) should be able to apply any patch generated by diff(1).

For the ports tree, in particular, it seems critical that anything generated with "make makepatch" (diff -upn if I remember well) should always work with patch(1).

I looked at some of the ports that are affected and portlint does complain about the original patches: if it's just old patches that still apply by sheer luck then it's OK, otherwise we shouldn't have to use specific diff flags to generate valid patches.
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-11-10 07:11:25 UTC
A commit references this bug:

Author: antoine
Date: Fri Nov 10 07:10:35 UTC 2017
New revision: 453885
URL: https://svnweb.freebsd.org/changeset/ports/453885

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/comms/morse/files/patch-QSO.1
  head/databases/mongodb32-tools/files/patch-vendor_src_github.com_spacemonkeygo_openssl_build.go
  head/databases/mongodb34-tools/files/patch-vendor_src_github.com_spacemonkeygo_openssl_build.go
  head/sysutils/mapchan/files/patch-examples__default
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-11-10 17:33:53 UTC
A commit references this bug:

Author: antoine
Date: Fri Nov 10 17:33:31 UTC 2017
New revision: 453906
URL: https://svnweb.freebsd.org/changeset/ports/453906

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/net/openmq/files/patch-imqbrokerd
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-11-10 19:16:14 UTC
A commit references this bug:

Author: antoine
Date: Fri Nov 10 19:15:32 UTC 2017
New revision: 453924
URL: https://svnweb.freebsd.org/changeset/ports/453924

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/devel/py-pykdeuic4/files/patch-CMakeLists.txt
Comment 10 commit-hook freebsd_committer freebsd_triage 2017-11-11 07:12:10 UTC
A commit references this bug:

Author: antoine
Date: Sat Nov 11 07:11:38 UTC 2017
New revision: 453953
URL: https://svnweb.freebsd.org/changeset/ports/453953

Log:
  Fix the context of some patches so that they apply with stricter patch(1)

  PR:		223545
  With hat:	portmgr

Changes:
  head/net/tcpick/files/patch-src_lookup.h
  head/net-mgmt/librenms/files/patch-poller-wrapper.py
Comment 11 Antoine Brodin freebsd_committer freebsd_triage 2017-11-14 16:05:53 UTC
Exp-run looks fine.  Could you send an email to notice about this change and ask committers to test with the newer version of patch(1) before committing?
Comment 12 Kyle Evans freebsd_committer freebsd_triage 2017-11-14 17:00:41 UTC
(In reply to Antoine Brodin from comment #11)

An e-mail to freebsd-ports@, or is there a more appropriate place?
Comment 13 commit-hook freebsd_committer freebsd_triage 2017-11-22 03:44:57 UTC
A commit references this bug:

Author: kevans
Date: Wed Nov 22 03:44:20 UTC 2017
New revision: 326084
URL: https://svnweb.freebsd.org/changeset/base/326084

Log:
  patch(1): don't assume a match if we run out of context to check

  Patches with very little context (-U0 and -U1) could get misapplied if
  the file to be patched changes and a hunk is no longer applicable. Matching
  with fuzz would be attempted and default to a match when we unexpectedly ran
  out of context.

  This also affected patches with higher levels of context but had limited
  actual context due to the hunk being located near the beginning/end of file.

  PR:		74127, 223545 (exp-run)
  Reviewed by:	emaste, pfg
  Approved by:	emaste (mentor)
  Differential Revision:	https://reviews.freebsd.org/D12631

Changes:
  head/usr.bin/patch/patch.c
Comment 14 commit-hook freebsd_committer freebsd_triage 2018-01-25 06:44:56 UTC
A commit references this bug:

Author: antoine
Date: Thu Jan 25 06:43:53 UTC 2018
New revision: 459908
URL: https://svnweb.freebsd.org/changeset/ports/459908

Log:
  Fix the context of this patch so that its applies with stricter patch(1)

  PR:		223545

Changes:
  head/devel/dub/files/patch-source-dub_version-d
Comment 15 commit-hook freebsd_committer freebsd_triage 2018-01-25 06:46:00 UTC
A commit references this bug:

Author: antoine
Date: Thu Jan 25 06:44:59 UTC 2018
New revision: 459909
URL: https://svnweb.freebsd.org/changeset/ports/459909

Log:
  MFH: r459908

  Fix the context of this patch so that its applies with stricter patch(1)

  PR:		223545

Changes:
_U  branches/2018Q1/
  branches/2018Q1/devel/dub/files/patch-source-dub_version-d
Comment 16 Kyle Evans freebsd_committer freebsd_triage 2018-02-14 17:33:12 UTC
Closing this, since I think all cases have been hammered out.
Comment 17 commit-hook freebsd_committer freebsd_triage 2018-03-19 13:08:21 UTC
A commit references this bug:

Author: antoine
Date: Mon Mar 19 13:07:26 UTC 2018
New revision: 465011
URL: https://svnweb.freebsd.org/changeset/ports/465011

Log:
  Fix patch context so it applies with stricted patch(1)

  PR:		223545

Changes:
  head/devel/dub/files/patch-source-dub_version-d