Re: [gentoo-user] links that behave differently per calling app?

2019-11-11 Thread Jack

On 11/11/19 12:38 PM, Walter Dnes wrote:

On Mon, Nov 11, 2019 at 04:37:17AM +, Caveman Al Toraboran wrote

hi - is it possible to have some kind of fancy links that
know the name of the process that is trying to access
it, and based on its name, it links it to a file?

   Short answer... YES!  Now convince the developers to use it.  Here's a
trivial example...

* Create a 2-line executable script "foo"
#!/bin/bash
echo "${0}"

* Create a symlink with the command "ln -s foo bar"

* Execute "./foo" and the output will be "./foo"

* Execute "./bar" and the output will be "./bar"


That makes a distinction based on the name by which the script was 
called, not on the name of the calling script.  Caveman Al, have I 
misunderstood what your are asking for?


Jack




Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Dale
Francesco Turco wrote:
> On Mon, Nov 11, 2019, at 14:00, Dale wrote:
>> root@fireball / # cat /etc/make.conf | grep var
>> PORT_LOGDIR=/var/log/portage/
>> source /var/lib/layman/make.conf
>> DISTDIR="/var/cache/portage/distfiles/"
>> PKGDIR="/var/cache/portage/packages"
>> PORTDIR="/var/cache/portage/tree"
> I'm sure you already know that, but that's an example of a useless use of cat.
>
> The following command is better:
> # grep var /etc/make.conf
>
> :-)
>

I occasionally use grep that way, especially if I'm not sure what
file/directory it is in.  I use the -r option then tho.  Handy for
/etc/portage/ but no clue where the file might be exactly.  ;-)

Dale

:-)  :-) 



Re: [gentoo-user] links that behave differently per calling app?

2019-11-11 Thread Walter Dnes
On Mon, Nov 11, 2019 at 04:37:17AM +, Caveman Al Toraboran wrote
> hi - is it possible to have some kind of fancy links that
> know the name of the process that is trying to access
> it, and based on its name, it links it to a file?

  Short answer... YES!  Now convince the developers to use it.  Here's a
trivial example...

* Create a 2-line executable script "foo"
#!/bin/bash
echo "${0}"

* Create a symlink with the command "ln -s foo bar"

* Execute "./foo" and the output will be "./foo"

* Execute "./bar" and the output will be "./bar"

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Neil Bothwick
On Mon, 11 Nov 2019 14:32:36 +, Peter Humphrey wrote:

> > Fact is, there are a lot of people out there who hate systemd because
> > it's been successful, and it's been successful because it sticks to
> > the nix philosophy of "do one thing, and do it well".  
> 
> ...but not the other *nix tradition of minimising keystrokes.

Thank $DEITY for aliases!


-- 
Neil Bothwick

Remember, it takes 47 muscles to frown
And only 4 to pull the trigger of a sniper rifle


pgpGI2MrsAZgd.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Neil Bothwick
On Mon, 11 Nov 2019 06:54:31 -0500, Rich Freeman wrote:

> > > It was obviously a semi-trollish comment.
> > >  
> > Now that's harsh! Although yes I'm sure he was tweaking tails - hence
> > the "tongue in cheek" smiley.  
> 
> I didn't intend to suggest that I thought it was mean-spirited.  Just
> stirring the pot.

Guilty as charged ;-)

> > Fact is, there are a lot of people out there who hate systemd because
> > it's been successful, and it's been successful because it sticks to
> > the nix philosophy of "do one thing, and do it well".
> >  
> 
> Now, THAT is a semi-trollish comment if I ever saw one.  :)
> 
> That said, you could argue that the individual components of systemd
> do generally do one thing well.  I think the criticism is more in the
> packaging, and that the components mostly don't interchange with
> anything non-systemd.  Though as we can see from eudev/elogind and so
> on that isn't strictly the case.

It seems that most of the criticism is about the way it was developed and
by whom, rather than the merits or demerits of the code itself,

> I sometimes describe systemd as the anti-busybox.
> 
> But, I don't want to derail the thread entirely...

I think you're too late :)


-- 
Neil Bothwick

Make like a tree and leave.


pgpXl8lBKhnf1.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Peter Humphrey
On Monday, 11 November 2019 10:38:50 GMT Wols Lists wrote:

> Fact is, there are a lot of people out there who hate systemd because
> it's been successful, and it's been successful because it sticks to the
> nix philosophy of "do one thing, and do it well".

...but not the other *nix tradition of minimising keystrokes.

