Gentoo Archives: gentoo-portage-dev

From: Ned Ludd <solar@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] default postsync
Date: Thu, 04 May 2006 21:00:51
Message-Id: 1146776374.17910.78.camel@onyx
In Reply to: Re: [gentoo-portage-dev] default postsync by Simon Stelling
1 On Thu, 2006-05-04 at 22:36 +0200, Simon Stelling wrote:
2 > Ned Ludd wrote:
3 > > #!/bin/sh
4 > > # Copyright 2006 Gentoo Foundation
5 > > # Distributed under the terms of the GNU General Public License v2
6 > > # $Header: $
7 > >
8 > > if [ -d /etc/portage/postsync.d/ ]; then
9 > > for f in /etc/portage/postsync.d/* ; do
10 > > if [ -x ${f} ] ; then
11 > > ${f}
12 > > fi
13 > > done
14 > > else
15 > > :
16 > > fi
17 > > ##############################
18 > >
19 > > How do you think we should handle it?
20 >
21 > I'd prefer this way:
22 >
23 > ----
24 > #!/bin/sh
25 > # Copyright 2006 Gentoo Foundation
26 > # Distributed under the terms of the GNU General Public License v2
27 > # $Header: $
28 >
29 > if [ -f /etc/portage/bashrc ]; then
30 > source /etc/portage/bashrc
31 > [ "$(type -t post_sync)" == "function" ] && post_sync
32 > fi
33 > ----
34 >
35 > i.e. use bashrc for this. We handle the existing hooks through bashrc,
36 > and postsync hooks aren't anything different, so they should be handled
37 > through the same logic. I think it's just more intuitive than a
38 > postsync.d/ subdirectory.
39
40 The post_sync action already exists in both 2.0 and 2.1
41 This mail is about extending it before it becomes wide spread to
42 include more than 1 action.
43
44 I'm thinking bashrc is not really the right place for this cuz there is
45 no $EBUILD_PHASE and everything todo with bashrc to date has always
46 been fed a PHASE where things like $PN / $PV / $D / $EBUILD etc are set.
47 post sync actions are completely separate from ebuilds on the
48 individual level.
49
50 Honestly I'm thinking more on the lines of this is best suited for
51 4-5 lines of python.
52
53 -peace.
54
55
56 > --
57 > Kind Regards,
58 >
59 > Simon Stelling
60 > Gentoo/AMD64 Developer
61 --
62 Ned Ludd <solar@g.o>
63 Gentoo Linux
64
65 --
66 gentoo-portage-dev@g.o mailing list