media-gfx/imagemagick: provide unrestricted policy during build to pass tests
authorThomas Deutschmann <whissi@gentoo.org>
Wed, 22 Aug 2018 20:10:15 +0000 (22:10 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Wed, 22 Aug 2018 20:21:37 +0000 (22:21 +0200)
Closes: https://bugs.gentoo.org/664238
Package-Manager: Portage-2.3.48, Repoman-2.3.10

media-gfx/imagemagick/files/policy.test.xml [new file with mode: 0644]
media-gfx/imagemagick/imagemagick-6.9.10.10-r1.ebuild
media-gfx/imagemagick/imagemagick-7.0.8.10-r1.ebuild
media-gfx/imagemagick/imagemagick-9999.ebuild

diff --git a/media-gfx/imagemagick/files/policy.test.xml b/media-gfx/imagemagick/files/policy.test.xml
new file mode 100644 (file)
index 0000000..6db44b7
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policymap [
+  <!ELEMENT policymap (policy)+>
+  <!ATTLIST policymap xmlns CDATA #FIXED ''>
+  <!ELEMENT policy EMPTY>
+  <!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
+    name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
+    stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
+]>
+<policymap>
+  <!-- Policy used for test suite only to allow passing test suite
+       in case user has installed a restriction which would prevent
+       the execution of some tests -->
+  <policy domain="delegate" rights="read|write" pattern="*" />
+  <policy domain="filter"   rights="read|write" pattern="*" />
+  <policy domain="coder"    rights="read|write" pattern="*" />
+</policymap>
index 1d686b48b4d3fe253428b37e8cde3fe3d1d8ff7b..660eaf7502036deae1d7b2ea441f57aabc05c0f9 100644 (file)
@@ -69,6 +69,13 @@ S="${WORKDIR}/${MY_P}"
 PATCHES=( "${FILESDIR}"/policy-hardening.patch )
 
 src_prepare() {
+       # Install default (unrestricted) policy in $HOME for test suite #664238
+       local _im_local_config_home="${HOME}/.config/ImageMagick"
+       mkdir -p "${_im_local_config_home}" || \
+               die "Failed to create IM config dir in '${_im_local_config_home}'"
+       cp "${FILESDIR}"/policy.test.xml "${_im_local_config_home}/policy.xml" || \
+               die "Failed to install default blank policy.xml in '${_im_local_config_home}'"
+
        local mesa_cards ati_cards nvidia_cards render_cards
        default
 
index 37caf38d4eb9db62ee16e55aab1233e1731809cb..be9dabf5dacac58ed84042017f11c6bf9846ee1f 100644 (file)
@@ -76,6 +76,13 @@ REQUIRED_USE="corefonts? ( truetype )
 S="${WORKDIR}/${MY_P}"
 
 src_prepare() {
+       # Install default (unrestricted) policy in $HOME for test suite #664238
+       local _im_local_config_home="${HOME}/.config/ImageMagick"
+       mkdir -p "${_im_local_config_home}" || \
+               die "Failed to create IM config dir in '${_im_local_config_home}'"
+       cp "${FILESDIR}"/policy.test.xml "${_im_local_config_home}/policy.xml" || \
+               die "Failed to install default blank policy.xml in '${_im_local_config_home}'"
+
        local ati_cards mesa_cards nvidia_cards render_cards
        default
 
index c4e214944021e07c27e20d19ed6952a709258855..7b3cfc9af8aa5b23d227059769744441b1c0214e 100644 (file)
@@ -76,6 +76,13 @@ REQUIRED_USE="corefonts? ( truetype )
 S="${WORKDIR}/${MY_P}"
 
 src_prepare() {
+       # Install default (unrestricted) policy in $HOME for test suite #664238
+       local _im_local_config_home="${HOME}/.config/ImageMagick"
+       mkdir -p "${_im_local_config_home}" || \
+               die "Failed to create IM config dir in '${_im_local_config_home}'"
+       cp "${FILESDIR}"/policy.test.xml "${_im_local_config_home}/policy.xml" || \
+               die "Failed to install default blank policy.xml in '${_im_local_config_home}'"
+
        local ati_cards mesa_cards nvidia_cards render_cards
        default