Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: slyfox@g.o, Donnie Berkholz <dberkholz@g.o>
Subject: Re: [gentoo-dev] [PATCH 2/2] Allow user mangle distfiles' "${EGIT_DIR}" after actual git fetch.
Date: Tue, 27 Nov 2012 19:48:42
Message-Id: 20121127204923.6d8fe698@pomiocik.lan
In Reply to: [gentoo-dev] [PATCH 2/2] Allow user mangle distfiles' "${EGIT_DIR}" after actual git fetch. by Sergei Trofimovich
1 On Tue, 27 Nov 2012 22:22:20 +0300
2 Sergei Trofimovich <slyfox@g.o> wrote:
3
4 > EGIT_REPO_URI="https://github.com/ghc/ghc.git"
5 > requires user to run './sync-all fetch / ./sync-all pull'
6 > after actual 'git pull', which fetches 20 more repos for code changes.
7 > Upstream does not use submodules.
8 >
9 > The patch injects user's callback right before 'git-2_move_source'.
10 > Currently I abuse 'git-2_gc':
11 >
12 > Original ebuild: https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-lang/ghc/ghc-9999.ebuild#L180
13 >
14 > Signed-off-by: Sergei Trofimovich <slyfox@g.o>
15 > ---
16 > git-2.eclass | 24 ++++++++++++++++++++++++
17 > 1 file changed, 24 insertions(+)
18 >
19 > diff --git a/git-2.eclass b/git-2.eclass
20 > index 1a96978..1bacef5 100644
21 > --- a/git-2.eclass
22 > +++ b/git-2.eclass
23 > @@ -569,6 +569,29 @@ git-2_cleanup() {
24 > unset EGIT_LOCAL_NONBARE
25 > }
26 >
27 > +
28 > +# @FUNCTION: git-2_fetch_user
29 > +# @DESCRIPTION:
30 > +# User-overridable callback allow user to update
31 > +# sources in "${EGIT_DIR}" (current location).
32 > +# Does nothing by default
33 > +git-2_fetch_user() {
34 > + :
35 > +}
36 > +
37 > +# @FUNCTION: git-2_post_fetch
38 > +# @INTERNAL
39 > +# Internal function calling user's callback
40 > +# when "${EGIT_DIR}" needs more actions, than
41 > +# simple fetch.
42 > +git-2_post_fetch() {
43 > + debug-print-function ${FUNCNAME} "$@"
44 > +
45 > + pushd "${EGIT_DIR}" > /dev/null
46 > + git-2_fetch_user
47 > + popd > /dev/null
48 > +}
49 > +
50 > # @FUNCTION: git-2_src_unpack
51 > # @DESCRIPTION:
52 > # Default git src_unpack function.
53 > @@ -581,6 +604,7 @@ git-2_src_unpack() {
54 > git-2_fetch "$@"
55 > git-2_gc
56 > git-2_submodules
57 > + git-2_post_fetch
58 > git-2_move_source
59 > git-2_branch
60 > git-2_bootstrap
61
62 That's not something that can or should be supported. This will confuse
63 at least smart-live-rebuild.
64
65 --
66 Best regards,
67 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature