OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.1 KiB

  1. #!/usr/bin/gawk -f
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  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
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  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 ---
  17. function check_package() {
  18. split(pkgline, a); dep=a[2];
  19. if ( ! index(a[2], stagelevel) ) return;
  20. repository = a[4];
  21. package = a[5];
  22. present = present " " package " ";
  23. if ( stagelevel < 2 ) return;
  24. depfile = depfile_tpl;
  25. gsub("<stagelevel>", stagelevel, depfile);
  26. gsub("<repository>", repository, depfile);
  27. gsub("<package>", package, depfile);
  28. firstent=1;
  29. gsub(" \\[.\\]:" repository "/" package ":[^ ]*", "", errors);
  30. while ( (getline depline < depfile) > 0 ) {
  31. split(depline, a);
  32. if (a[1] != "[DEP]") continue;
  33. for (c=2; a[c] != ""; c++) {
  34. if ( a[c] == package ) continue;
  35. if ( ! index(present, " " a[c] " ") ) {
  36. if (firstent)
  37. errors = errors " [" stagelevel "]:" \
  38. repository "/" package ":";
  39. errors = errors ":" a[c];
  40. firstent=0;
  41. }
  42. }
  43. }
  44. close(depfile);
  45. }
  46. BEGIN {
  47. present="";
  48. errors="";
  49. system("mkdir -p tmp ; ./bin/sde-list package > tmp/pkg_list");
  50. depfile_tpl = "package/<repository>/<package>/<package>.cache";
  51. for (stagelevel=0; stagelevel<9; stagelevel++) {
  52. while ( (getline pkgline < "tmp/pkg_list") > 0 ) {
  53. check_package();
  54. }
  55. close("tmp/pkg_list");
  56. }
  57. system("rm -f tmp/pkg_list");
  58. if (errors != "") {
  59. print "\nThe following packages have dependencies which";
  60. print "are not solved before stage 9:\n";
  61. print "Stage Package Dependencies";
  62. gsub(" ", "\n", errors);
  63. gsub("::", "\t", errors);
  64. gsub(":", " ", errors);
  65. print errors | "expand -t30";
  66. }
  67. }