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.

123 lines
3.9 KiB

  1. #!/bin/bash
  2. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  3. #
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. # Please add additional copyright information _after_ the line containing
  6. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  7. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  8. #
  9. # ROCK Linux: rock-src/misc/desktop/parse-config
  10. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  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; either version 2 of the License, or
  15. # (at your option) any later version. A copy of the GNU General Public
  16. # License can be found at Documentation/COPYING.
  17. #
  18. # Many people helped and are helping developing ROCK Linux. Please
  19. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  20. # file for details.
  21. #
  22. # --- ROCK-COPYRIGHT-NOTE-END ---
  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. echo "Checking ${desktop} ... "
  89. rm -f "${tmp}"
  90. rm -f "${desktop}.new"
  91. while read line ; do
  92. if [ "${line:0:1}" == "[" ] ; then
  93. entry=$(( ${entry} + 1 ))
  94. if [ ${entry} -gt 1 ] ; then # this is to support multiple entries in one file
  95. if [ -f "${tmp}" ] ; then
  96. postflist_desktop_process_desktop "${tmp}"
  97. cat "${tmp}" >> "${desktop}.new"
  98. rm -f "${tmp}"
  99. fi
  100. fi
  101. fi
  102. echo "${line}" >>"${tmp}"
  103. done < "${desktop}"
  104. if [ -f "${tmp}" ] ; then
  105. postflist_desktop_process_desktop "${tmp}"
  106. cat "${tmp}" >> "${desktop}.new"
  107. rm -f "${tmp}"
  108. fi
  109. rm -f ${desktop}
  110. mv "${desktop}.new" "${desktop}"
  111. done
  112. }
  113. hook_add postflist 5 "[ \"\$desktopauto\" = 1 ] && postflist_desktop"