From a9e55c386610c90d01cd387bb246db196ec517f4 Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 17 Jan 2012 00:01:06 +0100 Subject: [PATCH] Add some modules for ezsync --- config/modules/openrc-branding.conf | 1 + modules/gentoo-compat.ezmod | 13 +++++++++++++ modules/mini-manifest.ezmod | 13 +++++++++++++ modules/openrc-branding.ezmod | 14 ++++++++++++++ modules/sample.ezmod | 26 -------------------------- modules/thin-manifest.ezmod | 15 +++++++++++++++ 6 files changed, 56 insertions(+), 26 deletions(-) create mode 100644 config/modules/openrc-branding.conf create mode 100644 modules/gentoo-compat.ezmod create mode 100644 modules/mini-manifest.ezmod create mode 100644 modules/openrc-branding.ezmod delete mode 100644 modules/sample.ezmod create mode 100644 modules/thin-manifest.ezmod diff --git a/config/modules/openrc-branding.conf b/config/modules/openrc-branding.conf new file mode 100644 index 0000000..63c24b6 --- /dev/null +++ b/config/modules/openrc-branding.conf @@ -0,0 +1 @@ +CUSTOM_OPENRC_BRAND="reGen2" diff --git a/modules/gentoo-compat.ezmod b/modules/gentoo-compat.ezmod new file mode 100644 index 0000000..64403f6 --- /dev/null +++ b/modules/gentoo-compat.ezmod @@ -0,0 +1,13 @@ +# Copyright 2010-2012, Asio Software Technologies +# Distributed under the terms of the GNU General Public License v3 +EZMOD_DESCRIPTION="Enables various compatibility options in Portage tree" +EZMOD_COMPATIBILITY="ezsync" +EZMOD_AUTHOR="Rafal Kupiec" +EZMOD_VERSION="1.0" + +ezsync_precommit() { + printInfo "Enabling compatibility options..." + 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/mini-manifest.ezmod b/modules/mini-manifest.ezmod new file mode 100644 index 0000000..3ef48e7 --- /dev/null +++ b/modules/mini-manifest.ezmod @@ -0,0 +1,13 @@ +# Copyright 2010-2012, Asio Software Technologies +# Distributed under the terms of the GNU General Public License v3 +EZMOD_DESCRIPTION="Minifies Portage tree with so-called mini-manifests" +EZMOD_COMPATIBILITY="ezsync" +EZMOD_AUTHOR="Rafal Kupiec" +EZMOD_VERSION="1.0" + +ezsync_precommit() { + printInfo "Preparing mini-manifests..." + find ${PORTAGESDIR}/${PORTAGE_BUILD[0]} -type f -iname changelog -exec rm -f {} \; + find ${PORTAGESDIR}/${PORTAGE_BUILD[0]} -type f -iname manifest -exec sed -n -i -e "/DIST/p" {} \; + return 0 +} diff --git a/modules/openrc-branding.ezmod b/modules/openrc-branding.ezmod new file mode 100644 index 0000000..9cb6d7c --- /dev/null +++ b/modules/openrc-branding.ezmod @@ -0,0 +1,14 @@ +# Copyright 2010-2012, Asio Software Technologies +# Distributed under the terms of the GNU General Public License v3 +EZMOD_DESCRIPTION="Allows to re-brand the OpenRC package" +EZMOD_COMPATIBILITY="ezsync" +EZMOD_AUTHOR="Rafal Kupiec" +EZMOD_VERSION="1.0" + +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_OPENRC_BRAND} \${brand}\"/g" ${EBUILD} || return 1 + done + return 0 +} diff --git a/modules/sample.ezmod b/modules/sample.ezmod deleted file mode 100644 index 7e363f4..0000000 --- a/modules/sample.ezmod +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2010-2012, Asio Software Technologies -# Distributed under the terms of the GNU General Public License v3 -EZMOD_DESCRIPTION="Sample module for learning and testing purposes" -EZMOD_COMPATIBILITY="ezbuild ezsync" -EZMOD_AUTHOR="Rafal Kupiec" -EZMOD_VERSION="0.3" - -ezsync_presync() { - printWarn "Sample module loaded" - return 0 -} - -ezsync_postsync() { - printWarn "Sample module loaded" - return 0 -} - -ezsync_precommit() { - printWarn "Sample module loaded" - return 0 -} - -ezsync_postcommit() { - printWarn "Sample module loaded" - return 0 -} diff --git a/modules/thin-manifest.ezmod b/modules/thin-manifest.ezmod new file mode 100644 index 0000000..df959b6 --- /dev/null +++ b/modules/thin-manifest.ezmod @@ -0,0 +1,15 @@ +# Copyright 2010-2012, Asio Software Technologies +# Distributed under the terms of the GNU General Public License v3 +EZMOD_DESCRIPTION="Minifies Portage tree with so-called thin-manifests" +EZMOD_COMPATIBILITY="ezsync" +EZMOD_AUTHOR="Rafal Kupiec" +EZMOD_VERSION="1.0" + +ezsync_precommit() { + printInfo "Preparing thin-manifests..." + find ${PORTAGESDIR}/${PORTAGE_BUILD[0]} -type f -iname changelog -exec rm -f {} \; + find ${PORTAGESDIR}/${PORTAGE_BUILD[0]} -type f -iname manifest -exec sed -n -i -e "/DIST/p" {} \; + echo "thin-manifests = true" >> ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/metadata/layout.conf + echo "sign-manifests = false" >> ${PORTAGESDIR}/${PORTAGE_BUILD[0]}/metadata/layout.conf + return 0 +}