Re: [gentoo-portage-dev] please explain use of hooks

2008-03-02 Thread Jonas Bernoulli
On Sat, Mar 1, 2008 at 7:38 PM, Zac Medico [EMAIL PROTECTED] wrote:

  When portage is installed with USE=doc enabled, you'll find that
  there is a small Ebuild Phase Hooks section in the first chapter
  of the html documentation.

thx. I never bothered looking there as I have always assumed that
would just install the handbook.

I have seen rather complex uses of hooks, that's why I thought it
would be harder to get started.


On Sun, Mar 2, 2008 at 2:27 AM, Alec Warner [EMAIL PROTECTED] wrote:

  Do not attribute to malice what can easily be attributed to laziness ;)

yes sorry about that. Though I was not really all that lazy just made
a really bad assumption.

And if not the handbook this should really go into the portage manpage.

bashrc

If  needed, this  file can  be  used to  set up  a
special  environment for  ebuilds,  different from
the standard root  environment.  The syntax is the
same as for any other bash script.
+ One thing you can do here is define phase hooks.
+ A phase hook function name begins with a pre_ or post_ prefix to
indicate that it will be called before or after one of the ebuild
phases. The prefix is followed by the name of the ebuild function that
the hook will be associated with. + For example, a hook named
pre_src_compile will be called before src_compile, and a hook named
post_src_compile will be called after src_compile.

postsync.d should also be documented there.

All in all now that I have looked at the documentation installed with
portage I think it is obsolete. Not in the sense that it is outdated
but everything in it is documented elsewhere already or should be
moved there.

II. Package Formats -  2. Ebuild - Ebuild Phases is already in the
developer handbook and

III. Quality Assurance - 3. QA Notices should be moved to the
developer handbook


If some developers an the list agree with me and welcome me to do so
then I could file a bug(s) for those changes.

--Jonas
-- 
gentoo-portage-dev@lists.gentoo.org mailing list



Re: [gentoo-portage-dev] please explain use of hooks

2008-03-02 Thread Marius Mauch
On Sun, 2 Mar 2008 11:18:39 +0100
Jonas Bernoulli [EMAIL PROTECTED] wrote:

 And if not the handbook this should really go into the portage
 manpage.
 
 bashrc
 
 If  needed, this  file can  be  used to  set up  a
 special  environment for  ebuilds,  different from
 the standard root  environment.  The syntax is the
 same as for any other bash script.
 + One thing you can do here is define phase hooks.
 + A phase hook function name begins with a pre_ or post_ prefix to
 indicate that it will be called before or after one of the ebuild
 phases. The prefix is followed by the name of the ebuild function that
 the hook will be associated with. + For example, a hook named
 pre_src_compile will be called before src_compile, and a hook named
 post_src_compile will be called after src_compile.

Care to write a patch? (nobody likes to edit manpages)

 postsync.d should also be documented there.

No, as it isn't used by portage itself.

 All in all now that I have looked at the documentation installed with
 portage I think it is obsolete. Not in the sense that it is outdated
 but everything in it is documented elsewhere already or should be
 moved there.

Well, it's horribly incomplete and a work in progress. Eventually it
will replace the manpages (in the sense that manpages will be generated
from the same source). And authorative documentation (which isn't
exactly the same as a specification) should be kept with the
implementation, and that's not the case with the dev handbook/manual.

 If some developers an the list agree with me and welcome me to do so
 then I could file a bug(s) for those changes.

No.

Marius

-- 
Public Key at http://www.genone.de/info/gpg-key.pub

In the beginning, there was nothing. And God said, 'Let there be
Light.' And there was still nothing, but you could see a bit better.


signature.asc
Description: PGP signature


[gentoo-portage-dev] please explain use of hooks

2008-03-01 Thread Jonas Bernoulli
Hello

I was aware that the alternative package managers provide hooks for
some time now, but only found out recently that portage also has this
feature. Unfortunately I was not able to find any documentation about
it. I found some information related to hooks in portage on this list
and elsewhere but all of those sources assumed that the reader already
knows the basics.

So what I am looking for is a tutorial along the lines howto write
you first portage hook function. Of course a more in-depth
description would also be welcome. If something like this already
exists I apologize for not searching enough, and kindly ask you to
point you to the location.

The earlies post about hooks on this list seam to be from 2005, so I
was a bit surprised I could not find any documentation about them. In
my opinion this should be documented in the handbook. I can only
assume that either no one found the time to write it or that hooks are
intentionally not documented to prevent users from messing things up
and then filling untraceable bug reports. So if later were the case I
would still be very thankful if you could answer me in private, even
though I think this should be documented in public.

--Jonas
-- 
gentoo-portage-dev@lists.gentoo.org mailing list



Re: [gentoo-portage-dev] please explain use of hooks

2008-03-01 Thread Zac Medico
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonas Bernoulli wrote:
 So what I am looking for is a tutorial along the lines howto write
 you first portage hook function. Of course a more in-depth
 description would also be welcome. If something like this already
 exists I apologize for not searching enough, and kindly ask you to
 point you to the location.

When portage is installed with USE=doc enabled, you'll find that
there is a small Ebuild Phase Hooks section in the first chapter
of the html documentation. Writing a phase hook is very much like
writing a normal ebuild phase function. You just need to add a pre_
or post_ prefix to then name.

Zac
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFHyaK0/ejvha5XGaMRAjykAKCqcknbMtkLcqWSqB2t9wPN3PES7gCfQbPa
6MXfRyMUVQJBdREffaCwEBs=
=6ymu
-END PGP SIGNATURE-
-- 
gentoo-portage-dev@lists.gentoo.org mailing list