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 #include "zypp/capability/CapabilityImpl.h" 00026 00027 00028 namespace zypp 00029 { 00030 namespace target 00031 { 00032 namespace rpm 00033 { 00034 00035 00036 typedef struct 00037 { 00038 Pathname filename; 00039 ByteCount size; 00040 std::string md5sum; 00041 uid_t uid; 00042 gid_t gid; 00043 mode_t mode; 00044 time_t mtime; 00045 bool ghost; 00046 Pathname link_target; 00047 } 00048 FileInfo; 00049 00051 // 00052 // CLASS NAME : RpmHeader 00065 class RpmHeader : public BinHeader 00066 { 00067 public: 00068 typedef intrusive_ptr<RpmHeader> Ptr; 00069 typedef intrusive_ptr<const RpmHeader> constPtr; 00070 00071 private: 00072 00073 capability::CapabilityImplPtrSet PkgRelList_val( tag tag_r, bool pre, std::set<std::string> * freq_r = 0 ) const; 00074 00075 public: 00076 00080 RpmHeader( Header h_r = 0 ); 00081 00086 RpmHeader( BinHeader::Ptr & rhs ); 00087 00088 virtual ~RpmHeader(); 00089 00090 bool isSrc() const; 00091 00092 public: 00093 00094 std::string tag_name() const; 00095 std::string tag_epoch() const; 00096 std::string tag_version() const; 00097 std::string tag_release() const; 00098 std::string tag_arch() const; 00099 00104 Edition tag_edition() const; 00105 00106 Date tag_installtime() const; 00107 Date tag_buildtime() const; 00108 00112 capability::CapabilityImplPtrSet tag_provides ( std::set<std::string> * freq_r = 0 ) const; 00116 capability::CapabilityImplPtrSet tag_requires ( std::set<std::string> * freq_r = 0 ) const; 00120 capability::CapabilityImplPtrSet tag_prerequires ( std::set<std::string> * freq_r = 0 ) const; 00124 capability::CapabilityImplPtrSet tag_conflicts( std::set<std::string> * freq_r = 0 ) const; 00128 capability::CapabilityImplPtrSet tag_obsoletes( std::set<std::string> * freq_r = 0 ) const; 00132 capability::CapabilityImplPtrSet tag_enhances( std::set<std::string> * freq_r = 0 ) const; 00136 capability::CapabilityImplPtrSet tag_supplements( std::set<std::string> * freq_r = 0 ) const; 00137 00138 ByteCount tag_size() const; 00139 ByteCount tag_archivesize() const; 00140 00141 std::string tag_summary() const; 00142 std::string tag_description() const; 00143 std::string tag_group() const; 00144 std::string tag_vendor() const; 00145 std::string tag_distribution() const; 00146 std::string tag_license() const; 00147 std::string tag_buildhost() const; 00148 std::string tag_packager() const; 00149 std::string tag_url() const; 00150 std::string tag_os() const; 00151 std::string tag_prein() const; 00152 std::string tag_postin() const; 00153 std::string tag_preun() const; 00154 std::string tag_postun() const; 00155 std::string tag_sourcerpm() const; 00156 00158 std::list<std::string> tag_filenames() const; 00159 00164 std::list<FileInfo> tag_fileinfos() const; 00165 00166 Changelog tag_changelog() const; 00167 00171 DiskUsage & tag_du( DiskUsage & dudata_r ) const; 00172 00173 public: 00174 00175 virtual std::ostream & dumpOn( std::ostream & str ) const; 00176 00177 public: 00178 00182 enum VERIFICATION 00183 { 00184 VERIFY = 0x0000, 00185 NODIGEST = (1<<0), 00186 NOSIGNATURE = (1<<1), 00187 NOVERIFY = 0xffff 00188 }; 00189 00194 static RpmHeader::constPtr readPackage( const Pathname & path, 00195 VERIFICATION verification = VERIFY ); 00196 }; 00197 00199 } // namespace rpm 00200 } // namespace target 00201 } // namespace zypp 00202 00203 #endif // ZYPP_TARGET_RPM_RPMHEADER_H 00204
1.5.3