3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Create-PkgQueue
5 # Copyright (C) 2004 - 2023 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # This Copyright note is generated by scripts/Create-CopyPatch,
9 # more information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
25 config
=$2; shift; shift ;;
29 logdir
=$2; shift; shift ;;
35 nobrokendeps
=1; shift ;;
37 echo "Usage: $0 [ -cfg config ] [ -single ] [ -index ]\\"
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;
54 logfile = logfile_tpl;
55 gsub("<stagelevel>", stagelevel, logfile);
56 gsub("<repository>", repository, logfile);
57 gsub("<package>", package, logfile);
59 errfile = logfile; outfile = logfile;
60 gsub("<log>", "log", logfile);
61 gsub("<log>", "err", errfile);
62 gsub("<log>", "out", outfile);
65 if ((getline dummy < logfile == -1) &&
66 (getline dummy < errfile == -1)) {
67 build_this_package = 1;
68 found_dependencies = 0;
72 if (getline dummy < outfile != -1)
73 build_this_package = 0;
75 if (index(not_present, " " package " ")) {
76 if (debug && build_this_package)
77 print "DEBUG: Not building " stagelevel "-" \
78 package ": earlier stages not done " \
80 build_this_package = 0;
83 if (build_this_package && (package in database)) {
84 split(database[package], a);
89 # if (a[c] == package) continue;
90 # if (strtonum(c) <= 3) continue;
92 print "DEBUG: Checking " stagelevel \
93 "-" package ": needs " a[c];
94 if (index(not_present, " " a[c] " ") &&
95 stagelevel != stage9_no_deps) {
96 if (debug && build_this_package)
97 print "DEBUG: Not building " \
98 stagelevel "-" package \
99 ": " a[c] " is missing";
100 build_this_package=0;
102 found_dependencies = 1;
106 # Do not build packages parallel in stage 0
108 if (stagelevel == 0 && not_present != "")
109 build_this_package = 0;
111 # Do not build packages from stages > 0 if packages
112 # from stage 0 are still missing
115 stage0_not_present=1;
116 if (stagelevel > 0 && stage0_not_present)
117 build_this_package = 0;
119 # Do not build packages from stages >= 2 if packages
120 # from stages <= 1 are not build already.
123 stage01_not_present=1;
124 if (stagelevel >= 2 && stage01_not_present)
125 build_this_package = 0;
127 # Only ignore deps in stage 9 if everything < stage 9
130 stage9_no_deps = "x";
132 # A packages without dependencies automatically depend
133 # on all packages build before it
134 if (found_dependencies == 0 && not_present != "" &&
135 stagelevel != stage9_no_deps)
136 build_this_package = 0;
138 # t2-debug must be build _after_ all other packages
139 if (package == "t2-debug" && not_present != "")
140 build_this_package = 0;
142 if (build_this_package) {
143 sub("^X ", priority " ", pkgline);
144 sub(" 0$", " " buildtime, pkgline);
146 print stepi, stagelevel, pkgline;
148 print stagelevel, pkgline;
152 not_present = not_present " " package " ";
157 if ((getline dummy < errfile != -1)) {
158 not_present = not_present " " package " ";
162 close(logfile); # ignore errors here if we
163 close(errfile); # did not open this files
170 stage0_not_present=0;
171 stage01_not_present=0;
175 nobrokendeps='$nobrokendeps';
176 config="'$config'"; single='$single'; debug='$debug'; idx='$index';
177 logdir="'"${logdir:-build/$SDECFG_ID/var/adm/logs}"'";
179 logfile_tpl = logdir "/<stagelevel>-<package>.<log>";
180 #depdb_file = "scripts/dep_db.txt";
181 packages_file = "config/" config "/packages";
183 #while ((getline depline < depdb_file) > 0)
184 # { $0 = depline; sub(/:/, "", $1); database[$1]=$0; }
187 for (stagelevel=0; stagelevel<=9; stagelevel++) {
188 while ((getline pkgline < packages_file) > 0) {
191 close(packages_file);