-- 
Regards,
Peter.






Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Francesco Turco
On Mon, Nov 11, 2019, at 14:00, Dale wrote:
> root@fireball / # cat /etc/make.conf | grep var
> PORT_LOGDIR=/var/log/portage/
> source /var/lib/layman/make.conf
> DISTDIR="/var/cache/portage/distfiles/"
> PKGDIR="/var/cache/portage/packages"
> PORTDIR="/var/cache/portage/tree"

I'm sure you already know that, but that's an example of a useless use of cat.

The following command is better:
# grep var /etc/make.conf

:-)

-- 
https://fturco.net/



Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Dale
Mick wrote:
> On Monday, 11 November 2019 13:00:20 GMT Dale wrote:
>> Mickaël Bucas wrote:
>>> Le lun. 11 nov. 2019 à 09:35, Mick  a écrit :
 On Monday, 11 November 2019 08:25:06 GMT n952162 wrote:
> I re-installed gentoo from the minimal boot cd (amd64), re-emerged
> everything from my old, saved world file, overnight, and its up and
> running, more or less.  Then, I wanted to see what was available and
> discovered, there's no /usr/portage directory! What did I do wrong?
 Nothing.

 /usr/portage has now moved to /var/db/repos/gentoo/.

 /usr/portage/distfiles has moved to /var/cache/distfiles/

 Portage will work fine with both legacy and new fs locations.
 --
 Regards,

 Mick
>>> My two systems are currently using the old locations.
>>> Is there a documentation about the way to migrate to the new locations
>>> without breaking things ?
>>> The profile links comes to mind but other things are probably necessary !
>>>
>>> Has anyone already done the migration ?
>>> In this case do you have advices or warnings about it ?
>>>
>>> Thanks
>>>
>>> Best regards
>>> Mickaël Bucas
>> Others have posted some good info but sometimes a example that is in use
>> can help a lot.  Here's what is in my make.conf:
>>
>>
>> root@fireball / # cat /etc/make.conf | grep var
>> PORT_LOGDIR=/var/log/portage/
>> source /var/lib/layman/make.conf
>> DISTDIR="/var/cache/portage/distfiles/"
>> PKGDIR="/var/cache/portage/packages"
>> PORTDIR="/var/cache/portage/tree"
>> root@fireball / #
>>
>>
>> The last three are what you need to look at.  
> ... AND ...
>
> the last thing (PORTDIR) is what you should no longer have specified in /etc/
> portage/make.conf, but in /etc/portage/repos.conf/gentoo.conf:
>
> $ grep location /etc/portage/repos.conf/gentoo.conf
> #location = /usr/portage  <==legacy portage fs location
> location = /var/db/repos/gentoo
>
> HTH.


A, that one line is in there so I guess it got moved at some point,
likely the devs had some magic going on and did it for me.  ;-)  I'll
comment that out in make.conf, so I don't confuse myself later on.  :/ 
Come to think of it, I'll add a comment as to where it moved to as well
so I don't have to go dig for it some day. 

Thanks.  This will help the OP as well. 

Dale

:-)  :-) 





Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Wols Lists
On 11/11/19 11:54, Rich Freeman wrote:
> On Mon, Nov 11, 2019 at 5:38 AM Wols Lists  wrote:
>>
>> On 09/11/19 19:51, Rich Freeman wrote:
>>>
>>> Only if somebody has created a generator for openrc, which I doubt.
>>> It was obviously a semi-trollish comment.
>>>
>> Now that's harsh! Although yes I'm sure he was tweaking tails - hence
>> the "tongue in cheek" smiley.
> 
> I didn't intend to suggest that I thought it was mean-spirited.  Just
> stirring the pot.
> 
Fair enough. Trouble is, you can't be too careful with what you say on
the internet - it's too easily taken out of context or just plain
mis-understood.
>>
>> Fact is, there are a lot of people out there who hate systemd because
>> it's been successful, and it's been successful because it sticks to the
>> nix philosophy of "do one thing, and do it well".
>>
> 
> Now, THAT is a semi-trollish comment if I ever saw one.  :)
> 
> That said, you could argue that the individual components of systemd
> do generally do one thing well.  I think the criticism is more in the
> packaging, and that the components mostly don't interchange with
> anything non-systemd.  Though as we can see from eudev/elogind and so
> on that isn't strictly the case.
> 
> I sometimes describe systemd as the anti-busybox.
> 
> But, I don't want to derail the thread entirely...
> 
Poettering is very much "do it right, if something else is already
broken then just break it completely". Much better for a computer, but
ruffles peoples' feathers ...

That said, yes we are derailing this thread somewhat :-)

Cheers,
Wol



Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Mick
On Monday, 11 November 2019 12:02:43 GMT Rich Freeman wrote:

