aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorS├ębastien Fabbro <bicatali@gentoo.org>2014-01-21 09:02:36 -0800
committerS├ębastien Fabbro <bicatali@gentoo.org>2014-01-21 09:02:36 -0800
commit298f52cea3b60e05a2b851e2ebd745d45045684c (patch)
tree7f0dcff67e10e13af8dc06721e08932b38d73cd3 /eclass/alternatives-2.eclass
parentremoved HSL license, now in tree (diff)
downloadsci-298f52cea3b60e05a2b851e2ebd745d45045684c.tar.gz
sci-298f52cea3b60e05a2b851e2ebd745d45045684c.tar.bz2
sci-298f52cea3b60e05a2b851e2ebd745d45045684c.zip
fixed a bit removing alternative module with newer eselect
Diffstat (limited to 'eclass/alternatives-2.eclass')
-rw-r--r--eclass/alternatives-2.eclass19
1 files changed, 12 insertions, 7 deletions
diff --git a/eclass/alternatives-2.eclass b/eclass/alternatives-2.eclass
index 38a0328bf..fe2f55e95 100644
--- a/eclass/alternatives-2.eclass
+++ b/eclass/alternatives-2.eclass
@@ -147,13 +147,18 @@ alternatives-2_pkg_prerm() {
#echo "Making sure ${alt} has a valid provider"
#echo eselect "${alt}" update${ignore} "${provider}"
eselect "${alt}" update${ignore} "${provider}" && continue
- einfo "Removed ${provider} alternative module for ${alt}, current is $(eselect ${alt} show)"
- if [[ $? -eq 2 ]]; then
- einfo "Cleaning up unused alternatives module for ${alt}"
- echo rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect"
- rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" ||
- eerror rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" failed
- fi
+ einfo "Removing ${provider} alternative module for ${alt}, current is $(eselect ${alt} show)"
+ case $? in
+ 0) : ;;
+ 2)
+ einfo "Cleaning up unused alternatives module for ${alt}"
+ rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" || \
+ eerror rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" failed
+ ;;
+ *)
+ eerror eselect "${alt}" update "${provider}" returned $?
+ ;;
+ esac
done
}