pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Apr  9 00:26:33 UTC 2025

Modified Files:
        pkgsrc/pkgtools/pbulk: Makefile
        pkgsrc/pkgtools/pbulk-base: Makefile
        pkgsrc/pkgtools/pbulk/files/pbulk: pbulk.conf
        pkgsrc/pkgtools/pbulk/files/pbulk/presolve: pbulk-resolve.1 presolve.c
        pkgsrc/pkgtools/pbulk/files/pbulk/scripts: scan

Log Message:
pbulk*: add a 'strict_mode' option to pbulk

When this is set to 'yes', pbulk will just exit if there is an
unresolvable dependency in the resolve phase, like it did before
pbulk-base-0.58/pbulk-0.74.

Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 pkgsrc/pkgtools/pbulk/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/pkgtools/pbulk-base/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/pkgtools/pbulk/files/pbulk/pbulk.conf
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/pkgtools/pbulk/files/pbulk/presolve/pbulk-resolve.1
cvs rdiff -u -r1.5 -r1.6 \
    pkgsrc/pkgtools/pbulk/files/pbulk/presolve/presolve.c
cvs rdiff -u -r1.11 -r1.12 pkgsrc/pkgtools/pbulk/files/pbulk/scripts/scan

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pbulk/Makefile
diff -u pkgsrc/pkgtools/pbulk/Makefile:1.94 pkgsrc/pkgtools/pbulk/Makefile:1.95
--- pkgsrc/pkgtools/pbulk/Makefile:1.94 Thu Jan 23 15:05:41 2025
+++ pkgsrc/pkgtools/pbulk/Makefile      Wed Apr  9 00:26:32 2025
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.94 2025/01/23 15:05:41 wiz Exp $
+# $NetBSD: Makefile,v 1.95 2025/04/09 00:26:32 wiz Exp $
 
-PKGNAME=       pbulk-0.75
+PKGNAME=       pbulk-0.76
 COMMENT=       Modular bulk build framework
 
 .include "../../pkgtools/pbulk/Makefile.common"

Index: pkgsrc/pkgtools/pbulk-base/Makefile
diff -u pkgsrc/pkgtools/pbulk-base/Makefile:1.29 pkgsrc/pkgtools/pbulk-base/Makefile:1.30
--- pkgsrc/pkgtools/pbulk-base/Makefile:1.29    Mon Jan 13 11:03:03 2025
+++ pkgsrc/pkgtools/pbulk-base/Makefile Wed Apr  9 00:26:33 2025
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.29 2025/01/13 11:03:03 wiz Exp $
+# $NetBSD: Makefile,v 1.30 2025/04/09 00:26:33 wiz Exp $
 
-DISTNAME=      pbulk-base-0.58
+DISTNAME=      pbulk-base-0.59
 COMMENT=       Core components of the modular bulk build framework
 
 .include "../../pkgtools/pbulk/Makefile.common"

Index: pkgsrc/pkgtools/pbulk/files/pbulk/pbulk.conf
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/pbulk.conf:1.28 pkgsrc/pkgtools/pbulk/files/pbulk/pbulk.conf:1.29
--- pkgsrc/pkgtools/pbulk/files/pbulk/pbulk.conf:1.28   Mon Jan 13 11:03:03 2025
+++ pkgsrc/pkgtools/pbulk/files/pbulk/pbulk.conf        Wed Apr  9 00:26:32 2025
@@ -1,4 +1,4 @@
-# $NetBSD: pbulk.conf,v 1.28 2025/01/13 11:03:03 wiz Exp $
+# $NetBSD: pbulk.conf,v 1.29 2025/04/09 00:26:32 wiz Exp $
 
 # Version of the configuration file. This is bumped whenever the default
 # config changes to notify the administrator about updates.
@@ -44,6 +44,11 @@ bootstrapkit=/usr/pkgsrc/bootstrap/boots
 # The file is a newline separated list of package locations (e.g. lang/perl5).
 #limited_list=/limited_list
 
+# In strict mode, unresolvable dependencies lead to pbulk stopping
+# with an error in the scan phase. Otherwise, these packages are
+# reported as broken in the bulk build report instead.
+strict_mode=no
+
 # If yes, consider a package up-to-date, if the dependency list matches
 # the existing binary package and the recorded RCS IDs match the pkgsrc
 # tree. Otherwise, additionally require that the package is not older

Index: pkgsrc/pkgtools/pbulk/files/pbulk/presolve/pbulk-resolve.1
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/presolve/pbulk-resolve.1:1.2 pkgsrc/pkgtools/pbulk/files/pbulk/presolve/pbulk-resolve.1:1.3
--- pkgsrc/pkgtools/pbulk/files/pbulk/presolve/pbulk-resolve.1:1.2      Mon Jan 13 11:03:03 2025
+++ pkgsrc/pkgtools/pbulk/files/pbulk/presolve/pbulk-resolve.1  Wed Apr  9 00:26:32 2025
@@ -1,4 +1,4 @@
-.\" $NetBSD: pbulk-resolve.1,v 1.2 2025/01/13 11:03:03 wiz Exp $
+.\" $NetBSD: pbulk-resolve.1,v 1.3 2025/04/09 00:26:32 wiz Exp $
 .\"
 .\" Copyright (c) 2007 Thomas Klausner and Joerg Sonnenberger.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 6, 2025
+.Dd January 20, 2025
 .Dt PBULK-RESOLVE 1
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 output
 .Sh SYNOPSIS
 .Nm
-.Op Fl v
+.Op Fl sv
 .Op Fl i Ar missing
 .Ar input Op ...
 .Sh DESCRIPTION
