Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 May 2017 23:19:36 +0900
From:      Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
To:        freebsd-current@freebsd.org
Cc:        bapt@FreeBSD.org, alexander@wittig.name
Subject:   Re: ports-mgmt/pkg_rmleaves stops working properly on -head after bsdiff became default diff (r317209)
Message-ID:  <20170515231936.9aba0763a8eef73f64ced0c1@dec.sakura.ne.jp>
In-Reply-To: <20170514160355.5da31fb2f3c8a163e024acdf@dec.sakura.ne.jp>
References:  <20170514160355.5da31fb2f3c8a163e024acdf@dec.sakura.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Revised like Boris did for misc/mc [1].

Now attached raw Makefile and patch (renamed), as patch does not
handle new files on nonexistent files directory. :-(

PORTREVISION bumped, as this port is small enough and NO_BUILD,
and need updating for recent -head.

But at least 2 ports is affected for now, and possibly more.
IMHO, these Gnu diff compatible group-format related options
would be worth implemented by bsdiff.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219277


On Sun, 14 May 2017 16:03:55 +0900
Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote:

> Hi.
> Posting on freebsd-current as this only affects -head.
> 
> I recently noticed ports-mgmt/pkg_rmleaves failes to process
> new leaf ports after removal of leaf ports on -head with error
> messages below.
> 
> > diff: unrecognized option `--unchanged-line-format='
> > usage: diff [-abdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]
> >             [--no-ignore-case] [--normal] [--strip-trailing-cr]
> > [--tabsize] [-I pattern] [-L label] file1 file2
> >        diff [-abdilpTtw] [-I pattern] [-L label] [--ignore-case]
> >             [--no-ignore-case] [--normal] [--strip-trailing-cr]
> > [--tabsize] -C number file1 file2
> >        diff [-abdiltw] [-I pattern] [--ignore-case] [--no-ignore-case]
> >             [--normal] [--strip-trailing-cr] [--tabsize] -D string
> > file1 file2 diff [-abdilpTtw] [-I pattern] [-L label] [--ignore-case]
> >             [--no-ignore-case] [--normal] [--tabsize]
> > [--strip-trailing-cr] -U number file1 file2
> >        diff [-abdilNPprsTtw] [-c | -e | -f | -n | -q | -u]
> > [--ignore-case] [--no-ignore-case] [--normal] [--tabsize] [-I pattern]
> > [-L label] [-S name] [-X file] [-x pattern] dir1 dir2
> 
> stable/11 was OK, and the difference is that stable/11 has gnu diff
> as diff, while -head has bsdiff as diff.
> 
> There's 2 (or possibly 3) options.
> 
>  a) Let pkg_rmleaves use gnu diff via textprocs/diffutils.
>     This is easiest (Minimal diff is attached), but doesn't help
>     any other ports affected. Just change diff to gdiff and RUN_DEPENDS
>     on textproc/diffutils.
> 
>  b) Update bsdiff to support missing options below.
>     This is over my hand, but if possible, would help others.
> 
>  c) If the missing options below are implemented as different
>     (non-documented) options on bsdiff, use them for bsdiff instead.
>     Will need OSVERSION check in ports Makefile.
> 
> Please note that attached diff is really MINIMAL to work on -head.
> No OSVERSION switching is implemented and no bumps so forcibly
> installs textproc/diffutils on revisions with gnu diff is /usr/bin/diff.
> And patch wouldn't work properly as files directory doesn't exist
> in pkg-mgmt/pkg_rmleaves. (At least system patch.)
> 
> I wonder which option should be taken, so not yet filed PR on bugzilla.
> It should be filed differently with which option is taken.
> 
> -- 
> Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>


-- 
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>

[-- Attachment #2 --]
# Created by: Timothy Redaelli <drizzt@gufi.org>
# $FreeBSD: head/ports-mgmt/pkg_rmleaves/Makefile 345688 2014-02-23 01:51:24Z jhale $

PORTNAME=	pkg_rmleaves
PORTVERSION=	20140222
PORTREVISION=	1
CATEGORIES=	ports-mgmt
MASTER_SITES=	http://alex.wittig.name/${PORTNAME}/

MAINTAINER=	alexander@wittig.name
COMMENT=	Interactive script for deinstalling leaf packages

LICENSE=	BSD2CLAUSE

.include <bsd.port.pre.mk>

.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200030
RUN_DEPENDS=	gdiff:textproc/diffutils

EXTRA_PATCHES=	${FILESDIR}/extra-patch-pkg_rmleaves
.endif

NO_BUILD=	yes

WRKSRC=		${WRKDIR}

PLIST_FILES=	sbin/pkg_rmleaves man/man1/pkg_rmleaves.1.gz

do-install:
	${INSTALL_SCRIPT} ${WRKSRC}/pkg_rmleaves ${STAGEDIR}${PREFIX}/sbin/pkg_rmleaves
	${INSTALL_MAN} ${WRKSRC}/pkg_rmleaves.1 ${STAGEDIR}${MAN1PREFIX}/man/man1

.include <bsd.port.post.mk>

[-- Attachment #3 --]
--- pkg_rmleaves.orig	2014-02-22 21:21:47.000000000 +0900
+++ pkg_rmleaves	2017-05-14 02:16:55.751443000 +0900
@@ -74,7 +74,7 @@ checkLeafs() {
 	fi | sort | sed -e "y/\"/'/" -e 's/#&quot;#/"/g' > "$PKGFILE"
 
 	if [ -f "$PREV" ]; then
-		diff --unchanged-line-format='' --old-line-format='' --new-line-format='%L' "$PREV" "$PKGFILE" > "$TMPFILE"
+		gdiff --unchanged-line-format='' --old-line-format='' --new-line-format='%L' "$PREV" "$PKGFILE" > "$TMPFILE"
 	else
 		cp "$PKGFILE" "$TMPFILE"
 	fi


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170515231936.9aba0763a8eef73f64ced0c1>