[gentoo-dev] [PATCH 2/2] Allow user mangle distfiles' ${EGIT_DIR} after actual git fetch.

2012-11-27 Thread Sergei Trofimovich
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-.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




Re: [gentoo-dev] [PATCH 2/2] Allow user mangle distfiles' ${EGIT_DIR} after actual git fetch.

2012-11-27 Thread Michał Górny
On Tue, 27 Nov 2012 22:22:20 +0300
Sergei Trofimovich sly...@gentoo.org wrote:

 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-.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

That's not something that can or should be supported. This will confuse
at least smart-live-rebuild.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH 2/2] Allow user mangle distfiles' ${EGIT_DIR} after actual git fetch.

2012-11-27 Thread Tomáš Chvátal
This is bad idea. It breaks live rebuild and other stuff. You should just
clone each repo yourself, see how i did in libreoffice ebuild
Dne 27.11.2012 20:28 Sergei Trofimovich sly...@gentoo.org napsal(a):

 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-.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





Re: [gentoo-dev] [PATCH 2/2] Allow user mangle distfiles' ${EGIT_DIR} after actual git fetch.

2012-11-27 Thread Sergei Trofimovich
On Tue, 27 Nov 2012 21:46:06 +0100
Tomáš Chvátal tomas.chva...@gmail.com wrote:

 This is bad idea. It breaks live rebuild and other stuff. You should just
 clone each repo yourself, see how i did in libreoffice ebuild

How does it break live rebuild? I'm not sure I understand what exactly
you mean.

Does libreoffice export all the info for each submodule the way
smart-live-rebuild can pick it?

 Dne 27.11.2012 20:28 Sergei Trofimovich sly...@gentoo.org napsal(a):
 
  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-.ebuild#L180

-- 

  Sergei


signature.asc
Description: PGP signature