Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Sep 2000 13:21:39 +0300
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        asami@FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   Extending bsd.port.mk diagnostics when some of the patches fail to apply  [patch for review]
Message-ID:  <39B377B3.B10E748C@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------44BB3878D8B5CBEFE15D295F
Content-Type: text/plain; charset=x-user-defined
Content-Transfer-Encoding: 7bit

Hi,

I'm sure all hardcore porters are aware of this problem: when you are trying to
update some port and not all patches applied cleanly there is no easy way to
figure from error message which patches have been applied and which one has
not. The following patch is expected to make a life of porter a bit easier by
extending verbosity of error messages in this case (it doesn't affect anything
if all patches were applied cleanly).

For example with this patch applied you will have the following diagnostics:

$ make patch
===>  Patching for someport-3.0.1
===>  Applying FreeBSD patches for someport-3.0.1
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to AUTHORS.rej
>> Patch patch-ac failed to apply cleanly.
>> Patches patch-aa patch-ab were applied cleanly.
*** Error code 1

Stop in /usr/tmp/MyPorts/someport.
*** Error code 1


-Maxim

--------------44BB3878D8B5CBEFE15D295F
Content-Type: text/plain; charset=x-user-defined;
 name="bsd.port.mk-patches.errors.handling-diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bsd.port.mk-patches.errors.handling-diff"

--- /usr/ports/Mk/bsd.port.mk	2000/09/03 09:53:09	1.1
+++ /usr/ports/Mk/bsd.port.mk	2000/09/03 10:35:18
@@ -1699,6 +1699,7 @@
 			fi; \
 		else \
 			${ECHO_MSG} "===>  Applying ${OPSYS} patches for ${PKGNAME}" ; \
+			PATCHES_APPLIED="" ; \
 			for i in ${PATCHDIR}/patch-*; do \
 				case $$i in \
 					*.orig|*.rej|*~) \
@@ -1708,7 +1709,15 @@
 						if [ ${PATCH_DEBUG_TMP} = yes ]; then \
 							${ECHO_MSG} "===>   Applying ${OPSYS} patch $$i" ; \
 						fi; \
-						${PATCH} ${PATCH_ARGS} < $$i; \
+						if ${PATCH} ${PATCH_ARGS} < $$i ; then \
+							PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
+						else \
+							${ECHO_MSG} `${ECHO} ">> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
+							if [ x"$$PATCHES_APPLIED" != x"" ]; then \
+								${ECHO_MSG} `${ECHO} ">> Patches $$PATCHES_APPLIED were applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
+							fi; \
+							${FALSE} ; \
+						fi; \
 						;; \
 				esac; \
 			done; \

--------------44BB3878D8B5CBEFE15D295F--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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