From a79d8b6680d4b7f22421d2a4bc0cce2b65a71f7e Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 24 Sep 2009 21:40:28 +0200 Subject: added workaround for older eix versions added seperate file that overrides the eix-update and eix-diff binaries with a funktion that supports older eix removed eix call from regen-overlays by putting the overlay config path relativ to dirname $0 removed switch from eix-update and include seperate file --- eix-switch.sh | 17 +++++++++++++++++ postsync.d/eix-update | 16 +++++++--------- postsync.d/regen-overlays | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 eix-switch.sh diff --git a/eix-switch.sh b/eix-switch.sh new file mode 100644 index 0000000..c3b8be7 --- /dev/null +++ b/eix-switch.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +eix-update() { + if [ -x /usr/bin/eix-update ] ; then + /usr/bin/eix-update $@ + else + [ -x /usr/bin/update-eix ] && /usr/bin/update-eix $@ + fi +} + +eix-diff() { + if [ -x /usr/bin/eix-diff ] ; then + /usr/bin/eix-diff $@ + else + [ -x /usr/bin/diff-eix ] && /usr/bin/diff-eix $@ + fi +} diff --git a/postsync.d/eix-update b/postsync.d/eix-update index a94196f..729f5c4 100755 --- a/postsync.d/eix-update +++ b/postsync.d/eix-update @@ -2,8 +2,11 @@ . /etc/init.d/functions.sh -EIXCACHE=$(update-eix --print EIX_CACHEFILE) -OVERLAY_CONFIG_DIR="$(update-eix --print EIXCFGDIR)/overlays" +# implement old/new switch for older versions of eix +[ -r "$(dirname $0)/../eix-switch.sh" ] && . "$(dirname $0)/../eix-switch.sh" + +EIXCACHE=$(eix-update --print EIX_CACHEFILE) +OVERLAY_CONFIG_DIR="$(dirname $0)/../overlays" TMPFILE="" if [ -r "${EIXCACHE}" ]; then @@ -46,17 +49,12 @@ done echo -( [ -x /usr/bin/eix-update ] && /usr/bin/eix-update ${OVERLAY_PARAM} ) || ( [ -x /usr/bin/update-eix ] && /usr/bin/update-eix ${OVERLAY_PARAM} ) +eix-update ${OVERLAY_PARAM} if [ -r "${EIXCACHE}" -a -r "${TMPFILE}" ]; then echo - if [ -x /usr/bin/eix-diff ] ; then - eix-diff "${TMPFILE}" - else - [ -x /usr/bin/diff-eix ] && diff-eix "${TMPFILE}" - fi + eix-diff "${TMPFILE}" - echo rm -f "${TMPFILE}" fi diff --git a/postsync.d/regen-overlays b/postsync.d/regen-overlays index bbaec32..89d70dd 100755 --- a/postsync.d/regen-overlays +++ b/postsync.d/regen-overlays @@ -2,7 +2,7 @@ . /etc/init.d/functions.sh -OVERLAY_CONFIG_DIR="$(update-eix --print EIXCFGDIR)/overlays" +OVERLAY_CONFIG_DIR="$(dirname $0)/../overlays" ebegin "Regenerating overlay config ..." -- cgit v1.2.3