app-emulation/wine-vanilla: Sync from ::wine
authorNP-Hardass <NP-Hardass@gentoo.org>
Mon, 22 Jan 2018 22:46:19 +0000 (17:46 -0500)
committerNP-Hardass <NP-Hardass@gentoo.org>
Mon, 22 Jan 2018 22:51:14 +0000 (17:51 -0500)
Use estack eclass to avoid dealing with specifics of shopt usage
Change implementation to handle any manpage from any locale
Remove linguas references, finishing l10n switch

Closes: https://bugs.gentoo.org/645238
Bug: https://bugs.gentoo.org/617864
Closes: https://bugs.gentoo.org/643576
Package-Manager: Portage-2.3.19, Repoman-2.3.6

app-emulation/wine-vanilla/Manifest
app-emulation/wine-vanilla/wine-vanilla-2.0-r1.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.0.1-r1.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.0.2-r1.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.0.3.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.0.4.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.20.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.21.ebuild
app-emulation/wine-vanilla/wine-vanilla-2.22.ebuild
app-emulation/wine-vanilla/wine-vanilla-3.0.ebuild
app-emulation/wine-vanilla/wine-vanilla-9999.ebuild

index f40e3fed96291d4544b556a05e459e122f5157eb..b2f48ea9d7f7fdd74e33dd933a02c1fcf1ba5213 100644 (file)
@@ -1,4 +1,4 @@
-DIST gentoo-wine-patches-20180119.tar.xz 58688 BLAKE2B e7d44906f3c81c69fd3016ac6a7e2b8e68cc82762cc0a6b469e572d9b2edfd04ce9353e151c07dac11f82b1d108517fc86862d724e83ee8c4e938d64f3f9b934 SHA512 3e605bf613dca333e501b5578d9c92a42d351a23f8d7d9d6a545a7dc043dcc4c7f52918e6ad46db63a6f00f3ace4b77055f8343176afb976e6a04590dcee64b7
+DIST gentoo-wine-patches-20180120.tar.xz 58672 BLAKE2B 84d621075b65475cec41a06429680b518d7eafb938cefd903f3f8aa71ea3049ac9d8de05af48f9f4f4a1b9172c7ef17784540413e410eb8ec11e8ec4a63858c6 SHA512 5b354a409c7a2b77499aaa593b9248a1d15d755e3687b095755faacc30068bfcdbdd5c2a2a78617cb1a78c46d2931162bd69ec3379b035d81494bea7108263c2
 DIST wine-2.0.1.tar.xz 18845444 BLAKE2B 82e692c9a216087ea3b51cba659b12a79b25b44aac2ab572b9cf6d12c29b8fa5cee3c4bb9f8e9dca526ded2c6ba1f77d2c948b783914427ec2b93409e64ccaec SHA512 b32d07443655898768383b7409c21093b60c028fef166a596dad5dfab5a329b9fce4552e612c6d182e4f67eb1f28ed497fe2ed6af55d0000d3e96a124547722d
 DIST wine-2.0.2.tar.xz 18854952 BLAKE2B ae55b6a31e4d36b367a84e0e5fa7bea8c39a61ecfe7def4082747df4c55d0ee5c72e132bc77b49935fee8d0faf7f4d2cddfda0c712b6042b440dda1946e682b6 SHA512 3f37080a951819304cd3475f6012f1d6b5a94879b137cdf816cac4c8fde68ddc777905e92277ec5dce96437d8c32c43d55d3750b582781a9f9774b118f1a5b90
 DIST wine-2.0.3.tar.xz 18864648 BLAKE2B 0503a11e7545d5af805bfc3c2f614b6e35e39b7b532ee45dd9947e1a9a53eb788a304e744c683e42bf84f0e67e2c046ea5f839b6bbad1cf73b9996eaae5c30c1 SHA512 e20dbcb3a48ecb3526eba075d4baebab2529dfc50b7a6d5e18294704470f61db386013f457118c270274b911f9643d203110f46558d23e84e6a6c2d78e237dbb
index 423245563fe6879217fa8f4071d4aa413376447b..b6970b16cc73767a146e125909314b957cc2e526 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
        "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
        "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=(
        "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
@@ -340,29 +340,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index 1c0dacadef0ed083bc2fac0d2311d0dfa5e2c807..f19e2fee2149b5ea76e2dba124bc2475cf59ff66 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
        "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
        "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=(
        "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
@@ -340,29 +340,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index 1c0dacadef0ed083bc2fac0d2311d0dfa5e2c807..f19e2fee2149b5ea76e2dba124bc2475cf59ff66 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
        "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
        "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=(
        "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
