diff options
Diffstat (limited to 'src/link_install.cc')
| -rw-r--r-- | src/link_install.cc | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/link_install.cc b/src/link_install.cc index f4d9777..26c2b30 100644 --- a/src/link_install.cc +++ b/src/link_install.cc @@ -3,31 +3,30 @@ #include <string> #include <unistd.h> -#include "vars.cc" - -namespace fs = std::filesystem; +#include "link_install.hh" +#include "vars.hh" void link_install(std::filesystem::path build_dir) { - for (auto const& dir_entry : fs::recursive_directory_iterator(build_dir)) + for (auto const& dir_entry : std::filesystem::recursive_directory_iterator(build_dir)) if (dir_entry.path().extension().string().rfind(".so", 0) == 0) { - if (!fs::exists(lib+"/"+dir_entry.path().filename().string())) { + if (!std::filesystem::exists(lib+"/"+dir_entry.path().filename().string())) { create_symlink(dir_entry, lib+"/"+dir_entry.path().filename().string()); - std::cout << print_pkgit << "linked library: " << dir_entry << "\n"; - } else { std::cout << print_pkgit << "library already exists: " << dir_entry << "\n"; } + if (is_verbose) { std::cout << print_pkgit << "linked library: " << dir_entry << "\n"; } + } else { /*std::cout << print_pkgit << "library already exists: " << dir_entry << "\n";*/ } } else if (!access(dir_entry.path().c_str(), X_OK) && !is_directory(dir_entry.path())) { - if (!fs::exists(bin+"/"+dir_entry.path().filename().string()) && - dir_entry.path().filename().string() == "bldit" && - dir_entry.path().filename().string() == "build.sh" && - dir_entry.path().filename().string() == "compile.sh") { + if (!std::filesystem::exists(bin+"/"+dir_entry.path().filename().string()) && + dir_entry.path().filename().string() != "bldit" && + dir_entry.path().filename().string() != "build.sh" && + dir_entry.path().filename().string() != "compile.sh") { create_symlink(dir_entry, bin+"/"+dir_entry.path().filename().string()); - std::cout << print_pkgit << "linked executable: " << dir_entry << "\n"; - } else { std::cout << print_pkgit << "executable already exists: " << dir_entry << "\n"; } + if (is_verbose) { std::cout << print_pkgit << "linked executable: " << dir_entry << "\n"; } + } else { /*std::cout << print_pkgit << "executable already exists: " << dir_entry << "\n";*/ } } else if (dir_entry.path().extension() == ".h") { - if (!fs::exists(include+"/"+dir_entry.path().filename().string())) { + if (!std::filesystem::exists(include+"/"+dir_entry.path().filename().string())) { create_symlink(dir_entry, include+"/"+dir_entry.path().filename().string()); - std::cout << print_pkgit << "linked include: " << dir_entry << "\n"; - } else { std::cout << print_pkgit << "include already exists: " << dir_entry << "\n"; } + if (is_verbose) { std::cout << print_pkgit << "linked include: " << dir_entry << "\n"; } + } else { /*std::cout << print_pkgit << "include already exists: " << dir_entry << "\n";*/ } } } |
