pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/scripts While walking the dependency graph, push th...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8607ecf6d768
branches:  trunk
changeset: 506772:8607ecf6d768
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat Jan 21 22:16:13 2006 +0000

description:
While walking the dependency graph, push the dependencies onto the
stack in the reverse order that show-depends-pkgpaths outputs them.
This makes the top element of the stack the first child dependency
that was marked as "pushed".  This change orders the default "postfix"
output of this script in such a way that for any package listed in
the output, there is no earlier package that depends on it.

In other words, you can take the default output and install from first
to last and never need to install any dependencies, because any
dependencies are guaranteed to have already been installed earlier.

diffstat:

 mk/scripts/depends-depth-first.awk |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r a27d82dea444 -r 8607ecf6d768 mk/scripts/depends-depth-first.awk
--- a/mk/scripts/depends-depth-first.awk        Sat Jan 21 21:46:24 2006 +0000
+++ b/mk/scripts/depends-depth-first.awk        Sat Jan 21 22:16:13 2006 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -f
 #
-# $NetBSD: depends-depth-first.awk,v 1.4 2006/01/21 21:46:24 jlam Exp $
+# $NetBSD: depends-depth-first.awk,v 1.5 2006/01/21 22:16:13 jlam Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -221,10 +221,14 @@
                while (cmd | getline depends_pkgpath) {
                        if (status[depends_pkgpath] == "") {
                                status[depends_pkgpath] = "pushed"
-                               push(dir_stack, depends_pkgpath)
+                               push(tmp_stack, depends_pkgpath)
                        }
                }
                close(cmd)
+               while (!empty(tmp_stack)) {
+                       push(dir_stack, top(tmp_stack))
+                       pop(tmp_stack)
+               }
        }
        exit 0
 }



Home | Main Index | Thread Index | Old Index