Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Update of a package whose version was explicitly specified
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
JenyaKh
n00b
n00b


Joined: 07 Apr 2017
Posts: 9

PostPosted: Thu Apr 20, 2017 4:11 pm    Post subject: Update of a package whose version was explicitly specified Reply with quote

I have had stable gcc-4.9.4. Today emerge world installed the new gcc-5.4.0-r3 into another slot. However, I'm not ready to switch to the new version completely and I decided to keep both packages. I hoped that as the two versions are installed in different slots, emerge -c will not remove the older version gcc-4.9.4. However, emerge -c did offer to remove it.

So I tried the workaround. I installed the two versions explicitly:

sudo emerge =sys-devel/gcc-4.9.4
sudo emerge =sys-devel/gcc-5.4.0-r3

It worked. Now emerge -c does not offer to remove any gcc versions from my system.

However, I worry if the solution is good. Will portage offer me to emerge the newer version of gcc (I mean a stable version newer than 5.4.0-r3) when it appears in gentoo repo? If it offers me to install the newer version will emerge -c offers me to remove then older gcc-4.9.4 and gcc-5.4.0-r3 versions or will I have to remember of them and remove them manually?

I mean when I install a package not specifying a particular version, it all works automatically: portage finds a newer version by itself and allow to remove the older one. But if I specify a version when emerging a package it looks like masking but I don't understand how to consequently control the masking and the package updates.

Could you, please, explain the moment?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Thu Apr 20, 2017 4:18 pm    Post subject: Reply with quote

JenyaKh,

Your world file will contain both gcc versions because they have been explicitly installed.
You will still get gcc updates.

Due to the C++ ABI change between gcc-4 and gcc-5, the update is non-trivial. Read your news items.
You cannot mix C++ code built with gcc-4 and gcc-5.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
JenyaKh
n00b
n00b


Joined: 07 Apr 2017
Posts: 9

PostPosted: Thu Apr 20, 2017 4:26 pm    Post subject: Reply with quote

NeddySeagoon wrote:
JenyaKh,

Your world file will contain both gcc versions because they have been explicitly installed.
You will still get gcc updates.

Due to the C++ ABI change between gcc-4 and gcc-5, the update is non-trivial. Read your news items.
You cannot mix C++ code built with gcc-4 and gcc-5.


NeddySeagoon,

If I'm not mistaken my world file contains just the line

sys-devel/gcc

without any versions. Though right now I'm not near my gentoo machine and I will check this tomorrow.

I know about the ABI changes. I read my news items. I wrote that I just want to keep the two packets -- not to use them at the same time. When I have time I will try to switch to the newer version.

My question is particularly about how will the updates of the two versions in the two different slots happen so I asked:

"... when I install a package not specifying a particular version, it all works automatically: portage finds a newer version by itself and allow to remove the older one. But if I specify a version when emerging a package it looks like masking but I don't understand how to consequently control the masking and the package updates"
Back to top
View user's profile Send private message
JenyaKh
n00b
n00b


Joined: 07 Apr 2017
Posts: 9

PostPosted: Fri Apr 21, 2017 3:10 am    Post subject: Reply with quote

NeddySeagoon wrote:
JenyaKh,

Your world file will contain both gcc versions because they have been explicitly installed.
You will still get gcc updates.

Due to the C++ ABI change between gcc-4 and gcc-5, the update is non-trivial. Read your news items.
You cannot mix C++ code built with gcc-4 and gcc-5.


I checked my world file. Indeed, you have been right. I have the two entries there:

sys-devel/gcc:4.9.4
sys-devel/gcc:5.4.0

That explains much. Thank you, NeddySeagoon. However, still I'm not quite sure about their updates. If I understand right I will have to control it and the removal of the older packages by myself.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Fri Apr 21, 2017 8:35 am    Post subject: Reply with quote

JenyaKh,

It depends on the slotting. The easy part is that --depclean will not remove sys-devel/gcc:4.9.4 and sys-devel/gcc:5.4.0

Code:
emerge =sys-devel/gcc-4.9.4 =sys-devel/gcc-5.4.0-r3 -pv
 sys-devel/gcc-5.4.0-r3:5.4.0::gentoo
 sys-devel/gcc-4.9.4:4.9.4::gentoo


You read those lines as <category>/<package>-<version>:<slot>::>repository>

So the slots are 5.4.0 and 4.9.4. If there were -rX updates those updates go in the same slots, so yould would get those. Updates.
If there was a 5.4.x. It would go into its own slot too.

Notice your world file has a colon (:) seperator, not a dash (-), so the gcc entries are <category>/<package>:<slot>, not <category>/<package>-<version>.

This means that if you ever got, gcc-4.9.4, gcc-5.4.0, gcc-5.4.3 and gcc-5.4.5 installed, then ran --depcleen,
gcc-4.9.4, gcc-5.4.0 would remain as they are in world.
gcc-5.4.3 would be removed.
gcc-5.4.5 would remain as its the highest version.
Note that gcc-5.4.3 and gcc-5.4.5 don't exist today.

If the slots were 4 and 5, then its more complex. A slot holds a single installed version. All versions of gcc-4.x.y would go in slot 4.

I manage gcc with --depclean --exclude=sys-devel/gcc so that depclean ignores gcc.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Fri Apr 21, 2017 9:21 am    Post subject: Reply with quote

BTW:
Code:
emerge --noreplace <package>
is what you should consider to use.
Back to top
View user's profile Send private message
JenyaKh
n00b
n00b


Joined: 07 Apr 2017
Posts: 9

PostPosted: Fri Apr 21, 2017 10:48 am    Post subject: Reply with quote

NeddySeagoon wrote:
JenyaKh,

It depends on the slotting. The easy part is that --depclean will not remove sys-devel/gcc:4.9.4 and sys-devel/gcc:5.4.0

Code:
emerge =sys-devel/gcc-4.9.4 =sys-devel/gcc-5.4.0-r3 -pv
 sys-devel/gcc-5.4.0-r3:5.4.0::gentoo
 sys-devel/gcc-4.9.4:4.9.4::gentoo


You read those lines as <category>/<package>-<version>:<slot>::>repository>

So the slots are 5.4.0 and 4.9.4. If there were -rX updates those updates go in the same slots, so yould would get those. Updates.
If there was a 5.4.x. It would go into its own slot too.

Notice your world file has a colon (:) seperator, not a dash (-), so the gcc entries are <category>/<package>:<slot>, not <category>/<package>-<version>.

This means that if you ever got, gcc-4.9.4, gcc-5.4.0, gcc-5.4.3 and gcc-5.4.5 installed, then ran --depcleen,
gcc-4.9.4, gcc-5.4.0 would remain as they are in world.
gcc-5.4.3 would be removed.
gcc-5.4.5 would remain as its the highest version.
Note that gcc-5.4.3 and gcc-5.4.5 don't exist today.

If the slots were 4 and 5, then its more complex. A slot holds a single installed version. All versions of gcc-4.x.y would go in slot 4.

I manage gcc with --depclean --exclude=sys-devel/gcc so that depclean ignores gcc.


NeddySeagoon, Thank you very much for the detailed explanation!!! Especially that you have pointed out to me that it's slots that are used in world file rather than versions.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum