YUMPackageImpl.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
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       //        CLASS NAME : YUMPackageImpl
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), // TODO add to metadata
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(), // TODO
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       : _size_package(strtol(parsed.sizePackage.c_str(), 0, 10)),
00070         _size_archive(strtol(parsed.sizeArchive.c_str(), 0, 10)),
00071         _size_installed(strtol(parsed.sizeInstalled.c_str(), 0, 10)),
00072         _sourcepkg(parsed.sourcerpm),
00073         _dir_sizes(parsed.dirSizes),
00074 #endif
00075       {
00076         for (std::list<FileData>::const_iterator it = filelist.files.begin();
00077              it != filelist.files.end();
00078              it++)
00079         {
00080           _filenames.push_back(it->name);
00081         }
00082         for (std::list<zypp::parser::yum::ChangelogEntry>::const_iterator
00083                 it = other.changelog.begin();
00084              it != other.changelog.end();
00085              it++)
00086         {
00087           _changelog.push_back(ChangelogEntry(strtol(it->date.c_str(), 0, 10),
00088                                               it->author,
00089                                               it->entry));
00090         }
00091       }
00092 
00094       TranslatedText YUMPackageImpl::summary() const
00095       { return _summary; }
00096 
00098       TranslatedText YUMPackageImpl::description() const
00099       { return _description; }
00100 
00102       TranslatedText YUMPackageImpl::licenseToConfirm() const
00103       { return _license_to_confirm; }
00104 
00106       ByteCount YUMPackageImpl::size() const
00107       { return _size; }
00108 
00110       Date YUMPackageImpl::buildtime() const
00111       { return _buildtime; }
00112 
00114       std::string YUMPackageImpl::buildhost() const
00115       { return _buildhost; }
00116 
00118       Date YUMPackageImpl::installtime() const
00119       { return PackageImplIf::installtime(); }
00120 
00122       std::string YUMPackageImpl::distribution() const
00123 #warning fixme
00124       { return string(); }
00125 
00127       Vendor YUMPackageImpl::vendor() const
00128       { return _vendor; }
00129 
00131       Label YUMPackageImpl::license() const
00132       { return _license; }
00133 
00135       std::string YUMPackageImpl::packager() const
00136       { return _packager; }
00137 
00139       PackageGroup YUMPackageImpl::group() const
00140       { return _group; }
00141 
00143       Changelog YUMPackageImpl::changelog() const
00144       { return _changelog; }
00145 
00147       Pathname YUMPackageImpl::location() const
00148       { return _location; }
00149 
00152       std::string YUMPackageImpl::url() const
00153       { return _url; }
00154 
00156       std::string YUMPackageImpl::os() const
00157       // metadata doesn't priovide this attribute
00158       { return PackageImplIf::os(); }
00159 
00161       Text YUMPackageImpl::prein() const
00162       // metadata doesn't priovide this attribute
00163       { return PackageImplIf::prein(); }
00164 
00166       Text YUMPackageImpl::postin() const
00167       // metadata doesn't priovide this attribute
00168       { return PackageImplIf::postin(); }
00169 
00171       Text YUMPackageImpl::preun() const
00172       // metadata doesn't priovide this attribute
00173       { return PackageImplIf::preun(); }
00174 
00176       Text YUMPackageImpl::postun() const
00177       // metadata doesn't priovide this attribute
00178       { return PackageImplIf::postun(); }
00179 
00181       ByteCount YUMPackageImpl::sourcesize() const
00182 #warning fixme
00183       { return 0; }
00184 
00186       ByteCount YUMPackageImpl::archivesize() const
00187       { return _package_size; }
00188 
00190       std::list<std::string> YUMPackageImpl::authors() const
00191       { return _authors; }
00192 
00194       std::list<std::string> YUMPackageImpl::filenames() const
00195       { return _filenames; }
00196 
00198       std::string YUMPackageImpl::type() const
00199       { return _type; }
00200 
00202       std::list<std::string> YUMPackageImpl::keywords() const
00203       { return _keywords; }
00204 
00205       bool YUMPackageImpl::installOnly() const
00206       { return _install_only; }
00207 
00208       unsigned YUMPackageImpl::sourceMediaNr() const
00209       { return _mediaNumber; }
00210 
00211       CheckSum YUMPackageImpl::checksum() const
00212       { return _checksum; }
00213 
00214       std::list<detail::PackageImplIf::DeltaRpm> YUMPackageImpl::deltaRpms() const
00215       { return _delta_rpms; }
00216 
00217       std::list<detail::PackageImplIf::PatchRpm> YUMPackageImpl::patchRpms() const
00218       { return _patch_rpms; }
00219 
00220       Source_Ref YUMPackageImpl::source() const
00221       { return _source; }
00222 
00223     } // namespace yum
00225   } // namespace source
00228 } // namespace zypp

Generated on Thu Sep 14 15:38:46 2006 for zypp by  doxygen 1.4.6