diff options
author | 2017-04-11 21:33:56 -0400 | |
---|---|---|
committer | 2017-04-11 21:33:56 -0400 | |
commit | 8896fbcfb07e120148506ca2db8fc9aae62ce09b (patch) | |
tree | 7f3aa8ff36b4905aa76c16b3bb2226afd5bb00f3 | |
parent | wine.eselect: use failglob (diff) | |
download | eselect-wine-8896fbcfb07e120148506ca2db8fc9aae62ce09b.tar.gz eselect-wine-8896fbcfb07e120148506ca2db8fc9aae62ce09b.tar.bz2 eselect-wine-8896fbcfb07e120148506ca2db8fc9aae62ce09b.zip |
wine.eselect: use globstar to enable support of localized manpagesv1.1
-rw-r--r-- | wine.eselect | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/wine.eselect b/wine.eselect index 7846140..28d59ba 100644 --- a/wine.eselect +++ b/wine.eselect @@ -810,7 +810,7 @@ set_symlinks() { local link local links - local glob_state=$(shopt -p failglob) + ( shopt -s failglob store_config "${CONFIG_DIR}/links/${v}" symlink_dirs "bin" @@ -832,33 +832,35 @@ set_symlinks() { done store_config "${CONFIG_DIR}/links/${v}" "bin" "${links}" + shopt -s globstar links="" append_config "${CONFIG_DIR}/links/${v}" symlink_dirs "man" store_config "${CONFIG_DIR}/links/${v}" "man" "" - for md in "${wine_man}"/*; do - for m in "${md}"/*; do - link="${EPREFIX}/usr/share/man/${md##*/}/${m##*/}${v_arg#-}" - if [[ -L "${link}" ]]; then - write_warning_msg "${link} already exists, overwriting" - rm "${link}" || die -q "Failed to rm old link: ${link}" - fi - ln -s "${m}" "${link}" - if [[ $? -ne 0 ]]; then - write_warning_msg "Failed to set symlink from ${m} to ${link}" - write_warning_msg "Cleaning up" - remove_symlinks ${v_arg} - fi - links="${links} ${link}" - done + pushd "${wine_man}" > /dev/null + for m in **/*.1; do + link="${EPREFIX}/usr/share/man/${m}${v_arg#-}" + if [[ -L "${link}" ]]; then + write_warning_msg "${link} already exists, overwriting" + rm "${link}" || die -q "Failed to rm old link: ${link}" + fi + mkdir -p "${link%/*}" || die -q "Failed to mkdir: ${link%/*}" + ln -s "${wine_man}/${m}" "${link}" + if [[ $? -ne 0 ]]; then + write_warning_msg "Failed to set symlink from ${wine_man}/${m} to ${link}" + write_warning_msg "Cleaning up" + remove_symlinks ${v_arg} + fi + links="${links} ${link}" done append_config "${CONFIG_DIR}/links/${v}" "man" "${links}" + popd > /dev/null local desktop="${EPREFIX}/usr/share/applications/wine${v_arg#-}.desktop" cp "${wine_app}/wine.desktop" "${desktop}" || die "Failed to copy desktop file" sed -i "s:Exec=.*:Exec=wine${v_arg#-} start /unix %f:" ${desktop} || die "Failed to edit desktop file" desktop_database_update || die "Failed to update xorg desktop database" - eval "${glob_state}" + ) unset_dir_env } |