pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Tightened the code and improved the diagnostics.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/64fd70ffb380
branches:  trunk
changeset: 499848:64fd70ffb380
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Sep 28 10:06:05 2005 +0000

description:
Tightened the code and improved the diagnostics.

diffstat:

 mk/bsd.pkg.patch.mk |  25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diffs (58 lines):

diff -r 71cf94fe90a9 -r 64fd70ffb380 mk/bsd.pkg.patch.mk
--- a/mk/bsd.pkg.patch.mk       Wed Sep 28 09:52:52 2005 +0000
+++ b/mk/bsd.pkg.patch.mk       Wed Sep 28 10:06:05 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.patch.mk,v 1.18 2005/09/22 18:21:00 rillig Exp $
+# $NetBSD: bsd.pkg.patch.mk,v 1.19 2005/09/28 10:06:05 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and defines the
 # relevant variables and targets for the "patch" phase.
@@ -214,6 +214,11 @@
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        fail=;                                                          \
        patches=${_PKGSRC_PATCHES:Q};                                   \
+       patch_warning() {                                               \
+               ${ECHO_MSG} "**************************************";   \
+               ${ECHO_MSG} "$$1";                                      \
+               ${ECHO_MSG} "**************************************";   \
+       };                                                              \
        for i in $$patches; do                                          \
                ${TEST} -f "$$i" || continue;                           \
                case "$$i" in                                           \
@@ -225,33 +230,21 @@
                        ;;                                              \
                ${PATCHDIR}/patch-*)                                    \
                        if ${TEST} ! -f ${DISTINFO_FILE:Q}; then        \
-                               ${ECHO_MSG} "**************************************"; \
-                               ${ECHO_MSG} "Ignoring unknown patch file: $$i"; \
-                               ${ECHO_MSG} "**************************************"; \
+                               patch_warning "Ignoring patch file $$i: distinfo not found"; \
                                continue;                               \
                        fi;                                             \
                        filename=`${BASENAME} $$i`;                     \
                        algsum=`${AWK} '(NF == 4) && ($$2 == "('$$filename')") && ($$3 == "=") {print $$1 " " $$4}' ${DISTINFO_FILE} || ${TRUE}`; \
                        if ${TEST} -z "$$algsum"; then                  \
-                               ${ECHO_MSG} "**************************************"; \
-                               ${ECHO_MSG} "Ignoring unknown patch file: $$i"; \
-                               ${ECHO_MSG} "**************************************"; \
+                               patch_warning "Ignoring patch file $$i: no checksum found"; \
                                continue;                               \
                        fi;                                             \
                        set -- $$algsum;                                \
                        { alg="$$1"; recorded="$$2";                    \
                          calcsum=`${SED} -e '/\$$NetBSD.*/d' $$i | ${DIGEST} $$alg`; \
                          ${ECHO_PATCH_MSG} "=> Verifying $$filename (using digest algorithm $$alg)"; \
-                         if ${TEST} -z "$$recorded"; then              \
-                               ${ECHO_MSG} "**************************************"; \
-                               ${ECHO_MSG} "Ignoring unknown patch file: $$i"; \
-                               ${ECHO_MSG} "**************************************"; \
-                               continue;                               \
-                         fi;                                           \
                          if ${TEST} "$$calcsum" != "$$recorded"; then  \
-                               ${ECHO_MSG} "**************************************"; \
-                               ${ECHO_MSG} "Patch file $$i has been modified"; \
-                               ${ECHO_MSG} "**************************************"; \
+                               patch_warning "Ignoring patch file $$i: invalid checksum"; \
                                fail="$$fail $$i";                      \
                                continue;                               \
                          fi; };                                        \



Home | Main Index | Thread Index | Old Index