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/CapSetFwd.h" 00023 #include "zypp/Pathname.h" 00024 #include "zypp/DiskUsage.h" 00025 00026 namespace zypp { 00027 namespace target { 00028 namespace rpm { 00029 00030 00031 typedef struct { 00032 Pathname filename; 00033 ByteCount size; 00034 std::string md5sum; 00035 uid_t uid; 00036 gid_t gid; 00037 mode_t mode; 00038 time_t mtime; 00039 bool ghost; 00040 Pathname link_target; 00041 } FileInfo; 00042 00044 // 00045 // CLASS NAME : RpmHeader 00058 class RpmHeader : public BinHeader { 00059 public: 00060 typedef intrusive_ptr<RpmHeader> Ptr; 00061 typedef intrusive_ptr<const RpmHeader> constPtr; 00062 00063 private: 00064 00065 CapSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const; 00066 00067 public: 00068 00072 RpmHeader( Header h_r = 0 ); 00073 00078 RpmHeader( BinHeader::Ptr & rhs ); 00079 00080 virtual ~RpmHeader(); 00081 00082 bool isSrc() const; 00083 00084 public: 00085 00086 std::string tag_name() const; 00087 std::string tag_epoch() const; 00088 std::string tag_version() const; 00089 std::string tag_release() const; 00090 std::string tag_arch() const; 00091 00096 Edition tag_edition() const; 00097 00098 Date tag_installtime() const; 00099 Date tag_buildtime() const; 00100 00104 CapSet tag_provides ( std::set<std::string> * freq_r = 0 ) const; 00108 CapSet tag_requires ( std::set<std::string> * freq_r = 0 ) const; 00112 CapSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const; 00116 CapSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const; 00120 CapSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const; 00124 CapSet tag_enhances( std::set<std::string> * freq_r = 0 ) const; 00128 CapSet tag_supplements( std::set<std::string> * freq_r = 0 ) const; 00129 00130 ByteCount tag_size() const; 00131 ByteCount tag_archivesize() const; 00132 00133 std::string tag_summary() const; 00134 std::string tag_description() const; 00135 std::string tag_group() const; 00136 std::string tag_vendor() const; 00137 std::string tag_distribution() const; 00138 std::string tag_license() const; 00139 std::string tag_buildhost() const; 00140 std::string tag_packager() const; 00141 std::string tag_url() const; 00142 std::string tag_os() const; 00143 std::string tag_prein() const; 00144 std::string tag_postin() const; 00145 std::string tag_preun() const; 00146 std::string tag_postun() const; 00147 std::string tag_sourcerpm() const; 00148 00150 std::list<std::string> tag_filenames() const; 00151 00156 std::list<FileInfo> tag_fileinfos() const; 00157 00158 Changelog tag_changelog() const; 00159 00163 DiskUsage & tag_du( DiskUsage & dudata_r ) const; 00164 00165 public: 00166 00167 virtual std::ostream & dumpOn( std::ostream & str ) const; 00168 00169 public: 00170 00174 enum VERIFICATION { 00175 VERIFY = 0x0000, 00176 NODIGEST = (1<<0), 00177 NOSIGNATURE = (1<<1), 00178 NOVERIFY = 0xffff 00179 }; 00180 00185 static RpmHeader::constPtr readPackage( const Pathname & path, 00186 VERIFICATION verification = VERIFY ); 00187 }; 00188 00190 } // namespace rpm 00191 } // namespace target 00192 } // namespace zypp 00193 00194 #endif // ZYPP_TARGET_RPM_RPMHEADER_H 00195