paludis  Version 2.6.0
Public Member Functions | Protected Member Functions | List of all members
paludis::TestEnvironment Class Reference

#include <test_environment.hh>

+ Inheritance diagram for paludis::TestEnvironment:

Public Member Functions

virtual bool accept_license (const std::string &, const std::shared_ptr< const PackageID > &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual bool accept_keywords (const std::shared_ptr< const KeywordNameSet > &, const std::shared_ptr< const PackageID > &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual const std::shared_ptr< const Maskmask_for_user (const std::shared_ptr< const PackageID > &, const bool) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual bool unmasked_by_user (const std::shared_ptr< const PackageID > &, const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual std::shared_ptr< const FSPathSequencehook_dirs () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual uid_t reduced_uid () const
 
virtual gid_t reduced_gid () const
 
virtual std::shared_ptr< const MirrorsSequencemirrors (const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual HookResult perform_hook (const Hook &, const std::shared_ptr< OutputManager > &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual bool add_to_world (const QualifiedPackageName &) const
 
virtual bool add_to_world (const SetName &) const
 
virtual bool remove_from_world (const QualifiedPackageName &) const
 
virtual bool remove_from_world (const SetName &) const
 
virtual const std::shared_ptr< const MetadataValueKey< std::string > > format_key () const
 
virtual const std::shared_ptr< const MetadataValueKey< FSPath > > config_location_key () const
 
virtual const std::shared_ptr< const MetadataValueKey< FSPath > > preferred_root_key () const
 
virtual const std::shared_ptr< const MetadataValueKey< FSPath > > system_root_key () const
 
virtual Tribool interest_in_suggestion (const std::shared_ptr< const PackageID > &from_id, const PackageDepSpec &spec) const
 
virtual const Tribool want_choice_enabled (const std::shared_ptr< const PackageID > &, const std::shared_ptr< const Choice > &, const UnprefixedChoiceName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual const std::string value_for_choice_parameter (const std::shared_ptr< const PackageID > &, const std::shared_ptr< const Choice > &, const UnprefixedChoiceName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual std::shared_ptr< const Set< UnprefixedChoiceName > > known_choice_value_names (const std::shared_ptr< const PackageID > &, const std::shared_ptr< const Choice > &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual const std::shared_ptr< OutputManagercreate_output_manager (const CreateOutputManagerInfo &) const
 
void set_want_choice_enabled (const ChoicePrefixName &, const UnprefixedChoiceName &, const Tribool)
 
virtual const std::shared_ptr< Repositoryrepository_from_new_config_file (const FSPath &) PALUDIS_ATTRIBUTE((noreturn))
 
virtual void update_config_files_for_package_move (const PackageDepSpec &, const QualifiedPackageName &) const
 
void set_system_root (const FSPath &)
 
- Public Member Functions inherited from paludis::EnvironmentImplementation
virtual std::shared_ptr< const FSPathSequencebashrc_files () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual std::shared_ptr< const FSPathSequencesyncers_dirs () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual std::shared_ptr< const FSPathSequencefetchers_dirs () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual std::string distribution () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual bool is_paludis_package (const QualifiedPackageName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual std::shared_ptr< PackageIDSequenceoperator[] (const Selection &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual NotifierCallbackID add_notifier_callback (const NotifierCallbackFunction &)
 
virtual void remove_notifier_callback (const NotifierCallbackID)
 
virtual void trigger_notifier_callback (const NotifierCallbackEvent &) const
 
virtual void add_set (const SetName &, const SetName &, const std::function< std::shared_ptr< const SetSpecTree >()> &, const bool combine) const
 
virtual std::shared_ptr< const SetNameSetset_names () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual const std::shared_ptr< const SetSpecTreeset (const SetName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual void add_repository (int importance, const std::shared_ptr< Repository > &)
 
virtual const std::shared_ptr< const Repositoryfetch_repository (const RepositoryName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual const std::shared_ptr< Repositoryfetch_repository (const RepositoryName &) PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual bool has_repository_named (const RepositoryName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual QualifiedPackageName fetch_unique_qualified_package_name (const PackageNamePart &, const Filter &=all_filter(), const bool disambiguate=true) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual bool more_important_than (const RepositoryName &, const RepositoryName &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual RepositoryConstIterator begin_repositories () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual RepositoryConstIterator end_repositories () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
virtual const std::shared_ptr< const Set< std::string > > expand_licence (const std::string &) const
 
 EnvironmentImplementation ()
 
virtual ~EnvironmentImplementation ()=0
 
- Public Member Functions inherited from paludis::Environment
 Environment ()=default
 
virtual ~Environment ()=0
 
 Environment (const Environment &)=delete
 
Environmentoperator= (const Environment &)=delete
 
- Public Member Functions inherited from paludis::MetadataKeyHolder
MetadataConstIterator begin_metadata () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
MetadataConstIterator end_metadata () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
MetadataConstIterator find_metadata (const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result))
 

Protected Member Functions

virtual void need_keys_added () const
 
virtual void populate_sets () const
 
- Protected Member Functions inherited from paludis::EnvironmentImplementation
virtual void populate_standard_sets () const
 
void set_always_exists (const SetName &) const
 
- Protected Member Functions inherited from paludis::MetadataKeyHolder
virtual void add_metadata_key (const std::shared_ptr< const MetadataKey > &) const
 
virtual void clear_metadata_keys () const
 

Basic operations

 TestEnvironment ()
 
 TestEnvironment (bool)
 
 TestEnvironment (const FSPath &)
 
 TestEnvironment (const FSPath &, bool)
 
 ~TestEnvironment ()
 

Additional Inherited Members

- Public Types inherited from paludis::Environment
typedef WrappedForwardIterator< RepositoryConstIteratorTag, const std::shared_ptr< Repository > > RepositoryConstIterator
 
- Public Types inherited from paludis::MetadataKeyHolder
typedef WrappedForwardIterator< MetadataConstIteratorTag, const std::shared_ptr< const MetadataKey > > MetadataConstIterator
 
- Static Protected Member Functions inherited from paludis::Environment
static const Filterall_filter () PALUDIS_ATTRIBUTE((warn_unused_result))
 

Detailed Description

A TestEnvironment is an environment used during testing that lets us control all the options rather than reading them from configuration files.

Member Function Documentation

virtual bool paludis::TestEnvironment::accept_keywords ( const std::shared_ptr< const KeywordNameSet > &  ,
const std::shared_ptr< const PackageID > &   
) const
virtual

Do we accept any of the specified keywords for a particular package?

If the collection includes "*", should return true.

Used by PackageID implementations. Generally PackageID's masks methods should be used rather than calling this directly.

Since
0.58 takes id by shared_ptr

Implements paludis::Environment.

virtual bool paludis::TestEnvironment::accept_license ( const std::string &  ,
const std::shared_ptr< const PackageID > &   
) const
virtual

Do we accept a particular license for a particular package?

Used by PackageID implementations. Generally PackageID's masks methods should be used rather than calling this directly.

Since
0.58 takes id by shared_ptr

Implements paludis::Environment.

virtual bool paludis::TestEnvironment::add_to_world ( const QualifiedPackageName ) const
virtual

Add this package to world.

Returns
whether anything was added
Since
0.49

Implements paludis::Environment.

virtual bool paludis::TestEnvironment::add_to_world ( const SetName ) const
virtual

Add this set to world.

Returns
whether anything was added
Since
0.49

Implements paludis::Environment.

virtual const std::shared_ptr<const MetadataValueKey<FSPath> > paludis::TestEnvironment::config_location_key ( ) const
virtual

The config_location_key, if non-zero, specifies the location of the configuration file or directory, the contents of which depends on the format returned by format_key.

Implements paludis::Environment.

virtual const std::shared_ptr<OutputManager> paludis::TestEnvironment::create_output_manager ( const CreateOutputManagerInfo ) const
virtual

Create an output manager.

Since
0.36

Implements paludis::Environment.

virtual const std::shared_ptr<const MetadataValueKey<std::string> > paludis::TestEnvironment::format_key ( ) const
virtual

The format_key, if non-zero, holds our environment's format. Environment implementations should not return zero here, but clients should still check.

Implements paludis::Environment.

virtual std::shared_ptr<const FSPathSequence> paludis::TestEnvironment::hook_dirs ( ) const
virtual

Return directories to search for hooks.

Implements paludis::Environment.

virtual Tribool paludis::TestEnvironment::interest_in_suggestion ( const std::shared_ptr< const PackageID > &  from_id,
const PackageDepSpec spec 
) const
virtual

Do we want to ignore or take a particular suggestion from a particular package?

Command line things override this.

Since
0.58

Implements paludis::Environment.

virtual std::shared_ptr<const Set<UnprefixedChoiceName> > paludis::TestEnvironment::known_choice_value_names ( const std::shared_ptr< const PackageID > &  ,
const std::shared_ptr< const Choice > &   
) const
virtual

Return a collection of known value names for a particular choice.

Only for use by Repository, to get defaults from the environment. Clients should query the metadata key directly.

This is to deal with cases like USE_EXPAND values, where the repository doesn't know all possible values.

Implements paludis::Environment.

virtual const std::shared_ptr<const Mask> paludis::TestEnvironment::mask_for_user ( const std::shared_ptr< const PackageID > &  ,
const bool  will_be_used_for_overridden 
) const
virtual

Do we have a 'user' mask for a particular package?

Returns a zero pointer if no.

If the second parameter is true, return a Mask suitable for being added to an OverriddenMask.

Used by PackageID implementations. Generally PackageID's masks methods should be used rather than calling this directly.

Since
0.58 takes id by shared_ptr

Implements paludis::Environment.

virtual std::shared_ptr<const MirrorsSequence> paludis::TestEnvironment::mirrors ( const std::string &  ) const
virtual

Return the mirror URI prefixes for a named mirror.

Implements paludis::Environment.

virtual void paludis::TestEnvironment::need_keys_added ( ) const
protectedvirtual

This method will be called before any of the metadata key iteration methods does its work. It can be used by subclasses to implement as-needed loading of keys.

Implements paludis::MetadataKeyHolder.

virtual HookResult paludis::TestEnvironment::perform_hook ( const Hook ,
const std::shared_ptr< OutputManager > &  optional_output_manager 
) const
virtual

Perform a hook.

Since
0.53 takes optional_output_manager

Implements paludis::Environment.

virtual const std::shared_ptr<const MetadataValueKey<FSPath> > paludis::TestEnvironment::preferred_root_key ( ) const
virtual

The preferred_root_key, which must not be null, specifies the preferred filesystem root for actions.

Since
0.54

Implements paludis::Environment.

virtual gid_t paludis::TestEnvironment::reduced_gid ( ) const
virtual

Group id to use when reduced privs are permissible.

Implements paludis::Environment.

virtual uid_t paludis::TestEnvironment::reduced_uid ( ) const
virtual

User id to use when reduced privs are permissible.

Implements paludis::Environment.

virtual bool paludis::TestEnvironment::remove_from_world ( const QualifiedPackageName ) const
virtual

Remove this package from world, if it is present.

Returns
whether anything was removed
Since
0.49

Implements paludis::Environment.

virtual bool paludis::TestEnvironment::remove_from_world ( const SetName ) const
virtual

Remove this set from world, if it is present.

Returns
whether anything was removed
Since
0.49

Implements paludis::Environment.

virtual const std::shared_ptr<Repository> paludis::TestEnvironment::repository_from_new_config_file ( const FSPath )
virtual

Create a repository from a particular file.

Does not add the repository to the Environment.

This allows RepositoryRepository to add a repo config file, then sync that repo. If you aren't RepositoryRepository you shouldn't be calling this.

Since
0.48

Implements paludis::Environment.

virtual const std::shared_ptr<const MetadataValueKey<FSPath> > paludis::TestEnvironment::system_root_key ( ) const
virtual

The system_root_key, which must not be null, specifies the filesystem root for dependencies etc. This is usually "/", unless something funky is going on.

Since
0.55

Implements paludis::Environment.

virtual bool paludis::TestEnvironment::unmasked_by_user ( const std::shared_ptr< const PackageID > &  ,
const std::string &   
) const
virtual

Do we have a user unmask for a particular package?

This is only applied to repository and profile style masks, not keywords, licences etc. If true, user_mask shouldn't be used.

Used by PackageID implementations. Generally PackageID's masks methods should be used rather than calling this directly.

Since
0.58 takes id by shared_ptr
0.60 takes optional extra reason string

Implements paludis::Environment.

virtual void paludis::TestEnvironment::update_config_files_for_package_move ( const PackageDepSpec ,
const QualifiedPackageName  
) const
virtual

Where possible, update configuration files with the first spec to use the second package name.

Does not necessarily invalidate any in-memory configuration.

Since
0.48

Implements paludis::Environment.

virtual const std::string paludis::TestEnvironment::value_for_choice_parameter ( const std::shared_ptr< const PackageID > &  ,
const std::shared_ptr< const Choice > &  ,
const UnprefixedChoiceName  
) const
virtual

What string value, if any, is set for the parameter for a particular choice for a particular package?

There is no difference between "not set" and "set to an empty string".

Only for use by Repository, to get defaults from the environment. Clients should query the metadata key directly.

The third parameter is the name of the value, which might not have been created yet.

Since
0.40

Implements paludis::Environment.

virtual const Tribool paludis::TestEnvironment::want_choice_enabled ( const std::shared_ptr< const PackageID > &  ,
const std::shared_ptr< const Choice > &  ,
const UnprefixedChoiceName  
) const
virtual

Do we want a choice enabled for a particular package?

Only for use by Repository, to get defaults from the environment. Clients should query the metadata key directly.

The third parameter is the name of the value, which might not have been created yet.

Implements paludis::Environment.


The documentation for this class was generated from the following file: