aboutsummaryrefslogtreecommitdiff
path: root/src/remove_pkg.cc
diff options
context:
space:
mode:
authordacctal <dacctal@symlinx.net>2026-05-24 10:23:38 +0000
committerdacctal <dacctal@symlinx.net>2026-05-24 10:23:38 +0000
commitaa0d78815004ae6b0c4a42b0e024f5c4ef555ae2 (patch)
tree62f97b4c5acfdb98003568466f878fbd3d6b9dfb /src/remove_pkg.cc
parent83d471f2c1d1b1fa6be51f41e4f1c36ab19d7094 (diff)
c rewrite
Diffstat (limited to 'src/remove_pkg.cc')
-rw-r--r--src/remove_pkg.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/remove_pkg.cc b/src/remove_pkg.cc
deleted file mode 100644
index 0138f38..0000000
--- a/src/remove_pkg.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <filesystem>
-#include <iostream>
-#include <string>
-#include <unistd.h>
-
-#include "remove_pkg.hh"
-#include "vars.hh"
-
-void remove_pkg(Pkg pkg) {
- if (!std::filesystem::exists(pkg.src)) {
- std::cout << print_pkgit << pkg.name << " is not installed!" << std::endl;
- return;
- }
- for (auto const& dir_entry : std::filesystem::recursive_directory_iterator(pkg.src)) {
- if (dir_entry.path().extension().string().rfind(".so", 0) == 0) {
- std::filesystem::remove(install_directories["lib"]+"/"+dir_entry.path().filename().string());
- //std::cout << print_pkgit << "removed library: " << dir_entry << "\n";
-
- } else if (!access(dir_entry.path().c_str(), X_OK) && !is_directory(dir_entry.path())) {
- std::filesystem::remove(install_directories["bin"]+"/"+dir_entry.path().filename().string());
- //std::cout << print_pkgit << "removed executable: " << dir_entry << "\n";
-
- } else if (dir_entry.path().extension() == ".h") {
- std::filesystem::remove(install_directories["include"]+"/"+dir_entry.path().filename().string());
- //std::cout << print_pkgit << "removed include: " << dir_entry << "\n";
- }
- }
- remove_all(pkg.src.parent_path());
- std::cout << print_pkgit << "removed " << pkg.name << "\n";
-}