backup while cleaning up
[platform/upstream/libzypp.git] / zypp / Package.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/Package.cc
10  *
11 */
12 #include "zypp/Package.h"
13
14 using namespace std;
15
16 ///////////////////////////////////////////////////////////////////
17 namespace zypp
18 { /////////////////////////////////////////////////////////////////
19
20   IMPL_PTR_TYPE(Package);
21
22   ///////////////////////////////////////////////////////////////////
23   //
24   //    METHOD NAME : Package::Package
25   //    METHOD TYPE : Ctor
26   //
27   Package::Package( const sat::Solvable & solvable_r )
28   : ResObject( solvable_r )
29   {}
30
31   ///////////////////////////////////////////////////////////////////
32   //
33   //    METHOD NAME : Package::~Package
34   //    METHOD TYPE : Dtor
35   //
36   Package::~Package()
37   {}
38
39   ///////////////////////////////////////////////////////////////////
40   //
41   //    Package interface forwarded to implementation
42   //
43   ///////////////////////////////////////////////////////////////////
44
45 #warning DUMMY changelog
46   Changelog Package::changelog() const
47   { return Changelog(); }
48
49   /** */
50   std::string Package::buildhost() const
51   { return lookupStrAttribute( sat::SolvAttr::buildhost ); }
52
53   /** */
54   std::string Package::distribution() const
55   { return lookupStrAttribute( sat::SolvAttr::distribution ); }
56
57   /** */
58   std::string Package::license() const
59   { return lookupStrAttribute( sat::SolvAttr::license ); }
60
61   /** */
62   std::string Package::packager() const
63   { return lookupStrAttribute( sat::SolvAttr::packager ); }
64
65   /** */
66   std::string Package::group() const
67   { return lookupStrAttribute( sat::SolvAttr::group ); }
68
69 #warning DUMMY keywords
70   Package::Keywords Package::keywords() const
71   { return Keywords(); }
72
73   /** Don't ship it as class Url, because it might be
74    * in fact anything but a legal Url. */
75 #warning DUMMY url
76   std::string Package::url() const
77   { return string(); }
78
79   /** */
80   ByteCount Package::sourcesize() const
81   { return lookupNumAttribute( sat::SolvAttr::sourcesize ); }
82
83   /** */
84 #warning DUMMY authors
85   std::list<std::string> Package::authors() const
86   { return std::list<std::string>(); }
87
88   /** */
89 #warning DUMMY filenames
90   std::list<std::string> Package::filenames() const
91   { return std::list<std::string>(); }
92
93   OnMediaLocation Package::location() const
94   {
95 #warning MISSING checkdums in OnMediaLocation
96     OnMediaLocation loc;
97     unsigned medianr;
98     std::string filename = lookupLocation( medianr );
99     /* XXX This datadir should be part of RepoInfo.  */
100     if (repoInfo().type().toEnum() == repo::RepoType::YAST2_e)
101       filename = std::string("suse/") + filename;
102     loc.setLocation(filename, medianr);
103     return loc;
104   }
105
106 #warning DUMMY sourcePkgName
107  std::string Package::sourcePkgName() const
108   { return std::string(); }
109
110 #warning DUMMY sourcePkgEdition
111  Edition Package::sourcePkgEdition() const
112   { return Edition(); }
113
114   /////////////////////////////////////////////////////////////////
115 } // namespace zypp
116 ///////////////////////////////////////////////////////////////////