libzypp 9.41.1
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_TARGET_RPM_RPMHEADER_H 00013 #define ZYPP_TARGET_RPM_RPMHEADER_H 00014 00015 #include <iosfwd> 00016 #include <list> 00017 00018 #include "zypp/target/rpm/BinHeader.h" 00019 00020 #include "zypp/Package.h" 00021 #include "zypp/Changelog.h" 00022 #include "zypp/Pathname.h" 00023 #include "zypp/DiskUsage.h" 00024 00025 00026 namespace zypp 00027 { 00028 namespace target 00029 { 00030 namespace rpm 00031 { 00032 00033 struct FileInfo 00034 { 00035 Pathname filename; 00036 ByteCount size; 00037 std::string md5sum; 00038 uid_t uid; 00039 gid_t gid; 00040 mode_t mode; 00041 time_t mtime; 00042 bool ghost; 00043 Pathname link_target; 00044 }; 00045 00047 // 00048 // CLASS NAME : RpmHeader 00061 class RpmHeader : public BinHeader 00062 { 00063 public: 00064 typedef intrusive_ptr<RpmHeader> Ptr; 00065 typedef intrusive_ptr<const RpmHeader> constPtr; 00066 00067 private: 00068 00069 CapabilitySet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const; 00070 00071 public: 00072 00076 RpmHeader( Header h_r = 0 ); 00077 00082 RpmHeader( BinHeader::Ptr & rhs ); 00083 00084 virtual ~RpmHeader(); 00085 00086 bool isSrc() const; //< Either 'src' or 'nosrc' 00087 bool isNosrc() const; //< Only 'nosrc' 00088 00089 public: 00090 00091 std::string tag_name() const; 00092 Edition::epoch_t tag_epoch() const; 00093 std::string tag_version() const; 00094 std::string tag_release() const; 00095 Edition tag_edition() const; 00096 Arch tag_arch() const; 00097 00098 Date tag_installtime() const; 00099 Date tag_buildtime() const; 00100 00104 CapabilitySet tag_provides ( std::set<std::string> * freq_r = 0 ) const; 00108 CapabilitySet tag_requires ( std::set<std::string> * freq_r = 0 ) const; 00112 CapabilitySet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const; 00116 CapabilitySet tag_conflicts( std::set<std::string> * freq_r = 0 ) const; 00120 CapabilitySet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const; 00124 CapabilitySet tag_enhances( std::set<std::string> * freq_r = 0 ) const; 00128 CapabilitySet tag_suggests( std::set<std::string> * freq_r = 0 ) const; 00132 CapabilitySet tag_supplements( std::set<std::string> * freq_r = 0 ) const 00133 { return CapabilitySet(); } 00134 00135 ByteCount tag_size() const; 00136 ByteCount tag_archivesize() const; 00137 00138 std::string tag_summary() const; 00139 std::string tag_description() const; 00140 std::string tag_group() const; 00141 std::string tag_vendor() const; 00142 std::string tag_distribution() const; 00143 std::string tag_license() const; 00144 std::string tag_buildhost() const; 00145 std::string tag_packager() const; 00146 std::string tag_url() const; 00147 std::string tag_os() const; 00148 std::string tag_prein() const; 00149 std::string tag_postin() const; 00150 std::string tag_preun() const; 00151 std::string tag_postun() const; 00152 std::string tag_sourcerpm() const; 00153 00155 std::list<std::string> tag_filenames() const; 00156 00161 std::list<FileInfo> tag_fileinfos() const; 00162 00163 Changelog tag_changelog() const; 00164 00168 DiskUsage & tag_du( DiskUsage & dudata_r ) const; 00169 00170 public: 00171 00172 virtual std::ostream & dumpOn( std::ostream & str ) const; 00173 00174 public: 00175 00179 enum VERIFICATION 00180 { 00181 VERIFY = 0x0000, 00182 NODIGEST = (1<<0), 00183 NOSIGNATURE = (1<<1), 00184 NOVERIFY = 0xffff 00185 }; 00186 00191 static RpmHeader::constPtr readPackage( const Pathname & path, 00192 VERIFICATION verification = VERIFY ); 00193 }; 00194 00196 } // namespace rpm 00197 } // namespace target 00198 } // namespace zypp 00199 00200 #endif // ZYPP_TARGET_RPM_RPMHEADER_H 00201