Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
virtuals
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
hujuice
Guru
Guru


Joined: 16 Oct 2007
Posts: 336
Location: Rome, Italy

PostPosted: Sat Aug 04, 2012 12:02 pm    Post subject: virtuals Reply with quote

The virtuals management is unclear to me. Or (better) I understand something that doesn't work. :roll:
An example should be the best to explain.

I want to switch from MySQL to MariaDB.

# emerge -C dev-db/mysql:
bla bla bla


$ cat /etc/portage/make.profile/virtuals:
# MariaDB
virtual/mysql   dev-db/mariadb


$ grep mariadb /etc/portage/package.accept_keywords:
dev-db/mariadb


$ emerge -p virtual/mysql:
These are the packages that would be merged, in order:

Calculating dependencies               ... done!
[ebuild  N     ] dev-db/mysql-5.1.62-r1  USE="berkdb community perl ssl -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal -pbxt -profiling (-selinux) -static -test -xtradb" 0 kB
[ebuild   R    ] virtual/mysql-5.1  USE="-embedded -minimal -static" 0 kB

Total: 2 packages (1 new, 1 reinstall), Size of downloads: 0 kB


What's wrong?
I'm unable to drive the portage behaviour about.

The workaround works fine.

# rm /etc/portage/make.profile/virtuals:
rm: rimuovere file regolare "/etc/portage/make.profile/virtuals"? y


# emerge -1 dev-db/mariadb:
bla bla bla


$ emerge -p virtual/mysql:
These are the packages that would be merged, in order:

Calculating dependencies                ... done!           
[ebuild   R    ] virtual/mysql-5.1  USE="-embedded -minimal -static" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


Regards,
HUJuice


Here are my references...
Code:
/etc/make.profile/ or /etc/portage/make.profile/
              This  is usually just a symlink to the correct profile in /usr/portage/profiles/.  Since it is part of the portage
              tree, it may easily be updated/regenerated by running `emerge --sync`.  It defines what a profile is (usually arch
              specific  stuff).   If  you  need a custom profile, then you should make your own /etc/make.profile/ directory and
              populate it.  However, if you just wish to override some settings, use /etc/portage/profile/ (it supports  all  of
              the  same  file types that /etc/make.profile/ does, except parent). Do NOT edit the settings in /etc/make.profile/
              because they WILL be lost with the next `emerge --sync`. If both /etc/make.profile/ and /etc/portage/make.profile/
              exist, then /etc/make.profile/ will be preferred.

...

              virtuals
                     This  controls  what  packages  will provide a virtual by default.  For example, if a package needs to send
                     e-mail, it will need virtual/mta.  In the absence of a package that provides virtual/mta (like qmail, send‐
                     mail,  postfix,  etc...),  portage  will  look  here to see what package to use.  In this case, Gentoo uses
                     net-mail/ssmtp as the default (as defined in the virtuals file) because it's the package that does the very
                     bare minimum to send e-mail.

                     Format:
                     - comments begin with # (no inline comments)
                     - one virtual and DEPEND atom base pair per line

                     Example:
                     # use net-mail/ssmtp as the default mta
                     virtual/mta           net-mail/ssmtp
                     # use app-dicts/aspell-en as the default dictionary
                     virtual/aspell-dict   app-dicts/aspell-en

_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Aug 04, 2012 2:57 pm    Post subject: Reply with quote

The mysql virtual is a new style virtual. All the old style virtuals are gone from the tree.

vitual/mysql-5.1.ebuild:
RDEPEND="|| (
   =dev-db/mysql-${PV}*[embedded=,minimal=,static=]
   =dev-db/mariadb-${PV}*[embedded=,minimal=,static=]
)"


since mysql is the first one listed, it will pick it first. You need to manually emerge mariadb first so it can resolve it as the dep instead (installed optional dep wins).
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
hujuice
Guru
Guru


Joined: 16 Oct 2007
Posts: 336
Location: Rome, Italy

PostPosted: Sat Aug 04, 2012 4:41 pm    Post subject: Reply with quote

Thank you dol-sen.

So, what I called a "workaround" is the best practice, instead.

Can I consider the man page outdated?
(And this page also: http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=3&chap=6#doc_chap5)

HUJuice
_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Aug 04, 2012 11:08 pm    Post subject: Reply with quote

Yes, those /etc/portage/profile/virtuals is no longer supported with new style virtuals.

Please file a bug/bugs for them.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
hujuice
Guru
Guru


Joined: 16 Oct 2007
Posts: 336
Location: Rome, Italy

PostPosted: Sun Aug 12, 2012 3:50 pm    Post subject: Reply with quote

Man related bug: https://bugs.gentoo.org/show_bug.cgi?id=429978
_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
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