> I also keep a /usr/portage symlink because I must be getting old.  :)
> Some tools also have that path hard-coded.

I wasn't aware of this - mine is just an empty directory with no symlink.  I 
haven't noticed any adverse effects so far.

-- 
Regards,

Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Mick
On Monday, 11 November 2019 13:00:20 GMT Dale wrote:
> Mickaël Bucas wrote:
> > Le lun. 11 nov. 2019 à 09:35, Mick  a écrit :
> >> On Monday, 11 November 2019 08:25:06 GMT n952162 wrote:
> >>> I re-installed gentoo from the minimal boot cd (amd64), re-emerged
> >>> everything from my old, saved world file, overnight, and its up and
> >>> running, more or less.  Then, I wanted to see what was available and
> >>> discovered, there's no /usr/portage directory! What did I do wrong?
> >> 
> >> Nothing.
> >> 
> >> /usr/portage has now moved to /var/db/repos/gentoo/.
> >> 
> >> /usr/portage/distfiles has moved to /var/cache/distfiles/
> >> 
> >> Portage will work fine with both legacy and new fs locations.
> >> --
> >> Regards,
> >> 
> >> Mick
> > 
> > My two systems are currently using the old locations.
> > Is there a documentation about the way to migrate to the new locations
> > without breaking things ?
> > The profile links comes to mind but other things are probably necessary !
> > 
> > Has anyone already done the migration ?
> > In this case do you have advices or warnings about it ?
> > 
> > Thanks
> > 
> > Best regards
> > Mickaël Bucas
> 
> Others have posted some good info but sometimes a example that is in use
> can help a lot.  Here's what is in my make.conf:
> 
> 
> root@fireball / # cat /etc/make.conf | grep var
> PORT_LOGDIR=/var/log/portage/
> source /var/lib/layman/make.conf
> DISTDIR="/var/cache/portage/distfiles/"
> PKGDIR="/var/cache/portage/packages"
> PORTDIR="/var/cache/portage/tree"
> root@fireball / #
> 
> 
> The last three are what you need to look at.  

... AND ...

the last thing (PORTDIR) is what you should no longer have specified in /etc/
portage/make.conf, but in /etc/portage/repos.conf/gentoo.conf:

$ grep location /etc/portage/repos.conf/gentoo.conf
#location = /usr/portage  <==legacy portage fs location
location = /var/db/repos/gentoo

HTH.
-- 
Regards,

Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Dale
Mickaël Bucas wrote:
> Le lun. 11 nov. 2019 à 09:35, Mick  a écrit :
>> On Monday, 11 November 2019 08:25:06 GMT n952162 wrote:
>>> I re-installed gentoo from the minimal boot cd (amd64), re-emerged
>>> everything from my old, saved world file, overnight, and its up and
>>> running, more or less.  Then, I wanted to see what was available and
>>> discovered, there's no /usr/portage directory! What did I do wrong?
>> Nothing.
>>
>> /usr/portage has now moved to /var/db/repos/gentoo/.
>>
>> /usr/portage/distfiles has moved to /var/cache/distfiles/
>>
>> Portage will work fine with both legacy and new fs locations.
>> --
>> Regards,
>>
>> Mick
> My two systems are currently using the old locations.
> Is there a documentation about the way to migrate to the new locations
> without breaking things ?
> The profile links comes to mind but other things are probably necessary !
>
> Has anyone already done the migration ?
> In this case do you have advices or warnings about it ?
>
> Thanks
>
> Best regards
> Mickaël Bucas
>
>


Others have posted some good info but sometimes a example that is in use
can help a lot.  Here's what is in my make.conf:


root@fireball / # cat /etc/make.conf | grep var
PORT_LOGDIR=/var/log/portage/
source /var/lib/layman/make.conf
DISTDIR="/var/cache/portage/distfiles/"
PKGDIR="/var/cache/portage/packages"
PORTDIR="/var/cache/portage/tree"
root@fireball / #


The last three are what you need to look at.  I moved mine years ago,
long before the defaults were changed and maybe even on my last rig.  At
the time, there was good logic for it being where I put it but I'm sure
others have their own ideas and you may place yours somewhere else for
yet another good reason. 

In all honesty, you can put them practically anywhere as long as portage
knows where they are and the permissions can be set correctly.  By the
way, those are portage:portage for them all as far as I know.  This is mine:


root@fireball / # ls -al /var/cache/portage/
total 160
drwxr-xr-x   5 root    root  4096 Dec 20  2012 .
drwxr-xr-x  13 root    root  4096 Nov 11 03:39 ..
drwxrwxr-x   3 portage portage 143360 Nov 11 00:07 distfiles
drwxr-xr-x 109 portage portage   4096 Nov 11 01:22 packages
drwxr-xr-x 175 portage portage   4096 Nov 10 20:09 tree
root@fireball / #




