Bug 280289 - textproc/mgdiff: fix MASTERSITES, and change to lesstif
Summary: textproc/mgdiff: fix MASTERSITES, and change to lesstif
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
: 261554 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-07-15 09:18 UTC by Chris Hutchinson
Modified: 2024-07-17 19:44 UTC (History)
2 users (show)

See Also:


Attachments
patch for textproc/mgdiff (16.24 KB, patch)
2024-07-15 09:18 UTC, Chris Hutchinson
portmaster: maintainer-approval+
Details | Diff
Fix segfault when calling libgnuregex while using open-motif. (1.99 KB, patch)
2024-07-16 02:57 UTC, Cy Schubert
no flags Details | Diff
textproc/mgdiff: Port maintainer will become upstream of mgdiff (1.02 KB, patch)
2024-07-16 15:39 UTC, Cy Schubert
no flags Details | Diff
textproc/mgdiff: changes as discussed (16.63 KB, patch)
2024-07-16 17:30 UTC, Chris Hutchinson
portmaster: maintainer-approval+
Details | Diff
textproc/mgdiff: update MASTERSITES, WWW (2.18 KB, patch)
2024-07-17 00:52 UTC, Chris Hutchinson
portmaster: maintainer-approval+
Details | Diff
textproc/mgdiff: move to public VCS (2.46 KB, patch)
2024-07-17 06:22 UTC, Chris Hutchinson
portmaster: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Hutchinson 2024-07-15 09:18:36 UTC
Created attachment 252063 [details]
patch for textproc/mgdiff

textproc/mgdiff,
MASTERSITES went missing, move source to Codeberg,
while here, move desktop icon from files/ to source.
This patch also addresses bug #261554 by changing
from motif to lesstif. This tif change is only a
stop-gap till I can investigate this matter further.
I have tested all these changes, and everything works
as intended.

Port works as intended after install. All port tests
return OK.

