Difference between pages "Test" and "Virtual Packages"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
(two first cases for virtuals)
 
Line 1: Line 1:
{{#get_web_data:url=http://build.funtoo.org/index.xml|format=xml|use xpath|data=builds=/subarches/subarch[@name='amd64-bulldozer']/@builds}}
Virtual packages are special packages that correspond to a feature that can be satisfied by one or more package(s). This Wiki page aims to describe when and how to use them correctly, and what are their implications.
;Builds: {{#external_value:builds}}


asdflk asdlfk asdlf alsdf lasd flasd flasd flasd flasd flasd flasd flas dflasd flasdl flasdf lasdfl alsdf lasdf lasdflafsd la sdf
== Virtual packages, metapackages and package sets ==
<div style="align: center;"><div style="border: 1px solid #ccc; border-radius: 5px;">
Virtual packages, metapackages and package sets are similar concepts. However, they have a few important differences that make them fit for different use cases.
[[{{#show: Organization:Brownrice Internet| ?Logo|link=none}}|350px|class=img-responsive|link=Organization:Brownrice Internet]]</div><br/>
[[Organization:Brownrice Internet|Learn about Funtoo-friendly organization: Brownrice Internet]]</div>
asdflk asdlfk asdlf alsdf lasd flasd flasd flasd flasd flasd flasd flas dflasd flasdl flasdf lasdfl alsdf lasdf lasdflafsd la sdf
{{fullurl:News:The Many Builds of Funtoo Linux}}
{{#widget:AddThis}}


I like the {{f|/etc/make.conf}} file, which can also be referred to as {{f|/etc/portage/make.conf}}. It is a groovy file. Another cool file is {{f|/etc/fstab}}.
Virtual packages and metapackages are regular Funtoo packages (ebuilds) that install no files. Instead, they cause other packages to be installed by specifying them in their runtime dependencies. They can both be used in any context valid for regular packages. They can have multiple versions, slots and USE flags. They have to be located in an active repository, and once there they can be installed and uninstalled like regular packages.


=== make.conf mentions ===
Package sets are not packages but special atoms supported by Portage. Package sets can only specify other packages, either via a static list or dynamically (e.g. via running Python code that determines the package list). Package sets can't be versioned and don't have USE flags. Package sets can be used alongside packages in emerge commands and other package sets but they can't be referenced inside regular packages. Package sets can be installed into user's system, located in repositories or created by user in Portage configuration.


{{#ask: [[Mentions file::make.conf]]
Virtual packages represent a commonly used feature that can be provided by multiple different providers. Virtuals provide a convenient way of specifying all possible alternatives without having to update multiple ebuilds.
| format=category
}}


{{console|body=
Metapackages and package sets are used to represent lists of packages that user may want to install together. They provide a convenience for users, e.g. providing a shortcut to install all packages comprising a desktop environment.
# ##i##bluetoothctl
 
[##g##NEW##!g##] Controller 00:02:72:C9:62:65 antec [default]
== When virtual packages can be used? ==
##bl##[bluetooth]##!bl###power on
For virtual package ebuild to work correctly, the two following requirements must be met:
Changing power on succeeded
# the virtual providers must be interchangeable at runtime with no consequences to the reverse dependencies. In other words, installing another provider and removing the currently used provider must not cause any breakage or require reverse dependencies to be rebuilt.
##bl##[bluetooth]##!bl### ##i##agent on
# Reverse dependencies need to have consistent, predictable requirements for the alternatives. In other words, the packages must not require a very specific versions of the alternatives.
Agent registered
 
##bl##[bluetooth]##!bl### ##i##scan on
Virtuals can not be used if the underlying packages don't provide binary compatibility at least between predictable range of versions.
Discovery started
 
##bl##[bluetooth]##!bl### ##i##devices
== Common uses for virtual packages ==
Device 00:1F:20:3D:1E:75 Logitech K760
=== System components and services ===
##bl##[bluetooth]##!bl### ##i##pair 00:1F:20:3D:1E:75
Example: ''virtual/service-manager''
Attempting to pair with 00:1F:20:3D:1E:75
 
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Connected: yes
One of the common uses for virtuals is to define abstract ''system services''. Those virtuals are not very specific on how those services are provided. They are mostly intended to be used in the @system package set, to ensure that the user system doesn't lack key components such as a service manager or a package manager.
##r##[agent]##!r## Passkey: 454358
 
##r##[agent]##!r## Passkey: ##i##4##!i##54358
The providers for this kind of virtuals do not have to meet any specific requirements except for having a particular function. In particular, there's no requirement for common configuration or provided executables. The user is responsible for ensuring that the installed implementation is set up and working.
##r##[agent]##!r## Passkey: ##i##45##!i##4358
 
##r##[agent]##!r## Passkey: ##i##454##!i##358
=== Tools provided by multiple packages ===
##r##[agent]##!r## Passkey: ##i##4543##!i##58
Example: ''virtual/eject''
##r##[agent]##!r## Passkey: ##i##45435##!i##8
 
##r##[agent]##!r## Passkey: ##i##454358##!i##
This kind of virtuals is used when multiple packages may provide tools with the same names. The virtual is used in packages that rely on those tools being present, in particular when the tools are used at build-time of the package or are called by package's scripts (executables).
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Paired: yes
 
Pairing successful
While the tools don't necessarily need to be fully compatible, they need to have a common basic usage. In particular, when a tool from one provider is replaced by a tool from another, the reverse dependencies must remain in working state, with no need for rebuilds or configuration adjustments.
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Connected: no
##bl##[bluetooth]##!bl### ##i##connect 00:1F:20:3D:1E:75
Attempting to connect to 00:1F:20:3D:1E:75
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Connected: yes
Connection successful
##bl##[bluetooth]##!bl### ##i##quit
[##r##DEL##!r##] Controller 00:02:72:C9:62:65 antec [default]
#
}}

Revision as of 13:31, February 7, 2015

Virtual packages are special packages that correspond to a feature that can be satisfied by one or more package(s). This Wiki page aims to describe when and how to use them correctly, and what are their implications.

Virtual packages, metapackages and package sets

Virtual packages, metapackages and package sets are similar concepts. However, they have a few important differences that make them fit for different use cases.

Virtual packages and metapackages are regular Funtoo packages (ebuilds) that install no files. Instead, they cause other packages to be installed by specifying them in their runtime dependencies. They can both be used in any context valid for regular packages. They can have multiple versions, slots and USE flags. They have to be located in an active repository, and once there they can be installed and uninstalled like regular packages.

Package sets are not packages but special atoms supported by Portage. Package sets can only specify other packages, either via a static list or dynamically (e.g. via running Python code that determines the package list). Package sets can't be versioned and don't have USE flags. Package sets can be used alongside packages in emerge commands and other package sets but they can't be referenced inside regular packages. Package sets can be installed into user's system, located in repositories or created by user in Portage configuration.

Virtual packages represent a commonly used feature that can be provided by multiple different providers. Virtuals provide a convenient way of specifying all possible alternatives without having to update multiple ebuilds.

Metapackages and package sets are used to represent lists of packages that user may want to install together. They provide a convenience for users, e.g. providing a shortcut to install all packages comprising a desktop environment.

When virtual packages can be used?

For virtual package ebuild to work correctly, the two following requirements must be met:

  1. the virtual providers must be interchangeable at runtime with no consequences to the reverse dependencies. In other words, installing another provider and removing the currently used provider must not cause any breakage or require reverse dependencies to be rebuilt.
  2. Reverse dependencies need to have consistent, predictable requirements for the alternatives. In other words, the packages must not require a very specific versions of the alternatives.

Virtuals can not be used if the underlying packages don't provide binary compatibility at least between predictable range of versions.

Common uses for virtual packages

System components and services

Example: virtual/service-manager

One of the common uses for virtuals is to define abstract system services. Those virtuals are not very specific on how those services are provided. They are mostly intended to be used in the @system package set, to ensure that the user system doesn't lack key components such as a service manager or a package manager.

The providers for this kind of virtuals do not have to meet any specific requirements except for having a particular function. In particular, there's no requirement for common configuration or provided executables. The user is responsible for ensuring that the installed implementation is set up and working.

Tools provided by multiple packages

Example: virtual/eject

This kind of virtuals is used when multiple packages may provide tools with the same names. The virtual is used in packages that rely on those tools being present, in particular when the tools are used at build-time of the package or are called by package's scripts (executables).

While the tools don't necessarily need to be fully compatible, they need to have a common basic usage. In particular, when a tool from one provider is replaced by a tool from another, the reverse dependencies must remain in working state, with no need for rebuilds or configuration adjustments.