@@ -340,29 +340,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index 2aad417a855e951a4f8da2955d548a48a2c45e6f..dd5dfa1b3911ed09a0c06cbd978de7a81ab2fac3 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -155,7 +155,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -336,29 +336,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -491,16 +492,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index f9492b16f21dc0f7ded9589d3e87bac7ab361514..c2b9e49b3b081f0aa2f8a1b6322894151c85aae2 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -155,7 +155,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -336,29 +336,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -491,16 +492,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index d1fca61ea408294fb1c76c76b01f6e6cccc91945..55dd4bac5b7143bf1624e6114e4539ce9c325b08 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -338,29 +338,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index d1fca61ea408294fb1c76c76b01f6e6cccc91945..55dd4bac5b7143bf1624e6114e4539ce9c325b08 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -338,29 +338,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index d1fca61ea408294fb1c76c76b01f6e6cccc91945..55dd4bac5b7143bf1624e6114e4539ce9c325b08 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -338,29 +338,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index e4a4223882aa62cd455939a185c6f8953d91331c..cda136eb494ad42a0a66463cd8e2ee1b31fd248d 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -338,29 +338,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {
index d1fca61ea408294fb1c76c76b01f6e6cccc91945..55dd4bac5b7143bf1624e6114e4539ce9c325b08 100644 (file)
@@ -6,7 +6,7 @@ EAPI=6
 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 
-inherit autotools eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
+inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
 
 MY_PN="${PN%%-*}"
 MY_P="${MY_PN}-${PV}"
@@ -24,7 +24,7 @@ else
 fi
 S="${WORKDIR}/${MY_P}"
 
-GWP_V="20180119"
+GWP_V="20180120"
 PATCHDIR="${WORKDIR}/gentoo-wine-patches"
 
 DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
@@ -157,7 +157,7 @@ PATCHES=(
        "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
        "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
        "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
-       "${PATCHDIR}/patches/${MY_PN}-2.0-prevent-build-of-localized-manpages.patch" #469418 #617864
+       "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
 )
 PATCHES_BIN=()
 
@@ -338,29 +338,30 @@ src_prepare() {
        l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
 
        # Fix manpage generation for locales #469418 and abi_x86_64 #617864
-       # Depends on wine-2.0-prevent-build-of-localized-manpages.patch"
-       # Duplicate manpages input for wine64
-       local man
-       for man in loader/*.man.in; do
-               cp ${man} ${man/wine/wine64} || die
+       # Requires wine-2.0-rearrange-manpages.patch
+
+       # Duplicate manpages input files for wine64
+       local f
+       for f in loader/*.man.in; do
+               cp ${f} ${f/wine/wine64} || die
        done
-       # Add in proper manpages to Makefile
-       local search_text="wine.man.in"
+       # Add wine64 manpages to Makefile
        if use abi_x86_64; then
-               sed -i "/${search_text}/i \
-                       "$'\\\t'"wine64.man.in "$'\\\\' loader/Makefile.in || die
+               sed -i "/wine.man.in/i \
+                       \\\twine64.man.in \\\\" loader/Makefile.in || die
+               sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
+\164\2/' loader/Makefile.in || die
        fi
-       local l
-       for l in de fr pl; do
-               if has ${l} ${LINGUAS-${l}}; then
-                       sed -i "/${search_text}/i \
-                               "$'\\\t'"wine.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       if use abi_x86_64; then
-                               sed -i "/${search_text}/i \
-                                       "$'\\\t'"wine64.${l}.UTF-8.man.in "$'\\\\' loader/Makefile.in || die
-                       fi
-               fi
-       done
+
+       rm_man_file(){
+               local file="${1}"
+               loc=${2}
+               sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
+       }
+
+       while read f; do
+               l10n_for_each_disabled_locale_do rm_man_file "${f}"
+       done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
 }
 
 src_configure() {
@@ -495,16 +496,15 @@ multilib_src_install_all() {
                dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
        fi
 
-       # Failglob for bin and man loops
-       local glob_state=$(shopt -p failglob)
-       shopt -s failglob
-
+       # Failglob for binloops, shouldn't be necessary, but including to stay safe
+       eshopts_push -s failglob #615218
        # Make wrappers for binaries for handling multiple variants
        # Note: wrappers instead of symlinks because some are shell which use basename
        local b
        for b in "${D%/}${MY_PREFIX}"/bin/*; do
                make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
        done
+       eshopts_pop
 }
 
 pkg_postinst() {