ci-tools/cpp/lintian-ppa.cpp

32 lines
748 B
C++
Raw Normal View History

2024-12-17 01:29:02 -06:00
#include "common.h"
2025-01-24 19:06:37 -06:00
#include "ci_logic.h"
#include <yaml-cpp/yaml.h>
#include <filesystem>
2024-12-17 01:29:02 -06:00
#include <iostream>
#include <vector>
2025-01-24 19:06:37 -06:00
#include <string>
2024-12-17 01:29:02 -06:00
2025-01-24 19:06:37 -06:00
int main(int argc, char** argv) {
if (argc<2) {
std::cerr << "Usage: lintian-ppa <some.changes> [--verbose]\n";
return 1;
2024-12-17 01:29:02 -06:00
}
2025-01-24 19:06:37 -06:00
for (int i=1; i<argc; i++) {
std::string arg = argv[i];
if (arg=="--verbose" || arg=="-v") {
verbose = true;
2024-12-17 01:29:02 -06:00
}
}
2025-01-24 19:06:37 -06:00
std::string changes_path = argv[1];
2024-12-17 01:29:02 -06:00
try {
2025-01-24 19:06:37 -06:00
if (!run_command({"lintian", "-EvIL", "+pedantic", changes_path}, std::nullopt, false)) {
2024-12-17 01:29:02 -06:00
return 1;
}
2025-01-24 19:06:37 -06:00
} catch(...) {
log_error("Lintian reported some issues with " + changes_path);
2024-12-17 01:29:02 -06:00
}
return 0;
}