@@ -63,6 +63,9 @@ files are written to standard output inc
 dependencies.
 The location of each unresolved dependency is written to
 .Ar missing .
+.It Fl s
+Enter strict mode (see
+.Sx EXIT STATUS ) .
 .It Fl v
 If
 .Fl v
@@ -76,7 +79,9 @@ different packages can be used to fulfil
 .El
 .Sh EXIT STATUS
 .Nm
-exits with return value 0.
+exits with return value 0,
+except in strict mode where it will return 1 if a dependency could not
+be resolved.
 .Pp
 In incremental mode,
 .Ar missing

Index: pkgsrc/pkgtools/pbulk/files/pbulk/presolve/presolve.c
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/presolve/presolve.c:1.5 pkgsrc/pkgtools/pbulk/files/pbulk/presolve/presolve.c:1.6
--- pkgsrc/pkgtools/pbulk/files/pbulk/presolve/presolve.c:1.5   Mon Jan 13 11:03:03 2025
+++ pkgsrc/pkgtools/pbulk/files/pbulk/presolve/presolve.c       Wed Apr  9 00:26:32 2025
@@ -1,4 +1,4 @@
-/* $NetBSD: presolve.c,v 1.5 2025/01/13 11:03:03 wiz Exp $ */
+/* $NetBSD: presolve.c,v 1.6 2025/04/09 00:26:32 wiz Exp $ */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -46,13 +46,14 @@
 
 #include "pbulk.h"
 
-static int verbosity;
 static FILE *incremental = NULL;
+static int strict;
+static int verbosity;
 
 static void
 usage(void)
 {
-       (void)fprintf(stderr, "usage: pbulk-resolve [-v] [-i missing] <pscan output> [ ... ]\n");
+       (void)fprintf(stderr, "usage: pbulk-resolve [-sv] [-i missing] <pscan output> [ ... ]\n");
        exit(1);
 }
 
@@ -87,7 +88,7 @@ main(int argc, char **argv)
 
        setprogname("pbulk-resolve");
 
-       while ((ch = getopt(argc, argv, "i:pv")) != -1) {
+       while ((ch = getopt(argc, argv, "i:sv")) != -1) {
                switch (ch) {
                case 'i':
                        if (incremental != NULL)
@@ -95,6 +96,9 @@ main(int argc, char **argv)
                        if ((incremental = fopen(optarg, "w")) == NULL)
                                err(1, "Cannot open output file");
                        break;
+                case 's':
+                       ++strict;
+                        break;
                case 'v':
                        ++verbosity;
                        break;
@@ -305,7 +309,9 @@ resolve_entry(struct pkg_entry *pkg)
        free(depends_list);
        if (ret == 1) {
                free(pkg->depends);
-               pkg->depends = NULL;
+                pkg->depends = NULL;
+                if (strict)
+                       return 1;
        }
        return 0;
 }
@@ -403,7 +409,7 @@ write_entries(void)
                if (pkgs[i].active == 0)
                        continue;
                /* if package is ok, just print existing entry */
-               if (pkgs[i].broken == NULL) {
+               if (pkgs[i].broken == NULL || strict) {
                        (void)fwrite(pkgs[i].begin, 1, pkgs[i].end - pkgs[i].begin, stdout);
                } else {
                        /* otherwise, replace PKG_FAIL_REASON line with reason for brokenness */

Index: pkgsrc/pkgtools/pbulk/files/pbulk/scripts/scan
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/scripts/scan:1.11 pkgsrc/pkgtools/pbulk/files/pbulk/scripts/scan:1.12
--- pkgsrc/pkgtools/pbulk/files/pbulk/scripts/scan:1.11 Mon Jan 13 11:03:03 2025
+++ pkgsrc/pkgtools/pbulk/files/pbulk/scripts/scan      Wed Apr  9 00:26:33 2025
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: scan,v 1.11 2025/01/13 11:03:03 wiz Exp $
+# $NetBSD: scan,v 1.12 2025/04/09 00:26:33 wiz Exp $
 #
 # Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 # All rights reserved.
@@ -47,6 +47,17 @@ else
        extra_pscan_args=""
 fi
 
+case "${strict_mode}" in
+[yY][eE][sS])
+       extra_presolve_args="-s"
+       strict_mode=yes
+       ;;
+*)
+       extra_presolve_args=""
+       strict_mode=no
+       ;;
+esac
+
 if [ -n "${ignore_missing_dependencies}" ]; then
        echo "The 'ignore_missing_dependencies' configuration variable is obsolete and has no effect." >&2
 fi
@@ -66,7 +77,10 @@ if [ -z "${limited_list}" ]; then
                ;;
        esac
        echo "Resolving..."
-       ${presolve} -v ${loc}/pscan > ${loc}/presolve 2> ${loc}/presolve-err.log
+       if ! ${presolve} ${extra_presolve_args} -v ${loc}/pscan > ${loc}/presolve 2> ${loc}/presolve-err.log; then
+               # can only happen in strict mode
+               echo "Global dependency resolution failed, check ${loc}/presolve-err.log for details" >&2
+       fi
 else
        initial=1
        mkdir -p ${loc}
@@ -99,6 +113,11 @@ else
        done
 
        if [ -s ${loc}/missing ]; then
+               if [ "${strict_mode}" = "yes" ]; then
+                       echo "Unresolvable dependencies found, exiting"
+                       cat ${loc}/missing
+                       exit 1
+               fi
                echo "Unresolvable dependencies found, marking packages depending on them as broken:"
                cat ${loc}/missing
                ${presolve} -v ${loc}/presolve ${loc}/pscan > ${loc}/presolve.new



Home | Main Index | Thread Index | Old Index