pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pbulk/files/pbulk/pbuild



Module Name:    pkgsrc
Committed By:   joerg
Date:           Fri Feb 10 22:59:13 UTC 2023

Modified Files:
        pkgsrc/pkgtools/pbulk/files/pbulk/pbuild: jobs.c

Log Message:
Simplify DAG size computation. NFC


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/pbulk/files/pbulk/pbuild/jobs.c

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/files/pbulk/pbuild/jobs.c
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/pbuild/jobs.c:1.16 pkgsrc/pkgtools/pbulk/files/pbulk/pbuild/jobs.c:1.17
--- pkgsrc/pkgtools/pbulk/files/pbulk/pbuild/jobs.c:1.16        Tue Nov  3 19:06:47 2015
+++ pkgsrc/pkgtools/pbulk/files/pbulk/pbuild/jobs.c     Fri Feb 10 22:59:13 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: jobs.c,v 1.16 2015/11/03 19:06:47 joerg Exp $ */
+/* $NetBSD: jobs.c,v 1.17 2023/02/10 22:59:13 joerg Exp $ */
 
 /*-
  * Copyright (c) 2007, 2009, 2011 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -153,12 +153,12 @@ SLIST_HEAD(depth_tree_head, build_job);
 
 static int
 compute_tree_depth_rec(struct build_job *job, struct build_job *root,
-    struct depth_tree_head *head, int *count)
+    struct depth_tree_head *head)
 {
        struct dependency_list *dep_iter;
        struct build_job *job_iter;
 
-       if (job == root && *count != 0) {
+       if (job == root && root->pkg_depth != 0) {
                fprintf(stderr, "Cyclic dependency for package:\n%s\n", job->pkgname);
                return -1;
        }
@@ -168,10 +168,9 @@ compute_tree_depth_rec(struct build_job 
                        return 0;
        }
        SLIST_INSERT_HEAD(head, job, depth_tree_link);
-       *count = *count + 1;
+       ++root->pkg_depth;
        SLIST_FOREACH(dep_iter, &job->depending_pkgs, depends_link) {
-               if (compute_tree_depth_rec(dep_iter->dependency, root,
-                   head, count)) {
+               if (compute_tree_depth_rec(dep_iter->dependency, root, head)) {
                        fprintf(stderr, "%s\n", job->pkgname);
                        return -1;
                }
@@ -186,7 +185,7 @@ compute_tree_depth(struct build_job *job
 
        SLIST_INIT(&head);
        job->pkg_depth = 0;
-       if (compute_tree_depth_rec(job, job, &head, &job->pkg_depth))
+       if (compute_tree_depth_rec(job, job, &head))
                exit(1);
 }
 



Home | Main Index | Thread Index | Old Index