public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Just when is portage/bashrc sourced?
@ 2017-11-24  1:12 Ian Zimmerman
  2017-11-24  1:21 ` Michael Orlitzky
  2017-11-24  8:32 ` Neil Bothwick
  0 siblings, 2 replies; 13+ messages in thread
From: Ian Zimmerman @ 2017-11-24  1:12 UTC (permalink / raw
  To: gentoo-user

Package P bypasses applying user patches (by not calling
default_src_prepare).  I have patches I need to apply to P, and in this
case I really don't want to fork the ebuild.  So, I'm hell bent on
doing it the hacky way with /etc/portage/bashrc (which, IIRC, I have
been told on this list not to do, but now I don't have much choice).

To make it work I need to know how the bashrc file is spliced into the
ebuild.  For a given ebuild phase PH, does the bashrc code come before
the rest of PH, after PH, or does it replace PH?  wiki and even the dev
guide are silent about this.

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet, fetch the TXT record for the domain.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Just when is portage/bashrc sourced?
  2017-11-24  1:12 [gentoo-user] Just when is portage/bashrc sourced? Ian Zimmerman
@ 2017-11-24  1:21 ` Michael Orlitzky
  2017-11-24  8:32 ` Neil Bothwick
  1 sibling, 0 replies; 13+ messages in thread
From: Michael Orlitzky @ 2017-11-24  1:21 UTC (permalink / raw
  To: gentoo-user

On 11/23/2017 08:12 PM, Ian Zimmerman wrote:
> Package P bypasses applying user patches (by not calling
> default_src_prepare).  I have patches I need to apply to P, and in this
> case I really don't want to fork the ebuild.  So, I'm hell bent on
> doing it the hacky way with /etc/portage/bashrc (which, IIRC, I have
> been told on this list not to do, but now I don't have much choice).
> 
> To make it work I need to know how the bashrc file is spliced into the
> ebuild.

The usual example overrides "pre_src_prepare", which naturally is
executed before "src_prepare",

https://wiki.gentoo.org/wiki//etc/portage/patches#Enabling_.2Fetc.2Fportage.2Fpatches_for_all_ebuilds

With an extra line or two you can modify that code to check ${PN} to
avoid affecting other packages.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Just when is portage/bashrc sourced?
  2017-11-24  1:12 [gentoo-user] Just when is portage/bashrc sourced? Ian Zimmerman
  2017-11-24  1:21 ` Michael Orlitzky
@ 2017-11-24  8:32 ` Neil Bothwick
  2017-11-24 17:07   ` [gentoo-user] " Ian Zimmerman
  1 sibling, 1 reply; 13+ messages in thread
From: Neil Bothwick @ 2017-11-24  8:32 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

On Thu, 23 Nov 2017 17:12:37 -0800, Ian Zimmerman wrote:

> Package P bypasses applying user patches (by not calling
> default_src_prepare).  I have patches I need to apply to P, and in this
> case I really don't want to fork the ebuild.  So, I'm hell bent on
> doing it the hacky way with /etc/portage/bashrc (which, IIRC, I have
> been told on this list not to do, but now I don't have much choice).

You do have a choice, use /etc/portage/env. here's one I have to patch a
specific version of a package

% cat env/app-cdr/cdrdao-1.2.3
post_src_unpack() {
        cd "${S}"
        epatch_user
}

You could also use post_src_prepare to apply the patch after any the
ebuild effects.


-- 
Neil Bothwick

Found my .sig, it was in behind the cushion on the settee.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-24  8:32 ` Neil Bothwick
@ 2017-11-24 17:07   ` Ian Zimmerman
  2017-11-24 17:12     ` Michael Orlitzky
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ian Zimmerman @ 2017-11-24 17:07 UTC (permalink / raw
  To: gentoo-user

On 2017-11-24 08:32, Neil Bothwick wrote:

> > Package P bypasses applying user patches (by not calling
> > default_src_prepare).  I have patches I need to apply to P, and in
> > this case I really don't want to fork the ebuild.  So, I'm hell bent
> > on doing it the hacky way with /etc/portage/bashrc (which, IIRC, I
> > have been told on this list not to do, but now I don't have much
> > choice).
> 
> You do have a choice, use /etc/portage/env. here's one I have to patch
> a specific version of a package
> 
> % cat env/app-cdr/cdrdao-1.2.3
> post_src_unpack() {
>         cd "${S}"
>         epatch_user
> }

Again IIRC, when I tried using env for a similar purpose, it didn't work
at all, it seemed the only things valid in those files were variable
assignments.  If possible, I would of course much prefer this way, as is
avoids an ugly switch on the package name.

Do you know what I could've been doing wrong?  I think I brought it up
on the list, I'll try to dig up the thread.

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet, fetch the TXT record for the domain.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-24 17:07   ` [gentoo-user] " Ian Zimmerman
@ 2017-11-24 17:12     ` Michael Orlitzky
  2017-11-24 22:21     ` Neil Bothwick
  2017-11-26 20:24     ` Neil Bothwick
  2 siblings, 0 replies; 13+ messages in thread
From: Michael Orlitzky @ 2017-11-24 17:12 UTC (permalink / raw
  To: gentoo-user

On 11/24/2017 12:07 PM, Ian Zimmerman wrote:
> 
> Again IIRC, when I tried using env for a similar purpose, it didn't work
> at all, it seemed the only things valid in those files were variable
> assignments.


Sounds about right... from `man portage`...

  package.env
      Per-package environment variable settings.


(moreover, we're using a custom parser IIRC and not all bash syntax will
work)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-24 17:07   ` [gentoo-user] " Ian Zimmerman
  2017-11-24 17:12     ` Michael Orlitzky
@ 2017-11-24 22:21     ` Neil Bothwick
  2017-11-25  1:56       ` Ian Zimmerman
  2017-11-26 20:24     ` Neil Bothwick
  2 siblings, 1 reply; 13+ messages in thread
From: Neil Bothwick @ 2017-11-24 22:21 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

On Fri, 24 Nov 2017 09:07:24 -0800, Ian Zimmerman wrote:

> > You do have a choice, use /etc/portage/env. here's one I have to patch
> > a specific version of a package
> > 
> > % cat env/app-cdr/cdrdao-1.2.3
> > post_src_unpack() {
> >         cd "${S}"
> >         epatch_user
> > }  
> 
> Again IIRC, when I tried using env for a similar purpose, it didn't work
> at all, it seemed the only things valid in those files were variable
> assignments.

Are you mixing portage/env up with portage/package.env? The latter loads
conf files from env that contain variable assignments. 


-- 
Neil Bothwick

Excuse for the day: daemons did it

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-24 22:21     ` Neil Bothwick
@ 2017-11-25  1:56       ` Ian Zimmerman
  2017-11-25  8:59         ` Neil Bothwick
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Zimmerman @ 2017-11-25  1:56 UTC (permalink / raw
  To: gentoo-user

On 2017-11-24 22:21, Neil Bothwick wrote:

> Are you mixing portage/env up with portage/package.env? The latter
> loads conf files from env that contain variable assignments.

I don't think I'm mixing them up: one of them is a directory, so hardly
can contain any code at all ;-)

(Well, the other _can_ also be a directory, but YSWIM).

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet, fetch the TXT record for the domain.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-25  1:56       ` Ian Zimmerman
@ 2017-11-25  8:59         ` Neil Bothwick
  0 siblings, 0 replies; 13+ messages in thread
From: Neil Bothwick @ 2017-11-25  8:59 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Fri, 24 Nov 2017 17:56:27 -0800, Ian Zimmerman wrote:

> > Are you mixing portage/env up with portage/package.env? The latter
> > loads conf files from env that contain variable assignments.  
> 
> I don't think I'm mixing them up: one of them is a directory, so hardly
> can contain any code at all ;-)
> 
> (Well, the other _can_ also be a directory, but YSWIM).

Both are directories here, so it would be easy to confuse them.


-- 
Neil Bothwick

deja vous - the act of forgetting someone's name /again/ despite being
introduced to them several times.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-24 17:07   ` [gentoo-user] " Ian Zimmerman
  2017-11-24 17:12     ` Michael Orlitzky
  2017-11-24 22:21     ` Neil Bothwick
@ 2017-11-26 20:24     ` Neil Bothwick
  2017-11-27  1:57       ` David Haller
  2 siblings, 1 reply; 13+ messages in thread
From: Neil Bothwick @ 2017-11-26 20:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

On Fri, 24 Nov 2017 09:07:24 -0800, Ian Zimmerman wrote:

> > You do have a choice, use /etc/portage/env. here's one I have to patch
> > a specific version of a package
> > 
> > % cat env/app-cdr/cdrdao-1.2.3
> > post_src_unpack() {
> >         cd "${S}"
> >         epatch_user
> > }  
> 
> Again IIRC, when I tried using env for a similar purpose, it didn't work
> at all, it seemed the only things valid in those files were variable
> assignments.  If possible, I would of course much prefer this way, as is
> avoids an ugly switch on the package name.

I've just had to use this again, for the vcdimager ebuild to apply the
patch https://bugs.gentoo.org/638646 - the ebuild doesn't apply patches
in /etc/portage/patches but it did when I created this file

% cat /etc/portage/env/media-video/vcdimager-0.7.24
post_src_unpack() {
    cd "${S}"
    epatch_user
}


-- 
Neil Bothwick

.                            <-Stealth Tagline

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-26 20:24     ` Neil Bothwick
@ 2017-11-27  1:57       ` David Haller
  2017-11-27  8:35         ` Neil Bothwick
  0 siblings, 1 reply; 13+ messages in thread
From: David Haller @ 2017-11-27  1:57 UTC (permalink / raw
  To: gentoo-user

Hello,

On Sun, 26 Nov 2017, Neil Bothwick wrote:
[..]
>% cat /etc/portage/env/media-video/vcdimager-0.7.24
>post_src_unpack() {
>    cd "${S}"
>    epatch_user
>}

https://wiki.gentoo.org/wiki//etc/portage/patches#Enabling_.2Fetc.2Fportage.2Fpatches_for_all_ebuilds

HTH,
-dnh

-- 
Yah. Spam, spam, spam, cuisson de cerf haché au sauce truffe, and spam.
                                -- Richard Bos on french "hypermarkets"


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-27  1:57       ` David Haller
@ 2017-11-27  8:35         ` Neil Bothwick
  2017-11-27 12:59           ` Michael Orlitzky
  0 siblings, 1 reply; 13+ messages in thread
From: Neil Bothwick @ 2017-11-27  8:35 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On Mon, 27 Nov 2017 02:57:47 +0100, David Haller wrote:

> On Sun, 26 Nov 2017, Neil Bothwick wrote:
> [..]
> >% cat /etc/portage/env/media-video/vcdimager-0.7.24
> >post_src_unpack() {
> >    cd "${S}"
> >    epatch_user
> >}  
> 
> https://wiki.gentoo.org/wiki//etc/portage/patches#Enabling_.2Fetc.2Fportage.2Fpatches_for_all_ebuilds

That came up in the OP, but the question was about doing it for selected
ebuilds, which is exactly what this must shorter option does.


-- 
Neil Bothwick

There is so much sand in Northern Africa that if it were spread out it
would completely cover the Sahara Desert.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-27  8:35         ` Neil Bothwick
@ 2017-11-27 12:59           ` Michael Orlitzky
  2017-11-27 17:17             ` Ian Zimmerman
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Orlitzky @ 2017-11-27 12:59 UTC (permalink / raw
  To: gentoo-user

On 11/27/2017 03:35 AM, Neil Bothwick wrote:
> 
> That came up in the OP, but the question was about doing it for selected
> ebuilds, which is exactly what this must shorter option does.
> 

You should update the wiki, your way is better.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-user] Re: Just when is portage/bashrc sourced?
  2017-11-27 12:59           ` Michael Orlitzky
@ 2017-11-27 17:17             ` Ian Zimmerman
  0 siblings, 0 replies; 13+ messages in thread
From: Ian Zimmerman @ 2017-11-27 17:17 UTC (permalink / raw
  To: gentoo-user

On 2017-11-27 07:59, Michael Orlitzky wrote:

> > That came up in the OP, but the question was about doing it for
> > selected ebuilds, which is exactly what this must shorter option
> > does.
> 
> You should update the wiki, your way is better.

Ah, now I see why I was so confused.  the /etc/portage/env/ directory
serves two purposes, only distantly related:

- houses the environment files, referenced from /etc/portage/package.env
  These can apparantly contain only variable settings.

- houses the package specific bashrc files, as $CATEGORY/$PN and so on.
  These can contain hook definitions and perhaps even more general shell
  code.

Both man portage(5) and the wiki treat the two cases separately, so the
fact that the ultimate data files are in the same directory is lost on
the careless reader (such as me).  Michael or Neil, if you do edit the
docs please improve this aspect.

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet, fetch the TXT record for the domain.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-11-27 17:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24  1:12 [gentoo-user] Just when is portage/bashrc sourced? Ian Zimmerman
2017-11-24  1:21 ` Michael Orlitzky
2017-11-24  8:32 ` Neil Bothwick
2017-11-24 17:07   ` [gentoo-user] " Ian Zimmerman
2017-11-24 17:12     ` Michael Orlitzky
2017-11-24 22:21     ` Neil Bothwick
2017-11-25  1:56       ` Ian Zimmerman
2017-11-25  8:59         ` Neil Bothwick
2017-11-26 20:24     ` Neil Bothwick
2017-11-27  1:57       ` David Haller
2017-11-27  8:35         ` Neil Bothwick
2017-11-27 12:59           ` Michael Orlitzky
2017-11-27 17:17             ` Ian Zimmerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox