libzypp  17.1.1
Target.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <cassert>
13 
14 #include <iostream>
15 
16 #include "zypp/Target.h"
17 #include "zypp/target/TargetImpl.h"
18 
19 using namespace std;
20 
22 namespace zypp
23 {
24 
25  IMPL_PTR_TYPE(Target);
26 
28  //
29  // METHOD NAME : Target::Target
30  // METHOD TYPE : Ctor
31  //
32  Target::Target( const Pathname & root, bool doRebuild_r )
33  : _pimpl( new Impl(root,doRebuild_r) )
34  {
35  }
36 
38  //
39  // METHOD NAME : Target::Target
40  // METHOD TYPE : Ctor
41  //
42  Target::Target( const Impl_Ptr & impl_r )
43  : _pimpl( impl_r )
44  {
45  assert( impl_r );
46  }
47 
48  std::ostream & operator<<( std::ostream & str, const Target::DistributionLabel & obj )
49  {
50  str << "summary=" << obj.summary << endl;
51  str << "shortName=" << obj.shortName << endl;
52  return str;
53  }
54 
56  //
57  // Forward to TargetImpl:
58  //
60 
62  { _pimpl->buildCache(); }
63 
65  { _pimpl->clearCache(); }
66 
67  void Target::load()
68  { _pimpl->load(); }
69 
71  { _pimpl->reload(); }
72 
74  { _pimpl->unload(); }
75 
77  { return _pimpl->rpm(); }
78 
80  { return _pimpl->root(); }
81 
82  bool Target::providesFile (const std::string & name_str, const std::string & path_str) const
83  { return _pimpl->providesFile (name_str, path_str); }
84 
85  std::string Target::whoOwnsFile (const std::string & path_str) const
86  { return _pimpl->whoOwnsFile (path_str); }
87 
88  std::ostream & Target::dumpOn( std::ostream & str ) const
89  { return _pimpl->dumpOn( str ); }
90 
92  { return _pimpl->timestamp(); }
93 
95  { return _pimpl->baseProduct(); }
96 
98  { return _pimpl->requestedLocales(); }
100  { return target::TargetImpl::requestedLocales( root_r ); }
101 
103  { return _pimpl->updateAutoInstalled(); }
104 
105  std::string Target::targetDistribution() const
106  { return _pimpl->targetDistribution(); }
107  std::string Target::targetDistribution( const Pathname & root_r )
108  { return target::TargetImpl::targetDistribution( root_r ); }
109 
111  { return _pimpl->targetDistributionRelease(); }
112  std::string Target::targetDistributionRelease( const Pathname & root_r )
114 
116  { return _pimpl->targetDistributionFlavor(); }
117  std::string Target::targetDistributionFlavor( const Pathname & root_r )
119 
121  { return _pimpl->distributionLabel(); }
123  { return target::TargetImpl::distributionLabel( root_r ); }
124 
125  std::string Target::distributionVersion() const
126  { return _pimpl->distributionVersion(); }
127  std::string Target::distributionVersion( const Pathname & root_r )
128  { return target::TargetImpl::distributionVersion( root_r ); }
129 
130  std::string Target::distributionFlavor() const
131  { return _pimpl->distributionFlavor(); }
132  std::string Target::distributionFlavor( const Pathname & root_r )
133  { return target::TargetImpl::distributionFlavor( root_r ); }
134 
135  std::string Target::anonymousUniqueId() const
136  { return _pimpl->anonymousUniqueId(); }
137  std::string Target::anonymousUniqueId( const Pathname & root_r )
138  { return target::TargetImpl::anonymousUniqueId( root_r ); }
139 
141 } // namespace zypp
std::string targetDistribution() const
This is register.target attribute of the installed base product.
Definition: Target.cc:105
Interface to the rpm program.
Definition: RpmDb.h:47
std::string distributionVersion() const
This is version attribute of the installed base product.
Definition: Target.cc:125
void cleanCache()
cleans the target cache (.solv files)
Definition: Target.cc:64
bool providesFile(const std::string &name_str, const std::string &path_str) const
If the package is installed and provides the file Needed to evaluate split provides during Resolver::...
Definition: Target.cc:82
void reload()
Definition: Target.cc:70
String related utilities and Regular expression matching.
Definition: Arch.h:344
TraitsType::constPtrType constPtr
Definition: Product.h:38
std::string targetDistributionFlavor() const
This is register.flavor attribute of the installed base product.
Definition: TargetImpl.cc:1744
std::string whoOwnsFile(const std::string &path_str) const
Return name of package owning path_str or empty string if no installed package owns path_str...
Definition: Target.cc:85
target::rpm::RpmDb & rpmDb()
Refference to the RPM database.
Definition: Target.cc:76
std::string targetDistributionRelease() const
This is register.release attribute of the installed base product.
Definition: TargetImpl.cc:1738
std::string distributionVersion() const
This is version attribute of the installed base product.
Definition: TargetImpl.cc:1768
LocaleSet requestedLocales() const
Languages to be supported by the system.
Definition: TargetImpl.h:160
Store and operate on date (time_t).
Definition: Date.h:32
Base class for concrete Target implementations.
Definition: TargetImpl.h:53
LocaleSet requestedLocales() const
Languages to be supported by the system.
Definition: Target.cc:97
RW_pointer< Impl, rw_pointer::Intrusive< Impl > > _pimpl
Pointer to implementation.
Definition: Target.h:227
Product::constPtr baseProduct() const
returns the target base installed product, also known as the distribution or platform.
Definition: Target.cc:94
intrusive_ptr< Impl > Impl_Ptr
Definition: Target.h:53
std::string targetDistribution() const
This is register.target attribute of the installed base product.
Definition: TargetImpl.cc:1732
void buildCache()
builds or refreshes the target cache
Definition: Target.cc:61
std::string anonymousUniqueId() const
anonymous unique id
Definition: TargetImpl.cc:1835
std::string targetDistributionRelease() const
This is register.release attribute of the installed base product.
Definition: Target.cc:110
Date timestamp() const
return the last modification date of the target
Definition: Target.cc:91
void load()
load resolvables into the pool
Definition: Target.cc:67
void unload()
unload target resolvables from the pool
Definition: Target.cc:73
DistributionLabel distributionLabel() const
This is shortName and summary attribute of the installed base product.
Definition: Target.cc:120
Target(const Pathname &root="/", bool doRebuild_r=false)
Ctor.
Definition: Target.cc:32
friend std::ostream & operator<<(std::ostream &str, const Target &obj)
std::ostream & dumpOn(std::ostream &str) const
Stream output.
Definition: Target.cc:88
std::string anonymousUniqueId() const
anonymous unique id
Definition: Target.cc:135
Target::DistributionLabel distributionLabel() const
This is shortName and summary attribute of the installed base product.
Definition: TargetImpl.cc:1750
std::string distributionFlavor() const
This is flavor attribute of the installed base product but does not require the target to be loaded a...
Definition: TargetImpl.cc:1809
void updateAutoInstalled()
Update the database of autoinstalled packages.
Definition: Target.cc:102
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
std::string distributionFlavor() const
This is flavor attribute of the installed base product but does not require the target to be loaded a...
Definition: Target.cc:130
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
Pathname root() const
Return the root set for this target.
Definition: Target.cc:79
#define IMPL_PTR_TYPE(NAME)
std::string targetDistributionFlavor() const
This is register.flavor attribute of the installed base product.
Definition: Target.cc:115