For those who question where make.conf is, it's a link to the real one. 
Saves me some typing and I don't have to remember where the thing went
too.  ;-)  Y'all know how I am.  lol 

Hope that helps, a tiny bit more anyway.  You got some good info to
start with.

Dale

:-)  :-) 



Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Mick
On Monday, 11 November 2019 11:54:31 GMT Rich Freeman wrote:
> On Mon, Nov 11, 2019 at 5:38 AM Wols Lists  wrote:
>
> > Fact is, there are a lot of people out there who hate systemd because
> > it's been successful, and it's been successful because it sticks to the
> > nix philosophy of "do one thing, and do it well".
> 
> Now, THAT is a semi-trollish comment if I ever saw one.  :)

Well, the major criticism *against* systemd has been that it has been designed 
in an orthogonal direction to the *nix philosophy.  It tried from inception to 
do many things, building a monolithic stack primarily to facilitate quick and 
easy spinning of linux deployment in cloud technologies.


> That said, you could argue that the individual components of systemd
> do generally do one thing well.  I think the criticism is more in the
> packaging, and that the components mostly don't interchange with
> anything non-systemd.  Though as we can see from eudev/elogind and so
> on that isn't strictly the case.
> 
> I sometimes describe systemd as the anti-busybox.

Well, some systemd components can be taken as single applications and used 
separately from the whole systemd stack, that much is true.  However, (some) 
systemd devs are known for for being disrespectful towards the rest of the 
Linux ecosystem and making architectural decisions which break 
interoperability.  systemd has been gradually taking over more and more 
functions/services which reminds me of the old emacs joke:

 "... emacs is a fine operating system, in need of a good editor"


> But, I don't want to derail the thread entirely...

Sorry, I couldn't resist contributing!  :-)

-- 
Regards,

Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Rich Freeman
On Mon, Nov 11, 2019 at 5:28 AM Mickaël Bucas  wrote:
>
> My two systems are currently using the old locations.
> Is there a documentation about the way to migrate to the new locations
> without breaking things ?
> The profile links comes to mind but other things are probably necessary !
>
> Has anyone already done the migration ?
> In this case do you have advices or warnings about it ?

Moving both paths around have been trivial for a very long time.  Both
are completely disposable when you think about it so there isn't much
you can do wrong.

Just set DISTDIR and PORTDIR anywhere you want.  You can optionally
move the existing files to those locations, but if you don't portage
will just re-create everything on the next emerge --sync and re-fetch
distfiles as needed.

If you're ever concerned that something bad has happened to either
directory you can always just wipe it out and let portage repopulate
it.

I personally keep both in /var/cache and am not a fan of the non-LSB
/var/db in general, as I think the repo basically is a cache.
However, this was not the majority view.  In any case it is just a
default so it really isn't a big deal - any user can put both of these
directories anywhere they prefer.  Ditto for binary packages, logs,
etc.

The only thing you'd need to be careful about migrating is the
installed package metadata, as that can't be easily regenerated.

I also keep a /usr/portage symlink because I must be getting old.  :)
Some tools also have that path hard-coded.

The one thing I do strongly recommend is not nesting DISTDIR inside
PORTDIR.  That really wasn't a great design from day 1 and I don't
think anybody disagreed with separating them.  I'm not sure how much I
like $PORTDIR/metadata being where it is either, but I can at least
see the argument of keeping syncs of it and PORTDIR atomic and that is
an easy way to accomplish this.

-- 
Rich



Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Arve Barsnes
On Mon, 11 Nov 2019 at 11:29, Mickaël Bucas  wrote:
> My two systems are currently using the old locations.
> Is there a documentation about the way to migrate to the new locations
> without breaking things ?
> The profile links comes to mind but other things are probably necessary !
>
> Has anyone already done the migration ?
> In this case do you have advices or warnings about it ?

Any migration is probably not necessary ever. The location of your
repos are in your configuration, like
/etc/portage/repos.conf/gentoo.conf, so portage shouldn't care.

Regards,
Arve



Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Rich Freeman
On Mon, Nov 11, 2019 at 5:38 AM Wols Lists  wrote:
>
> On 09/11/19 19:51, Rich Freeman wrote:
> >
> > Only if somebody has created a generator for openrc, which I doubt.
> > It was obviously a semi-trollish comment.
> >
> Now that's harsh! Although yes I'm sure he was tweaking tails - hence
> the "tongue in cheek" smiley.

