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.

74 lines
1.9 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-3
  11. # ROCK Linux is Copyright (C) 1998 - 2003 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);
  26. package = a[5];
  27. if ( package == ARGV[2] ) running = 1;
  28. if ( ! running ) return;
  29. if ( ! index(a[2], stagelevel) ) return;
  30. split(depdb[package], a);
  31. for (c=1; a[c] != ""; c++) {
  32. if ( a[c] == package ) continue;
  33. if ( broken[a[c]] ) {
  34. print "[" stagelevel "] package " \
  35. package " depends on " a[c];
  36. broken[package]=1;
  37. }
  38. }
  39. }
  40. BEGIN {
  41. if ( ! ARGV[3] ) {
  42. print "Usage: ./scripts/Check-Dep-3 " \
  43. "<stagelevel> <package-name> <pkg-list-file>";
  44. exit 1;
  45. }
  46. running = 0;
  47. broken[ARGV[2]] = 1;
  48. while ( (getline depline < "scripts/dep_db.txt") > 0 ) {
  49. p=depline; sub(":.*", "", p);
  50. d=depline; sub("^[^ ] [^ ] [^ ] ", "", d);
  51. depdb[p] = d;
  52. }
  53. for (stagelevel=ARGV[1]; stagelevel<=9; stagelevel++) {
  54. while ( (getline pkgline < ARGV[3]) > 0 ) {
  55. check_package();
  56. }
  57. close(ARGV[3]);
  58. }
  59. if ( ! running ) {
  60. print "Package " ARGV[2] " not found!";
  61. exit 1;
  62. }
  63. exit 0;
  64. }