summaryrefslogtreecommitdiffstats
path: root/postsync.d/regen-overlays
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-01-08 20:48:47 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2009-01-08 20:48:47 +0100
commit0ca3f6991a7c8352423a1b2673d91941917cfcb2 (patch)
treee2e1f4d5ae01801fde3f6e3197a529a0108ab4de /postsync.d/regen-overlays
parent1e57b0b6831f84fe435695816fd9f870750e2498 (diff)
downloadportage-ext-0ca3f6991a7c8352423a1b2673d91941917cfcb2.tar.gz
portage-ext-0ca3f6991a7c8352423a1b2673d91941917cfcb2.tar.xz
portage-ext-0ca3f6991a7c8352423a1b2673d91941917cfcb2.zip
reworked scripts
sync of overlays is now possible sync gives output prepended with the overlay name to enable sync set $SYNC in the overlay configuration to the command that should be executed in the directory of the overlay to sync it
Diffstat (limited to 'postsync.d/regen-overlays')
-rwxr-xr-xpostsync.d/regen-overlays45
1 files changed, 11 insertions, 34 deletions
diff --git a/postsync.d/regen-overlays b/postsync.d/regen-overlays
index 4788e85..bbaec32 100755
--- a/postsync.d/regen-overlays
+++ b/postsync.d/regen-overlays
@@ -1,44 +1,19 @@
#!/bin/bash
+
+. /etc/init.d/functions.sh
+
OVERLAY_CONFIG_DIR="$(update-eix --print EIXCFGDIR)/overlays"
-# error
-eecho() {
- case "x${NOCOLOR}" in
- x[y,Y][e,E][s,S]|x-[t,T][r,R][u,U][e,E]|x)
- echo -ne '\e[1;31m * \e[0m';;
- x*)
- echo -n " * ";;
- esac
-
- echo "$*"
-}
-
-# warning
-wecho() {
- case "x${NOCOLOR}" in
- x[y,Y][e,E][s,S]|x-[t,T][r,R][u,U][e,E]|x)
- echo -ne '\e[1;33m * \e[0m';;
- x*)
- echo -n " * ";;
- esac
-
- echo "$*"
-}
-
-# info
-iecho() {
- echo ">>> $*"
-}
-
-iecho "Regenerating overlay config ..."
+ebegin "Regenerating overlay config ..."
if [ ! -d "${OVERLAY_CONFIG_DIR}" ] ; then
- eecho "${OVERLAY_CONFIG_DIR} does not exists!"
+ eerror "${OVERLAY_CONFIG_DIR} does not exists!"
+ eend 1
return 1
fi
if [ ! -f "${OVERLAY_CONFIG_DIR}/make.conf" ] ; then
- wecho "${OVERLAY_CONFIG_DIR}/make.conf does not exists, creating..."
+ ewarn "${OVERLAY_CONFIG_DIR}/make.conf does not exists, creating..."
touch "${OVERLAY_CONFIG_DIR}/make.conf"
fi
@@ -49,7 +24,7 @@ for overlay_config in $(ls ${OVERLAY_CONFIG_DIR}); do
if [[ "${overlay_config}" != "make.conf" ]] ; then
source ${OVERLAY_CONFIG_DIR}/${overlay_config}
- if [[ -n "${LOCATION}" ]]; then
+ if [[ -n "${LOCATION}" && -d "${LOCATION}" ]]; then
echo " ${LOCATION}" >> "${OVERLAY_CONFIG_DIR}/make.conf"
fi
fi
@@ -58,5 +33,7 @@ done
echo "\"" >> "${OVERLAY_CONFIG_DIR}/make.conf"
if [[ -z "$(grep "^[ \t]*source ${OVERLAY_CONFIG_DIR}/make.conf" /etc/make.conf)" ]] ; then
- wecho "\"source ${OVERLAY_CONFIG_DIR}/make.conf\" not found in /etc/make.conf"
+ ewarn "\"source ${OVERLAY_CONFIG_DIR}/make.conf\" not found in /etc/make.conf"
fi
+
+eend 0