-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

The current state of ebuild.sh is that it's been abused to perform 
miscellaneous shell tasks that are triggered before or after various ebuild 
phases.  In order to rectify the situation, I propose that we factor out any 
logic and shell code that is not directly needed for the execution of 
legitimate ebuild phases that are documented in the ebuild.5 man page.  
Anything that we factor out can be triggered from the doebuild function of the 
portage module instead.

In order to facilitate the migration of miscellaneous shell tasks out of 
ebuild.sh, I've created a shell script called misc-functions.sh which can be 
used instead of ebuild.sh for shell tasks that use the ebuild.sh environment.  
This script actually sources ebuild.sh in order to inherit the ebuild.sh 
environment, without polluting ebuild.sh itself.

I've written a patch [1] that migrates several shell tasks out of the ebuild.sh 
dyn_preinst() function and into misc-functions.sh.  Those functions are then 
triggered inside of the doebuild function of the portage module.  The 
install_mask function came from solar's patch for bug 81025 [2].

When migrating code out of ebuild.sh, it's important that the environment 
variables and functions that are expected by ebuilds remain intact.  However, a 
large amount of code an logic  that currently resides in ebuild.sh can safely 
be migrated to misc-functions.sh (or elsewhere) and triggered from the doebuild 
function of the portage module instead.

My hope is that, eventually, all of the shell code and logic that is not needed 
for the execution of legitimate ebuild phases (documented in ebuild.5) will be 
migrated out of ebuild.sh.  This will make ebuild.sh easier to maintain by 
reducing bloat and will lead to better organization of code and logic that is 
triggered from doebuild.

If you would like to try the patch, I've provided a current svn snapshot and an 
ebuild [3] that automatically applies the patch.  Your feedback would be 
appreciated.

Zac

[1] 
http://dev.gentoo.org/~zmedico/portage/branches/2.1/patches/doebuild_refactoring.patch
[2] http://bugs.gentoo.org/show_bug.cgi?id=81025
[3] 
http://dev.gentoo.org/~zmedico/overlay/sys-apps/portage/portage-2.1_pre20060306.ebuild

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFEDMcs/ejvha5XGaMRArsvAKC+JnDrjsEb6mjleLfBZ1qjZfOmVwCfQumH
FTOUOdIHOmDnueniXhITtXs=
=dT1k
-----END PGP SIGNATURE-----
-- 
gentoo-portage-dev@gentoo.org mailing list

Reply via email to