Bug 219277 - [patch] misc/mc: use textproc/diffutils at FreeBSD-12 after switch to bsddiff
Summary: [patch] misc/mc: use textproc/diffutils at FreeBSD-12 after switch to bsddiff
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ben Woods
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-14 14:38 UTC by Boris Samorodov
Modified: 2017-05-29 13:50 UTC (History)
4 users (show)

See Also:


Attachments
Use textproc/diffutils at FreeBSD-12 after switch to bsddiff (1.33 KB, patch)
2017-05-14 14:38 UTC, Boris Samorodov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Samorodov freebsd_committer freebsd_triage 2017-05-14 14:38:40 UTC
Created attachment 182593 [details]
Use textproc/diffutils at FreeBSD-12 after switch to bsddiff

misc/mc has an awesome feature to compare two files and highlight the differences. However the gnu specific diff options are hardcoded at sources, ex. src/diffviewer/ydiff.c:
---
    800 static int
    801 dff_execute (const char *args, const char *extra, const char *file1, const char *file2,
    802              GArray * ops)
    803 {
    804     static const char *opt =
    805         " --old-group-format='%df%(f=l?:,%dl)d%dE\n'"
    806         " --new-group-format='%dea%dF%(F=L?:,%dL)\n'"
    807         " --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)\n'"
    808         " --unchanged-group-format=''";
---

FreeBSD has switched to bsddiff recently, from /usr/src/UPDATING:
---
20170420:
        GNU diff has been replaced by a BSD licensed diff. Some features of GNU
        diff has not been implemented, if those are needed a newer version of
        GNU diff is available via the diffutils package under the gdiff name.
---

So, to keep the aforementioned functionality we should use gnu diff util.

To reproduce the issue, use a fresh FreeBSD-current, install misc/mc and try to compare two files (F9->command->compare files) and get the error:
---
diff: unrecognized option `--old-group-format=%df%(f=l?:,%dl)d%dE`
[...]
---

I propose a patch (mind the new file at ${FILESDIR}).
Comment 1 Ben Woods freebsd_committer freebsd_triage 2017-05-29 13:47:22 UTC
Committed. Thanks for the patch!
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-05-29 13:50:44 UTC
A commit references this bug:

Author: woodsb02
Date: Mon May 29 13:50:20 UTC 2017
New revision: 441985
URL: https://svnweb.freebsd.org/changeset/ports/441985

Log:
  misc/mc: Use textproc/diffutils on FreeBSD 12

  - The new bsddiff in FreeBSD 12 does not yet support --old-group-format
  - Fix python shebangfix to require python2

  PR:		219277
  Submitted by:	bsam

Changes:
  head/misc/mc/Makefile
  head/misc/mc/files/extra-patch-src_diffviewer_ydiff.c