* updated ktouch (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / scripts / Check-Deps-1
blob0692c8af5b6e30a91543c5ab5d65b8dbe7c9c97e
1 #!/usr/bin/gawk -f
3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by scripts/Create-CopyPatch.
5 #
6 # T2 SDE: scripts/Check-Deps-1
7 # Copyright (C) 2004 - 2020 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 ROCK Linux Project
9 #
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 ---
18 function check_package() {
19 split(pkgline, a); dep=a[2];
20 if ( ! index(a[2], stagelevel) ) return;
22 repository = a[4];
23 package = a[5];
25 present = present " " package " ";
26 if ( stagelevel < 2 ) return;
28 depfile = depfile_tpl;
29 gsub("<stagelevel>", stagelevel, depfile);
30 gsub("<repository>", repository, depfile);
31 gsub("<package>", package, depfile);
33 firstent=1;
34 gsub(" \\[.\\]:" repository "/" package ":[^ ]*", "", errors);
35 while ( (getline depline < depfile) > 0 ) {
36 split(depline, a);
37 if (a[1] != "[DEP]") continue;
39 for (c=2; a[c] != ""; c++) {
40 if ( a[c] == package ) continue;
41 if ( ! index(present, " " a[c] " ") ) {
42 if (firstent)
43 errors = errors " [" stagelevel "]:" \
44 repository "/" package ":";
45 errors = errors ":" a[c];
46 firstent=0;
51 close(depfile);
54 BEGIN {
55 present="";
56 errors="";
58 system("mkdir -p src; scripts/Create-PkgList > src/pkg_list");
59 depfile_tpl = "package/<repository>/<package>/<package>.cache";
61 for (stagelevel=0; stagelevel<9; stagelevel++) {
62 while ( (getline pkgline < "src/pkg_list") > 0 ) {
63 check_package();
65 close("src/pkg_list");
67 system("rm -f src/pkg_list");
69 if (errors != "") {
71 print "\nThe following packages have dependencies which";
72 print "are not solved before stage 9:\n";
74 print "Stage Package Dependencies";
76 gsub(" ", "\n", errors);
77 gsub("::", "\t", errors);
78 gsub(":", " ", errors);
80 print errors | "expand -t30";