aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua_state.cc2
-rw-r--r--src/remove_pkg.cc11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lua_state.cc b/src/lua_state.cc
index fd2b080..5e79fdd 100644
--- a/src/lua_state.cc
+++ b/src/lua_state.cc
@@ -207,7 +207,7 @@ void cache_repos() {
cached_repos[repo_name].source.value = url ? url : "";
lua_getfield(L, -1, "dependencies");
if (!lua_istable(L, -1)) {
- std::cout << print_warning << repo_name << ": \tlua variable 'dependencies' is not a table.\n";
+ //std::cout << print_warning << repo_name << ": \tlua variable 'dependencies' is not a table.\n";
lua_pop(L, 2);
continue;
}
diff --git a/src/remove_pkg.cc b/src/remove_pkg.cc
index 6b82296..0138f38 100644
--- a/src/remove_pkg.cc
+++ b/src/remove_pkg.cc
@@ -7,19 +7,24 @@
#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";
+ //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";
+ //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";
+ //std::cout << print_pkgit << "removed include: " << dir_entry << "\n";
}
}
remove_all(pkg.src.parent_path());
+ std::cout << print_pkgit << "removed " << pkg.name << "\n";
}