He's not dead, he's resting

EAPI 3: pkg_info Changes

This is part of a series on EAPI 3.

With EAPI 3, the requirement that a package be installed before the package manager calls its pkg_info function has been dropped. If developers find they usually need to ask for certain information when a package build fails, they can make a pkg_info that will try to display that information, rather than having to ask the user to run commands by hand.

Some points to note:

  • You can’t rely upon anything in particular being installed. We don’t force the package manager to ensure that a package’s dependencies are met. Thus, write code that only tries to display information, and doesn’t mind if it can’t.
  • You could use has_version to determine whether something’s installed, but it’s better to just try to do whatever you want.
  • There is no variable telling you whether your package is installed. This is because it’s not a simple boolean choice — do you care whether a package is installed, whether our exact version is installed, whether our slot is installed or something else? Again, has_version is available, but using it is probably a sign you’re writing code that’s trying to be too clever.

This feature was originally in kdebuild-1.


One response to “EAPI 3: pkg_info Changes

  1. Pingback: What’s in EAPI 3? « Ciaran McCreesh’s Blag

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s