Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

glorious funtoo updates

merged:

  funtoo-overlay: 6b848391914f518fc6192914bac3278af32da80e
  foo-overlay: 51b7b4f479ac7bdc89ff28e0b67a27645b1b6e1a
  bar-overlay: 09dbf39ca3130b8fa3d3c049518b56edd8dffcbe
  mate: 61884c81ba11a45aa114e76ddc08510457479ea1
  squeezebox: cda6d46cdfdfb2f3329ce89a3faad053b1476ed1
  sabayon-for-gentoo: 8dcbfd44574f6ec682264570d4ad32b26ab1b1e2
  • Loading branch information...
commit d14fca0567b946b0bb12d8db2b05015c8c075882 1 parent 7b2fb6f
@danielrobbins danielrobbins authored
Showing with 22,307 additions and 15,184 deletions.
  1. +2 −2 app-accessibility/speechd-el/speechd-el-2.5.ebuild
  2. +1 −19 app-admin/eselect-wxwidgets/eselect-wxwidgets-1.4-r1.ebuild
  3. +0 −2  app-admin/eselect-wxwidgets/eselect-wxwidgets-1.4.ebuild
  4. +1 −1  app-admin/eselect/Manifest
  5. +0 −72 app-admin/eselect/eselect-1.3.3.1_rc1.ebuild
  6. +0 −72 app-admin/eselect/eselect-1.3.3.ebuild
  7. +0 −2  app-admin/eselect/eselect-1.3.5.ebuild
  8. +64 −0 app-admin/eselect/eselect-1.3.8.ebuild
  9. +0 −55 app-admin/eselect/eselect-9999.ebuild
  10. +0 −127 app-admin/eselect/files/1.3.3.1_rc1/kernel.eselect
  11. +0 −1,376 app-admin/eselect/files/1.3.3.1_rc1/profile.eselect
  12. +0 −1,057 app-admin/eselect/files/1.3.3/profile.eselect
  13. 0  app-admin/eselect/files/{1.3.3 → 1.3.8}/kernel.eselect
  14. +1,384 −0 app-admin/eselect/files/1.3.8/profile.eselect
  15. +71 −0 app-admin/glance/files/glance-2.initd
  16. +2 −2 app-admin/glance/glance-2013.1.9999.ebuild
  17. +2 −2 app-admin/glance/glance-9999.ebuild
  18. +0 −57 app-admin/metalog/metalog-2.ebuild
  19. +1 −1  app-admin/metalog/metalog-3-r1.ebuild
  20. +1 −1  app-admin/tripwire/files/tripwire
  21. 0  app-admin/tripwire/files/{tripwire-2.4.2.2-twpol-GENERIC.patch → tripwire-twpol-GENERIC.patch}
  22. +3 −2 app-admin/tripwire/metadata.xml
  23. +7 −6 app-admin/tripwire/tripwire-2.4.2.2-r2.ebuild
  24. +1 −1  app-arch/gzip/Manifest
  25. +39 −0 app-arch/gzip/gzip-1.6.ebuild
  26. +0 −2  app-crypt/gcr/Manifest
  27. +136 −0 app-crypt/gcr/files/gcr-3.6.2-gobject.patch
  28. +1 −3 app-crypt/gcr/gcr-3.4.1-r2.ebuild
  29. +4 −4 app-crypt/gcr/gcr-3.6.2.ebuild
  30. +0 −65 app-crypt/gcr/gcr-3.8.1.ebuild
  31. +0 −65 app-crypt/gcr/gcr-3.8.2.ebuild
  32. +1 −0  app-dicts/dictd-moby-thesaurus/Manifest
  33. +29 −0 app-dicts/dictd-moby-thesaurus/dictd-moby-thesaurus-1.0.ebuild
  34. +130 −0 app-emulation/lxc/files/lxc.initd.3
  35. +2 −4 app-emulation/lxc/lxc-0.8.0-r1.ebuild
  36. +2 −4 app-emulation/lxc/lxc-0.8.0_rc2-r1.ebuild
  37. +0 −1  app-emulation/virt-manager/Manifest
  38. +0 −71 app-emulation/virt-manager/virt-manager-0.10.0-r1.ebuild
  39. +2 −7 app-emulation/virt-manager/virt-manager-0.10.0.ebuild
  40. +0 −2  app-emulation/virt-manager/virt-manager-0.9.4.ebuild
  41. +0 −2  app-emulation/virt-manager/virt-manager-0.9.5.ebuild
  42. +0 −75 app-emulation/virt-manager/virt-manager-9999.ebuild
  43. +2 −2 app-emulation/xen-pvgrub/xen-pvgrub-4.2.2-r1.ebuild
  44. +155 −0 app-forensics/openscap/openscap-9999.ebuild
  45. +2 −2 app-i18n/ibus/Manifest
  46. +85 −0 app-i18n/ibus/files/ibus-1.4.1-libxslt-1.1.27.patch
  47. +367 −0 app-i18n/ibus/files/ibus-1.5.1-queue-events.patch
  48. +30 −0 app-i18n/ibus/files/ibus-1.5.1-setup.patch
  49. +85 −0 app-i18n/ibus/files/ibus-1.5.1-use-system-keyboard-layout.patch
  50. +9 −4 app-i18n/ibus/ibus-1.4.1.ebuild
  51. +13 −8 app-i18n/ibus/ibus-1.4.2.ebuild
  52. +0 −168 app-i18n/ibus/ibus-1.4.99.20121006.ebuild
  53. +0 −168 app-i18n/ibus/ibus-1.5.1.ebuild
  54. +174 −0 app-i18n/ibus/ibus-1.5.2.ebuild
  55. +174 −0 app-i18n/ibus/ibus-1.5.3.ebuild
  56. +13 −10 app-i18n/ibus/metadata.xml
  57. +1 −2  app-laptop/easy-slow-down-manager/metadata.xml
  58. +1 −0  app-laptop/nvidiabl/Manifest
  59. +1 −2  app-laptop/nvidiabl/metadata.xml
  60. +38 −0 app-laptop/nvidiabl/nvidiabl-0.83.ebuild
  61. +1 −2  app-laptop/samsung-tools/metadata.xml
  62. +0 −18 app-leechcraft/lc-laure/lc-laure-9999.ebuild
  63. +1 −0  app-misc/byobu/Manifest
  64. +42 −0 app-misc/byobu/byobu-5.60.ebuild
  65. +1 −3 app-misc/screenfetch/Manifest
  66. +6 −6 app-misc/screenfetch/metadata.xml
  67. +0 −29 app-misc/screenfetch/screenfetch-2.7.7.ebuild
  68. +0 −29 app-misc/screenfetch/screenfetch-2.9.0.ebuild
  69. +3 −13 app-misc/screenfetch/screenfetch-3.0.5.ebuild
  70. +8 −15 app-misc/screenfetch/screenfetch-9999.ebuild
  71. +6 −4 app-shells/bash/files/bashrc
  72. +69 −0 app-text/active-dvi/active-dvi-1.10.2-r1.ebuild
  73. +63 −0 app-text/jadetex/jadetex-3.13-r6.ebuild
  74. +2 −2 app-text/poppler/poppler-0.22.5.ebuild
  75. +1 −0  app-vim/checkattach/Manifest
  76. +13 −0 app-vim/checkattach/checkattach-0.15.ebuild
  77. +5 −0 app-vim/checkattach/metadata.xml
  78. +1 −0  app-vim/command-t/Manifest
  79. +40 −0 app-vim/command-t/command-t-1.5.1.ebuild
  80. +1 −0  app-vim/dbext/Manifest
  81. +14 −0 app-vim/dbext/dbext-20.0.ebuild
  82. +1 −0  app-vim/notes/Manifest
  83. +30 −0 app-vim/notes/notes-0.23.4.ebuild
  84. +2 −2 app-vim/puppet-syntax/puppet-syntax-3.0.1.ebuild
  85. +1 −0  app-vim/recover/Manifest
  86. +5 −0 app-vim/recover/metadata.xml
  87. +13 −0 app-vim/recover/recover-0.18.ebuild
  88. +1 −0  app-vim/tcomment/Manifest
  89. +5 −0 app-vim/tcomment/metadata.xml
  90. +22 −0 app-vim/tcomment/tcomment-2.08.ebuild
  91. +1 −0  app-vim/vim-r/Manifest
  92. +17 −0 app-vim/vim-r/vim-r-0.9.9.4.ebuild
  93. +1 −0  app-vim/yankring/Manifest
  94. +12 −0 app-vim/yankring/yankring-18.0.ebuild
  95. +1 −0  dev-db/pgadmin3/Manifest
  96. +13 −0 dev-db/pgadmin3/files/pgadmin3-desktop.patch
  97. +59 −0 dev-db/pgadmin3/pgadmin3-1.18.0.ebuild
  98. +2 −2 dev-db/tora/tora-2.1.3-r2.ebuild
  99. +93 −0 dev-java/bsf/bsf-2.4.0-r2.ebuild
  100. +1 −0  dev-java/classmate/Manifest
  101. +43 −0 dev-java/classmate/classmate-0.9.0.ebuild
  102. +9 −0 dev-java/classmate/metadata.xml
  103. +0 −2  dev-java/freemarker/freemarker-2.3.13-r1.ebuild
  104. +0 −2  dev-java/freemarker/freemarker-2.3.13.ebuild
  105. +5 −5 dev-java/gcj-jdk/files/gcj-jdk.env
  106. +2 −0  dev-java/gcj-jdk/gcj-jdk-4.4.4-r1.ebuild
  107. +2 −0  dev-java/gcj-jdk/gcj-jdk-4.4.5-r1.ebuild
  108. +2 −0  dev-java/gcj-jdk/gcj-jdk-4.4.6.ebuild
  109. +2 −0  dev-java/gcj-jdk/gcj-jdk-4.5.1-r1.ebuild
  110. +2 −0  dev-java/gcj-jdk/gcj-jdk-4.5.2-r1.ebuild
  111. +3 −1 dev-java/gcj-jdk/gcj-jdk-4.5.3.ebuild
  112. +98 −0 dev-java/gcj-jdk/gcj-jdk-4.5.4-r1.ebuild
  113. +97 −0 dev-java/gcj-jdk/gcj-jdk-4.5.4.ebuild
  114. +104 −0 dev-java/gcj-jdk/gcj-jdk-4.6.0.ebuild
  115. +104 −0 dev-java/gcj-jdk/gcj-jdk-4.6.1.ebuild
  116. +110 −0 dev-java/gcj-jdk/gcj-jdk-4.6.2-r1.ebuild
  117. +0 −104 dev-java/gcj-jdk/gcj-jdk-4.6.2.ebuild
  118. +110 −0 dev-java/gcj-jdk/gcj-jdk-4.6.3-r1.ebuild
  119. +97 −0 dev-java/gcj-jdk/gcj-jdk-4.6.3-r2.ebuild
  120. +98 −0 dev-java/gcj-jdk/gcj-jdk-4.6.3-r3.ebuild
  121. +14 −10 dev-java/gcj-jdk/gcj-jdk-4.6.3.ebuild
  122. +98 −0 dev-java/gcj-jdk/gcj-jdk-4.7.2.ebuild
  123. +98 −0 dev-java/gcj-jdk/gcj-jdk-4.7.3.ebuild
  124. +1 −0  dev-java/gcj-jdk/metadata.xml
  125. +1 −0  dev-java/guava/Manifest
  126. +28 −0 dev-java/guava/guava-15.0.ebuild
  127. +2 −0  dev-java/guice/Manifest
  128. +16 −0 dev-java/guice/files/2.0-build.xml.patch
  129. +21 −0 dev-java/guice/files/2.0-common.xml.patch
  130. +55 −0 dev-java/guice/files/3.0-build.xml.patch
  131. +26 −0 dev-java/guice/files/3.0-common.xml.patch
  132. +51 −0 dev-java/guice/guice-2.0.ebuild
  133. +50 −0 dev-java/guice/guice-3.0.ebuild
  134. +9 −0 dev-java/guice/metadata.xml
  135. +2 −2 dev-java/java-gnome/java-gnome-4.1.3.ebuild
  136. +1 −0  dev-java/jsoup/Manifest
  137. +46 −0 dev-java/jsoup/jsoup-1.7.2.ebuild
  138. +18 −0 dev-java/jsoup/metadata.xml
  139. +3 −3 dev-java/jython/jython-2.1-r12.ebuild
  140. +3 −3 dev-java/jython/jython-2.2.1-r3.ebuild
  141. +3 −3 dev-java/jython/jython-2.5.3-r3.ebuild
  142. +4 −4 dev-java/jython/jython-2.7_beta1-r1.ebuild
  143. +2 −2 dev-java/minlog/minlog-1.2.ebuild
  144. +1 −0  dev-lang/perl/Manifest
  145. +0 −2  dev-lang/perl/perl-5.16.1.ebuild
  146. +115 −0 dev-lang/perl/perl-5.18.1.ebuild
  147. +2,899 −0 dev-lang/php/ChangeLog-2012
  148. +7 −10 dev-lang/php/Manifest
  149. +0 −9 dev-lang/php/files/eblits/common-v2.eblit
  150. +0 −16 dev-lang/php/files/eblits/pkg_setup-v2.eblit
  151. +0 −9 dev-lang/php/files/eblits/pkg_setup-v3.eblit
  152. +0 −61 dev-lang/php/files/eblits/src_compile-v1.eblit
  153. +0 −18 dev-lang/php/files/eblits/src_compile-v2.eblit
  154. +0 −264 dev-lang/php/files/eblits/src_configure-v53.eblit
  155. +0 −258 dev-lang/php/files/eblits/src_configure-v54.eblit
  156. +0 −165 dev-lang/php/files/eblits/src_install-v2.eblit
  157. +0 −165 dev-lang/php/files/eblits/src_install-v3.eblit
  158. +0 −71 dev-lang/php/files/eblits/src_prepare-v2.eblit
  159. +0 −73 dev-lang/php/files/eblits/src_prepare-v3.eblit
  160. +0 −62 dev-lang/php/files/eblits/src_prepare-v4.eblit
  161. +0 −54 dev-lang/php/files/eblits/src_test-v1.eblit
  162. +52 −0 dev-lang/php/files/iodbc-pkgconfig-r1.patch
  163. +3 −3 dev-lang/php/metadata.xml
  164. +0 −921 dev-lang/php/php-5.3.18.ebuild
  165. +0 −910 dev-lang/php/php-5.3.20.ebuild
  166. +0 −910 dev-lang/php/php-5.3.21-r1.ebuild
  167. +0 −803 dev-lang/php/php-5.3.23-r1.ebuild
  168. +0 −906 dev-lang/php/php-5.3.23.ebuild
  169. +0 −807 dev-lang/php/php-5.3.26.ebuild
  170. +808 −0 dev-lang/php/php-5.3.27.ebuild
  171. +0 −792 dev-lang/php/php-5.4.13-r2.ebuild
  172. +0 −855 dev-lang/php/php-5.4.13.ebuild
  173. +12 −10 dev-lang/php/php-5.4.17.ebuild
  174. +794 −0 dev-lang/php/php-5.4.18.ebuild
  175. +794 −0 dev-lang/php/php-5.4.19.ebuild
  176. +789 −0 dev-lang/php/php-5.4.20.ebuild
  177. +0 −872 dev-lang/php/php-5.4.8.ebuild
  178. +0 −772 dev-lang/php/php-5.5.0.ebuild
  179. +772 −0 dev-lang/php/php-5.5.2.ebuild
  180. +779 −0 dev-lang/php/php-5.5.3-r1.ebuild
  181. +772 −0 dev-lang/php/php-5.5.3.ebuild
  182. +768 −0 dev-lang/php/php-5.5.4.ebuild
  183. +2,583 −0 dev-lang/python/ChangeLog-2011
  184. +9 −10 dev-lang/python/Manifest
  185. +320 −0 dev-lang/python/files/CVE-2013-4238_py26.patch
  186. +247 −0 dev-lang/python/files/CVE-2013-4238_py27.patch
  187. +241 −0 dev-lang/python/files/CVE-2013-4238_py33.patch
  188. +0 −24 dev-lang/python/files/linux2.patch
  189. +0 −19 dev-lang/python/files/python-2.4.4-test-cross.patch
  190. +0 −34 dev-lang/python/files/python-2.5-cross-printf.patch
  191. +11 −0 dev-lang/python/files/python-2.5-tcl86.patch
  192. +0 −59 dev-lang/python/files/python-2.6-chflags-cross.patch
  193. +0 −19 dev-lang/python/files/python-2.6-test-cross.patch
  194. +25 −0 dev-lang/python/files/python-2.7.5-library-path.patch
  195. +23 −0 dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch
  196. +51 −0 dev-lang/python/files/python-3.2-CVE-2013-2099.patch
  197. +20 −0 dev-lang/python/files/python-3.2.3-x32.patch
  198. +51 −0 dev-lang/python/files/python-3.3-CVE-2013-2099.patch
  199. +0 −306 dev-lang/python/python-2.6.6-r1.ebuild
  200. +364 −0 dev-lang/python/python-2.6.8-r1.ebuild
  201. +365 −0 dev-lang/python/python-2.6.8-r2.ebuild
  202. +366 −0 dev-lang/python/python-2.6.8-r3.ebuild
  203. +0 −409 dev-lang/python/python-2.7.1-r3.ebuild
  204. +329 −0 dev-lang/python/python-2.7.3-r2.ebuild
  205. +384 −0 dev-lang/python/python-2.7.3-r3.ebuild
  206. +393 −0 dev-lang/python/python-2.7.5-r1.ebuild
  207. +394 −0 dev-lang/python/python-2.7.5-r2.ebuild
  208. +392 −0 dev-lang/python/python-2.7.5.ebuild
  209. +0 −340 dev-lang/python/python-3.1.3-r1.ebuild
  210. +0 −372 dev-lang/python/python-3.2.2.ebuild
  211. +307 −0 dev-lang/python/python-3.2.3-r1.ebuild
  212. +361 −0 dev-lang/python/python-3.2.3-r2.ebuild
  213. +307 −0 dev-lang/python/python-3.2.3.ebuild
  214. +366 −0 dev-lang/python/python-3.2.4.ebuild
Sorry, we could not display the entire diff because too many files (3,986) changed.
View
4 app-accessibility/speechd-el/speechd-el-2.5.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-accessibility/speechd-el/speechd-el-2.5.ebuild,v 1.3 2013/09/22 06:50:47 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-accessibility/speechd-el/speechd-el-2.5.ebuild,v 1.4 2013/09/25 17:29:54 ago Exp $
EAPI="4"
NEED_EMACS=23
@@ -12,7 +12,7 @@ SRC_URI="http://www.freebsoft.org/pub/projects/speechd-el/${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
-KEYWORDS="amd64 ~ppc x86"
+KEYWORDS="amd64 ppc x86"
IUSE="brltty"
DEPEND=""
View
20 app-admin/eselect-wxwidgets/eselect-wxwidgets-1.4-r1.ebuild
@@ -1,6 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
EAPI=2
@@ -14,7 +12,7 @@ SRC_URI="mirror://gentoo/wxwidgets.eselect-${WXESELECT_VER}.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="*"
-IUSE="+symlink"
+IUSE=""
DEPEND="!<=x11-libs/wxGTK-2.6.4.0-r2"
RDEPEND=">=app-admin/eselect-1.2.3"
@@ -37,19 +35,3 @@ src_install() {
keepdir /var/lib/wxwidgets
keepdir /usr/share/bakefile/presets
}
-
-
-pkg_postinst() {
- if use symlink ; then
- if [[ -e "${ROOT}"/usr/lib/wx/config ]] ; then
- local wxwidgets=( $(find -H "${ROOT}"/usr/lib/wx/config/* -printf "%f " 2> /dev/null) )
- if [[ ! -z "${wxwidgets[@]}" && "${#wxwidgets[@]}" == 1 ]] ; then
- eselect wxwidgets set "${wxwidgets[0]}"
- echo
- elog "Portage detected that your system has only one wxWidgets profile."
- elog "Your systems wxWidgets profile is now set to ${wxwidgets[0]}"
- echo
- fi
- fi
- fi
-}
View
2  app-admin/eselect-wxwidgets/eselect-wxwidgets-1.4.ebuild
@@ -1,6 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-wxwidgets/eselect-wxwidgets-1.4.ebuild,v 1.8 2012/05/29 14:26:28 aballier Exp $
WXWRAP_VER=1.3
WXESELECT_VER=1.4
View
2  app-admin/eselect/Manifest
@@ -1,2 +1,2 @@
-DIST eselect-1.3.3.tar.xz 164872 SHA256 09132a0e7512da5c0e5907d04736445101c83b0dd0e6283374ebbc9d76bf6b74 SHA512 480c9c0cd844471b84b2e44440b23ab7538cb6ecb953648ea63057d65ac0f475f057294313f00d3c8cf4b1f1b4effb960cafdd636421302100b8ad7b82213114 WHIRLPOOL c91c91d5e52a9eeba0e8ef86a741838ce3dec2f5b0f0911ada3de3d51a5eba7b9addd9a4e4696171fa4ff3c71f7db494cd8f356d0d7b5daf943b0c24129ac2ea
DIST eselect-1.3.5.tar.xz 165780 SHA256 aa27fa55863630f81c74486cdca4d3b206d8d8ee71fe3d57fb5c5c5d0117ab9a SHA512 f95400b638ca1a11d7779a80dd742e5b02c68f090beff68090e323d970a18bb35b197bf3c79aea6d12b7c31654b77d57bb01c8d728eff12702ab9854ced0d29d WHIRLPOOL ff45c5dcc061a112f536f271b8b547af1d593f79899c28d6843cb979ecc19a9948ea8123dd64198af0215bfa8f1f2cb0c9a6cf4a627d19f40e2d74f9360026a0
+DIST eselect-1.3.8.tar.xz 168040 SHA256 d0c50bfe0faaddc54fc184f698ee74a6029a21f5155c4670a2bea3ead954c138 SHA512 159bf3ddb05b1966318eaf62d09e454a024f8be7ead2300392abbcbaa54ef748a1c4db1b2f96162994bcab43071396eb96a0b47268f04cb8557f8804818da18e WHIRLPOOL 9c4da0bde2ae2b53e8949d59b13498f55ef2c849dcc8cac503a7d0dda2511311d94dfc7aa27a97432f13aa0b430fec0ab280594dc165bbb40e573dce8c8a74b0
View
72 app-admin/eselect/eselect-1.3.3.1_rc1.ebuild
@@ -1,72 +0,0 @@
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=3
-
-inherit bash-completion-r1
-
-DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
-SRC_URI="mirror://gentoo/eselect-1.3.3.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="*"
-IUSE="doc"
-S=$WORKDIR/eselect-1.3.3
-
-RDEPEND="sys-apps/sed
- || (
- sys-apps/coreutils
- sys-freebsd/freebsd-bin
- app-misc/realpath
- )"
-DEPEND="${RDEPEND}
- app-arch/xz-utils
- doc? ( dev-python/docutils )"
-RDEPEND="!app-admin/eselect-news
- ${RDEPEND}
- sys-apps/file
- sys-libs/ncurses"
-
-# Commented out: only few users of eselect will edit its source
-#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
-# vim-syntax? ( app-vim/eselect-syntax )"
-
-src_compile() {
- emake || die
-
- if use doc; then
- emake html || die
- fi
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die
- newbashcomp misc/${PN}.bashcomp ${PN} || die
- dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt || die
-
- if use doc; then
- dohtml *.html doc/* || die
- fi
-
- # needed by news module
- keepdir /var/lib/gentoo/news
- fowners root:portage /var/lib/gentoo/news || die
- fperms g+w /var/lib/gentoo/news || die
-
- # tweaks for funtoo-1.0 profile
- insinto /usr/share/eselect/modules
- doins $FILESDIR/$PVR/profile.eselect || die
- doins $FILESDIR/$PVR/kernel.eselect || die
-}
-
-pkg_postinst() {
- # fowners in src_install doesn't work for the portage group:
- # merging changes the group back to root
- [[ -z ${EROOT} ]] && local EROOT=${ROOT}
- chgrp portage "${EROOT}/var/lib/gentoo/news" \
- && chmod g+w "${EROOT}/var/lib/gentoo/news"
-
- ewarn "This version of eselect supports using /etc/portage/make.profile along with the new Funtoo 1.0 profiles."
- ewarn "Please visit http://www.funtoo.org/wiki/Funtoo_1.0_Profile for instructions on how to switch"
-}
View
72 app-admin/eselect/eselect-1.3.3.ebuild
@@ -1,72 +0,0 @@
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=3
-
-inherit bash-completion-r1
-
-DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
-SRC_URI="mirror://gentoo/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="*"
-IUSE="doc"
-S=$WORKDIR/$PN-$PV
-
-RDEPEND="sys-apps/sed
- || (
- sys-apps/coreutils
- sys-freebsd/freebsd-bin
- app-misc/realpath
- )"
-DEPEND="${RDEPEND}
- app-arch/xz-utils
- doc? ( dev-python/docutils )"
-RDEPEND="!app-admin/eselect-news
- ${RDEPEND}
- sys-apps/file
- sys-libs/ncurses"
-
-# Commented out: only few users of eselect will edit its source
-#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
-# vim-syntax? ( app-vim/eselect-syntax )"
-
-src_compile() {
- emake || die
-
- if use doc; then
- emake html || die
- fi
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die
- newbashcomp misc/${PN}.bashcomp ${PN} || die
- dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt || die
-
- if use doc; then
- dohtml *.html doc/* || die
- fi
-
- # needed by news module
- keepdir /var/lib/gentoo/news
- fowners root:portage /var/lib/gentoo/news || die
- fperms g+w /var/lib/gentoo/news || die
-
- # tweaks for funtoo-1.0 profile
- insinto /usr/share/eselect/modules
- doins $FILESDIR/$PVR/profile.eselect || die
- doins $FILESDIR/$PVR/kernel.eselect || die
-}
-
-pkg_postinst() {
- # fowners in src_install doesn't work for the portage group:
- # merging changes the group back to root
- [[ -z ${EROOT} ]] && local EROOT=${ROOT}
- chgrp portage "${EROOT}/var/lib/gentoo/news" \
- && chmod g+w "${EROOT}/var/lib/gentoo/news"
-
- ewarn "This version of eselect supports using /etc/portage/make.profile along with the new Funtoo 1.0 profiles."
- ewarn "Please visit http://www.funtoo.org/wiki/Funtoo_1.0_Profile for instructions on how to switch"
-}
View
2  app-admin/eselect/eselect-1.3.5.ebuild
@@ -1,6 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/eselect-1.3.5.ebuild,v 1.1 2013/06/22 16:20:11 ulm Exp $
EAPI=4
View
64 app-admin/eselect/eselect-1.3.8.ebuild
@@ -0,0 +1,64 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils bash-completion-r1
+
+DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Eselect"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
+SLOT="0"
+KEYWORDS="*"
+IUSE="doc emacs vim-syntax"
+
+RDEPEND="sys-apps/sed
+ || (
+ sys-apps/coreutils
+ sys-freebsd/freebsd-bin
+ app-misc/realpath
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ doc? ( dev-python/docutils )"
+RDEPEND="!app-admin/eselect-news
+ ${RDEPEND}
+ sys-apps/file
+ sys-libs/ncurses"
+
+PDEPEND="emacs? ( app-emacs/eselect-mode )
+ vim-syntax? ( app-vim/eselect-syntax )"
+
+src_compile() {
+ emake
+ use doc && emake html
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ newbashcomp misc/${PN}.bashcomp ${PN}
+ dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
+ use doc && dohtml *.html doc/*
+
+ # needed by news module
+ keepdir /var/lib/gentoo/news
+ if ! use prefix; then
+ fowners root:portage /var/lib/gentoo/news
+ fperms g+w /var/lib/gentoo/news
+ fi
+
+ # tweaks for funtoo-1.0 profile
+ insinto /usr/share/eselect/modules
+ doins $FILESDIR/$PVR/profile.eselect || die
+ doins $FILESDIR/$PVR/kernel.eselect || die
+}
+
+pkg_postinst() {
+ # fowners in src_install doesn't work for the portage group:
+ # merging changes the group back to root
+ if ! use prefix; then
+ chgrp portage "${EROOT}/var/lib/gentoo/news" \
+ && chmod g+w "${EROOT}/var/lib/gentoo/news"
+ fi
+}
View
55 app-admin/eselect/eselect-9999.ebuild
@@ -1,55 +0,0 @@
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=4
-ESVN_REPO_URI="svn://anonsvn.gentoo.org/eselect/trunk"
-ESVN_BOOTSTRAP="autogen.bash"
-
-inherit subversion bash-completion-r1
-
-DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
-SRC_URI=""
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS=""
-IUSE="doc"
-
-RDEPEND="sys-apps/sed
- || (
- sys-apps/coreutils
- sys-freebsd/freebsd-bin
- app-misc/realpath
- )"
-DEPEND="${RDEPEND}
- doc? ( dev-python/docutils )"
-RDEPEND="!app-admin/eselect-news
- ${RDEPEND}
- sys-apps/file
- sys-libs/ncurses"
-
-# Commented out: only few users of eselect will edit its source
-#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
-# vim-syntax? ( app-vim/eselect-syntax )"
-
-src_compile() {
- emake
- use doc && emake html
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- newbashcomp misc/${PN}.bashcomp ${PN}
- dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
- use doc && dohtml *.html doc/*
-
- # needed by news module
- keepdir /var/lib/gentoo/news
-}
-
-pkg_postinst() {
- # fowners in src_install doesn't work for the portage group:
- # merging changes the group back to root
- chgrp portage "${EROOT}/var/lib/gentoo/news" \
- && chmod g+w "${EROOT}/var/lib/gentoo/news"
-}
View
127 app-admin/eselect/files/1.3.3.1_rc1/kernel.eselect
@@ -1,127 +0,0 @@
-# -*-eselect-*- vim: ft=eselect
-# Copyright 2005-2012 Gentoo Foundation
-# Distributed under the terms of the GNU GPL version 2 or later
-# $Id: $
-
-# This version was modified by Funtoo to support all kernel sources in /usr/src
-
-DESCRIPTION="Manage the /usr/src/linux symlink"
-MAINTAINER="rh1@funtoo.org"
-VERSION="funtoo-1.1_beta"
-
-# sort function for kernel versions, to be used in a pipe
-sort_kernel_versions() {
- local vsort="sort --version-sort"
- # Test if our sort supports the --version-sort option
- # (should be GNU sort, since the kernel module is GNU/Linux specific)
- ${vsort} </dev/null &>/dev/null || vsort=sort
-
- # We sort kernel versions as follows:
- # 1. Run sed to prepend the version string by the numeric version
- # and an additional rank indicator that is 0 for release candidates
- # or 1 otherwise. After this step we have, for example:
- # 2.6.29 1 linux-2.6.29
- # 2.6.29 0 linux-2.6.29-rc8
- # 2. sort --version-sort
- # 3. Run sed again to remove the prepended keys from step 1.
- sed -e 's/^\(linux-.*\)\?\([[:digit:].]\+\)[-_]rc/\2 0 &/' \
- -e 't;s/^\(linux-.*\)\?\([[:digit:].]\+\)/\2 1 &/' \
- | LC_ALL=C ${vsort} | sed 's/.* //'
-}
-
-# find a list of kernel symlink targets
-find_targets() {
- local f
- for f in "${EROOT}"/usr/src/linux-[[:graph:]]*; do
- [[ -d ${f} ]] && basename "${f}"
- done | sort_kernel_versions
-}
-
-# remove the kernel symlink
-remove_symlink() {
- rm "${EROOT}/usr/src/linux"
-}
-
-# set the kernel symlink
-set_symlink() {
- local target=$1
-
- if is_number "${target}"; then
- local targets=( $(find_targets) )
- target=${targets[target-1]}
- fi
-
- if [[ -z ${target} ]]; then
- die -q "Target \"$1\" doesn't appear to be valid!"
- elif [[ -d ${EROOT}/usr/src/${target} ]]; then
- ln -s "${target}" "${EROOT}/usr/src/linux"
- elif [[ -d ${EROOT}/usr/src/linux-${target} ]]; then
- ln -s "linux-${target}" "${EROOT}/usr/src/linux"
- else
- die -q "Target \"$1\" doesn't appear to be valid!"
- fi
-}
-
-### show action ###
-
-describe_show() {
- echo "Show the current kernel symlink"
-}
-
-do_show() {
- write_list_start "Current kernel symlink:"
- if [[ -L ${EROOT}/usr/src/linux ]]; then
- local kernel=$(canonicalise "${EROOT}/usr/src/linux")
- write_kv_list_entry "${kernel%/}" ""
- else
- write_kv_list_entry "(unset)" ""
- fi
-}
-
-### list action ###
-
-describe_list() {
- echo "List available kernel symlink targets"
-}
-
-do_list() {
- local i targets=( $(find_targets) )
-
- write_list_start "Available kernel symlink targets:"
- for (( i = 0; i < ${#targets[@]}; i++ )); do
- [[ ${targets[i]} = \
- $(basename "$(canonicalise "${EROOT}/usr/src/linux")") ]] \
- && targets[i]=$(highlight_marker "${targets[i]}")
- done
- write_numbered_list -m "(none found)" "${targets[@]}"
-}
-
-### set action ###
-
-describe_set() {
- echo "Set a new kernel symlink target"
-}
-
-describe_set_parameters() {
- echo "<target>"
-}
-
-describe_set_options() {
- echo "target : Target name or number (from 'list' action)"
-}
-
-do_set() {
- [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to"
- [[ $# -gt 1 ]] && die -q "Too many parameters"
-
- if [[ -L ${EROOT}/usr/src/linux ]]; then
- # existing symlink
- remove_symlink || die -q "Couldn't remove existing symlink"
- set_symlink "$1" || die -q "Couldn't set a new symlink"
- elif [[ -e ${EROOT}/usr/src/linux ]]; then
- # we have something strange
- die -q "${EROOT}/usr/src/linux exists but is not a symlink"
- else
- set_symlink "$1" || die -q "Couldn't set a new symlink"
- fi
-}
View
1,376 app-admin/eselect/files/1.3.3.1_rc1/profile.eselect
@@ -1,1376 +0,0 @@
-# -*-eselect-*- vim: ft=eselect
-# Copyright 2005-2012 Gentoo Foundation
-# Copyright 2012-2013 Ryan P. Harris
-# Distributed under the terms of the GNU General Public License v2
-# $Id: $
-
-# This is a portage-only module.
-# This version of profile.eselect is written for use with Funtoo's
-# multi-profile approach
-
-inherit package-manager output
-
-DESCRIPTION="Manage portage profiles"
-MAINTAINER="rh1@funtoo.org"
-VERSION="funtoo-1.7"
-
-### INIT ###
-
-# Global variables
-[[ -z "${MAKE_PROFILE_DIR}" ]] && MAKE_PROFILE_DIR="/etc/portage/make.profile"
-[[ -z "${PARENT_FILE}" ]] && PARENT_FILE="${MAKE_PROFILE_DIR}/parent"
-[[ -z "${MAIN_REPO_DIRECTORY}" ]] && MAIN_REPO_DIRECTORY="$(portageq portdir)"
-[[ -z "${MAIN_PROFILE_DIRECTORY}" ]] && MAIN_PROFILE_DIRECTORY="${MAIN_REPO_DIRECTORY}/profiles"
-[[ -z "${PROFILE_DESC_FILENAME}" ]] && PROFILE_DESC_FILENAME="profiles.eselect.desc"
-[[ -z "${MAIN_PROFILE_DESC_FILE}" ]] && MAIN_PROFILE_DESC_FILE="${MAIN_PROFILE_DIRECTORY}/${PROFILE_DESC_FILENAME}"
-[[ -z "${PORTAGE_OVERLAY_DIRS}" ]] && PORTAGE_OVERLAY_DIRS=( $(portageq portdir_overlay) )
-
-
-# We try to use global array variables anywhere we need to specify profile types
-# While it makes some of the code more complicated, it makes future maintenance
-# a lot easier if type names are changed or added to.
-
-# IMPORTANT Keep array variables in same order that profiles should appear in $PARENT_FILE.
-VALID_PROFILE_TYPES=( "arch" "build" "flavor" "mix-ins" "mono" )
-REQUIRED_SINGLE_PROFILE_TYPES=( "arch" "build" "flavor" )
-MULTI_PROFILE_TYPES=( "arch" "build" "flavor" "mix-ins" )
-MULTIPLE_PROFILES_ALLOWED_TYPES=( "mix-ins" )
-AUTO_ENABLED_PROFILE_TYPES=( "mix-ins" )
-CHECK_FOR_AUTO_ENABLED_PROFILE_TYPES=( "build" "flavor" )
-MONOLITHIC_PROFILE_TYPE="mono"
-MACHINE_ARCH_TYPE="arch"
-
-# Die if MAIN_PROFILE_DESC_FILE doesn't exist
-if [[ ! -e "${MAIN_PROFILE_DESC_FILE}" ]] ; then
- die -q "Can't find ${MAIN_PROFILE_DESC_FILE}"
-fi
-
-# Create path to parent if needed.
-if [[ ! -e $(dirname "${PARENT_FILE}") ]] ; then
- mkdir -p $(dirname "${PARENT_FILE}")
-fi
-
-# Create $PARENT_FILE if it doesn't exist.
-if [[ ! -e "${PARENT_FILE}" ]] ; then
- touch "${PARENT_FILE}" || die -q "Error creating ${PARENT_FILE}"
- chmod 644 "${PARENT_FILE}"
-fi
-
-# Set MACHINE_ARCH
-MACHINE_ARCH="$(arch)"
-case "${MACHINE_ARCH}" in
- amd64)
- MACHINE_ARCH="x86-64bit"
- ;;
- arm)
- # TODO: Fix for different arm versions
- MACHINE_ARCH="arm-32bit"
- ;;
- x86)
- MACHINE_ARCH="x86-32bit"
- ;;
- *)
- MACHINE_ARCH="None"
- ;;
-esac
-
-
-### HELPER FUNCTIONS ###
-
-
-# PRIVATE
-# Assigns a value and returns it based on profile type for use in determining where to add profile
-# $1 = profile_type
-assign_profile_value() {
- local pro_type="${1}"
- local pro_type_number
- local count_num=1
- for profile_type in ${VALID_PROFILE_TYPES[@]} ; do
- if [[ "${pro_type}" == "${profile_type}" ]] ; then
- pro_type_number=${count_num}
- fi
- count_num="$(( ${count_num}+1 ))"
- done
- if [[ -z "${pro_type}" ]] ; then
- pro_type_number="${count_num}"
- fi
- echo "${pro_type_number}"
- return 0
-}
-
-
-# PUBLIC
-# Checks passed in profile against NoMix profiles for currently set
-# profiles and returns a list of any conflicting profiles it finds.
-# $1 = Profile to check against
-check_for_nomix() {
- local pro_to_check="${1}"
- local repo_name="$(get_repo_name ${pro_to_check})"
- local profile_desc_file="$(get_profiles_desc_file ${repo_name})"
- local pro_to_check_type="$(get_profile_type ${pro_to_check})"
- local stripped_pro_name
-
- if [[ -z "${repo_name}" ]] ; then
- # NoMix is only supported for new style multi profiles specified in format <repo_name>:<path_to_profile> so just return.
- return 0
- else
- stripped_pro_name="${pro_to_check#${repo_name}:}"
- fi
-
- local profile_path
- for profile_type in ${MULTI_PROFILE_TYPES[@]} ; do
- if [[ "${profile_type}" == "${pro_to_check_type}" ]] ; then
- profile_path="${stripped_pro_name%/${profile_type}/*}"
- fi
- done
- if [[ -z "${profile_path}" ]] ; then
- return 0
- fi
-
- local nomix=( $(awk '( $2 == "'"${stripped_pro_name}"'" ) && ( NF > 3 ) { print $4 }' "${profile_desc_file}" | awk -F "," '{ for ( x = 1; x <= NF; x++ ) { print $x } }') )
- if [[ -n "${nomix}" ]] ; then
- for profile in ${nomix[@]} ; do
- for current_pro in $(get_currently_set_profiles) ; do
- current_repo_name="$(get_repo_name ${current_pro})"
- if [[ "${repo_name}" == "${current_repo_name}" ]] ; then
- local full_pro="${repo_name}:${profile_path}/${profile}"
- if [[ "${full_pro}" == "${current_pro}" ]] ; then
- echo "${full_pro}"
- fi
- fi
- done
- done
- fi
- return 0
-}
-
-
-# PUBLIC
-# Creates and returns temporary file using mktemp and sets permissions to 644
-create_temp_file() {
- local temp_file="$(mktemp)"
- if (( $? != 0 )) ; then
- die -q "Error: Unable to create temporary file using 'mktemp'"
- fi
- chmod 644 "${temp_file}"
- echo "${temp_file}"
- return 0
-}
-
-
-# PUBLIC
-# Converts a full path for a profile to repo_name:profile format
-# $1 = path to convert
-convert_full_path_to_profile() {
- local pro_path="${1}"
- for repo in ${MAIN_REPO_DIRECTORY} ${PORTAGE_OVERLAY_DIRS[@]} ; do
- local repo_match="$(expr match "${pro_path}" "\(${repo}/profiles/\)")"
- if [[ "${repo_match}" == "${repo}/profiles/" ]] ; then
- if [[ -e "${repo_match}repo_name" ]] ; then
- local repo_name="$(cat ${repo_match}repo_name)"
- echo "${repo_name}:${pro_path#${repo_match}}"
- return 0
- else
- # repo_name file is required for this version to work right
- return 1
- fi
-
- fi
- done
- # If here then there was an error converting the full path
- return 1
-}
-
-
-# PUBLIC
-# Converts number from profile list to name of profile
-# $1 = Number to convert
-convert_list_number() {
- local pro_number="${1}"
- local profiles=( $(get_profiles_list) )
- # Added in validation for numbers. It wasn't notifiying a number
- # was invalid if it was too large
- # psychopatch - 11-19-2012
- local profile_length=${#profiles[@]}
- if [[ ${1} -gt $profile_length ]]; then
- die -q "${1} is not a valid selection"
- fi
- echo "${profiles[$((${pro_number} - 1))]}"
-}
-
-
-# PUBLIC
-# Converts repo_name:profile format to full profile path
-# Returns full path to profile
-# $1 = profile to convert
-convert_profile_to_full_path() {
- local pro_to_convert="${1}"
- for repo in ${MAIN_REPO_DIRECTORY} ${PORTAGE_OVERLAY_DIRS[@]} ; do
- if [[ -e "${repo}/profiles/repo_name" ]] ; then
- local repo_name="$(get_repo_name ${pro_to_convert})"
- if [[ "${repo_name}" == "$(cat ${repo}/profiles/repo_name)" ]] ; then
- echo "${repo}/profiles/${pro_to_convert#${repo_name}:}"
- return 0
- fi
- fi
- done
- # If here then there was an error converting the profile
- return 1
-}
-
-
-# PUBLIC
-# Returns list of profiles in $PARENT_FILE
-get_currently_set_profiles() {
- while read line ; do
- if [[ "${line:0:1}" != "#" ]] ; then
- echo "${line}"
- fi
- done < "${PARENT_FILE}"
-}
-
-
-# PUBLIC
-# Searches all PROFILE_DESC_FILENAME files and returns any profiles of passed in type
-# $1 = profile type to search for
-get_profiles() {
- local profile_type="${1}"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- local profiles=( $(awk '$1 == "'"${profile_type}"'" { print $2 }' "${pro_desc_file}") )
- for profile in ${profiles[@]} ; do
- echo "${repo_name}:${profile}"
- done
- done
- return 0
-}
-
-
-# PUBLIC
-# Returns PROFILE_DESC_FILENAME file from passed in repo
-# $1 = Name of repo to get file from
-get_profiles_desc_file() {
- local repo_to_check="${1}"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- if [[ "${repo_name}" == "${repo_to_check}" ]] ; then
- echo "${pro_desc_file}"
- return 0
- fi
- done
- # If here then we didn't find a file.
- return 1
-}
-
-
-# PUBLIC
-# Returns list of profiles.desc files from main repo and those
-# found by looking in PORTDIR_OVERLAY repos.
-get_profiles_desc_files() {
- # Echo main repo first
- echo "${MAIN_PROFILE_DESC_FILE}"
-
- for repo in ${PORTAGE_OVERLAY_DIRS[@]} ; do
- if [[ -e "${repo}/profiles/${PROFILE_DESC_FILENAME}" ]] ; then
- echo "${repo}/profiles/${PROFILE_DESC_FILENAME}"
- fi
- done
- return 0
-}
-
-
-# PUBLIC
-# Searches through the passed in profile's parent file for profiles of the specified type
-# Returns all matching profiles found
-# $1 = profile to search through $2 = profile type to search for
-get_profiles_enabled_by_profile() {
- local profile_to_check="${1}"
- local type_to_find="${2}"
- local parent_file="$(convert_profile_to_full_path ${profile_to_check})/parent"
-
- if [[ ! -e "${parent_file}" ]] ; then
- return 0
- fi
-
-
- while read line ; do
- if [[ "${line:0:1}" == "#" ]] ; then
- continue
- fi
-
- # If line starts with a "/" then it's an absolute path. Otherwise
- # if line contains a ':' then it's a new style profile. If neither
- # apply then we assume the path is relative to the directory containing
- # the parent file.
- if [[ "${line:0:1}" == "/" ]] ; then
- # Absolute paths would only make sense if this was a
- # local user created profile in which case we just skip
- continue
- else
- local profile
- if [[ "${line}" == *:* ]] ; then
- # If a profile starts with ':' it is relative to the 'profiles' directory
- # that it's in.
- if [[ "${line:0:1}" == ":" ]] ; then
- local current_dir="$(pwd)"
- cd $(dirname "${parent_file}")
- local profile_dir="$(pwd)"
- while [[ "${profile_dir}" != "/" ]] ; do
- if [[ "$(basename ${profile_dir})" == "profiles" ]] ; then
- break;
- else
- profile_dir="$(dirname ${profile_dir})"
- fi
- done
- cd "${current_dir}"
-
- # If we didn't find a profiles dir then just skip
- if [[ "${profile_dir}" == "/" ]] ; then
- continue;
- fi
-
- local full_profile_path="${profile_dir}/${line:1}"
- profile="$(convert_full_path_to_profile ${full_profile_path})"
- if (( $? != 0 )) ; then
- continue
- fi
-
- else
- profile="${line}"
- fi
- else
- profile="$(dirname ${parent_file})/${line}"
- if [[ -e "${profile}" ]] ; then
- # Record pwd so we can return there after getting profile
- local current_dir="$(pwd)"
- cd "${profile}"
- profile="$(convert_full_path_to_profile $(pwd))"
- cd "${current_dir}"
- if (( $? != 0 )) ; then
- continue
- fi
- else
- continue
- fi
- fi
-
- if [[ "$(get_profile_type ${profile})" == "${type_to_find}" ]] ; then
- echo "${profile}"
- fi
- fi
- done < "${parent_file}"
- return 0
-}
-
-
-# PUBLIC
-# Returns full list of available profiles.
-get_profiles_list() {
- ### MUST USE SAME ORDER AS write_numbered_list DOES SO convert_list_number WORKS ###
- for profile_type in ${VALID_PROFILE_TYPES[@]} ; do
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- local profiles=( $(awk '$1 == "'"${profile_type}"'" { print $2 }' "${pro_desc_file}") )
- for profile in ${profiles[@]} ; do
- if [[ "${profile_type}" == "arch" ]] ; then
- local profile_matched="$(match_arch_profile ${profile})"
- if [[ "${profile_matched}" == "True" ]] ; then
- echo "${repo_name}:${profile}"
- else
- continue
- fi
- else
- echo "${repo_name}:${profile}"
- fi
- done
- done
- done
- return 0
-}
-
-
-# PUBLIC
-# Returns type of profile
-# $1 = Profile to check. Must be in format <repo_name>:<path_to_profile>
-get_profile_type() {
- local profile="${1}"
- local repo_name="$(get_repo_name ${profile})"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- curr_name="$(get_repo_name_from_file ${pro_desc_file})"
- if [[ "${curr_name}" == "${repo_name}" ]] ; then
- # Check against $VALID_PROFILE_TYPES to insure correct values are retuned
- for pro_type in ${VALID_PROFILE_TYPES[@]} ; do
- # Strip repo_name
- local profile_type="$(awk '( $2 == "'"${profile#${repo_name}:}"'" ) && ( $1 == "'"$pro_type"'" ) { print $1 }' "${pro_desc_file}")"
- if [[ "${profile_type}" == "${pro_type}" ]] ; then
- echo "${profile_type}"
- return 0
- fi
- done
- fi
- done
-}
-
-
-# PUBLIC
-# Returns repo name found at beginning of profile.
-# $1 = Profile to check. Must be in format <repo_name>:<path_to_profile>
-get_repo_name() {
- local profile="${1}"
- local repo_name="$(expr match "${profile}" "\([^:]\+:\{1\}\)")"
- # Remove colon
- echo "${repo_name%:}"
-}
-
-
-# PUBLIC
-# Returns name of repo associated with the passed in PROFILE_DESC_FILENAME file
-# $1 = Full path to PROFILE_DESC_FILENAME file. Ex: /usr/portage/profiles/profiles.eselect.desc
-get_repo_name_from_file() {
- local repo_name_file="${1%${PROFILE_DESC_FILENAME}}repo_name"
- if [[ -e "${repo_name_file}" ]] ; then
- echo $(cat "${repo_name_file}")
- fi
-}
-
-
-# PUBLIC
-# Returns "True" if profile is set in $PARENT_FILE, "False" if not set.
-# $1 = Profile to look for
-is_profile_set() {
- local profile="${1}"
- for curr_pro in $(get_currently_set_profiles) ; do
- if [[ "${profile}" == "${curr_pro}" ]] ; then
- echo "True"
- return 0
- fi
- done
- # If we made it here, profile isn't set
- echo "False"
-}
-
-
-# PUBLIC
-# Checks if arch profile matches machine arch. Returns True if matches, False if not.
-# Also returns True for all arches if MACHINE_ARCH="None"
-# $1 = profile to check
-match_arch_profile() {
- local pro_to_check="${1}"
- local stripped_arch="${pro_to_check#*/arch/}"
- local pro_arch="${stripped_arch%%/*}"
-
- if [[ "${MACHINE_ARCH}" == "None" ]] ; then
- echo "True"
- else
- if [[ "${pro_arch}" == "${MACHINE_ARCH}" ]] ; then
- echo "True"
- else
- echo "False"
- fi
- fi
-}
-
-
-# PUBLIC
-# Returns all auto enabled profiles of type(s) defined by AUTO_ENABLED_PROFILE_TYPES
-# First parses the current profile for all profiles of types defined by CHECK_FOR_AUTO_ENABLED_PROFILE_TYPES and
-# then parses them for AUTO_ENABLED_PROFILE_TYPES.
-parse_auto_enabled_profiles() {
-
- # We must first build a list of profiles to check
- local profiles_to_check
- local profile_count=0
- for current_pro in $(get_currently_set_profiles) ; do
- for pro_type_to_check in ${CHECK_FOR_AUTO_ENABLED_PROFILE_TYPES[@]} ; do
- if [[ "$(get_profile_type ${current_pro})" == "${pro_type_to_check}" ]] ; then
- profiles_to_check=( ${profiles_to_check[@]} ${current_pro} )
- fi
- done
- done
-
- # Loop through the profiles we found so far and parse their parent files for any
- # more profiles that match what we're looking for. Keep looping until no more new profiles
- # are found.
- while (( ${profile_count} < ${#profiles_to_check[@]} )) ; do
-
- profile_count=${#profiles_to_check[@]}
- local new_profiles
- for pro_to_check in ${profiles_to_check[@]} ; do
- for pro_type_to_check in ${CHECK_FOR_AUTO_ENABLED_PROFILE_TYPES[@]} ; do
- local current_profiles=( $(get_profiles_enabled_by_profile "${pro_to_check}" "${pro_type_to_check}") )
- # Check if profile is already added
- local current_profiles_count=${#current_profiles[@]}
- for (( i=0; i < ${current_profiles_count}; i++ )) ; do
- for new_pro in ${new_profiles[@]} ; do
- if [[ ${current_profiles[${i}]} == "${new_pro}" ]] ; then
- unset current_profiles[${i}]
- fi
- done
- done
-
- if (( ${#current_profiles[@]} > 0 )) ; then
- new_profiles=( ${new_profiles[@]} ${current_profiles[@]} )
- fi
- done
- done
-
- # Check if profile is already added
- local new_profiles_count=${#new_profiles[@]}
- for (( i=0; i < ${new_profiles_count}; i++ )) ; do
- for pro_to_check in ${profiles_to_check[@]} ; do
- if [[ "${new_profiles[${i}]}" == "${pro_to_check}" ]] ; then
- unset new_profiles[${i}]
- fi
- done
- done
-
- if (( ${#new_profiles[@]} > 0 )) ; then
- profiles_to_check=( ${profiles_to_check[@]} ${new_profiles[@]} )
- fi
-
- done
-
- # Now loop through the profiles we found above and parse all of the auto-enables ones
- local auto_enabled_profiles
- for profile in ${profiles_to_check[@]} ; do
- for pro_type_to_get in ${AUTO_ENABLED_PROFILE_TYPES[@]} ; do
- local new_enabled_profiles=( $(get_profiles_enabled_by_profile ${profile} ${pro_type_to_get}) )
- local profile_count=${#new_enabled_profiles[@]}
- for (( i = 0; i < ${profile_count}; i++ )) ; do
- # Check if already set
- local already_set="False"
- for auto_pro in ${auto_enabled_profiles[@]} ; do
- if [[ "${new_enabled_profiles[${i}]}" == "${auto_pro}" ]] ; then
- already_set="True"
- fi
- done
- if [[ "${already_set}" == "True" ]] ; then
- unset new_enabled_profiles[${i}]
- fi
- done
- auto_enabled_profiles=( ${auto_enabled_profiles[@]} ${new_enabled_profiles[@]} )
- done
- done
-
- for profile in ${auto_enabled_profiles[@]} ; do
- echo "${profile}"
- done
- return 0
-}
-
-
-# PUBLIC
-# Processes passed in profile. Converts from number and validates profile strings.
-# Returns valid profile string
-# $1 = profile or number to process
-process_passed_in_profile() {
- local profile="${1}"
- if $(is_number "${profile}") ; then
- profile="$(convert_list_number ${profile})"
- else
- profile="$(validate_profile_string ${profile})"
- fi
- echo "${profile}"
-}
-
-
-# PUBLIC
-# Checks if parent file is valid.
-# Sets global variables with results
-validate_parent_file() {
-
- # Check if profiles are valid
- local invalid_profiles profile_count=0
- for profile in $(get_currently_set_profiles) ; do
- if [[ "$(validate_profile ${profile})" != "True" ]] ; then
- invalid_profiles["${profile_count}"]="${profile}"
- profile_count="$(( ${profile_count}+1 ))"
- fi
- done
-
- # Check if either no required profiles or too many set.
- local no_profile no_profile_count=0 extra_profiles extra_profiles_count=0
- for profile_type in ${REQUIRED_SINGLE_PROFILE_TYPES[@]} ; do
- local profile_count=0
- for profile in $(get_currently_set_profiles) ; do
- local curr_type="$(get_profile_type ${profile})"
- if [[ "${curr_type}" == "${profile_type}" ]] ; then
- profile_count="$(( ${profile_count}+1 ))"
- fi
- done
- if (( ${profile_count} == 0 )) ; then
- no_profile["${no_profile_count}"]="${profile_type}"
- no_profile_count="$(( ${no_profile_count} + 1 ))"
- elif (( ${profile_count} > 1 )) ; then
- extra_profiles["${extra_profiles_count}"]="${profile_type}"
- extra_profiles_count="$(( ${extra_profiles_count} + 1 ))"
- fi
- done
-
- # Check if mixing old style and new style profiles
- local old_style=0 new_style=0 mixed_profiles
- for profile in $(get_currently_set_profiles) ; do
- local current_type="$(get_profile_type ${profile})"
-
- if [[ "${current_type}" == "${MONOLITHIC_PROFILE_TYPE}" ]] ; then
- old_style="$(( ${old_style}+1 ))"
- continue
- else
- for profile_type in ${MULTI_PROFILE_TYPES[@]} ; do
- if [[ "${current_type}" == "${profile_type}" ]] ; then
- new_style="$(( ${new_style} + 1 ))"
- break
- fi
- done
- fi
- done
-
- # Set global variables with results. Set as strings, not array
- if (( ${#invalid_profiles} > 0 )) ; then
- INVALID_PROFILES="${invalid_profiles[@]}"
- fi
- # Not having profiles set is only error if not using an old style monolithic profile
- if (( ${#no_profile} > 0 && ${old_style} == 0 )) ; then
- MISSING_PROFILE_TYPES="${no_profile[@]}"
- fi
- if (( ${#extra_profiles} > 0 )) ; then
- EXTRA_PROFILE_TYPES="${extra_profiles[@]}"
- fi
- if (( ${old_style} > 0 && ${new_style} > 0 )) ; then
- MIXED_PROFILES="True"
- fi
- if (( ${old_style} > 0 && ${new_style} == 0 )) ; then
- USING_OLD_STYLE="True"
- fi
-
- return 0
-}
-
-
-# PRIVATE
-# Checks if profile exists. Returns "True" if it exists, "False" if it doesn't
-# NOTE: Only for profiles defined in PARENT_FILE.
-# $1 = Profile to check
-validate_profile() {
- local profile_valid profile="${1}"
- if [[ "${profile:0:1}" == "/" ]] ; then
- if [[ -d "${profile}" ]] ; then
- profile_valid="True"
- else
- profile_valid="False"
- fi
- elif [[ "${profile:0:1}" == "." ]] ; then
- if [[ -d "${MAKE_PROFILE_DIR}/${profile}" ]] ; then
- profile_valid="True"
- else
- profile_valid="False"
- fi
- elif [[ "${profile:0:1}" == ":" ]] ; then
- if [[ -d "${MAKE_PROFILE_DIR}/${profile:1}" ]] ; then
- profile_valid="True"
- else
- profile_valid="False"
- fi
- elif [[ -n "$(get_repo_name ${profile})" ]] ; then
- local repo_name="$(get_repo_name ${profile})"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- curr_name="$(get_repo_name_from_file ${pro_desc_file})"
- if [[ "${curr_name}" == "${repo_name}" ]] ; then
- local full_profile="${pro_desc_file%profiles.desc}${profile#${repo_name}:}"
- if [[ -d "${full_profile}" ]] ; then
- profile_valid="True"
- break
- else
- profile_valid="False"
- break
- fi
- fi
- done
- # If profile_valid isn't set then couldn't find profile, mark invalid
- if [[ -z "${profile_valid}" ]] ; then
- profile_valid="False"
- fi
- else
- # If here then not sure what this is. Doesn't appear to be valid profile.
- profile_valid="False"
- fi
-
- echo "${profile_valid}"
-}
-
-
-# PUBLIC
-# BUG FL-182
-# Validates a profile string entry against the list of profiles.
-# if the profile string doesn't exist, it errors out.
-# psychopatch 11-19-2012
-validate_profile_string() {
- local profile_string="${1}"
- local profiles=( $(get_profiles_list) )
- local repo_name=( $(get_repo_name_from_file ${MAIN_PROFILE_DESC_FILE}) )
- local profile_length=${#profiles[@]}
- # BUG FL-183
- # The eselect profile list command doesn't list the portage directory profile
- # prepending string "gentoo". This leaves the user not knowing he needs to add it
- # simplist fix i could think of was to check for the : in the string, if it doesn't
- # exist, we add the master profile repo name to the beginning before we match
- # psychopatch - 11-19-2012
- if [[ "${profile_string}" != *:* ]]; then
- profile_string="${repo_name}:${profile_string}"
- fi
- for ((i=0; i<$profile_length; i++)) {
- if [[ "${profile_string}" == "${profiles[${i}]}" ]]; then
- echo "${profiles[${i}]}"
- return 0
- fi
- }
- die -q "${1} is not a valid selection"
- return 1
-}
-
-
-### ADD ACTION ###
-
-# PUBLIC
-# Adds a profile to $PARENT_FILE
-add_profile() {
- local pro_to_add="$(process_passed_in_profile ${1})"
-
- # Die if profile is already set
- if [[ "$(is_profile_set ${pro_to_add})" == "True" ]] ; then
- die -q "'${pro_to_add}' is already set in ${PARENT_FILE}"
- fi
-
- # Check for NoMix
- local nomix=( $(check_for_nomix "${pro_to_add}") )
- if [[ -n "${nomix}" ]] ; then
- if [[ -z "${FORCE_ADD}" ]] ; then
- die -q "Current profile contains the profile(s) '${nomix[@]}' which should not be used with '${pro_to_add}'. Use -f to override"
- fi
- fi
-
- # Assign value to profile type, used to determine where to add profile
- local pro_to_add_type="$(get_profile_type ${pro_to_add})"
- local pro_type_number="$(assign_profile_value ${pro_to_add_type})"
-
- # Loop through current profiles and add new one in right place
- local now_set="False"
- local temp_file="$(create_temp_file)"
- for current_pro in $(get_currently_set_profiles) ; do
- # Same as above, assign value to profile type
- local current_type="$(get_profile_type ${current_pro})"
- local current_type_number="$(assign_profile_value ${current_type})"
- # Check if trying to add more than one ${REQUIRED_SINGLE_PROFILE_TYPES}
- for profile_type in ${REQUIRED_SINGLE_PROFILE_TYPES[@]} ; do
- if [[ "${pro_to_add_type}" == "${profile_type}" && "${pro_to_add_type}" == "${current_type}" ]] ; then
- if [[ -z "${FORCE_ADD}" ]] ; then
- rm "${temp_file}"
- die -q "Your profile already contains a '${pro_to_add_type}' type profile. You should only have one set. Either use replace action or if you know what your doing you can override with '-f'"
- fi
- fi
- done
- if [[ "${now_set}" != "True" ]] ; then
- if (( ${current_type_number} <= ${pro_type_number} )) ; then
- echo "${current_pro}" >> "${temp_file}"
- else
- echo "${pro_to_add}" >> "${temp_file}"
- echo "${current_pro}" >> "${temp_file}"
- now_set="True"
- fi
- else
- echo "${current_pro}" >> "${temp_file}"
- fi
- done
- # If we didn't find spot to add above then just add to end of file.
- if [[ "${now_set}" != "True" ]] ; then
- echo "${pro_to_add}" >> "${temp_file}"
- fi
-
- # Move new parent file into place
- mv "${temp_file}" "${PARENT_FILE}" || die -q "Error trying to update parent file. Temp file = ${temp_file}, Parent file = ${PARENT_FILE}"
-
-}
-
-# PUBLIC
-# Description of add action
-describe_add() {
- echo "Adds profiles."
-}
-
-# PUBLIC
-# Called by eselect when passed add as action
-do_add() {
- # Parse cli args
- FORCE_ADD=""
- while getopts ":f" option ; do
- case ${option} in
- f)
- FORCE_ADD="--force"
- ;;
- *)
- echo "Unrecognized option, use -f for force"
- ;;
- esac
- done
- # Remove option args
- shift $(($OPTIND - 1))
-
- if [[ -z "${1}" ]] ; then
- die -q "You didn't tell me what profile to add"
- else
- for profile in ${@} ; do
- add_profile "${profile}"
- done
- fi
-}
-
-### CLEAN ACTION ###
-
-# PRIVATE
-# Cleans $PARENT_FILE of all invalid entries and corrects order of profiles
-# $1 = "-p" If set just prints what new $PARENT_FILE would contain
-clean_profiles() {
- # Need temporary parent file
- local temp_parent_file="$(create_temp_file)"
-
- # Get rid of any invalid profiles.
- for profile in $(get_currently_set_profiles) ; do
- if [[ "$(validate_profile ${profile})" == "True" ]] ; then
- echo "${profile}" >> "${temp_parent_file}"
- fi
- done
-
- # Copy original $PARENT_FILE location before changing variable
- local orig_parent_file="${PARENT_FILE}"
- PARENT_FILE="${temp_parent_file}"
-
- local current_profiles=( $(get_currently_set_profiles) )
- local current_profiles_count=${#current_profiles[@]}
-
- # Loop through valid profile types and current profiles to add in right place
- local temp_file=$(create_temp_file)
- for (( x=0; x<${#VALID_PROFILE_TYPES[@]}; x++ )) ; do
- local valid_type="${VALID_PROFILE_TYPES[${x}]}"
- for profile in ${current_profiles[@]} ; do
- curr_type="$(get_profile_type ${profile})"
- if [[ "${curr_type}" == "${valid_type}" ]] ; then
- echo "${profile}" >> "${temp_file}"
- fi
- done
- done
-
- # Remove all profiles we set above. Anything left goes at end of parent file
- for profile in $(cat "${temp_file}") ; do
- for (( x=0; x<${current_profiles_count}; x++ )) ; do
- if [[ "${profile}" == "${current_profiles[${x}]}" ]] ; then
- unset current_profiles[x]
- fi
- done
- done
-
- if (( ${#current_profiles[@]} > 0 )) ; then
- for profile in ${current_profiles[@]} ; do
- echo "${profile}" >> "${temp_file}"
- done
- fi
-
- # Clean up mess and either display results or update file
- PARENT_FILE="${orig_parent_file}"
- if [[ "${PRETEND_CLEAN}" == "True" ]] ; then
- echo
- write_list_start "Pretend flag set, Displaying diff of what would be changed:"
- diff -u ${PARENT_FILE} ${temp_file}
- echo
- rm "${temp_parent_file}"
- rm "${temp_file}"
- else
- rm "${temp_parent_file}"
- mv "${temp_file}" "${PARENT_FILE}"
- fi
-}
-
-# PUBLIC
-# Description of clean action
-describe_clean() {
- echo "Cleans up parent file. Removes invalid profiles. Fixes mis-ordered entries. Use '-p' to check what would be changed/removed."
-}
-
-# PUBLIC
-# Called by eselect when passed clean as action
-do_clean() {
- # Parse cli args
- PRETEND_CLEAN=""
- while getopts ":p" option ; do
- case ${option} in
- p)
- PRETEND_CLEAN="True"
- ;;
- *)
- echo "Unrecognized option, use -p for pretend"
- ;;
- esac
- done
- # Remove option args
- shift $(($OPTIND - 1))
-
- clean_profiles
-}
-
-### LIST ACTION ###
-
-# PRIVATE
-# Writes a list entry
-# $1 = List number, $2 = Name of profile, $3 = Type of profile
-write_numbered_profile_list_entry() {
- local list_num="${1}" profile="${2}" profile_type="${3}"
-
- # Must come before stripping repo name
- local profile_set=$(is_profile_set "${profile}")
- local auto_enabled="False"
- for auto_pro in ${CURRENT_AUTO_ENABLED_PROFILES[@]} ; do
- if [[ "${auto_pro}" == "${profile}" ]] ; then
- auto_enabled="True"
- fi
- done
-
- # Strip repo name if from main repo
- profile="${profile#gentoo:}"
-
- # Mark with "*" and highlight if in current profiles, add "auto" if auto-enabled
- if [[ "${profile_set}" == "True" && "${auto_enabled}" == "True" ]] ; then
- profile="${COLOUR_LIST_LEFT}${profile} * (auto)${COLOUR_NORMAL}"
- elif [[ "${profile_set}" == "True" ]] ; then
- profile="${COLOUR_LIST_LEFT}${profile} * ${COLOUR_NORMAL}"
- elif [[ "${auto_enabled}" == "True" ]] ; then
- profile="${COLOUR_LIST_LEFT}${profile} (auto) ${COLOUR_NORMAL}"
- fi
-
- # List number
- echo -n -e " ${COLOUR_LIST_LEFT}"
- echo -n -e "[$(apply_text_highlights "${COLOUR_LIST_LEFT}" "${list_num}")]"
- echo -n -e "${COLOUR_NORMAL}"
- space $(( 4 - ${#list_num} ))
-
- # Profile name
- echo -n -e "${COLOUR_LIST_RIGHT}"
- echo -n -e "$(apply_text_highlights "${COLOUR_LIST_RIGHT}" "${profile}")"
- echo -e "${COLOUR_NORMAL}"
-}
-
-# PRIVATE For use with write_numbered_profile_list(),
-# Prints list of <type> profiles.
-# $1 = profile type $2 = "True" if print this list otherwise "False".
-write_type_list() {
- local profile_type="${1}" print_list
- if [[ "${2}" == "True" ]] ; then
- print_list="True"
- else
- print_list="False"
- fi
-
- if [[ "${print_list}" == "True" ]] ; then
- write_list_start "Currently available ${profile_type} profiles:"
- fi
-
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- local profiles=( $(awk '$1 == "'"${profile_type}"'" { print $2 }' "${pro_desc_file}") )
- for profile in ${profiles[@]} ; do
- if [[ "${profile_type}" == "arch" ]] ; then
- local profile_matched="$(match_arch_profile ${profile})"
- if [[ "${profile_matched}" == "True" ]] ; then
- if [[ "${print_list}" == "True" ]] ; then
- write_numbered_profile_list_entry "${LIST_ENTRY_NUMBER}" "${repo_name}:${profile}" "${profile_type}"
- fi
- else
- continue
- fi
- else
- if [[ "${print_list}" == "True" ]] ; then
- write_numbered_profile_list_entry "${LIST_ENTRY_NUMBER}" "${repo_name}:${profile}" "${profile_type}"
- fi
- fi
- LIST_ENTRY_NUMBER=$(( ${LIST_ENTRY_NUMBER}+1 ))
- done
- done
-}
-
-# PRIVATE
-# Writes a numbered list of profiles
-# "$1 = Type of profiles to list or "all" for all valid types
-write_numbered_profile_list() {
- local list_type
- if [[ -z "${1}" ]] ; then
- list_type="all"
- else
- list_type="${1}"
- fi
-
- # Declare global vars here:
- # This is needed so that numbers on list will match entry order in get_profiles_list()
- LIST_ENTRY_NUMBER="1"
- # This is set here to avoid repeated calls to parse_auto_enabled_profiles.
- CURRENT_AUTO_ENABLED_PROFILES=( $(parse_auto_enabled_profiles) )
-
- for profile_type in ${VALID_PROFILE_TYPES[@]} ; do
- local print_list
- if [[ "${list_type}" == "all" || "${list_type}" == "${profile_type}" ]] ; then
- print_list="True"
- else
- print_list="False"
- fi
-
- # Only display profiles if present
- if [[ "${profile_type}" != "${list_type}" ]] ; then
- local profiles=( $(get_profiles "${profile_type}") )
- if [[ -n "${profiles[@]}" ]] ; then
- write_type_list "${profile_type}" "${print_list}"
- else
- continue
- fi
- else
- write_type_list "${profile_type}" "${print_list}"
- fi
- done
-}
-
-# PUBLIC
-# Description of list action
-describe_list() {
- echo "List available profile targets."
-}
-
-# PUBLIC
-# Called by eselect when passed list as action
-do_list() {
- write_numbered_profile_list "${1}"
-}
-
-### REMOVE ACTION ###
-
-# PUBLIC
-# Removes a profile
-# $1 = profile to remove
-remove_profile() {
- local pro_to_remove="$(process_passed_in_profile ${1})"
-
- local found_pro="False"
- local temp_file="$(create_temp_file)"
- for profile in $(get_currently_set_profiles); do
- if [[ "${profile}" == ${pro_to_remove} ]] ; then
- found_pro="True"
- else
- echo "${profile}" >> "${temp_file}"
- fi
- done
-
- if [[ "${found_pro}" == "False" ]] ; then
- rm "${temp_file}"
- auto_enabled="False"
- for profile in $(parse_auto_enabled_profiles) ; do
- if [[ "${profile}" == "${pro_to_remove}" ]] ; then
- auto_enabled="True"
- fi
- done
-
- if [[ "${auto_enabled}" == "True" ]] ; then
- die -q "${pro_to_remove} is automatically enabled by another profile and can't be removed"
-
- else
- die -q "'${pro_to_remove}' was not found in your current profiles"
- fi
- else
- mv "${temp_file}" "${PARENT_FILE}" || die -q "Error trying to update parent file. Temp file = ${temp_file}, Parent file = ${PARENT_FILE}"
- fi
-
-}
-
-# PUBLIC
-# Description of remove action
-describe_remove() {
- echo "Removes a profile."
-}
-
-# PUBLIC
-# Called by eselect when passed remove as action
-do_remove() {
-
- if [[ -z "${1}" ]] ; then
- die -q "You didn't tell me what profile to remove"
- else
- for profile in ${@} ; do
- remove_profile "${profile}"
- done
- fi
-}
-
-### REPLACE ACTION ###
-
-# PRIVATE
-# Replaces a profile in $PARENT_FILE
-# $1 = profile to remove $2 = profile to add_profile
-replace_profile() {
- local old_profile="$(process_passed_in_profile ${1})"
- local new_profile="$(process_passed_in_profile ${2})"
-
- # Copy original parent file to temp location before removing old profile, that way if something goes wrong we can restore it
- local orig_parent_file="$(create_temp_file)"
- cp "${PARENT_FILE}" "${orig_parent_file}"
- remove_profile "${old_profile}"
-
- # Check if profile already set
- if [[ "$(is_profile_set ${new_profile})" == "True" ]] ; then
- mv "${orig_parent_file}" "${PARENT_FILE}"
- die -q "'${new_profile}' is already set in ${PARENT_FILE}"
- fi
-
- # Check for NoMix
- local nomix=( $(check_for_nomix ${new_profile}) )
- if [[ -n "${nomix}" ]] ; then
- if [[ -z "${FORCE_REPLACE}" ]] ; then
- mv "${orig_parent_file}" "${PARENT_FILE}"
- die -q "Current profile contains the profile(s) '${nomix[@]}' which should not be used with '${new_profile}'. Use -f to override"
- fi
- fi
-
- # Get type number for new profile
- local new_profile_type="$(get_profile_type ${new_profile})"
- new_pro_type_number="$(assign_profile_value ${new_profile_type})"
-
- # Loop through current profiles and decide where to add new one.
- local now_set="False"
- local temp_file="$(create_temp_file)"
- for current_pro in $(get_currently_set_profiles) ; do
- # Assign value to profile type
- local current_type="$(get_profile_type ${current_pro})"
- local current_type_number="$(assign_profile_value ${current_type})"
-
- # Check if trying to add more than one ${REQUIRED_SINGLE_PROFILE_TYPES}
- for profile_type in ${REQUIRED_SINGLE_PROFILE_TYPES[@]} ; do
- if [[ "${new_profile_type}" == "${profile_type}" && "${new_profile_type}" == "${current_type}" ]] ; then
- if [[ -z "${FORCE_REPLACE}" ]] ; then
- rm "${temp_file}"
- mv "${orig_parent_file}" "${PARENT_FILE}"
- die -q "Your profile already contains a '${new_profile_type}' type profile. You should only have one set. Either use replace action or if you know what your doing you can override with '-f'"
- fi
- fi
- done
- if [[ "${now_set}" != "True" ]] ; then
- if (( ${current_type_number} <= ${new_pro_type_number} )) ; then
- echo "${current_pro}" >> "${temp_file}"
- else
- echo "${new_profile}" >> "${temp_file}"
- echo "${current_pro}" >> "${temp_file}"
- now_set="True"
- fi
- else
- echo "${current_pro}" >> "${temp_file}"
- fi
- done
-
- # If we didn't find spot to add new profile above then just add to end of file.
- if [[ "${now_set}" != "True" ]] ; then
- echo "${new_profile}" >> "${temp_file}"
- fi
-
- # Move new parent file into place
- mv "${temp_file}" "${PARENT_FILE}"
- if (( $? != 0 )) ; then
- mv "${orig_parent_file}" "${PARENT_FILE}"
- rm "${temp_file}"
- die -q "Error trying to update parent file. Temp file was= ${temp_file}, Parent file = ${PARENT_FILE}"
- else
- rm "${orig_parent_file}"
- fi
-}
-
-# PUBLIC
-# Description of replace action
-describe_replace() {
- echo "Replaces a profile. Use -f to force. Usage: eselect profile replace [-f] <old_pro> <new_pro>"
-}
-
-# PUBLIC
-# Called by eselect when passed replace as action
-do_replace() {
- # Parse cli args
- FORCE_REPLACE=""
- while getopts ":f" option ; do
- case ${option} in
- f)
- FORCE_REPLACE="True"
- ;;
- *)
- echo "Unrecognized option, Use -f for force"
- ;;
- esac
- done
- # Remove option args
- shift $(($OPTIND - 1))
-
- if (( $# < 2 )) ; then
- die -q "The replace action requires 2 arguments. Usage: eselect profile replace [-f] <old_pro> <new_pro>"
- else
- replace_profile "${1}" "${2}"
- fi
-}
-
-
-### SET-BUILD ACTION ###
-
-# PUBLIC
-# Description of set-build action
-describe_set-build() {
- echo "Changes the build profile"
-}
-
-# PUBLIC
-# Adding a set-build action to go along with set-flavor action.
-do_set-build() {
- local pro_to_add="$(process_passed_in_profile ${1})"
-
- local profile_type="$(get_profile_type ${pro_to_add})"
- if [[ "${profile_type}" == "build" ]]
- then
-
- local profiles=( $(get_currently_set_profiles) )
- for i in "${profiles[@]}"
- do
-
- if [[ "$(get_profile_type ${i})" == "build" ]]
- then
- do_remove "${i}"
- break
- fi
- done
- do_add "${1}"
- else
- die -q "Selection is not a build profile"
- fi
-}
-
-
-### SET-FLAVOR ACTION ###
-
-# PUBLIC
-# Description of set-flavor action.
-describe_set-flavor() {
- echo "Changes the flavor profile"
-}
-
-# PUBLIC
-# FL-184
-# Adding a set-flavor function to allow an easier workflow
-# to replace system flavors.
-do_set-flavor() {
- local pro_to_add="$(process_passed_in_profile ${1})"
-
- local profile_type="$(get_profile_type ${pro_to_add})"
- if [[ "${profile_type}" == "flavor" ]]
- then
- #this is where the work to swap out the flavors happen.
- #get current flavor
- local profiles=( $(get_currently_set_profiles) )
- for i in "${profiles[@]}"
- do
-
- if [[ "$(get_profile_type ${i})" == "flavor" ]]
- then
- do_remove "${i}"
- break
- fi
- done
- #enable flavor
- do_add "${1}"
- else
- die -q "Selection is not a flavor profile"
- fi
-}
-
-### SHOW ACTION ###
-
-# PRIVATE
-# Displays currently set profiles
-show_profiles() {
-
- # Validate parent file so global vars are set
- validate_parent_file
-
- # Determine spacing
- local spaceme=1
- local no_type="(no type)"
- for profile_type in ${VALID_PROFILE_TYPES[@]} ${no_type} ; do
- if (( ${#profile_type} > ${spaceme} )) ; then
- spaceme=${#profile_type}
- fi
- done
- spaceme=$(( ${spaceme} + 1 ))
-
- # Get profiles and write list
- profiles=( $(get_currently_set_profiles) )
- echo
- write_list_start "Currently set profiles:"
- if [[ "${USING_OLD_STYLE}" != "True" && "${MIXED_PROFILES}" != "True" && -z "${EXTRA_PROFILE_TYPES}" ]] ; then
- # Print required types first
- local profile_count=0
- for (( x = 0 ; x < ${#REQUIRED_SINGLE_PROFILE_TYPES[@]}; x++ )) ; do
- if [[ "${REQUIRED_SINGLE_PROFILE_TYPES[${x}]}" == "$(get_profile_type ${profiles[${profile_count}]})" ]] ; then
- echo -e "$(space $(( spaceme - ${#REQUIRED_SINGLE_PROFILE_TYPES[${x}]} )))${REQUIRED_SINGLE_PROFILE_TYPES[${x}]}: ${profiles[${profile_count}]}"
- unset profiles["${profile_count}"]
- profile_count=$(( ${profile_count} + 1 ))
- else
- echo -e "$(space $(( spaceme - ${#REQUIRED_SINGLE_PROFILE_TYPES[${x}]} )))${REQUIRED_SINGLE_PROFILE_TYPES[${x}]}: ${COLOUR_WARN}(missing)${COLOUR_NORMAL}"
- fi
- done
-
- # Print rest of profiles
- for pro in ${profiles[@]} ; do
- local pro_type=$(get_profile_type ${pro})
- if [[ -n "${pro_type}" ]] ; then
- echo -e "$(space $(( spaceme - ${#pro_type} )))${pro_type}: ${pro}"
- else
- echo -e "$(space $(( spaceme - ${#no_type} )))${no_type}: ${pro}"
- fi
- done
-
- # Print list of auto-enabled profiles
- auto_enabled_profiles=( $(parse_auto_enabled_profiles) )
- if (( ${#auto_enabled_profiles[@]} > 0 )) ; then
- echo
- write_list_start "Automatically enabled profiles:"
-
- for auto_pro in ${auto_enabled_profiles[@]} ; do
- local pro_type=$(get_profile_type ${auto_pro})
- if [[ -n "${pro_type}" ]] ; then
- echo -e "$(space $(( spaceme - ${#pro_type} )))${pro_type}: ${auto_pro}"
- else
- echo -e "$(space $(( spaceme - ${#no_type} )))${no_type}: ${auto_pro}"
- fi
- done
- fi
- else
- # Using either old style or mixed profile(s) or user force-added extra profiles of same type, just print list.
- for pro in ${profiles[@]} ; do
- local pro_type=$(get_profile_type ${pro})
- if [[ -n "${pro_type}" ]] ; then
- echo -e "$(space $(( spaceme - ${#pro_type} )))${pro_type}: ${pro}"
- else
- echo -e "$(space $(( spaceme - ${#no_type} )))${no_type}: ${pro}"
- fi
- done
- fi
- echo
-}
-
-# PUBLIC
-# Description of show action
-describe_show() {
- echo "Displays list of profiles that are currently set."
-}
-
-# PUBLIC
-# Called by eselect when passed show as action
-do_show() {
- show_profiles
-}
-
View
1,057 app-admin/eselect/files/1.3.3/profile.eselect
@@ -1,1057 +0,0 @@
-# -*-eselect-*- vim: ft=eselect
-# Copyright 2005-2012 Gentoo Foundation
-# Copyright 2012 Ryan P. Harris
-# Distributed under the terms of the GNU General Public License v2
-# $Id: $
-
-# This is a portage-only module.
-# This version of profile.eselect is written for use with Funtoo's
-# multi-profile approach
-
-inherit package-manager output
-
-DESCRIPTION="Manage portage profiles"
-MAINTAINER="rh1@funtoo.org"
-VERSION="funtoo-1.5"
-
-### INIT ###
-
-# Global variables
-MAKE_PROFILE_DIR="/etc/portage/make.profile"
-PARENT_FILE="${MAKE_PROFILE_DIR}/parent"
-MAIN_PROFILE_DIRECTORY="$(portageq portdir)/profiles"
-PROFILE_DESC_FILENAME="profiles.eselect.desc"
-MAIN_PROFILE_DESC_FILE="${MAIN_PROFILE_DIRECTORY}/${PROFILE_DESC_FILENAME}"
-PORTAGE_OVERLAY_DIRS=( $(portageq portdir_overlay) )
-
-# IMPORTANT: Keep these in same order that profiles should appear in $PARENT_FILE
-VALID_PROFILE_TYPES=( "arch" "build" "flavor" "mix-ins" "mono" )
-REQUIRED_SINGLE_PROFILE_TYPES=( "arch" "build" "flavor" )
-MULTI_PROFILE_TYPES=( "arch" "build" "flavor" "mix-ins" )
-MULTIPLE_PROFILES_ALLOWED_TYPE=( "mix-ins" )
-MONOLITHIC_PROFILE_TYPE=( "mono" )
-
-# Die if MAIN_PROFILE_DESC_FILE doesn't exist
-if [[ ! -e "${MAIN_PROFILE_DESC_FILE}" ]] ; then
- die -q "Can't find ${MAIN_PROFILE_DESC_FILE}"
-fi
-
-# Create path to parent if needed.
-if [[ ! -e $(dirname "${PARENT_FILE}") ]] ; then
- mkdir -p $(dirname "${PARENT_FILE}")
-fi
-
-# Create $PARENT_FILE if it doesn't exist.
-if [[ ! -e "${PARENT_FILE}" ]] ; then
- touch "${PARENT_FILE}" || die -q "Error creating ${PARENT_FILE}"
- chmod 644 "${PARENT_FILE}"
-fi
-
-# Set MACHINE_ARCH
-MACHINE_ARCH="$(arch)"
-case "${MACHINE_ARCH}" in
- amd64)
- MACHINE_ARCH="x86-64bit"
- ;;
- arm)
- # TODO: Fix for different arm versions
- MACHINE_ARCH="arm-32bit"
- ;;
- x86)
- MACHINE_ARCH="x86-32bit"
- ;;
- *)
- MACHINE_ARCH="None"
- ;;
-esac
-
-### HELPER FUNCTIONS ###
-
-# PRIVATE
-# Assigns a value and returns it based on profile type for use in determining where to add profile
-# $1 = profile_type
-assign_profile_value() {
- local pro_type="${1}"
- local pro_type_number count_num=1
- for profile_type in ${VALID_PROFILE_TYPES[@]} ; do
- if [[ "${pro_type}" == "${profile_type}" ]] ; then
- pro_type_number=${count_num}
- fi
- count_num="$(( ${count_num}+1 ))"
- done
- if [[ -z "${pro_type}" ]] ; then
- pro_type_number="${count_num}"
- fi
- echo "${pro_type_number}"
-}
-
-# PUBLIC
-# Checks passed in profile against NoMix profiles for currently set
-# profiles and returns a list of any conflicting profiles it finds.
-# $1 = Profile to check against
-check_for_nomix() {
- local pro_to_check="${1}"
- local repo_name="$(get_repo_name ${pro_to_check})"
- local profile_desc_file="$(get_profiles_desc_file ${repo_name})"
- local pro_to_check_type="$(get_profile_type ${pro_to_check})"
- local stripped_pro_name
-
- if [[ -z "${repo_name}" ]] ; then
- # NoMix is only supported for new style multi profiles specified in format <repo_name>:<path_to_profile> so just return.
- return
- else
- stripped_pro_name="${pro_to_check#${repo_name}:}"
- fi
-
- local profile_path
- for profile_type in ${MULTI_PROFILE_TYPES[@]} ; do
- if [[ "${profile_type}" == "${pro_to_check_type}" ]] ; then
- profile_path="${stripped_pro_name%/${profile_type}/*}"
- fi
- done
- if [[ -z "${profile_path}" ]] ; then
- return
- fi
-
- local nomix=( $(awk '( $2 == "'"${stripped_pro_name}"'" ) && ( NF > 3 ) { print $4 }' "${profile_desc_file}" | awk -F "," '{ for ( x = 1; x <= NF; x++ ) { print $x } }') )
- if [[ -n "${nomix}" ]] ; then
- for profile in ${nomix[@]} ; do
- for current_pro in $(get_currently_set_profiles) ; do
- current_repo_name="$(get_repo_name ${current_pro})"
- if [[ "${repo_name}" == "${current_repo_name}" ]] ; then
- local full_pro="${repo_name}:${profile_path}/${profile}"
- if [[ "${full_pro}" == "${current_pro}" ]] ; then
- echo "${full_pro}"
- fi
- fi
- done
- done
- fi
-}
-
-# PUBLIC
-# Creates and returns temporary file using mktemp and sets permissions to 644
-create_temp_file() {
- local temp_file="$(mktemp)"
- chmod 644 "${temp_file}"
- echo "${temp_file}"
-}
-
-# PUBLIC
-# Converts number from profile list to name of profile
-# $1 = Number to convert
-convert_list_number() {
- local pro_number="${1}"
- local profiles=( $(get_profiles_list) )
- # Added in validation for numbers. It wasn't notifiying a number
- # was invalid if it was too large
- # psychopatch - 11-19-2012
- local profile_length=${#profiles[@]}
- if [[ ${1} -gt $profile_length ]]; then
- die -q "${1} is not a valid selection"
- fi
- echo "${profiles[$((${pro_number} - 1))]}"
-}
-
-
-# PUBLIC
-# BUG FL-182
-# Validates a profile string entry against the list of profiles.
-# if the profile string doesn't exist, it errors out.
-# psychopatch 11-19-2012
-validate_profile_string() {
- local profile_string="${1}"
- local profiles=( $(get_profiles_list) )
- local repo_name=( $(get_repo_name_from_file ${MAIN_PROFILE_DESC_FILE}) )
- local profile_length=${#profiles[@]}
- # BUG FL-183
- # The eselect profile list command doesn't list the portage directory profile
- # prepending string "gentoo". This leaves the user not knowing he needs to add it
- # simplist fix i could think of was to check for the : in the string, if it doesn't
- # exist, we add the master profile repo name to the beginning before we match
- # psychopatch - 11-19-2012
- if [[ "${profile_string}" != *:* ]]; then
- profile_string="${repo_name}:${profile_string}"
- fi
- for ((i=0; i<$profile_length; i++)) {
- if [[ "${profile_string}" == "${profiles[${i}]}" ]]; then
- echo "${profiles[${i}]}"
- return 0
- fi
- }
- die -q "${1} is not a valid selection"
- return 1
-}
-
-# PUBLIC
-# Returns list of profiles in $PARENT_FILE
-get_currently_set_profiles() {
- while read line ; do
- if [[ "${line:0:1}" != "#" ]] ; then
- echo "${line}"
- fi
- done < "${PARENT_FILE}"
-}
-
-# PUBLIC
-# Searches all PROFILE_DESC_FILENAME files and returns any profiles of passed in type
-# $1 = profile type to search for
-get_profiles() {
- local profile_type="${1}"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- local profiles=( $(awk '$1 == "'"${profile_type}"'" { print $2 }' "${pro_desc_file}") )
- for profile in ${profiles[@]} ; do
- echo "${repo_name}:${profile}"
- done
- done
-}
-
-# PUBLIC
-# Returns PROFILE_DESC_FILENAME file from passed in repo
-# $1 = Name of repo to get file from
-get_profiles_desc_file() {
- local repo_to_check="${1}"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- if [[ "${repo_name}" == "${repo_to_check}" ]] ; then
- echo "${pro_desc_file}"
- return
- fi
- done
-}
-
-# PUBLIC
-# Returns list of profiles.desc files from main repo and those
-# found by looking in PORTDIR_OVERLAY repos.
-get_profiles_desc_files() {
- # Echo main repo first
- echo "${MAIN_PROFILE_DESC_FILE}"
-
- for repo in ${PORTAGE_OVERLAY_DIRS[@]} ; do
- if [[ -e "${repo}/profiles/${PROFILE_DESC_FILENAME}" ]] ; then
- echo "${repo}/profiles/${PROFILE_DESC_FILENAME}"
- fi
- done
-}
-
-# PUBLIC
-# Returns full list of available profiles.
-get_profiles_list() {
- ### MUST USE SAME ORDER AS write_numbered_list DOES SO convert_list_number WORKS ###
- for profile_type in ${VALID_PROFILE_TYPES[@]} ; do
- for pro_desc_file in $(get_profiles_desc_files) ; do
- local repo_name="$(get_repo_name_from_file ${pro_desc_file})"
- local profiles=( $(awk '$1 == "'"${profile_type}"'" { print $2 }' "${pro_desc_file}") )
- for profile in ${profiles[@]} ; do
- if [[ "${profile_type}" == "arch" ]] ; then
- local profile_matched="$(match_arch_profile ${profile})"
- if [[ "${profile_matched}" == "True" ]] ; then
- echo "${repo_name}:${profile}"
- else
- continue
- fi
- else
- echo "${repo_name}:${profile}"
- fi
- done
- done
- done
-}
-
-#PUBLIC
-# Returns type of profile
-# $1 = Profile to check. Must be in format <repo_name>:<path_to_profile>
-get_profile_type() {
- local profile="${1}"
- local repo_name="$(get_repo_name ${profile})"
- for pro_desc_file in $(get_profiles_desc_files) ; do
- curr_name="$(get_repo_name_from_file ${pro_desc_file})"
- if [[ "${curr_name}" == "${repo_name}" ]] ; then
- # Check against $VALID_PROFILE_TYPES to insure correct values are retuned
- for pro_type in ${VALID_PROFILE_TYPES[@]} ; do
- # Strip repo_name
- local profile_type="$(awk '( $2 == "'"${profile#${repo_name}:}"'" ) && ( $1 == "'"$pro_type"'" ) { print $1 }' "${pro_desc_file}")"
- if [[ "${profile_type}" == "${pro_type}" ]] ; then
- echo "${profile_type}"
- return
- fi
- done
- fi
- done
-}
-
-# PUBLIC
-# Returns repo name found at beginning of profile.
-# $1 = Profile to check. Must be in format <repo_name>:<path_to_profile>
-get_repo_name() {
- local profile="${1}"
- local repo_name="$(expr match "${profile}" "\([^:]\+:\{1\}\)")"
- # Remove colon
- echo "${repo_name%:}"
-}
-
-# PUBLIC
-# Returns name of repo associated with the passed in PROFILE_DESC_FILENAME file
-# $1 = Full path to PROFILE_DESC_FILENAME file. Ex: /usr/portage/profiles/profiles.eselect.desc
-get_repo_name_from_file() {
- local repo_name_file="${1%${PROFILE_DESC_FILENAME}}repo_name"
- if [[ -e "${repo_name_file}" ]] ; then
- echo $(cat "${repo_name_file}")
- fi
-}
-
-# PUBLIC
-# Returns "True" if profile is set in $PARENT_FILE, "False" if not set.
-# $1 = Profile to look for
-is_profile_set() {
- local profile="${1}"
- for curr_pro in $(get_currently_set_profiles) ; do
- if [[ "${profile}" == "${curr_pro}" ]] ; then
- echo "True"
- return
- fi
- done
- # If we made it here, profile isn't set
- echo "False"
-}
-
-# PUBLIC
-# Checks if arch profile matches machine arch. Returns True if matches, False if not.
-# Also returns True for all arches if MACHINE_ARCH="None"
-# $1 = profile to check
-match_arch_profile() {
- local pro_to_check="${1}"
- local stripped_arch="${pro_to_check#*/arch/}"
- local pro_arch="${stripped_arch%%/*}"
-
- if [[ "${MACHINE_ARCH}" == "None" ]] ; then
- echo "True"
- else
- if [[ "${pro_arch}" == "${MACHINE_ARCH}" ]] ; then
- echo "True"
- else
- echo "False"
- fi
- fi
-}
-
-# PUBLIC
-# Checks if parent file is valid.
-# $1 = "print_warn" If $1 is set to "print_warn" then print warning messages. If not set then just return "False" if anything in parent is invalid
-validate_parent_file() {
-
- # Check if profiles are valid
- local invalid_profiles profile_count=0
- for profile in $(get_currently_set_profiles) ; do
- if [[ "$(validate_profile ${profile})" != "True" ]] ; then
- invalid_profiles["${profile_count}"]="${profile}"
- profile_count="$(( ${profile_count}+1 ))"
- fi
- done
-
- # Check if either no required profiles or too many set.
- local no_profile no_profile_count=0 extra_profiles extra_profiles_count=0
- for profile_type in ${REQUIRED_SINGLE_PROFILE_TYPES[@]} ; do
- local profile_count=0
- for profile in $(get_currently_set_profiles) ; do
- local curr_type="$(get_profile_type ${profile})"
- if [[ "${curr_type}" == "${profile_type}" ]] ; then
- profile_count="$(( ${profile_count}+1 ))"
- fi
- done
- if (( ${profile_count} == 0 )) ; then
- no_profile["${no_profile_count}"]="${profile_type}"
- no_profile_count="$(( ${no_profile_count} + 1 ))"
- elif (( ${profile_count} > 1 )) ; then
- extra_profiles["${extra_profiles_count}"]="${profile_type}"
- extra_profiles_count="$(( ${extra_profiles_count} + 1 ))"
- fi
- done
-
- # Check if mixing old style and new style profiles
- local old_style=0 new_style=0 mixed_profiles
- for profile in $(get_currently_set_profiles) ; do
- local current_type="$(get_profile_type ${profile})"
-
- if [[ "${current_type}" == "${MONOLITHIC_PROFILE_TYPE}" ]] ; then
- old_style="$(( ${old_style}+1 ))"
- continue
- else
- for profile_type in ${MULTI_PROFILE_TYPES[@]} ; do
- if [[ "${current_type}" == "${profile_type}" ]] ; then
- new_style="$(( ${new_style} + 1 ))"
- break
- fi
- done
- fi
- done
-
- # Set global variables with results. Set as strings, not array
- if (( ${#invalid_profiles} > 0 )) ; then
- INVALID_PROFILES="${invalid_profiles[@]}"
- fi
- # Not having profiles set is only error if not using an old style monolithic profile
- if (( ${#no_profile} > 0 && ${old_style} == 0 )) ; then
- MISSING_PROFILE_TYPES="${no_profile[@]}"
- fi
- if (( ${#extra_profiles} > 0 )) ; then
- EXTRA_PROFILE_TYPES="${extra_profiles[@]}"
- fi
- if (( ${old_style} > 0 && ${new_style} > 0 )) ; then
- MIXED_PROFILES="True"
- fi
- if (( ${old_style} > 0 && ${new_style} == 0 )) ; then
- USING_OLD_STYLE="True"
- fi
-}
-
-# PUBLIC
-# Checks if profile exists. Returns "True" if it exists, "False" if it doesn't
-# $1 = Profile to check
-validate_profile() {
- local profile_valid profile="${1}"