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.

109 lines
2.4 KiB

  1. #!/bin/bash
  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/Create-PkgList
  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. nobroken=0
  25. if [ "$1" = "-nobroken" ] ; then
  26. nobroken=1 ; shift
  27. fi
  28. if [ "$1" -a ! -d architecture/"$1" ] ; then
  29. echo "Usage: $0 [ -nobroken ] [ <arch-name> ]" ; exit 1
  30. fi
  31. gawk '
  32. BEGIN {
  33. arch="'$1'";
  34. nobroken='$nobroken';
  35. }
  36. function print_package() {
  37. disable=0
  38. if ( nobroken ) {
  39. cachefile="package/" pkgtree "/" package "/" package ".cache";
  40. no_cache_file_found=1;
  41. while ( (getline line < cachefile) > 0 ) {
  42. no_cache_file_found=0;
  43. if ( line ~ /^\[.-ERROR\]/ ) {
  44. disable=1;
  45. }
  46. }
  47. close(cachefile);
  48. if ( no_cache_file_found ) disable=1;
  49. }
  50. if ( ! disable ) {
  51. print defset, stages, pri, pkgtree,
  52. package, ver, "/" categories flags, 0;
  53. }
  54. }
  55. END {
  56. if ( pkgtree ) print_package();
  57. }
  58. ( FNR == 1 && pkgtree ) {
  59. print_package();
  60. }
  61. FNR == 1 {
  62. split(FILENAME, a, /\//);
  63. pkgtree=a[2]; package=a[3];
  64. defset="X"; pri="999.999";
  65. stages="-----------";
  66. ver="0000"; categories=""
  67. flags=""
  68. }
  69. /^\[(P|PRI|PRIORITY)\]/ {
  70. split($0, a, /[ \t]+/);
  71. defset=a[2]; stages=a[3]; pri=a[4];
  72. }
  73. /^\[(V|VER|VERSION)\]/ {
  74. split($0, a, /[ \t]+/); ver=a[2];
  75. }
  76. /^\[(C|CATEGORY)\]/ {
  77. split($0, a, /[ \t]+/);
  78. for (c=2; a[c]; c++) categories = categories " " a[c];
  79. }
  80. /^\[(F|FLAGS)\]/ {
  81. split($0, a, /[ \t]+/);
  82. for (c=2; a[c]; c++) flags = flags " " a[c];
  83. }
  84. /^\[(R|ARCH|ARCHITECTURE)\]/ {
  85. split($0, a, /[ \t]+/);
  86. if ( arch != "" ) {
  87. if ( a[2] == "+" ) {
  88. if ( index($0, arch) == 0 ) pkgtree="";
  89. } else {
  90. if ( index($0, arch) != 0 ) pkgtree="";
  91. }
  92. }
  93. }
  94. ' package/*/*/*.desc | sort -k3