EGIT_REPO_URI="https://github.com/ghc/ghc.git";
    requires user to run './sync-all fetch / ./sync-all pull'
    after actual 'git pull', which fetches 20 more repos for code changes.
    Upstream does not use submodules.

The patch injects user's callback right before 'git-2_move_source'.
Currently I abuse 'git-2_gc':

Original ebuild: 
https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-lang/ghc/ghc-9999.ebuild#L180

Signed-off-by: Sergei Trofimovich <sly...@gentoo.org>
---
 git-2.eclass | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/git-2.eclass b/git-2.eclass
index 1a96978..1bacef5 100644
--- a/git-2.eclass
+++ b/git-2.eclass
@@ -569,6 +569,29 @@ git-2_cleanup() {
        unset EGIT_LOCAL_NONBARE
 }
 
+
+# @FUNCTION: git-2_fetch_user
+# @DESCRIPTION:
+# User-overridable callback allow user to update
+# sources in "${EGIT_DIR}" (current location).
+# Does nothing by default
+git-2_fetch_user() {
+       :
+}
+
+# @FUNCTION: git-2_post_fetch
+# @INTERNAL
+# Internal function calling user's callback
+# when "${EGIT_DIR}" needs more actions, than
+# simple fetch.
+git-2_post_fetch() {
+       debug-print-function ${FUNCNAME} "$@"
+
+       pushd "${EGIT_DIR}" > /dev/null
+       git-2_fetch_user
+       popd > /dev/null
+}
+
 # @FUNCTION: git-2_src_unpack
 # @DESCRIPTION:
 # Default git src_unpack function.
@@ -581,6 +604,7 @@ git-2_src_unpack() {
        git-2_fetch "$@"
        git-2_gc
        git-2_submodules
+       git-2_post_fetch
        git-2_move_source
        git-2_branch
        git-2_bootstrap
-- 
1.8.0


Reply via email to