feat(install): generate RPM packages
This commit is contained in:
1 parent
2b80718f98
commit
3198b32f2b
7 files changed
+365
-82
No files matched your search
@@ -1053,6 +1053,26 @@ void build(Void::Build::Project &p) {
|
||||
Void::Testing::expect(sign_res.has_value() && !sign_res->succeeded());
|
||||
}
|
||||
|
||||
// RPM package generator: lead + header magic + newc cpio payload.
|
||||
const auto rpm_archive = tmp / "cli_hi.rpm";
|
||||
auto rpm_req = inst_req;
|
||||
for (auto &arg : rpm_req.arguments) {
|
||||
if (arg == installer_archive.string()) {
|
||||
arg = rpm_archive.string();
|
||||
}
|
||||
}
|
||||
rpm_req.arguments.push_back("--archive-format");
|
||||
rpm_req.arguments.push_back("rpm");
|
||||
auto rpm_res = Platform::run_supervised(rpm_req);
|
||||
Void::Testing::expect(rpm_res.has_value() && rpm_res->succeeded());
|
||||
auto rpm_bytes = Void::FileSystem::read_file(rpm_archive);
|
||||
Void::Testing::require(rpm_bytes.has_value());
|
||||
Void::Testing::expect(rpm_bytes->starts_with(std::string("\xed\xab\xee\xdb", 4)));
|
||||
Void::Testing::expect(rpm_bytes->substr(96, 3) == std::string("\x8e\xad\xe8", 3));
|
||||
Void::Testing::expect(rpm_bytes->find("CliHiPkg") != std::string::npos);
|
||||
Void::Testing::expect(rpm_bytes->find("070701") != std::string::npos);
|
||||
Void::Testing::expect(rpm_bytes->find("TRAILER!!!") != std::string::npos);
|
||||
|
||||
Platform::ProcessRequest uninst_req;
|
||||
uninst_req.executable = vbs_bin;
|
||||
uninst_req.arguments = {"uninstall", "--prefix", cli_prefix.string()};
|
||||
|
||||
Reference in new issue
Block a user