sde-commit: Changed commit message generator to use pkg: instead of [pkg]
[opensde-nopast.git] / scripts / Check-Deps-1
blob4343d6f1463248248300b65e79e3e69660952ae8
1 #!/usr/bin/gawk -f
2 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # Filename: scripts/Check-Deps-1
6 # Copyright (C) 2006 - 2007 The OpenSDE Project
7 # Copyright (C) 2004 - 2006 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 Clifford Wolf
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 # --- SDE-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 tmp ; ./bin/sde-list package > tmp/pkg_list");
59 depfile_tpl = "package/<repository>/<package>/<package>.cache";
61 for (stagelevel=0; stagelevel<9; stagelevel++) {
62 while ( (getline pkgline < "tmp/pkg_list") > 0 ) {
63 check_package();
65 close("tmp/pkg_list");
67 system("rm -f tmp/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";