dev-python/six: Run six dir QA check twice
authorJustin Lecher <jlec@gentoo.org>
Mon, 30 Nov 2015 07:24:40 +0000 (08:24 +0100)
committerJustin Lecher <jlec@gentoo.org>
Mon, 30 Nov 2015 07:24:40 +0000 (08:24 +0100)
Using pkg_pretend to catch as early as possible but don't break when python
impl is not installed. Use pkg_Setup to catch them all

Package-Manager: portage-2.2.25
Signed-off-by: Justin Lecher <jlec@gentoo.org>
dev-python/six/six-1.10.0.ebuild

index 6161e0ad2ca7a2335e383427391bf6cfb2bdd1cf..ffbb168d3c246628216188c8790852f616c62b7a 100644 (file)
@@ -26,7 +26,21 @@ PATCHES=(
        "${FILESDIR}"/1.9.0-mapping.patch
        )
 
+# Run twice.
+# pkg_pretend to catch as early as possible, but be forgiving if 
+# python impl is not installed allready.
+# pkg_setup to catch them all
 pkg_pretend() {
+       six_dir_check() {
+               local dir="${ROOT}"/$(python_get_sitedir)/six
+               type -p "${PYTHON}" > /dev/null || return 0
+               [[ -d "${dir}" ]] \
+                       && die "${PN} doesn't work if ${dir} is a directory #546730"
+       }
+       python_foreach_impl six_dir_check
+}
+
+pkg_setup() {
        six_dir_check() {
                local dir="${ROOT}"/$(python_get_sitedir)/six
                [[ -d "${dir}" ]] \