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.

126 lines
3.9 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/misc/desktop/parse-config
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. #!/bin/bash
  23. postflist_desktop_rock2desktop() {
  24. case "${1}" in
  25. base/boot) echo "Core" ;;
  26. base/kernel) echo "Core" ;;
  27. base/setup) echo "Core" ;;
  28. base/tool) echo "Core" ;;
  29. base/development) echo "Core" ;;
  30. base/system) echo "Core" ;;
  31. base/library) echo "Core" ;;
  32. base/x11) echo "Core" ;;
  33. extra/archive) echo "Archiving" ;;
  34. extra/base) echo "Core" ;;
  35. extra/crypto) echo "System;Security" ;;
  36. extra/configuration) echo "System" ;;
  37. extra/database) echo "Development;Database" ;;
  38. extra/desktop/kde) echo "Core" ;;
  39. extra/desktop/enlightenment) echo "Core" ;;
  40. extra/desktop/gnome) echo "Core" ;;
  41. extra/desktop/xfce) echo "Core" ;;
  42. extra/development) echo "Development" ;;
  43. extra/documentation) echo "Development" ;;
  44. extra/editor) echo "Utility;TextEditor" ;;
  45. extra/education) echo "Education" ;;
  46. extra/emulator) echo "Emulator" ;;
  47. extra/filesystem) echo "System;FileSystem" ;;
  48. extra/font) echo "Core" ;;
  49. extra/game) echo "Game" ;;
  50. extra/icon) echo "Core" ;;
  51. extra/login) echo "Core" ;;
  52. extra/multimedia) echo "AudioVideo" ;;
  53. extra/network) echo "Network" ;;
  54. extra/office) echo "Office" ;;
  55. extra/printing) echo "Office" ;;
  56. extra/scientific) echo "Science" ;;
  57. extra/screensaver) echo "Utility" ;;
  58. extra/security) echo "System;Security" ;;
  59. extra/server) echo "Core" ;;
  60. extra/shell) echo "Shell" ;;
  61. extra/text) echo "Utility;TextEditor" ;;
  62. extra/theme) echo "Core" ;;
  63. extra/tool) echo "Utility" ;;
  64. extra/toy) echo "Amusement" ;;
  65. extra/windowmanager) echo "Core" ;;
  66. extra/religion) echo "Utility" ;;
  67. *) echo "AIEE! postflist_desktop_rock2desktop is out of date!!" >&2 ;
  68. echo "I don't know what ${1} maps to!" >&2 ;
  69. abort ;;
  70. esac
  71. }
  72. postflist_desktop_process_desktop() {
  73. file=${1}
  74. if ! grep -q "Categories=" "${file}" ; then
  75. category="`postflist_desktop_rock2desktop ${desc_C}`"
  76. echo "Adding Categories tag (${category})"
  77. echo "Categories=${category}" >>"${file}"
  78. fi
  79. if ! grep -q "X-ROCK-Name=" "${file}" ; then
  80. echo "Adding X-ROCK-Name tag (${pkg})"
  81. echo "X-ROCK-Name=${pkg}" >>"${file}"
  82. fi
  83. }
  84. postflist_desktop() {
  85. tmp=`mktemp`
  86. grep \\.desktop\$ ${builddir}/flist.txt | while read desktop ; do
  87. [ ! -f "${desktop}" ] && continue
  88. [ "${desktop/opt?kde/}" != "${desktop}" ] && continue
  89. echo "Checking ${desktop} ... "
  90. rm -f "${tmp}"
  91. rm -f "${desktop}.new"
  92. while read line ; do
  93. if [ "${line:0:1}" == "[" ] ; then
  94. entry=$(( ${entry} + 1 ))
  95. if [ ${entry} -gt 1 ] ; then # this is to support multiple entries in one file
  96. if [ -f "${tmp}" ] ; then
  97. postflist_desktop_process_desktop "${tmp}"
  98. cat "${tmp}" >> "${desktop}.new"
  99. rm -f "${tmp}"
  100. fi
  101. fi
  102. fi
  103. echo "${line}" >>"${tmp}"
  104. done < "${desktop}"
  105. if [ -f "${tmp}" ] ; then
  106. postflist_desktop_process_desktop "${tmp}"
  107. cat "${tmp}" >> "${desktop}.new"
  108. rm -f "${tmp}"
  109. fi
  110. rm -f ${desktop}
  111. mv "${desktop}.new" "${desktop}"
  112. done
  113. }
  114. hook_add postflist 5 postflist_desktop