pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/bulk Added the KEEP_BUILDLOGS variable. If it is se...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/00ed2fc3172a
branches:  trunk
changeset: 507530:00ed2fc3172a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Feb 04 01:08:25 2006 +0000

description:
Added the KEEP_BUILDLOGS variable. If it is set to "yes", the build logs
of successful builds are not removed, only renamed. This variable will
be useful for examining the warnings that appear during the bulk builds
but are thrown away because the package builds fine. This feature is
experimental and thus not enabled by default.

diffstat:

 mk/bulk/bsd.bulk-pkg.mk |  27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diffs (69 lines):

diff -r 6eed8fa9d022 -r 00ed2fc3172a mk/bulk/bsd.bulk-pkg.mk
--- a/mk/bulk/bsd.bulk-pkg.mk   Sat Feb 04 00:41:43 2006 +0000
+++ b/mk/bulk/bsd.bulk-pkg.mk   Sat Feb 04 01:08:25 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.bulk-pkg.mk,v 1.114 2006/02/03 20:47:06 rillig Exp $
+#      $NetBSD: bsd.bulk-pkg.mk,v 1.115 2006/02/04 01:08:25 rillig Exp $
 
 #
 # Copyright (c) 1999, 2000 Hubert Feyrer <hubertf%NetBSD.org@localhost>
@@ -71,6 +71,11 @@
 # to build this package
 PRECLEAN?=     yes
 
+# Sometimes it's useful to not only keep the build logs from broken
+# packages, but also the ones from packages that worked.
+# This feature is still experimental.
+KEEP_BUILDLOGS?=       no
+
 # If OBJHOSTNAME is set, use first component of hostname in cache and log files
 # If OBJMACHINE is set, use ${MACHINE_ARCH} in the cache and log files
 .if defined(OBJHOSTNAME)
@@ -88,6 +93,10 @@
 # Package-specific files
 #
 
+# If the package has been built successfully, and if KEEP_BUILDLOGS is
+# set to "yes", the build log is saved in this file.
+BUILD_SUCCEEDED_FILE?= .build_succeeded${BULK_ID}
+
 # This file exists to mark a package as broken
 BROKENFILE?=   .broken${BULK_ID}.html
 
@@ -191,6 +200,7 @@
 _BROKENWRKLOG=         ${_BULK_PKGLOGDIR}/${BROKENWRKLOG}
 _BUILDLOG=             ${_BULK_PKGLOGDIR}/${BUILDLOG}
 _FORCEBROKENFILE=      ${_BULK_PKGLOGDIR}/${FORCEBROKENFILE}
+_BUILD_SUCCEEDED_FILE= ${_BULK_PKGLOGDIR}/${BUILD_SUCCEEDED_FILE}
 
 # Only create directories if ${PKGSRCDIR} != ${BULKFILESDIR}
 .if ${PKGSRCDIR} != ${BULKFILESDIR}
@@ -438,7 +448,12 @@
                ${DO}     ( ${MAKE} package 2>&1 ); \
                ) 2>&1 | ${TEE} -a ${_BUILDLOG:Q} ; \
                if [ -f ${PKGFILE} ]; then \
-                       ${RM} ${_BUILDLOG:Q} ; \
+                       case ${KEEP_BUILDLOGS} in                       \
+                       yes)    ${MV} ${_BUILDLOG:Q} ${_BUILD_SUCCEEDED_FILE:Q}; \
+                               ;;                                      \
+                       no)     ${RM} ${_BUILDLOG:Q};                   \
+                               ;;                                      \
+                       esac;                                           \
                else \
                        ${MV} ${_BUILDLOG:Q} ${_BROKENFILE:Q} ;\
                        if [ -f "${WRKLOG}" ]; then \
@@ -515,7 +530,13 @@
                ${BULK_MSG} "Build for ${PKGNAME} was not successful, aborting." | ${TEE} -a ${_BROKENFILE:Q} ; \
                exit 1; \
        else \
-               ${RM} -f ${_BUILDLOG:Q} ;\
+               case ${KEEP_BUILDLOGS} in                               \
+               yes)    ${TEST} ! -f ${_BUILDLOG:Q}                     \
+                       || ${MV} ${_BUILDLOG:Q} ${_BUILD_SUCCEEDED_FILE:Q}; \
+                       ;;                                              \
+               no)     ${RM} -f ${_BUILDLOG:Q};                        \
+                       ;;                                              \
+               esac;                                                   \
        fi
 .if ${BULKFILESDIR} != ${PKGSRCDIR}
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \



Home | Main Index | Thread Index | Old Index