mirror of the now-defunct rocklinux.org
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.

90 lines
2.4 KiB

  1. #!/usr/bin/gawk -f
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/Check-Deps-1
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. function check_package() {
  25. split(pkgline, a); dep=a[2];
  26. if ( ! index(a[2], stagelevel) ) return;
  27. repository = a[4];
  28. package = a[5];
  29. present = present " " package " ";
  30. if ( stagelevel < 2 ) return;
  31. depfile = depfile_tpl;
  32. gsub("<stagelevel>", stagelevel, depfile);
  33. gsub("<repository>", repository, depfile);
  34. gsub("<package>", package, depfile);
  35. firstent=1;
  36. gsub(" \\[.\\]:" repository "/" package ":[^ ]*", "", errors);
  37. while ( (getline depline < depfile) > 0 ) {
  38. split(depline, a);
  39. if (a[1] != "[DEP]") continue;
  40. for (c=2; a[c] != ""; c++) {
  41. if ( a[c] == package ) continue;
  42. if ( ! index(present, " " a[c] " ") ) {
  43. if (firstent)
  44. errors = errors " [" stagelevel "]:" \
  45. repository "/" package ":";
  46. errors = errors ":" a[c];
  47. firstent=0;
  48. }
  49. }
  50. }
  51. close(depfile);
  52. }
  53. BEGIN {
  54. present="";
  55. errors="";
  56. system("mkdir -p src ; ./scripts/Create-PkgList > src/pkg_list");
  57. depfile_tpl = "package/<repository>/<package>/<package>.cache";
  58. for (stagelevel=0; stagelevel<9; stagelevel++) {
  59. while ( (getline pkgline < "src/pkg_list") > 0 ) {
  60. check_package();
  61. }
  62. close("src/pkg_list");
  63. }
  64. system("rm -f src/pkg_list");
  65. if (errors != "") {
  66. print "\nThe following packages have dependencies which";
  67. print "are not solved before stage 9:\n";
  68. print "Stage Package Dependencies";
  69. gsub(" ", "\n", errors);
  70. gsub("::", "\t", errors);
  71. gsub(":", " ", errors);
  72. print errors | "expand -t30";
  73. }
  74. }