aboutsummaryrefslogtreecommitdiff
path: root/src/install_pkg.cc
diff options
context:
space:
mode:
authordacctal <dacctalyt@gmail.com>2026-04-03 14:56:05 +0000
committerdacctal <dacctalyt@gmail.com>2026-04-03 14:56:05 +0000
commited78991edc4755c0276dcb4eb454b43fa38296fc (patch)
tree460da5399e34e1dce7a293cb22578da15977d895 /src/install_pkg.cc
parent2a6b92ed130ade1ea7542ee210e6957427a0aa81 (diff)
countless changes
Diffstat (limited to 'src/install_pkg.cc')
-rw-r--r--src/install_pkg.cc36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/install_pkg.cc b/src/install_pkg.cc
index 13cef81..3f0bd75 100644
--- a/src/install_pkg.cc
+++ b/src/install_pkg.cc
@@ -1,10 +1,36 @@
-#include "fetch_src.cc"
-#include "build.cc"
-#include "link_install.cc"
+#include <iostream>
+
+#include "add_repo.hh"
+#include "fetch_src.hh"
+#include "build.hh"
+#include "copy_install.hh"
+#include "install_pkg.hh"
+#include "link_install.hh"
+#include "vars.hh"
void install_pkg(Pkg pkg) {
+ std::cout << print_pkgit << "fetching source..." << std::endl;
fetch_src(pkg);
- //build_pkg(pkg.src);
+
+ std::cout << print_pkgit << "building..." << std::endl;
build(pkg.src.c_str());
- link_install(pkg.src);
+
+ std::cout << print_pkgit << "installing..." << std::endl;
+ if (is_symlink_install) { link_install(pkg.src); }
+ else { copy_install(pkg.src); }
+
+ bool repo_exists = false;
+ for (auto repo : repos) {
+ if (repo.first == pkg.name) {
+ repo_exists = true;
+ }
+ }
+
+ if (!repo_exists) {
+ std::cout << print_pkgit << "adding repository..." << std::endl;
+ add_repo(pkg.url, pkg.name);
+ std::cout << print_pkgit << "done!" << std::endl;
+ } else {
+ std::cout << print_pkgit << "repo already exists, done!" << std::endl;
+ }
}