// file : bbot/bootstrap-manifest -*- C++ -*- // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BBOT_BOOTSTRAP_MANIFEST #define BBOT_BOOTSTRAP_MANIFEST #include #include #include #include #include namespace bbot { // Toolchain manifest. // class toolchain_manifest { public: // Toolchain id (SHAXXX). // string id; explicit toolchain_manifest (string i): id (i) {} public: toolchain_manifest () = default; // VC export. toolchain_manifest (butl::manifest_parser&, bool ignore_unknown = false); toolchain_manifest (butl::manifest_parser&, butl::manifest_name_value start, bool ignore_unknown = false); void serialize (butl::manifest_serializer&) const; }; // Bootstrap result manifest. Uploaded by the worker to the agent's TFTP // server. // class bootstrap_manifest { public: // Map of packages to their (numeric) versions that were used inside the // bootstrapped machine. Used to make sure bbot agent/worker use the same // versions. For example: // // libbbot-version: 1010100 # 1.1.1 // bbot-version: 1010200 # 1.1.2 // using versions_type = std::map; versions_type versions; explicit bootstrap_manifest (versions_type v) : versions (move (v)) {} public: bootstrap_manifest () = default; // VC export. bootstrap_manifest (butl::manifest_parser&, bool ignore_unknown = false); bootstrap_manifest (butl::manifest_parser&, butl::manifest_name_value start, bool ignore_unknown = false); void serialize (butl::manifest_serializer&) const; }; // The manifest stored in -/ consists of the machine // manifest (original), toolchain manifest, and bootstrap manifest. // class bootstrapped_machine_manifest { public: machine_manifest machine; toolchain_manifest toolchain; bootstrap_manifest bootstrap; bootstrapped_machine_manifest (machine_manifest m, toolchain_manifest t, bootstrap_manifest b) : machine (move (m)), toolchain (move (t)), bootstrap (move (b)) {} public: bootstrapped_machine_manifest () = default; // VC export. bootstrapped_machine_manifest (butl::manifest_parser&, bool ignore_unknown = false); void serialize (butl::manifest_serializer&) const; }; } #endif // BBOT_BOOTSTRAP_MANIFEST