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 00085 bool isSrc() const; 00089 bool isPatchRpm() const; 00093 bool isDeltaRpm() const; 00094 00095 public: 00096 00097 std::string tag_name() const; 00098 std::string tag_epoch() const; 00099 std::string tag_version() const; 00100 std::string tag_release() const; 00101 std::string tag_arch() const; 00102 00107 Edition tag_edition() const; 00108 00109 Date tag_installtime() const; 00110 Date tag_buildtime() const; 00111 00115 CapSet tag_provides ( std::set<std::string> * freq_r = 0 ) const; 00119 CapSet tag_requires ( std::set<std::string> * freq_r = 0 ) const; 00123 CapSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const; 00127 CapSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const; 00131 CapSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const; 00135 CapSet tag_enhances( std::set<std::string> * freq_r = 0 ) const; 00139 CapSet tag_supplements( std::set<std::string> * freq_r = 0 ) const; 00140 00141 ByteCount tag_size() const; 00142 ByteCount tag_archivesize() const; 00143 00144 std::string tag_summary() const; 00145 std::string tag_description() const; 00146 std::string tag_group() const; 00147 std::string tag_vendor() const; 00148 std::string tag_distribution() const; 00149 std::string tag_license() const; 00150 std::string tag_buildhost() const; 00151 std::string tag_packager() const; 00152 std::string tag_url() const; 00153 std::string tag_os() const; 00154 std::string tag_prein() const; 00155 std::string tag_postin() const; 00156 std::string tag_preun() const; 00157 std::string tag_postun() const; 00158 std::string tag_sourcerpm() const; 00159 00161 std::list<std::string> tag_filenames() const; 00162 00167 std::list<FileInfo> tag_fileinfos() const; 00168 00169 Changelog tag_changelog() const; 00170 00174 DiskUsage & tag_du( DiskUsage & dudata_r ) const; 00175 00176 public: 00177 00178 virtual std::ostream & dumpOn( std::ostream & str ) const; 00179 00180 public: 00181 00185 enum VERIFICATION { 00186 VERIFY = 0x0000, 00187 NODIGEST = (1<<0), 00188 NOSIGNATURE = (1<<1), 00189 NOVERIFY = 0xffff 00190 }; 00191 00196 static RpmHeader::constPtr readPackage( const Pathname & path, 00197 VERIFICATION verification = VERIFY ); 00198 }; 00199 00201 } // namespace rpm 00202 } // namespace target 00203 } // namespace zypp 00204 00205 #endif // ZYPP_TARGET_RPM_RPMHEADER_H 00206
1.4.6