apache, nginx, tor, fdisk
This commit is contained in:
16
src/main.cc
16
src/main.cc
@@ -8,7 +8,7 @@
|
||||
#include <thread>
|
||||
#include <unordered_map>
|
||||
|
||||
static const std::string BUILD_PATH = "/tmp/shrap";
|
||||
constexpr static const std::string BUILD_PATH = "/tmp/shrap";
|
||||
|
||||
std::unordered_map<std::string, Expr> packages;
|
||||
|
||||
@@ -216,6 +216,11 @@ void generate_graph(const std::vector<std::string> &to_highlight) {
|
||||
int main(int argc, char **argv) {
|
||||
auto args = std::span(argv, static_cast<size_t>(argc));
|
||||
|
||||
if (geteuid() != 0) {
|
||||
std::cerr << "This program needs to be ran as root.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::filesystem::create_directories(BUILD_PATH);
|
||||
std::filesystem::create_directories(DB::DB_PATH);
|
||||
|
||||
@@ -239,10 +244,6 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag_raw) {
|
||||
to_install = resolve_dependencies(to_install, db);
|
||||
}
|
||||
|
||||
if (flag_graph) {
|
||||
generate_graph(to_install);
|
||||
return 0;
|
||||
@@ -253,9 +254,8 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (geteuid() != 0) {
|
||||
std::cerr << "This program needs to be ran as root.\n";
|
||||
return 1;
|
||||
if (!flag_raw) {
|
||||
to_install = resolve_dependencies(to_install, db);
|
||||
}
|
||||
|
||||
std::cout << "\nFollowing packages will be installed:\n";
|
||||
|
||||
Reference in New Issue
Block a user