I didn't intend to suggest that I thought it was mean-spirited.  Just
stirring the pot.

>
> Fact is, there are a lot of people out there who hate systemd because
> it's been successful, and it's been successful because it sticks to the
> nix philosophy of "do one thing, and do it well".
>

Now, THAT is a semi-trollish comment if I ever saw one.  :)

That said, you could argue that the individual components of systemd
do generally do one thing well.  I think the criticism is more in the
packaging, and that the components mostly don't interchange with
anything non-systemd.  Though as we can see from eudev/elogind and so
on that isn't strictly the case.

I sometimes describe systemd as the anti-busybox.

But, I don't want to derail the thread entirely...

-- 
Rich



Re: [gentoo-user] visualise openrc initscript start order and dependency tree

2019-11-11 Thread Wols Lists
On 09/11/19 19:51, Rich Freeman wrote:
> On Sat, Nov 9, 2019 at 7:01 AM J. Roeleveld  wrote:
>>
>> On 9 November 2019 11:42:38 CET, Neil Bothwick  wrote:
>>> On Fri, 08 Nov 2019 21:03:13 +0100, J. Roeleveld wrote:
>>>
 I had a similar issue and ended up checking every init-script, conf.d
 file and rc.conf entry and making a dependency-tree manually on a big
 white-board.

 I haven't found a tool that does this automatically yet.
>>>
>>> systemd's systemctl ;-)
>>>
>>> I'll get my coat...
>>
>> Does this parse openrc scripts correctly?
> 
> Only if somebody has created a generator for openrc, which I doubt.
> It was obviously a semi-trollish comment.
> 
Now that's harsh! Although yes I'm sure he was tweaking tails - hence
the "tongue in cheek" smiley.

Fact is, there are a lot of people out there who hate systemd because
it's been successful, and it's been successful because it sticks to the
nix philosophy of "do one thing, and do it well".

Cheers,
Wol




Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Mickaël Bucas
Le lun. 11 nov. 2019 à 09:35, Mick  a écrit :
>
> On Monday, 11 November 2019 08:25:06 GMT n952162 wrote:
> > I re-installed gentoo from the minimal boot cd (amd64), re-emerged
> > everything from my old, saved world file, overnight, and its up and
> > running, more or less.  Then, I wanted to see what was available and
> > discovered, there's no /usr/portage directory! What did I do wrong?
>
> Nothing.
>
> /usr/portage has now moved to /var/db/repos/gentoo/.
>
> /usr/portage/distfiles has moved to /var/cache/distfiles/
>
> Portage will work fine with both legacy and new fs locations.
> --
> Regards,
>
> Mick

My two systems are currently using the old locations.
Is there a documentation about the way to migrate to the new locations
without breaking things ?
The profile links comes to mind but other things are probably necessary !

Has anyone already done the migration ?
In this case do you have advices or warnings about it ?

Thanks

Best regards
Mickaël Bucas



Re: [gentoo-user] links that behave differently per calling app?

2019-11-11 Thread Peter Humphrey
On Monday, 11 November 2019 04:37:17 GMT Caveman Al Toraboran wrote:
> hi - is it possible to have some kind of fancy links that
> know the name of the process that is trying to access
> it, and based on its name, it links it to a file?

Yes, it's done all the time. Have a look at, e.g., /usr/bin/rst*, which all 
point to ../lib/python-exec/python-exec2, which is a python script.

-- 
Regards,
Peter.






Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Mick
On Monday, 11 November 2019 08:38:38 GMT you wrote:
> wishoo!   ;-)
> 
> Thank you.


You're welcome.  :-)  This page explains the new portage fs locations in more 
detail:

https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Files

-- 
Regards,

Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] where is /usr/portage?

2019-11-11 Thread Mick
On Monday, 11 November 2019 08:25:06 GMT n952162 wrote:
> I re-installed gentoo from the minimal boot cd (amd64), re-emerged
> everything from my old, saved world file, overnight, and its up and
> running, more or less.  Then, I wanted to see what was available and
> discovered, there's no /usr/portage directory! What did I do wrong?

Nothing.

/usr/portage has now moved to /var/db/repos/gentoo/.

/usr/portage/distfiles has moved to /var/cache/distfiles/

Portage will work fine with both legacy and new fs locations.
-- 
Regards,

Mick

signature.asc
Description: This is a digitally signed message part.


[gentoo-user] where is /usr/portage?

2019-11-11 Thread n952162

I re-installed gentoo from the minimal boot cd (amd64), re-emerged
everything from my old, saved world file, overnight, and its up and
running, more or less.  Then, I wanted to see what was available and
discovered, there's no /usr/portage directory! What did I do wrong?