Thanks!
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2024-07-15 14:42:24 UTC
The problem with moving to lesstif is that should a person want to install mgdiff, it will remove motif which also removes a bunch of other packages, including CDE. This is at best a workaround but not a real solution.
Comment 2 Chris Hutchinson 2024-07-15 19:06:45 UTC
(In reply to Cy Schubert from comment #1)
Right. That's why I called it a "stop-gap". :)

OTOH what has happened with open-motif (both
motif && -devel) that mgdiff no longer functions
as intended? Looks like I'm going to need to start
walking the motif commit history until I find the
offending commit, then submit a patch to the maintainer.

Until I find the offending commit. This patch works as
intended and there's little reason not to commit it.
Comment 3 Chris Hutchinson 2024-07-15 21:48:25 UTC
OK I walked back version by version to 2.3.5, installing
and testing mgdiff against them. But all attempts still
return; exited on signal 11 (core dumped).
I'm now not so sure it's only motif. Shutting down my
jails also return signal 11. So there's something more subtle
at play, I think.

Until that can be discovered. I'm sticking to lesstif.
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2024-07-15 21:58:44 UTC
I'm building relevant ports WITH_DEBUG. The backtrace will tell us where it's failing.
Comment 5 Chris Hutchinson 2024-07-15 22:29:36 UTC
(In reply to Cy Schubert from comment #4)
You're now officially my hero. :)

Thanks.
Comment 6 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 02:57:19 UTC
Created attachment 252091 [details]
Fix segfault when calling libgnuregex while using open-motif.

(In reply to Chris Hutchinson from comment #5)

Anybody can do this.

Attached is the fix. Instead of calling libgnuregexec's regexec() function we call the FreeBSD libc regexec() function.

I will commit this.
Comment 7 Chris Hutchinson 2024-07-16 05:08:48 UTC
> Anybody can do this.
True. But given it previously worked with motif, and
currently works with lesstif. I spent my time going a different
direction. Given that failed. I was only too pleased you chose
to do this.

Thanks, again!
Comment 8 Chris Hutchinson 2024-07-16 05:11:14 UTC
Comment on attachment 252091 [details]
Fix segfault when calling libgnuregex while using open-motif.

Approved. Thanks, Cy for all the time you invested here.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-07-16 12:43:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0ba6ae2c12e3a5c0b7a2aac812e25a02a32ae0b3

commit 0ba6ae2c12e3a5c0b7a2aac812e25a02a32ae0b3
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-07-16 02:47:29 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-07-16 12:41:56 +0000

    textproc/mgdiff: Fix segfault when with open file dialogue box

    Under open-motif we see a segfault when mgdiff calls regexec() in
    libgnuregexec's regexec.c at line 782. Let's avoid libgnuregexec
    entirely and use the regexec(3) provided by FreeBSD's libc instead.
    This resolves the segfault and as a bonus we reduce mgdiff's
    dependency list.

    We also remove a now incorrect comment in the patch. It was misleading
    since the EXTRA_LIBRARIES for Dell SVR4 had already been removed.

    PR:             280289
    Approved by:    portmaster@BSDforge.com (maintainer)
    MFH:            2024Q3

 textproc/mgdiff/Makefile              |  4 +---
 textproc/mgdiff/files/patch-Imakefile | 16 ++++++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-07-16 12:46:04 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=04a09c2ce8894c4f5252d6d0256f5bce799ec289

commit 04a09c2ce8894c4f5252d6d0256f5bce799ec289
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-07-16 02:47:29 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-07-16 12:44:47 +0000

    textproc/mgdiff: Fix segfault when with open file dialogue box

    Under open-motif we see a segfault when mgdiff calls regexec() in
    libgnuregexec's regexec.c at line 782. Let's avoid libgnuregexec
    entirely and use the regexec(3) provided by FreeBSD's libc instead.
    This resolves the segfault and as a bonus we reduce mgdiff's
    dependency list.

    We also remove a now incorrect comment in the patch. It was misleading
    since the EXTRA_LIBRARIES for Dell SVR4 had already been removed.

    PR:             280289
    Approved by:    portmaster@BSDforge.com (maintainer)

    (cherry picked from commit 0ba6ae2c12e3a5c0b7a2aac812e25a02a32ae0b3)

 textproc/mgdiff/Makefile              |  4 +---
 textproc/mgdiff/files/patch-Imakefile | 16 ++++++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-07-16 12:54:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c959ac70e0d4d13041fcd40feae9169598a7ca2e

commit c959ac70e0d4d13041fcd40feae9169598a7ca2e
Author:     Chris Hutchinson <portmaster@BSDforge.com>
AuthorDate: 2024-07-16 12:52:36 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-07-16 12:52:36 +0000

    textproc/mgdiff: Fix MASTERSITES

    PR:     280289
    MFH:    2024Q3

 textproc/mgdiff/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-07-16 12:55:07 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=99434265ed0025ede0c80de884d5ffd5c8498857

commit 99434265ed0025ede0c80de884d5ffd5c8498857
Author:     Chris Hutchinson <portmaster@BSDforge.com>
AuthorDate: 2024-07-16 12:52:36 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-07-16 12:54:26 +0000

    textproc/mgdiff: Fix MASTERSITES

    PR:     280289
    MFH:    2024Q3
    (cherry picked from commit c959ac70e0d4d13041fcd40feae9169598a7ca2e)

 textproc/mgdiff/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Comment 13 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 13:33:47 UTC
*** Bug 261554 has been marked as a duplicate of this bug. ***
Comment 14 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 14:11:03 UTC
Chris,

I had to revert the MASTERSITES commit because it failed to fetch. Can you please double check the URL?

Also, would it make more sense to use both URLs in MASTERSITES? Yours first and Xorg's after yours?
Comment 15 Chris Hutchinson 2024-07-16 14:36:46 UTC
(In reply to Cy Schubert from comment #14)
> I had to revert the MASTERSITES commit because it failed to
> fetch. Can you please double check the URL?
I reapplied my changes (MASTERSITES/distinfo) after your revert
and it (still) works as intended. I can't explain your experience
to the contrary.
Comment 16 Chris Hutchinson 2024-07-16 14:49:34 UTC
ports5/textproc/mgdiff % make deinstall clean distclean
===>  Deinstalling for mgdiff
===>   mgdiff not installed, skipping
===>  Cleaning for mgdiff-1.0_7
===>  Deleting distfiles for mgdiff-1.0_7

ports5/textproc/mgdiff % head ./Makefile 
PORTNAME=	mgdiff
DISTVERSION=	1.0
PORTREVISION=	7
CATEGORIES=	textproc
MASTER_SITES=	https://codeberg.org/BSDforge/${PORTNAME}/archive/${DISTVERSIONFULL}${EXTRACT_SUFX}?dummy=/
#DISTNAME=	${PORTNAME}

MAINTAINER=	portmaster@BSDforge.com
COMMENT=	Graphical front end to the UNIX diff command
WWW=		https://BSDforge.com/projects/textproc/mgdiff/

ports5/textproc/mgdiff % make -DBATCH makesum
===>  License MIT accepted by the user
===>  License MIT accepted by the user
===>   mgdiff-1.0_7 depends on file: /usr/local/sbin/pkg - found
=> mgdiff-1.0.tar.gz doesn't seem to exist in /root/PDEV/ports5/distfiles/.
=> Attempting to fetch https://codeberg.org/BSDforge/mgdiff/archive/1.0.tar.gz?dummy=/mgdiff-1.0.tar.gz
mgdiff-1.0.tar.gz                                       45 kB  299 kBps    00s
===> Fetching all distfiles required by mgdiff-1.0_7 for building
Comment 17 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 14:51:31 UTC
(In reply to Chris Hutchinson from comment #15)

I can reapply but, I see you have added copyright yourself. I don't see any significant changes except:

Jul 16 07:49 2024 mgdiff1 only and mgdiff only Page 1


                                            ./LICENSE
                                            ./README
                                            ./README.md
                                            ./mgdiff-48x48.xpm

Do you intend to maintain a separate copy of mgdiff? If yes, would it not make more sense to add a port that uses your fork instead?
Comment 18 Chris Hutchinson 2024-07-16 15:01:36 UTC
(In reply to Cy Schubert from comment #17)
> Also, would it make more sense to use both URLs in MASTERSITES?
> Yours first and Xorg's after yours?
No. That site is dead:
make -DBATCH patch
===>  License MIT accepted by the user
===>   mgdiff-1.0_7 depends on file: /usr/local/sbin/pkg - found
=> mgdiff.tar.gz doesn't seem to exist in /root/PDEV/ports5/distfiles/.
=> Attempting to fetch ftp://ftp.gwdg.de/pub/x11/x.org/contrib/applications/mgdiff.tar.gz
fetch: ftp://ftp.gwdg.de/pub/x11/x.org/contrib/applications/mgdiff.tar.gz: Connection refused
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/mgdiff.tar.gz
mgdiff.tar.gz                                           40 kB 2512 kBps    00s

Which is why I moved the project to Codeberg. I added myself to the copyright,
as I intend to continue to maintain it. I also have additional stuff I haven't
(yet) committed.

I'll be moving (changing) the WWW to Codeberg shortly.
Comment 19 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 15:05:47 UTC
(In reply to Chris Hutchinson from comment #18)

Let's do this then. Move the existing mgdiff port to mgdiff-legacy. The main mgdiff port can be based on your sources. Does this make sense.

If you want I can take on maintainership of the legacy port so you are not encumbered with PRs, like it won't fetch.

What do you think?
Comment 20 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 15:06:26 UTC
Or you can maintain both. Your choice.
Comment 21 Chris Hutchinson 2024-07-16 15:22:14 UTC
(In reply to Cy Schubert from comment #19)
> Let's do this then. Move the existing mgdiff port to mgdiff-legacy.
> The main mgdiff port can be based on your sources. Does this make sense.

> If you want I can take on maintainership of the legacy port so you are
> not encumbered with PRs, like it won't fetch.

> What do you think?
Hmm. Seems like the copyright stuff makes you uncomfortable. The
new LICENSE file is simply copied out of the head of the source.
I only added myself, as I intend to make changes as necessary to
keep it functional for as long as anyone continues to use it.

I don't care if I get any credit for any of my work. It's more
in an effort to let users know that someone maintains it, and who
to contact in regards to it. As Daniel is unlikely to respond / care.

If it makes you more comfortable. I'll just remove my name, and we
can proceed with the port as if nothing has changed.
Comment 22 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 15:39:16 UTC
Created attachment 252107 [details]
textproc/mgdiff: Port maintainer will become upstream of mgdiff

(In reply to Chris Hutchinson from comment #21)
Typically one would change the copyright after one makes changes to the source.

This is not about credit. It's all about the fork. As you intend to become the upstream for mgdiff I'll commit the change as such. "Fix MASTERSITES" was not completely correct then.

Here's a copy of the proposed commit message:

    textproc/mgdiff: Port maintainer will become upstream of mgdiff
    
    The port maintainer wishes to host mgdiff off his own site and
    maintain mgdiff. This is in a sense a fork of the sources, which are
    essentailly not maintained by Xorg.
    
    PR:             280289


Do you have a git repo that one can follow your progress?
Comment 23 Chris Hutchinson 2024-07-16 15:51:41 UTC
Right. Then I'll just pull my name out of the newly (copied
from source) LICENSE file, and we'll proceed as a "relocated"
mgdiff project. :)

> Do you have a git repo that one can follow your progress?
Of course:
https://codeberg.org/BSDforge/mgdiff/src/branch/main

Let me remove my name from LICENSE, tag the changes at 1.1
and submit a patch which adds all the changes we've agreed
on here, with the addition of WWW pointing to Codeberg repo.

Sound agreeable?
Comment 24 Chris Hutchinson 2024-07-16 16:09:04 UTC
OK I've updated Codeberg based on our discussion.
If everything looks/seems good to you. I'll tag it at 1.1
and submit a patch for your approval.
Comment 25 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 16:30:55 UTC
(In reply to Chris Hutchinson from comment #23)

Personally, I don't care about the license or attribution. It just seemed odd as typically a copyright is altered after changes have been made not before. But this is your business. I simply pointed this out because it seemed odd.

Your proposed changes are fine. Just submit a patch using git-format-patch. I'll git-am and do a quick test and push the commit for you.

BTW, just searching github, there appear to be quite a few "forks" of mgdiff. Seems there's more interest in mgdiff than I would have thought.
Comment 26 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 16:31:38 UTC
(In reply to Chris Hutchinson from comment #24)

Perfect! Thanks.
Comment 27 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 16:40:30 UTC
On second thought, maybe incorporate the patch files into your upstream as well, before releasing 1.1.
Comment 28 Chris Hutchinson 2024-07-16 17:23:33 UTC
> On second thought, maybe incorporate the patch files into your
> upstream as well, before releasing 1.1.
Sorry. I missed this comment before pulling the trigger. :(
I'm going to simply make an #ifdef (FreeBSD) out of your change.
So as to still be generic enough for others. We can land that in 1.2. :)
Comment 29 Chris Hutchinson 2024-07-16 17:30:38 UTC
Created attachment 252108 [details]
textproc/mgdiff: changes as discussed

OK here's all the changes as discussed.
Your patch-Imakefile was not ports framework friendly. So I tweaked it.
Files affected in this patch:

Makefile              
distinfo              
files/mgdiff-48x48.xpm (removed)
files/patch-Imakefile

Please tweak the commit subject/message to your liking.

Builds/Installs as expected/intended.
All tests return OK.

Thanks for all your time invested on this, Cy!
Comment 30 Cy Schubert freebsd_committer freebsd_triage 2024-07-16 17:40:34 UTC
Looking at your commit, we no longer do jumbo commits. We try to separate each functional commit out into separate commits so that,

1) the commit log reflects the actual change,
2) should a commit need to be reverted, not all the updates will necessarily need to be,
3) for those following reading the logs and the patches, months down the road the reader doesn't need to parse out the different changes from the commit just to understand what is being done by each.

#3 above was drilled into my by my src mentor when my ports commit bit was updated to include src. This is the most important reason we do this. Though, historically ports committers have batched many changes into a single commit because after the switch from CVS to SVN, we discovered that subversion would grow significantly with each commit regardless of the size of the commit. This is no longer a problem with GIT. We try to make each commit granular enough to help those reading the logs bisecting changes to the tree understand them better. Some projects don't do this and trying to figure out what each change is time consuming. Especially if multiple changes affect the same line or lines of code.

If you want we can do a phabricator review instead.
Comment 31 Chris Hutchinson 2024-07-17 00:52:56 UTC
Created attachment 252113 [details]
textproc/mgdiff: update MASTERSITES, WWW

OK let's try this;
The patch attached fixes the commit you reverted. Nothing more.
That way, we can resolve the original intent of this pr(1)
w/o complicating/inflating anything.

Files affected:

Makefile
distinfo

Changes:
MASTERSITES, WWW, distinfo

Patch is easy to read for even the uninitiated. :)
Comment 32 Cy Schubert freebsd_committer freebsd_triage 2024-07-17 01:52:23 UTC
(In reply to Chris Hutchinson from comment #31)

The port commit message still doesn't describe what is being changed and why.

I took it upon myself earlier this afternoon to commit a patch that switches the fetch URL to codeberg. Here is what I wrote earlier today:

    textproc/mgdiff: Port maintainer will become upstream of mgdiff
    
    The port maintainer wishes to host mgdiff off his codeberg forking
    mgdiff because Xorg doesn't actively maintain mgdiff.
    
    PR:             280289

Just itemize what you're changing and why.

The patch itself looks OK.
Comment 33 Chris Hutchinson 2024-07-17 06:22:34 UTC
Created attachment 252118 [details]
textproc/mgdiff: move to public VCS

OK this patch is the same as before. But comes with a better
subject and description, based on your feedback.

Thanks, Cy.
Comment 34 commit-hook freebsd_committer freebsd_triage 2024-07-17 19:23:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ebd88827296f5c4f1b68c87f882886ffb199b5cd

commit ebd88827296f5c4f1b68c87f882886ffb199b5cd
Author:     Chris Hutchinson <portmaster@BSDforge.com>
AuthorDate: 2024-07-17 00:42:14 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-07-17 19:22:28 +0000

    textproc/mgdiff: move source to public VCS; Codeberg

    The original source location went dark. This patch moves the
    original source to a public VCS, as it's still a suprisingly
    popular utility. This patch changes MASTERSITES, WWW and distinfo.
    While here, use desktop icon now located with the source.

    PR:     280289
    MFH:    2024Q3

 textproc/mgdiff/Makefile | 13 +++++++------
 textproc/mgdiff/distinfo |  5 +++--
 2 files changed, 10 insertions(+), 8 deletions(-)
Comment 35 commit-hook freebsd_committer freebsd_triage 2024-07-17 19:41:57 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=723ddd51709d86d9ce13ce343e9ede4b651cf270

commit 723ddd51709d86d9ce13ce343e9ede4b651cf270
Author:     Chris Hutchinson <portmaster@BSDforge.com>
AuthorDate: 2024-07-17 00:42:14 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-07-17 19:41:15 +0000

    textproc/mgdiff: move source to public VCS; Codeberg

    The original source location went dark. This patch moves the
    original source to a public VCS, as it's still a suprisingly
    popular utility. This patch changes MASTERSITES, WWW and distinfo.
    While here, use desktop icon now located with the source.

    PR:     280289

    (cherry picked from commit ebd88827296f5c4f1b68c87f882886ffb199b5cd)

 textproc/mgdiff/Makefile | 13 +++++++------
 textproc/mgdiff/distinfo |  5 +++--
 2 files changed, 10 insertions(+), 8 deletions(-)
Comment 36 Cy Schubert freebsd_committer freebsd_triage 2024-07-17 19:44:20 UTC
I think this pretty much fixes the current mgdiff issues. Thank you for the patch and thank you for maintaining the port.