From 4ac606d81cabc453048a467a48ac1e47d4ea465e Mon Sep 17 00:00:00 2001 From: BlackNoxis Date: Fri, 3 Apr 2015 17:58:19 +0300 Subject: [eclass/sab-patches.eclass] upgrade the eclass --- eclass/sab-patches.eclass | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'eclass') diff --git a/eclass/sab-patches.eclass b/eclass/sab-patches.eclass index 8511256e..40e89911 100644 --- a/eclass/sab-patches.eclass +++ b/eclass/sab-patches.eclass @@ -9,10 +9,13 @@ # SÅ‚awomir Nizio # @BLURB: eclass that makes it easier to apply patches from multiple packages # @DESCRIPTION: -# Adds a patch or patches to SRC_URI and makes it easy to apply them, +# Makes it easy to apply patches stored in a remote location # with the intention to make the task easier for Sabayon split ebuilds. # (Plain patches kept in a VCS are very nice, but in the case of split # ebuilds, duplicating the patches is not effective.) +# Patches are not added to SRC_URI by default, because it makes ebuilds +# use "SRC_URI+=..." which makes them more diverged from the original +# one than necessary. # The eclass does not define any phase function. # @ECLASS-VARIABLE: SAB_PATCHES_SRC @@ -31,10 +34,16 @@ if [[ ${#SAB_PATCHES_SRC[@]} -eq 0 ]]; then die "SAB_PATCHES_SRC is not set" fi -for _sab_patch in "${SAB_PATCHES_SRC[@]}"; do - SRC_URI=${_sab_patch} -done -unset _sab_patch +# @FUNCTION: sab-patches_update_SRC_URI +# @DESCRIPTION: +# Appends patches entries to SRC_URI. If it is not done, an error will +# occur later on. +sab-patches_update_SRC_URI() { + local p + for p in "${SAB_PATCHES_SRC[@]}"; do + SRC_URI+=${SRC_URI:+ }${p} + done +} # @FUNCTION: sab-patches_apply_all # @DESCRIPTION: @@ -75,6 +84,21 @@ sab-patches_apply() { done } +# @FUNCTION: sab-patches_unpack +# @DESCRIPTION: +# Unpack every file provided in SAB_PATCHES_SRC. +sab-patches_unpack() { + local p + pushd "${WORKDIR}" > /dev/null || die + + for p in "${SAB_PATCHES_SRC[@]}"; do + local name=${p##*/} + unpack "${name}" + done + + popd > /dev/null || die +} + # @FUNCTION: _sab-patches_apply_nonskipped # @INTERNAL # @DESCRIPTION: -- cgit v1.2.3