Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
packagemanagerconfig.h
1 #ifndef PACKAGE_MANAGER_PACKAGEMANAGERCONFIG_H_
2 #define PACKAGE_MANAGER_PACKAGEMANAGERCONFIG_H_
3 
4 #include <boost/filesystem.hpp>
5 #include <boost/property_tree/ptree_fwd.hpp>
6 #include <map>
7 #include <string>
8 
9 #include "utilities/config_utils.h"
10 
11 // TODO: move these to their corresponding headers
12 #define PACKAGE_MANAGER_NONE "none"
13 #define PACKAGE_MANAGER_OSTREE "ostree"
14 #define PACKAGE_MANAGER_DEBIAN "debian"
15 #define PACKAGE_MANAGER_ANDROID "android"
16 #define PACKAGE_MANAGER_OSTREEDOCKERAPP "ostree+docker-app"
17 
18 #ifdef BUILD_OSTREE
19 #define PACKAGE_MANAGER_DEFAULT PACKAGE_MANAGER_OSTREE
20 #else
21 #define PACKAGE_MANAGER_DEFAULT PACKAGE_MANAGER_NONE
22 #endif
23 
24 struct PackageConfig {
25  std::string type{PACKAGE_MANAGER_DEFAULT};
26 
27  // OSTree options
28  std::string os;
29  boost::filesystem::path sysroot;
30  std::string ostree_server;
31  boost::filesystem::path packages_file{"/usr/package.manifest"};
32 
33  // Options for simulation (to be used with "none")
34  bool fake_need_reboot{false};
35 
36  // for specialized configuration
37  std::map<std::string, std::string> extra;
38 
39  void updateFromPropertyTree(const boost::property_tree::ptree& pt);
40  void writeToStream(std::ostream& out_stream) const;
41 };
42 
43 #endif // PACKAGE_MANAGER_PACKAGEMANAGERCONFIG_H_