summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bashrc56
-rwxr-xr-xpostsync.d/eix-update (renamed from postsync.d/50-eix-update)25
-rwxr-xr-xpostsync.d/regen-overlays45
3 files changed, 45 insertions, 81 deletions
diff --git a/bashrc b/bashrc
index 4389b83..d523183 100644
--- a/bashrc
+++ b/bashrc
@@ -1,45 +1,6 @@
#!/bin/bash
-# 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 "$*"
-}
-
-# positiv echo
-pecho() {
- 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;32m * \e[0m';;
- x*)
- echo -n " * ";;
- esac
-
- echo "$*"
-}
-
-# info
-iecho() {
- echo ">>> $*"
-}
+. /etc/init.d/functions.sh
autopatch() {
local diff level p patches patched
@@ -50,7 +11,7 @@ autopatch() {
[[ $patches == "" ]] && return 0
if ! cd ${S}; then
- eecho "FAILED TO cd $S"
+ eerror "FAILED TO cd $S"
return 1
fi
@@ -69,24 +30,27 @@ autopatch() {
fi
fi
done
- [[ $patched != 1 ]] && eecho "FAILED auto patching $p"
+ [[ $patched != 1 ]] && eerror "FAILED auto patching $p"
else
- [[ ! -e $diff ]] && eecho "$diff does not exist, unable to auto patch"
+ [[ ! -e $diff ]] && eerror "$diff does not exist, unable to auto patch"
fi
done
cd $OLDPWD
}
-#wecho "at $EBUILD_PHASE"
+#ewarn "at $EBUILD_PHASE"
case $EBUILD_PHASE in
compile)
+ ebegin "Checking for auto patches in ${PATCH_OVERLAY}/${CATEGORY}/${PN} ..."
+
if [[ ! -d "$PATCH_OVERLAY" ]]; then
- eecho "PATCH_OVERLAY=$PATCH_OVERLAY is not a dir"
+ eend 1
+ eerror "PATCH_OVERLAY=$PATCH_OVERLAY is not a dir"
else
- iecho "Checking for auto patches in ${PATCH_OVERLAY}/${CATEGORY}/${PN} ..."
PATH=$PATH:/usr/sbin:/usr/bin:/bin:/sbin
autopatch
+ eend 0
fi
;;
esac
diff --git a/postsync.d/50-eix-update b/postsync.d/eix-update
index e9eb5ac..00c6bd9 100755
--- a/postsync.d/50-eix-update
+++ b/postsync.d/eix-update
@@ -1,3 +1,7 @@
+#!/bin/bash
+
+. /etc/init.d/functions.sh
+
EIXCACHE=$(update-eix --print EIX_CACHEFILE)
OVERLAY_CONFIG_DIR="$(update-eix --print EIXCFGDIR)/overlays"
@@ -14,15 +18,34 @@ for overlay_config in $(ls ${OVERLAY_CONFIG_DIR}); do
unset CACHE_FORMAT
source ${OVERLAY_CONFIG_DIR}/${overlay_config}
- if [[ -n ${LOCATION} ]]; then
+ if [[ -n "${LOCATION}" ]]; then
+ if [[ ! -d "${LOCATION}" ]]; then
+ mkdir -p "${LOCATION}"
+ fi
+
OVERLAY_PARAM="${OVERLAY_PARAM} --add-overlay ${LOCATION}"
if [[ -n ${CACHE_FORMAT} ]]; then
OVERLAY_PARAM="${OVERLAY_PARAM} -m ${LOCATION} ${CACHE_FORMAT}"
fi
+
+ OVERLAY_NAME="$(echo ${overlay_config} | sed 's/\.[^\.]*$//')"
+ if [[ -n ${SYNC} ]]; then
+ echo
+ pushd ${LOCATION} > /dev/null 2>&1
+ ${SYNC} 2>&1 | sed -ue "s/^/${OVERLAY_NAME}> /g"
+
+ if [[ "0" -ne "${PIPESTATUS[0]}" ]]; then
+ ewarn "Sync of ${OVERLAY_NAME} failed"
+ fi
+
+ popd > /dev/null 2>&1
+ fi
fi
done
+echo
+
[ -x /usr/bin/update-eix ] && /usr/bin/update-eix ${OVERLAY_PARAM}
if [ -r "${EIXCACHE}" -a -r "${TMPFILE}" ]; then
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