Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Alt (http://www.linux-archive.org/gentoo-alt/)
-   -   eprefixify_patch (http://www.linux-archive.org/gentoo-alt/652076-eprefixify_patch.html)

"Gregory M. Turner" 04-03-2012 08:37 AM

eprefixify_patch
 
Current prefix SOP is to epatch a bunch of files with @GENTOO_PORTAGE_EPREFIX@ and then eprefixify the affected files. Although this adds a bit of precision and flexibility, it leads to laundry lists in the ebuild, especially if/when we start getting more rigorous about prefixification. The attached eclass provides eprefixify_patch, which simply prefixifies the patch itself before applying.

It also includes some quick & dirty tools to prefixify /bin/{ba,}sh shebangs. I'm using both in my overlay. So far, so good. What I'm using it /for/ is a more interesting question that I'd like to bring up in a separate, presumably more controversial thread. Anyhow, for the moment I thought these might come in handy or at least precipitate an interesting flamewar :)

-gmt

"Gregory M. Turner" 04-03-2012 09:22 AM

eprefixify_patch
 
----- Original Message -----
> prefixifies the patch itself

Hm, since sending, I already noticed one semi-bug in this and one obvious misfeature.. so stay tuned for an improved revision. In the meanwhile I'd still appreciate your thoughts on the general idea.

-gmt

"Gregory M. Turner" 04-03-2012 10:49 AM

eprefixify_patch
 
Here's an updated version that fixes the issues I noticed.

-gmt

Fabian Groffen 04-03-2012 11:28 AM

eprefixify_patch
 
On 03-04-2012 08:37:57 -0000, Gregory M. Turner wrote:
> Current prefix SOP is to epatch a bunch of files with @GENTOO_PORTAGE_EPREFIX@ and then eprefixify the affected files. Although this adds a bit of precision and flexibility, it leads to laundry lists in the ebuild, especially if/when we start getting more rigorous about prefixification. The attached eclass provides eprefixify_patch, which simply prefixifies the patch itself before applying.

Feels dirty too ;)

> It also includes some quick & dirty tools to prefixify /bin/{ba,}sh shebangs. I'm using both in my overlay. So far, so good. What I'm using it /for/ is a more interesting question that I'd like to bring up in a separate, presumably more controversial thread. Anyhow, for the moment I thought these might come in handy or at least precipitate an interesting flamewar :)

I fail to see how this is necessary. Portage already fixes those/these
shebangs, doesn't it?


Fabian

--
Fabian Groffen
Gentoo on a different level

"Gregory M. Turner" 04-03-2012 03:57 PM

eprefixify_patch
 
----- Original Message -----
> On 03-04-2012 08:37:57 -0000, Gregory M. Turner wrote:
> > Current prefix SOP is to epatch a bunch of files with
> > @GENTOO_PORTAGE_EPREFIX@ and then eprefixify the affected files.
> > Although this adds a bit of precision and flexibility, it leads
> > to laundry lists in the ebuild, especially if/when we start
> > getting more rigorous about prefixification. The attached eclass
> > provides eprefixify_patch, which simply prefixifies the patch
> > itself before applying.
>
> Feels dirty too ;)

Admittedly, there is a certain inelegance there. But I can't imagine a real-world scenario which both: would correctly be solved by 'patch + eprefixify'; but would not correctly be solved by eprefixify_patch. It would have to be something like, "well, foo.patch puts '@GENTOO_PORTAGE_EPREFIX@' into 20 different places in '${S}', but only 18 of them are to be eprefixified; the other two are correct patches to the source", which hardly seems like a use-case worth preserving.

The idea is to promote clarity and correctness by:

o Eliminating redundant information (files in patch vs. files eprefixified
in ebuild)

o Eliminating potential for error (did we remember to eprefixify all the files
that we patched? did we leave behind formerly-eprefixified files in the
ebuild?)

o Minimizing prefix-specific changes to ebuilds be getting rid of laundry-lists

o Encouraging a clear distinction between two types of patches: normal patches,
which typically are reverse-able and have legitimate source files as both
their input and output, and "eprefixification" patches, which leave the
source in an intermediate state, and become pseudo-irreversible once that
intermediate state is resolved back to a source-file (plus, this
approach makes them reversible again).

> > It also includes some quick & dirty tools to prefixify /bin/{ba,}sh
> > shebangs. I'm using both in my overlay. So far, so good. What
> > I'm using it /for/ is a more interesting question that I'd like to
> > bring up in a separate, presumably more controversial thread.
> > Anyhow, for the moment I thought these might come in handy or at
> > least precipitate an interesting flamewar :)
>
> I fail to see how this is necessary. Portage already fixes
> those/these shebangs, doesn't it?

Not on my system (which isn't saying much :) )... Where is that supposed to be happening? I have a vague memory of prefix-portage doing this at one time, but the code is not jumping out at me.

-gmt


All times are GMT. The time now is 12:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.