Bug 24292 - update-patches target in ports/Mk/bsd.port.mk
Summary: update-patches target in ports/Mk/bsd.port.mk
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-01-12 21:20 UTC by Trevor Johnson
Modified: 2003-05-27 07:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Johnson 2001-01-12 21:20:00 UTC
Christian Weisgerber <naddy@openbsd.org>, supplied this patch in support
of ports/Tools/scripts/update-patches, a utility I've taken from OpenBSD
which helps manage changes to patch files when working with the ports
collection.  Without this support in bsd.port.mk, the script does not work
properly:  it will not always guess $WRKSRC correctly, and the generated
patches cannot be edited.

Fix: 

+DISTORIG?=	.bak.orig
 PATCH?=			/usr/bin/patch
 PATCH_STRIP?=	-p0
 PATCH_DIST_STRIP?=	-p0
 .if defined(PATCH_DEBUG)
 PATCH_DEBUG_TMP=	yes
 PATCH_ARGS?=	-d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?=	-d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
+PATCH_DIST_ARGS?=	-b ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
 .else
 PATCH_DEBUG_TMP=	no
 PATCH_ARGS?=	-d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?=	-d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
+PATCH_DIST_ARGS?=	-b ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
 .endif
 .if defined(BATCH)
 PATCH_ARGS+=		--batch
@@ -2325,6 +2326,16 @@
 	 done)
 .endif
 .endif
+
+# Generates patches.
+
+update-patches:
+	@toedit=`WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} PATCH_LIST=${PATCHDIR}/patch-* \
+		DIFF_ARGS=${DIFF_ARGS} DISTORIG=${DISTORIG} \
+		${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
+	case $$toedit in "");; \
+	*) ${ECHO} -n 'edit patches: '; read i; \
+	cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac

 # Checksumming utilities--WofekgzwGUwXPiA4K7qleCUpS6TnTEv0bZRveIcv49vsHWwd
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.360
diff -u -r1.360 bsd.port.mk
--- ports/Mk/bsd.port.mk	2000/11/16 13:06:25	1.360
+++ ports/Mk/bsd.port.mk	2000/12/28 17:58:49
@@ -955,17 +955,18 @@
 TOUCH?=			/usr/bin/touch
 TOUCH_FLAGS?=	-f
How-To-Repeat: 
N/A
Comment 1 Trevor Johnson freebsd_committer freebsd_triage 2001-03-31 09:35:47 UTC
Responsible Changed
From-To: asami->portmgr

change of maintainership of bsd.port.mk
Comment 2 Trevor Johnson 2002-04-01 10:29:47 UTC
Since I submitted this PR, there have been forty-six revisions to
bsd.port.mk and four releases of FreeBSD.  What, if anything, can I do to
speed up the process of getting this committed?
-- 
Trevor Johnson
Comment 3 Trevor Johnson 2002-05-25 16:18:46 UTC
I have updated the patch to support PATCH_WRKSRC, which was introduced in
revision 1.356 of bsd.port.mk.  See
http://people.freebsd.org/~trevor/ports/update-patches-1.411.diff .
-- 
Trevor Johnson
Comment 4 Kris Kennaway freebsd_committer freebsd_triage 2003-04-13 02:41:52 UTC
State Changed
From-To: open->analyzed

Currently undergoing pre-commit testing
Comment 5 Kris Kennaway freebsd_committer freebsd_triage 2003-05-06 06:15:25 UTC
State Changed
From-To: analyzed->closed

Patch committed, thanks!
Comment 6 Trevor Johnson 2003-05-24 04:05:16 UTC
> kris        2003/05/05 22:15:19 PDT
>
>   FreeBSD ports repository
>
>   Modified files:
>     Mk                   bsd.port.mk
>   Log:
>   - Add support for the Tools/scripts/update-patches script [1]

[...]

>   Submitted by:   trevor [1], lioux [2],
>                   Sergey Matveychuk <sem@ciam.ru> [3]
>   PR:             24292 [1], 47146 [3]

<URL:http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24292>

>
>   Revision  Changes    Path
>   1.448     +94 -44    ports/Mk/bsd.port.mk
>
> <URL:http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk.diff?&r1=1.447&r2=1.448&f=u>

In a follow-up to the PR, I said:

 Date: Sat, 25 May 2002 11:18:46 -0400 (EDT)

 I have updated the patch to support PATCH_WRKSRC, which was introduced in
 revision 1.356 of bsd.port.mk.  See
 http://people.freebsd.org/~trevor/ports/update-patches-1.411.diff .

The patch from 2001 was committed instead of the updated patch from 2002.
The older one no longer works.  The following patch is the difference
between what is in bsd.port.mk and what I submitted last year, which also
had a whitespace change for readability.

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.449
diff -u -r1.449 bsd.port.mk
--- bsd.port.mk	14 May 2003 16:47:31 -0000	1.449
+++ bsd.port.mk	24 May 2003 02:50:13 -0000
@@ -3421,7 +3421,9 @@
 # Generates patches.

 update-patches:
-	@toedit=`WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} PATCH_LIST=${PATCHDIR}/patch-* \
+	@toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
+		PATCHDIR=${PATCHDIR} \
+		PATCH_LIST=${PATCHDIR}/patch-* \
 		DIFF_ARGS=${DIFF_ARGS} DISTORIG=${DISTORIG} \
 		${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
 	case $$toedit in "");; \
-- 
Trevor Johnson
Comment 7 Trevor Johnson 2003-05-27 06:56:45 UTC
Please reopen PR 24292.  See my followups of May 25th, 2002 and May 23rd,
2003 for the reason.
-- 
Trevor Johnson