diff --git a/config/modules/baselayout-branding.conf b/config/modules/baselayout-branding.conf index c702352..e23bfca 100644 --- a/config/modules/baselayout-branding.conf +++ b/config/modules/baselayout-branding.conf @@ -1,4 +1,4 @@ # This directive defines the new branding for BaseLayout package that will be set by the # baselayout-branding module. Usually this should be a string representing distribution # name. -CUSTOM_BRANDING="MyOwn Base System" +CUSTOMBRANDING="MyOwn Base System" diff --git a/config/modules/custom-patches.conf b/config/modules/custom-patches.conf index cb670de..8afa6d9 100644 --- a/config/modules/custom-patches.conf +++ b/config/modules/custom-patches.conf @@ -1,3 +1,3 @@ # Specifies a list of patches that will be applied on generated Portage tree by the # custom-patches module. Absolute paths to files are necessary! -CUSTOM_PATCHES="" +CUSTOMPATCHES="" diff --git a/config/modules/local-mirror.conf b/config/modules/local-mirror.conf index ec96edc..ff10763 100644 --- a/config/modules/local-mirror.conf +++ b/config/modules/local-mirror.conf @@ -1,7 +1,7 @@ # This specifies the local repository with the base path. This is the directory, where # Portage mirror will be saved. Don't forget to uncomment this option! -#LOCALMIRROR_PATH="/path/to/portage-mirror.git" +#LOCALMIRRORPATH="/path/to/portage-mirror" # Directive sets a username, that will be used to pull changes from remote repository. # This is useful when the local daemon is running with different permissions. -LOCALMIRROR_USER="root" +LOCALMIRRORUSER="root" diff --git a/config/modules/openrc-branding.conf b/config/modules/openrc-branding.conf index 9261762..c442ce6 100644 --- a/config/modules/openrc-branding.conf +++ b/config/modules/openrc-branding.conf @@ -1,3 +1,3 @@ # This directive defines the new branding for OpenRC package that will be set by # openrc-branding module. Usually this should be a distribution name. -CUSTOM_BRANDING="MyOwn" +CUSTOMBRANDING="MyOwn" diff --git a/config/modules/update-notification.conf b/config/modules/update-notification.conf index 67dc405..0b9d8de 100644 --- a/config/modules/update-notification.conf +++ b/config/modules/update-notification.conf @@ -1,9 +1,9 @@ # This array specifies a list of packages that will be checked for updates. If any from # listed below is older than the one found in mainline Portage tree, the notification # will be sent. -MUSTCHECK=( "my-cat/package1" "my-cat2/package2" ) +CHECKPACKAGES=( "my-cat/package1" "my-cat2/package2" ) # Specifies an e-mail address, where all notifications about packages that needs update # will be send to. If this variable is empty, none notification will be sent at all, even # if the modules is enabled. -UPDATE_NOTIFY="" +UPDATENOTIFY="" diff --git a/modules/baselayout-branding.ezmod b/modules/baselayout-branding.ezmod index 4948999..e733205 100644 --- a/modules/baselayout-branding.ezmod +++ b/modules/baselayout-branding.ezmod @@ -3,13 +3,13 @@ EZMOD_DESCRIPTION="Allows to re-brand the sys-apps/baselayout package" EZMOD_COMPATIBILITY="ezsync" EZMOD_AUTHOR="Rafal Kupiec" -EZMOD_VERSION="1.0" +EZMOD_VERSION="1.1" ezsync_precommit() { printInfo "Enabling custom BaseLayout branding..." - find ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/sys-apps/baselayout -type f -name \*.ebuild | while read EBUILD; do - sed -i "s/echo \"Gentoo Base System release/echo \"${CUSTOM_BRANDING}/g" ${EBUILD} || return 1 + while read EBUILD; do + sed -i "s/echo \"Gentoo Base System release/echo \"${CUSTOMBRANDING}/g" ${EBUILD} || return 1 run "ebuild ${EBUILD} manifest" || return 1 - done + done < <(find ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/sys-apps/baselayout -type f -name \*.ebuild) return 0 } diff --git a/modules/custom-patches.ezmod b/modules/custom-patches.ezmod index 42dff76..fd82e8f 100644 --- a/modules/custom-patches.ezmod +++ b/modules/custom-patches.ezmod @@ -3,21 +3,18 @@ EZMOD_DESCRIPTION="Applies custom patches onto generated Portage tree" EZMOD_COMPATIBILITY="ezsync" EZMOD_AUTHOR="Rafal Kupiec" -EZMOD_VERSION="1.0" +EZMOD_VERSION="1.2" ezsync_precommit() { local PATCH PREFIX - if [ "${CUSTOM_PATCHES}" != "" ]; then + if [ "${CUSTOMPATCHES}" != "" ]; then printInfo "Applying custom patches..." - for PATCH in ${CUSTOM_PATCHES}; do - for PREFIX in {0..4}; do - if run "patch -d \"${PORTAGESDIR}/${PORTAGE_BUILD[0]}\" --dry-run -p ${PREFIX} -i \"${PATCH}\" -s"; then - run "patch -d \"${PORTAGESDIR}/${PORTAGE_BUILD[0]}\" -p ${PREFIX} -i \"${PATCH}\"" || return 1 - elif [ ${PREFIX} -ge 4 ]; then - printError "Patch ${PATCH} does not fit!" - return 1 - fi - done + for PATCH in ${CUSTOMPATCHES}; do + applyPatch "${PORTAGESDIR}/${PORTAGE_BUILD[0]}" "${PATH}" + if [ ${?} -ne 0 ]; then + printError "Patch ${PATCH} does not fit!" + return 1 + fi done fi return 0 diff --git a/modules/gentoo-compat.ezmod b/modules/gentoo-compat.ezmod index 7864fe2..ae24f0e 100644 --- a/modules/gentoo-compat.ezmod +++ b/modules/gentoo-compat.ezmod @@ -7,7 +7,7 @@ EZMOD_VERSION="1.1" ezsync_precommit() { printInfo "Enabling compatibility options..." - run "rm -rf ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/metadata/cache" || return 1 + rm -rf ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/metadata/cache echo "cache-formats = md5-dict pms" >> ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/metadata/layout.conf echo "profile-formats = portage-1" >> ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/metadata/layout.conf return 0 diff --git a/modules/local-mirror.ezmod b/modules/local-mirror.ezmod index e56ed4a..4de5cb9 100644 --- a/modules/local-mirror.ezmod +++ b/modules/local-mirror.ezmod @@ -6,18 +6,18 @@ EZMOD_AUTHOR="Rafal Kupiec" EZMOD_VERSION="1.0" ezsync_postcommit() { - if [ "${LOCALMIRROR_PATH}" != "" ]; then + if [ "${LOCALMIRRORPATH}" != "" ]; then printInfo "Synchronizing local Portage mirror..." if [ "$(toUpper ${PORTAGE_BUILD[1]})" != "GIT" ]; then printWarn "Local mirror actually supports only GIT!" return 0 fi - if [ -d ${LOCALMIRROR_PATH} ]; then - cd ${LOCALMIRROR_PATH} - run "su ${LOCALMIRROR_USER} -s \"/bin/sh\" -c \"git fetch --all\"" || return 1 + if [ -d ${LOCALMIRRORPATH} ]; then + cd ${LOCALMIRRORPATH} + run "su ${LOCALMIRRORUSER} -s \"/bin/sh\" -c \"git fetch --all\"" || return 1 else - makeDirectory ${LOCALMIRROR_PATH} - run "su ${LOCALMIRROR_USER} -s \"/bin/sh\" -c \"git clone --mirror --bare ${PORTAGE_BUILD[2]} ${LOCALMIRROR_PATH}\"" || return 1 + makeDirectory ${LOCALMIRRORPATH} + run "su ${LOCALMIRRORUSER} -s \"/bin/sh\" -c \"git clone --mirror --bare ${PORTAGE_BUILD[2]} ${LOCALMIRRORPATH}\"" || return 1 fi fi return 0 diff --git a/modules/openrc-branding.ezmod b/modules/openrc-branding.ezmod index 7b21264..97c4368 100644 --- a/modules/openrc-branding.ezmod +++ b/modules/openrc-branding.ezmod @@ -3,13 +3,13 @@ EZMOD_DESCRIPTION="Allows to re-brand the sys-apps/openrc package" EZMOD_COMPATIBILITY="ezsync" EZMOD_AUTHOR="Rafal Kupiec" -EZMOD_VERSION="1.0" +EZMOD_VERSION="1.1" ezsync_precommit() { printInfo "Enabling custom OpenRC branding..." - find ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/sys-apps/openrc -type f -name \*.ebuild | while read EBUILD; do - sed -i "s/BRANDING=\"Gentoo \${brand}\"/BRANDING=\"${CUSTOM_BRANDING} \${brand}\"/g" ${EBUILD} || return 1 + while read EBUILD; do + sed -i "s/BRANDING=\"Gentoo \${brand}\"/BRANDING=\"${CUSTOMBRANDING} \${brand}\"/g" ${EBUILD} || return 1 run "ebuild ${EBUILD} manifest" || return 1 - done + done < <(find ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/sys-apps/openrc -type f -name \*.ebuild) return 0 } diff --git a/modules/update-notification.ezmod b/modules/update-notification.ezmod index c91ede6..fc8a567 100644 --- a/modules/update-notification.ezmod +++ b/modules/update-notification.ezmod @@ -8,8 +8,8 @@ EZMOD_VERSION="1.0" ezsync_postcommit() { local BUILDVER MAINLINEVER NEEDSUPDATE NEWER PACKAGE local SENDMESG=0 - if [ "${UPDATE_NOTIFY}" != "" ]; then - for PACKAGE in ${MUSTCHECK[*]}; do + if [ "${UPDATENOTIFY}" != "" ]; then + for PACKAGE in ${CHECKPACKAGES[*]}; do makeCleanDirectory ${TRASHDIR}/ebuilds makeDirectory ${TRASHDIR}/ebuilds/build makeDirectory ${TRASHDIR}/ebuilds/mainline @@ -28,7 +28,7 @@ ezsync_postcommit() { done rm -rf ${TRASHDIR}/ebuilds if isEnabled ${SENDMSG}; then - echo "The following packages needs your attention, because they probably has been updated in mainline Portage tree: ${NEEDSUPDATE}" | mailx -s "Packages need an update!" ${UPDATE_NOTIFY} + echo "The following packages needs your attention, because they probably has been updated in mainline Portage tree: ${NEEDSUPDATE}" | mailx -s "Packages need an update!" ${UPDATENOTIFY} fi fi return 0