libzypp 17.37.10

RpmHeader.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_TARGET_RPM_RPMHEADER_H
13#define ZYPP_TARGET_RPM_RPMHEADER_H
14
15#include <iosfwd>
16#include <list>
17#include <utility>
18
19#include <zypp/target/rpm/BinHeader.h>
20
21#include <zypp/Package.h>
22#include <zypp/Changelog.h>
23#include <zypp/Pathname.h>
24
25
26 namespace zypp
27{
28 namespace target
29{
30 namespace rpm
31{
32
33 struct FileInfo
34{
35 Pathname filename;
36 ByteCount size;
37 std::string md5sum;
38 uid_t uid;
39 gid_t gid;
40 mode_t mode;
41 time_t mtime;
42 bool ghost;
43 Pathname link_target;
44};
45
47//
48// CLASS NAME : RpmHeader
61 class ZYPP_API RpmHeader : public BinHeader
62{
63 public:
64 using Ptr = intrusive_ptr<RpmHeader>;
65 using constPtr = intrusive_ptr<const RpmHeader>;
66
67 private:
68
69 CapabilitySet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const;
70
71 public:
72
76 RpmHeader( Header h_r = 0 );
77
82 RpmHeader( BinHeader::Ptr & rhs );
83
84 ~RpmHeader() override;
85
86 bool isSrc() const;
87 bool isNosrc() const;
88
89 std::string ident() const;
90
91 public:
92
93 std::string tag_name() const;
94 Edition::epoch_t tag_epoch() const;
95 std::string tag_version() const;
96 std::string tag_release() const;
97 Edition tag_edition() const;
98 Arch tag_arch() const;
99
100 Date tag_installtime() const;
101 Date tag_buildtime() const;
102
106 CapabilitySet tag_provides ( std::set<std::string> * freq_r = 0 ) const;
110 CapabilitySet tag_requires ( std::set<std::string> * freq_r = 0 ) const;
114 CapabilitySet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const;
118 CapabilitySet tag_conflicts( std::set<std::string> * freq_r = 0 ) const;
122 CapabilitySet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const;
126 CapabilitySet tag_enhances( std::set<std::string> * freq_r = 0 ) const;
130 CapabilitySet tag_suggests( std::set<std::string> * freq_r = 0 ) const;
134 CapabilitySet tag_supplements( std::set<std::string> * freq_r = 0 ) const;
138 CapabilitySet tag_recommends( std::set<std::string> * freq_r = 0 ) const;
139
140 ByteCount tag_size() const;
141 ByteCount tag_archivesize() const;
142
143 std::string tag_summary() const;
144 std::string tag_description() const;
145 std::string tag_group() const;
146 std::string tag_vendor() const;
147 std::string tag_distribution() const;
148 std::string tag_license() const;
149 std::string tag_buildhost() const;
150 std::string tag_packager() const;
151 std::string tag_url() const;
152 std::string tag_os() const;
153 std::string tag_prein() const;
154 std::string tag_preinprog() const;
155 std::string tag_postin() const;
156 std::string tag_postinprog() const;
157 std::string tag_preun() const;
158 std::string tag_preunprog() const;
159 std::string tag_postun() const;
160 std::string tag_postunprog() const;
161 std::string tag_pretrans() const;
162 std::string tag_pretransprog() const;
163 std::string tag_posttrans() const;
164 std::string tag_posttransprog()const;
165 std::string tag_sourcerpm() const;
166
171 std::string signatureKeyID() const;
172
174 std::list<std::string> tag_filenames() const;
175
180 std::list<FileInfo> tag_fileinfos() const;
181
182 Changelog tag_changelog() const;
183
184 public:
185
186 std::ostream & dumpOn( std::ostream & str ) const override;
187
188 public:
189
193 enum VERIFICATION
194 {
195 VERIFY = 0x0000,
196 NODIGEST = (1<<0),
197 NOSIGNATURE = (1<<1),
198 NOVERIFY = 0xffff
199 };
200
205 static RpmHeader::constPtr readPackage( const Pathname & path,
206 VERIFICATION verification = VERIFY );
207
212 static std::pair<RpmHeader::Ptr, int> readPackage( rpmts ts_r, const Pathname & path_r );
213};
214
216} // namespace rpm
217} // namespace target
218} // namespace zypp
219
220#endif // ZYPP_TARGET_RPM_RPMHEADER_H
221
BinHeader.h
Changelog.h
Package.h
intrusive_ptr
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::ByteCount
Store and operate with byte count.
Definition ByteCount.h:32
zypp::Date
Store and operate on date (time_t).
Definition Date.h:33
zypp::Edition
Edition represents [epoch:]version[-release]
Definition Edition.h:61
zypp::Edition::epoch_t
unsigned int epoch_t
Type of an epoch.
Definition Edition.h:64
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::target::rpm::BinHeader::Ptr
intrusive_ptr< BinHeader > Ptr
Definition BinHeader.h:48
zypp::target::rpm::BinHeader::BinHeader
BinHeader(Header h_r=0)
Definition BinHeader.cc:161
zypp::target::rpm::BinHeader::tag
rpmTag tag
Definition BinHeader.h:52
zypp::target::rpm::RpmHeader::ident
std::string ident() const
N-V-R.A or empty.
Definition RpmHeader.cc:299
zypp::target::rpm::RpmHeader::tag_requires
CapabilitySet tag_requires(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:577
zypp::target::rpm::RpmHeader::tag_vendor
std::string tag_vendor() const
Definition RpmHeader.cc:762
zypp::target::rpm::RpmHeader::tag_recommends
CapabilitySet tag_recommends(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:680
zypp::target::rpm::RpmHeader::tag_prein
std::string tag_prein() const
Definition RpmHeader.cc:846
zypp::target::rpm::RpmHeader::tag_epoch
Edition::epoch_t tag_epoch() const
Definition RpmHeader.cc:329
zypp::target::rpm::RpmHeader::tag_pretrans
std::string tag_pretrans() const
Definition RpmHeader.cc:870
zypp::target::rpm::RpmHeader::tag_supplements
CapabilitySet tag_supplements(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:663
zypp::target::rpm::RpmHeader::constPtr
intrusive_ptr< const RpmHeader > constPtr
Definition RpmHeader.h:65
zypp::target::rpm::RpmHeader::tag_archivesize
ByteCount tag_archivesize() const
Definition RpmHeader.cc:710
zypp::target::rpm::RpmHeader::RpmHeader
RpmHeader(Header h_r=0)
Definition RpmHeader.cc:181
zypp::target::rpm::RpmHeader::tag_obsoletes
CapabilitySet tag_obsoletes(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:616
zypp::target::rpm::RpmHeader::isNosrc
bool isNosrc() const
Only 'nosrc'.
Definition RpmHeader.cc:294
zypp::target::rpm::RpmHeader::tag_summary
std::string tag_summary() const
Definition RpmHeader.cc:723
zypp::target::rpm::RpmHeader::tag_preunprog
std::string tag_preunprog() const
Definition RpmHeader.cc:861
zypp::target::rpm::RpmHeader::tag_os
std::string tag_os() const
Definition RpmHeader.cc:840
zypp::target::rpm::RpmHeader::tag_version
std::string tag_version() const
Definition RpmHeader.cc:342
zypp::target::rpm::RpmHeader::tag_postun
std::string tag_postun() const
Definition RpmHeader.cc:864
zypp::target::rpm::RpmHeader::tag_prerequires
CapabilitySet tag_prerequires(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:590
zypp::target::rpm::RpmHeader::tag_provides
CapabilitySet tag_provides(std::set< std::string > *freq_r=0) const
If freq_r is not NULL, file dependencies found are inserted.
Definition RpmHeader.cc:564
zypp::target::rpm::RpmHeader::Ptr
intrusive_ptr< RpmHeader > Ptr
Definition RpmHeader.h:64
zypp::target::rpm::RpmHeader::dumpOn
std::ostream & dumpOn(std::ostream &str) const override
Overload to realize std::ostream & operator<<.
Definition RpmHeader.cc:271
zypp::target::rpm::RpmHeader::tag_installtime
Date tag_installtime() const
Definition RpmHeader.cc:394
zypp::target::rpm::RpmHeader::tag_description
std::string tag_description() const
Definition RpmHeader.cc:736
zypp::target::rpm::RpmHeader::tag_name
std::string tag_name() const
Definition RpmHeader.cc:316
zypp::target::rpm::RpmHeader::tag_pretransprog
std::string tag_pretransprog() const
Definition RpmHeader.cc:873
zypp::target::rpm::RpmHeader::tag_buildhost
std::string tag_buildhost() const
Definition RpmHeader.cc:801
zypp::target::rpm::RpmHeader::tag_edition
Edition tag_edition() const
Definition RpmHeader.cc:368
zypp::target::rpm::RpmHeader::tag_preinprog
std::string tag_preinprog() const
Definition RpmHeader.cc:849
zypp::target::rpm::RpmHeader::tag_url
std::string tag_url() const
Definition RpmHeader.cc:827
zypp::target::rpm::RpmHeader::tag_changelog
Changelog tag_changelog() const
Definition RpmHeader.cc:1032
zypp::target::rpm::RpmHeader::tag_posttransprog
std::string tag_posttransprog() const
Definition RpmHeader.cc:879
zypp::target::rpm::RpmHeader::PkgRelList_val
CapabilitySet PkgRelList_val(tag tag_r, bool pre, std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:420
zypp::target::rpm::RpmHeader::signatureKeyID
std::string signatureKeyID() const
Uses headerFormat to query the signature info from the header.
Definition RpmHeader.cc:895
zypp::target::rpm::RpmHeader::tag_postunprog
std::string tag_postunprog() const
Definition RpmHeader.cc:867
zypp::target::rpm::RpmHeader::tag_distribution
std::string tag_distribution() const
Definition RpmHeader.cc:775
zypp::target::rpm::RpmHeader::tag_postinprog
std::string tag_postinprog() const
Definition RpmHeader.cc:855
zypp::target::rpm::RpmHeader::tag_group
std::string tag_group() const
Definition RpmHeader.cc:749
zypp::target::rpm::RpmHeader::tag_license
std::string tag_license() const
Definition RpmHeader.cc:788
zypp::target::rpm::RpmHeader::tag_sourcerpm
std::string tag_sourcerpm() const
Definition RpmHeader.cc:890
zypp::target::rpm::RpmHeader::tag_conflicts
CapabilitySet tag_conflicts(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:603
zypp::target::rpm::RpmHeader::tag_size
ByteCount tag_size() const
Definition RpmHeader.cc:697
zypp::target::rpm::RpmHeader::tag_buildtime
Date tag_buildtime() const
Definition RpmHeader.cc:407
zypp::target::rpm::RpmHeader::tag_packager
std::string tag_packager() const
Definition RpmHeader.cc:814
zypp::target::rpm::RpmHeader::tag_release
std::string tag_release() const
Definition RpmHeader.cc:355
zypp::target::rpm::RpmHeader::isSrc
bool isSrc() const
Either 'src' or 'nosrc'.
Definition RpmHeader.cc:289
zypp::target::rpm::RpmHeader::tag_preun
std::string tag_preun() const
Definition RpmHeader.cc:858
zypp::target::rpm::RpmHeader::tag_suggests
CapabilitySet tag_suggests(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:646
zypp::target::rpm::RpmHeader::tag_arch
Arch tag_arch() const
Definition RpmHeader.cc:381
zypp::target::rpm::RpmHeader::tag_postin
std::string tag_postin() const
Definition RpmHeader.cc:852
zypp::target::rpm::RpmHeader::tag_fileinfos
std::list< FileInfo > tag_fileinfos() const
complete information about the files (extended version of tag_filenames())
Definition RpmHeader.cc:951
zypp::target::rpm::RpmHeader::tag_posttrans
std::string tag_posttrans() const
Definition RpmHeader.cc:876
zypp::target::rpm::RpmHeader::VERIFICATION
VERIFICATION
Digest and signature verification flags.
Definition RpmHeader.h:194
zypp::target::rpm::RpmHeader::NOSIGNATURE
@ NOSIGNATURE
Definition RpmHeader.h:197
zypp::target::rpm::RpmHeader::VERIFY
@ VERIFY
Definition RpmHeader.h:195
zypp::target::rpm::RpmHeader::NOVERIFY
@ NOVERIFY
Definition RpmHeader.h:198
zypp::target::rpm::RpmHeader::NODIGEST
@ NODIGEST
Definition RpmHeader.h:196
zypp::target::rpm::RpmHeader::tag_enhances
CapabilitySet tag_enhances(std::set< std::string > *freq_r=0) const
Definition RpmHeader.cc:629
zypp::target::rpm::RpmHeader::tag_filenames
std::list< std::string > tag_filenames() const
just the list of names
Definition RpmHeader.cc:923
str
String related utilities and Regular expression matching.
zypp::target::rpm
Definition KeyRing.h:327
zypp::target
Definition KeyRing.h:325
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::CapabilitySet
std::unordered_set< Capability > CapabilitySet
Definition Capability.h:35
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
zypp::Changelog
std::list< ChangelogEntry > Changelog
List of ChangelogEntry.
Definition Changelog.h:55
zypp::target::rpm::FileInfo
Definition RpmHeader.h:34
zypp::target::rpm::FileInfo::filename
Pathname filename
Definition RpmHeader.h:35
zypp::target::rpm::FileInfo::md5sum
std::string md5sum
Definition RpmHeader.h:37
zypp::target::rpm::FileInfo::ghost
bool ghost
Definition RpmHeader.h:42
zypp::target::rpm::FileInfo::mode
mode_t mode
Definition RpmHeader.h:40
zypp::target::rpm::FileInfo::size
ByteCount size
Definition RpmHeader.h:36
zypp::target::rpm::FileInfo::uid
uid_t uid
Definition RpmHeader.h:38
zypp::target::rpm::FileInfo::mtime
time_t mtime
Definition RpmHeader.h:41
zypp::target::rpm::FileInfo::gid
gid_t gid
Definition RpmHeader.h:39
zypp::target::rpm::FileInfo::link_target
Pathname link_target
Definition RpmHeader.h:43
Pathname.h