aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-02-24 00:17:10 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-02-24 00:17:10 -0500
commit2c947166b0b573239c57d190031b4069174e4732 (patch)
treeddb5e5b4730465450e94cd9f3e01f3e6e75b87f5
parentcb88c4fdb648b9173011cf5f851e02b9175a2d29 (diff)
downloadspmc-2c947166b0b573239c57d190031b4069174e4732.tar.gz
Add install_show_package()
-rw-r--r--include/install.h1
-rw-r--r--src/install.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/include/install.h b/include/install.h
index 3ecba04..784c608 100644
--- a/include/install.h
+++ b/include/install.h
@@ -2,6 +2,7 @@
#define SPM_INSTALL_H
int metadata_remove(const char *_path);
+void install_show_package(ManifestPackage *package);
int install(const char *destroot, const char *_package);
#endif //SPM_INSTALL_H
diff --git a/src/install.c b/src/install.c
index c1d0f8c..cf22d23 100644
--- a/src/install.c
+++ b/src/install.c
@@ -33,6 +33,14 @@ int metadata_remove(const char *_path) {
return 0;
}
+void install_show_package(ManifestPackage *package) {
+ if (package == NULL) {
+ fprintf(stderr, "ERROR: package was NULL\n");
+ return;
+ }
+ printf(" -> %-10s %-10s (origin: %s)\n", package->name, package->version, package->origin);
+}
+
/**
* Install a package and its dependencies into a destination root.
* The destination is created if it does not exist.
@@ -103,6 +111,7 @@ int install(const char *destroot, const char *_package) {
if (SPM_GLOBAL.verbose) {
printf("Installing tree: '%s' => '%s'\n", source, destroot);
}
+
if (rsync(NULL, source, destroot) != 0) {
exit(1);
}