3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by scripts/Create-CopyPatch.
6 # T2 SDE: scripts/Create-PkgQueue
7 # Copyright (C) 2004 - 2020 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 ROCK Linux Project
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- T2-COPYRIGHT-NOTE-END ---
27 config
=$2; shift; shift ;;
31 logdir
=$2; shift; shift ;;
35 nobrokendeps
=1; shift ;;
37 echo "Usage: $0 [ -cfg config ] [ -single ] \\"
38 echo " ${0//?/ } [ -logdir logdir ] [ -debug ]"
43 .
scripts
/parse-config
46 function check_package() {
47 split(pkgline, a); dep=a[2];
48 if ( a[1] != "X" || ! index(a[2], stagelevel) ) return;
53 logfile = logfile_tpl;
54 gsub("<stagelevel>", stagelevel, logfile);
55 gsub("<repository>", repository, logfile);
56 gsub("<package>", package, logfile);
58 errfile = logfile; outfile = logfile;
59 gsub("<log>", "log", logfile);
60 gsub("<log>", "err", errfile);
61 gsub("<log>", "out", outfile);
64 if ( (getline dummy < logfile == -1) &&
65 (getline dummy < errfile == -1) ) {
66 build_this_package = 1;
67 found_dependencies = 0;
71 if ( getline dummy < outfile != -1 )
72 build_this_package = 0;
74 if ( index(not_present, " " package " ") ) {
75 if (debug && build_this_package)
76 print "DEBUG: Not building " stagelevel "-" \
77 package ": earlier stages not done " \
79 build_this_package = 0;
82 if ( build_this_package && (package in database) ) {
83 split(database[package], a);
88 # if ( a[c] == package ) continue;
89 # if ( strtonum(c) <= 3 ) continue;
91 print "DEBUG: Checking " stagelevel \
92 "-" package ": needs " a[c];
93 if ( index(not_present, " " a[c] " ") &&
94 stagelevel != stage9_no_deps ) {
95 if (debug && build_this_package)
96 print "DEBUG: Not building " \
97 stagelevel "-" package \
98 ": " a[c] " is missing";
101 found_dependencies = 1;
105 # Do not build packages parallel in stage 0
107 if ( stagelevel == 0 && not_present != "")
108 build_this_package = 0;
110 # Do not build packages from stages > 0 if packages
111 # from stage 0 are still missing
113 if ( stagelevel == 0 )
114 stage0_not_present=1;
115 if ( stagelevel > 0 && stage0_not_present )
116 build_this_package = 0;
118 # Do not build packages from stages >= 2 if packages
119 # from stages <= 1 are not build already.
121 if ( stagelevel <= 1 )
122 stage01_not_present=1;
123 if ( stagelevel >= 2 && stage01_not_present )
124 build_this_package = 0;
126 # Only ignore deps in stage 9 if everything < stage 9
128 if ( stagelevel < 9 )
129 stage9_no_deps = "x";
131 # A packages without dependencies automatically depend
132 # on all packages build before it
133 if (found_dependencies == 0 && not_present != "" &&
134 stagelevel != stage9_no_deps)
135 build_this_package = 0;
137 # t2-debug must be build _after_ all other packages
138 if (package == "t2-debug" && not_present != "")
139 build_this_package = 0;
141 if (build_this_package) {
142 sub("^X ", priority " ", pkgline);
143 sub(" 0$", " " buildtime, pkgline);
144 print stagelevel, pkgline;
148 not_present = not_present " " package " ";
154 if ( (getline dummy < errfile != -1) ) {
155 not_present = not_present " " package " ";
159 close(logfile); # ignore errors here if we
160 close(errfile); # did not open this files
167 stage0_not_present=0;
168 stage01_not_present=0;
171 nobrokendeps='$nobrokendeps';
172 config="'$config'"; single='$single'; debug='$debug';
173 logdir="'"${logdir:-build/$SDECFG_ID/var/adm/logs}"'";
175 logfile_tpl = logdir "/<stagelevel>-<package>.<log>";
176 #depdb_file = "scripts/dep_db.txt";
177 packages_file = "config/" config "/packages";
179 #while ( (getline depline < depdb_file) > 0 )
180 # { $0 = depline; sub(/:/, "", $1); database[$1]=$0; }
183 for (stagelevel=0; stagelevel<=9; stagelevel++) {
184 while ( (getline pkgline < packages_file) > 0 ) {
187 close(packages_file);