00001
00002
00003
00004
00005
00006
00007
00008
00013 #include "zypp/source/yum/YUMPackageImpl.h"
00014 #include "zypp/base/String.h"
00015 #include "zypp/base/Logger.h"
00016
00017 using namespace std;
00018 using namespace zypp::detail;
00019 using namespace zypp::parser::yum;
00020
00022 namespace zypp
00023 {
00024
00025 namespace source
00026 {
00027 namespace yum
00028 {
00030
00031
00032
00034
00037 YUMPackageImpl::YUMPackageImpl(
00038 Source_Ref source_r,
00039 const zypp::parser::yum::YUMPrimaryData & parsed,
00040 const zypp::parser::yum::YUMFileListData & filelist,
00041 const zypp::parser::yum::YUMOtherData & other
00042 )
00043 : _summary(parsed.summary),
00044 _description(parsed.description),
00045 _license_to_confirm(parsed.license_to_confirm),
00046 _buildtime(str::strtonum<time_t>(parsed.timeBuild)),
00047 _buildhost(parsed.buildhost),
00048 _url(parsed.url),
00049 _vendor( parsed.vendor),
00050 _license( parsed.license),
00051 _packager(parsed.packager),
00052 _group(parsed.group),
00053 _changelog(),
00054 _type(parsed.type),
00055 _authors(parsed.authors),
00056 _keywords( parsed.keywords),
00057 _mediaNumber(str::strtonum<unsigned int>(parsed.media)),
00058 _checksum(parsed.checksumType,
00059 parsed.checksum),
00060 _filenames(),
00061 _location(parsed.location),
00062 _delta_rpms(),
00063 _patch_rpms(),
00064 _install_only(parsed.installOnly),
00065 _package_size(str::strtonum<unsigned int>(parsed.sizePackage)),
00066 _size(str::strtonum<unsigned int>(parsed.sizeInstalled)),
00067 _source(source_r)
00068 #if 0
00069 :
00070 _size_package(strtol(parsed.sizePackage.c_str(), 0, 10)),
00071 _size_archive(strtol(parsed.sizeArchive.c_str(), 0, 10)),
00072 _size_installed(strtol(parsed.sizeInstalled.c_str(), 0, 10)),
00073 _sourcepkg(parsed.sourcerpm),
00074 _dir_sizes(parsed.dirSizes),
00075 #endif
00076 {
00077 for (std::list<FileData>::const_iterator it = filelist.files.begin();
00078 it != filelist.files.end();
00079 it++)
00080 {
00081 _filenames.push_back(it->name);
00082 }
00083 for (std::list<zypp::parser::yum::ChangelogEntry>::const_iterator
00084 it = other.changelog.begin();
00085 it != other.changelog.end();
00086 it++)
00087 {
00088 _changelog.push_back(ChangelogEntry(strtol(it->date.c_str(), 0, 10),
00089 it->author,
00090 it->entry));
00091 }
00092 }
00093
00095 TranslatedText YUMPackageImpl::summary() const
00096 {
00097 return _summary;
00098 }
00099
00101 TranslatedText YUMPackageImpl::description() const
00102 {
00103 return _description;
00104 }
00105
00107 TranslatedText YUMPackageImpl::licenseToConfirm() const
00108 {
00109 return _license_to_confirm;
00110 }
00111
00113 ByteCount YUMPackageImpl::size() const
00114 {
00115 return _size;
00116 }
00117
00119 Date YUMPackageImpl::buildtime() const
00120 {
00121 return _buildtime;
00122 }
00123
00125 std::string YUMPackageImpl::buildhost() const
00126 {
00127 return _buildhost;
00128 }
00129
00131 Date YUMPackageImpl::installtime() const
00132 {
00133 return PackageImplIf::installtime();
00134 }
00135
00137 std::string YUMPackageImpl::distribution() const
00138 #warning fixme
00139 {
00140 return string();
00141 }
00142
00144 Vendor YUMPackageImpl::vendor() const
00145 {
00146 return _vendor;
00147 }
00148
00150 Label YUMPackageImpl::license() const
00151 {
00152 return _license;
00153 }
00154
00156 std::string YUMPackageImpl::packager() const
00157 {
00158 return _packager;
00159 }
00160
00162 PackageGroup YUMPackageImpl::group() const
00163 {
00164 return _group;
00165 }
00166
00168 Changelog YUMPackageImpl::changelog() const
00169 {
00170 return _changelog;
00171 }
00172
00174 Pathname YUMPackageImpl::location() const
00175 {
00176 return _location;
00177 }
00178
00181 std::string YUMPackageImpl::url() const
00182 {
00183 return _url;
00184 }
00185
00187 std::string YUMPackageImpl::os() const
00188
00189 {
00190 return PackageImplIf::os();
00191 }
00192
00194 Text YUMPackageImpl::prein() const
00195
00196 {
00197 return PackageImplIf::prein();
00198 }
00199
00201 Text YUMPackageImpl::postin() const
00202
00203 {
00204 return PackageImplIf::postin();
00205 }
00206
00208 Text YUMPackageImpl::preun() const
00209
00210 {
00211 return PackageImplIf::preun();
00212 }
00213
00215 Text YUMPackageImpl::postun() const
00216
00217 {
00218 return PackageImplIf::postun();
00219 }
00220
00222 ByteCount YUMPackageImpl::sourcesize() const
00223 #warning fixme
00224 {
00225 return 0;
00226 }
00227
00229 ByteCount YUMPackageImpl::archivesize() const
00230 {
00231 return _package_size;
00232 }
00233
00235 std::list<std::string> YUMPackageImpl::authors() const
00236 {
00237 return _authors;
00238 }
00239
00241 std::list<std::string> YUMPackageImpl::filenames() const
00242 {
00243 return _filenames;
00244 }
00245
00247 std::string YUMPackageImpl::type() const
00248 {
00249 return _type;
00250 }
00251
00253 std::list<std::string> YUMPackageImpl::keywords() const
00254 {
00255 return _keywords;
00256 }
00257
00258 bool YUMPackageImpl::installOnly() const
00259 {
00260 return _install_only;
00261 }
00262
00263 unsigned YUMPackageImpl::sourceMediaNr() const
00264 {
00265 return _mediaNumber;
00266 }
00267
00268 CheckSum YUMPackageImpl::checksum() const
00269 {
00270 return _checksum;
00271 }
00272
00273 std::list<detail::PackageImplIf::DeltaRpm> YUMPackageImpl::deltaRpms() const
00274 {
00275 return _delta_rpms;
00276 }
00277
00278 std::list<detail::PackageImplIf::PatchRpm> YUMPackageImpl::patchRpms() const
00279 {
00280 return _patch_rpms;
00281 }
00282
00283 Source_Ref YUMPackageImpl::source() const
00284 {
00285 return _source;
00286 }
00287
00288 }
00290 }
00293 }