1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/rpm/RPMPackageImpl.cc
13 #include "zypp/target/rpm/RpmPackageImpl.h"
14 #include "zypp/base/String.h"
15 #include "zypp/base/Logger.h"
21 using namespace zypp::detail;
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
28 { /////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////
33 // CLASS NAME : RPMPackageImpl
35 ///////////////////////////////////////////////////////////////////
38 RPMPackageImpl::RPMPackageImpl(
39 const RpmHeader::constPtr data
41 : _summary(data->tag_summary()),
43 _buildtime(data->tag_buildtime()),
44 _buildhost(data->tag_buildhost()),
45 _url(data->tag_url()),
46 _vendor(data->tag_vendor()),
47 _license(data->tag_license()),
48 _packager(data->tag_packager()),
49 _group(data->tag_group()),
50 _changelog(data->tag_changelog()),
51 _type("rpm"), // FIXME in the future
52 // _authors(data->authors),
53 // _keywords(data->keywords),
54 _filenames(data->tag_filenames())
56 : _size_package( strtol(parsed.sizePackage.c_str(), 0, 10)),
57 _size_archive( strtol(parsed.sizeArchive.c_str(), 0, 10)),
58 _size_installed( strtol(parsed.sizeInstalled.c_str(), 0, 10)),
59 _sourcepkg( parsed.sourcerpm),
60 _dir_sizes(parsed.dirSizes),
63 _description.push_back(data->tag_description());
67 /** Package summary */
68 Label RPMPackageImpl::summary() const
71 /** Package description */
72 Text RPMPackageImpl::description() const
73 { return _description; }
75 Text RPMPackageImpl::insnotify() const
76 // metadata doesn't priovide this attribute
77 { return ResObjectImplIf::insnotify(); }
79 Text RPMPackageImpl::delnotify() const
80 // metadata doesn't priovide this attribute
81 { return ResObjectImplIf::delnotify(); }
83 ByteCount RPMPackageImpl::size() const
86 bool RPMPackageImpl::providesSources() const
87 { return ResObjectImplIf::providesSources(); }
89 Label RPMPackageImpl::instSrcLabel() const
90 { return ResObjectImplIf::instSrcLabel(); }
92 Vendor RPMPackageImpl::instSrcVendor() const
93 { return ResObjectImplIf::instSrcVendor(); }
96 Date RPMPackageImpl::buildtime() const
97 { return _buildtime; }
100 std::string RPMPackageImpl::buildhost() const
101 { return _buildhost; }
104 Date RPMPackageImpl::installtime() const
105 { return PackageImplIf::installtime(); }
108 std::string RPMPackageImpl::distribution() const
112 Vendor RPMPackageImpl::vendor() const
116 Label RPMPackageImpl::license() const
120 std::string RPMPackageImpl::packager() const
121 { return _packager; }
124 PackageGroup RPMPackageImpl::group() const
128 Changelog RPMPackageImpl::changelog() const
129 { return _changelog; }
131 /** Don't ship it as class Url, because it might be
132 * in fact anything but a legal Url. */
133 std::string RPMPackageImpl::url() const
137 std::string RPMPackageImpl::os() const
138 // metadata doesn't priovide this attribute
139 { return PackageImplIf::os(); }
142 Text RPMPackageImpl::prein() const
143 // metadata doesn't priovide this attribute
144 { return PackageImplIf::prein(); }
147 Text RPMPackageImpl::postin() const
148 // metadata doesn't priovide this attribute
149 { return PackageImplIf::postin(); }
152 Text RPMPackageImpl::preun() const
153 // metadata doesn't priovide this attribute
154 { return PackageImplIf::preun(); }
157 Text RPMPackageImpl::postun() const
158 // metadata doesn't priovide this attribute
159 { return PackageImplIf::postun(); }
162 ByteCount RPMPackageImpl::sourcesize() const
166 ByteCount RPMPackageImpl::archivesize() const
170 Text RPMPackageImpl::authors() const
174 Text RPMPackageImpl::filenames() const
175 { return _filenames; }
177 License RPMPackageImpl::licenseToConfirm() const
178 { return _license_to_confirm; }
181 std::string RPMPackageImpl::type() const
185 std::list<std::string> RPMPackageImpl::keywords() const
186 { return _keywords; }
190 std::list<std::string> RPMPackageImpl::insnotify() const
191 { return std::list<std::string>(); }
193 std::list<std::string> RPMPackageImpl::delnotify() const
194 { return std::list<std::string>(); }
196 unsigned RPMPackageImpl::packageSize() const
197 { return _size_package; }
199 unsigned RPMPackageImpl::archiveSize() const
200 { return _size_archive; }
202 unsigned RPMPackageImpl::installedSize() const
203 { return _size_installed; }
204 // FIXME do not understand items below
206 bool RPMPackageImpl::providesSources() const
211 std::string RPMPackageImpl::instSrcLabel() const
216 std::string RPMPackageImpl::instSrcVendor() const
221 unsigned RPMPackageImpl::instSrcRank() const
226 std::string RPMPackageImpl::buildhost() const
231 std::string RPMPackageImpl::distribution() const
236 std::string RPMPackageImpl::vendor() const
241 std::string RPMPackageImpl::license() const
246 std::list<std::string> RPMPackageImpl::licenseToConfirm() const
248 return std::list<std::string>();
251 std::string RPMPackageImpl::packager() const
256 std::string RPMPackageImpl::group() const
261 std::list<std::string> RPMPackageImpl::changelog() const
264 std::string RPMPackageImpl::url() const
269 std::string RPMPackageImpl::os() const
272 std::list<std::string> RPMPackageImpl::prein() const
275 std::list<std::string> RPMPackageImpl::postin() const
278 std::list<std::string> RPMPackageImpl::preun() const
281 std::list<std::string> RPMPackageImpl::postun() const
284 std::string RPMPackageImpl::sourcepkg() const
285 { return _sourcepkg; }
287 std::list<std::string> RPMPackageImpl::authors() const
290 std::list<std::string> RPMPackageImpl::filenames() const
293 std::list<std::string> RPMPackageImpl::recommends() const
296 std::list<std::string> RPMPackageImpl::suggests() const
299 std::string RPMPackageImpl::location() const
302 std::string RPMPackageImpl::md5sum() const
305 std::string RPMPackageImpl::externalUrl() const
308 std::list<Edition> RPMPackageImpl::patchRpmBaseVersions() const
311 unsigned RPMPackageImpl::patchRpmSize() const
314 bool RPMPackageImpl::forceInstall() const
317 std::string RPMPackageImpl::patchRpmMD5() const
320 bool RPMPackageImpl::isRemote() const
323 bool RPMPackageImpl::prefererCandidate() const
329 /////////////////////////////////////////////////////////////////
330 } // namespace target
331 ///////////////////////////////////////////////////////////////////
332 /////////////////////////////////////////////////////////////////
334 ///////////////////////////////////////////////////////////////////