aboutsummaryrefslogtreecommitdiff
path: root/src/internal_cmd.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-02-17 00:13:30 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-02-17 00:13:30 -0500
commit1c2cdc4d8e28ce1b4c0d1ba75686f05fd5dd772d (patch)
tree32257d5a12cc0dc06c62e4212806573477065080 /src/internal_cmd.c
parentb5dc6f2c428b4555d3e56e628605f54e4a63b16e (diff)
downloadspmc-1c2cdc4d8e28ce1b4c0d1ba75686f05fd5dd772d.tar.gz
Refactor continues:
* Implement multiple manifests * Random bug fixes * More bugs added * Start removing references to SPM_GLOBAL.package_dir * Start using manifests for everything * Simplify mkmanifest_interface
Diffstat (limited to 'src/internal_cmd.c')
-rw-r--r--src/internal_cmd.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/internal_cmd.c b/src/internal_cmd.c
index 3583073..e1344ed 100644
--- a/src/internal_cmd.c
+++ b/src/internal_cmd.c
@@ -100,24 +100,15 @@ void mkmanifest_interface_usage(void) {
* @return value of `manifest_write`
*/
int mkmanifest_interface(int argc, char **argv) {
- if (argc < 1 || argc > 3) {
+ if (argc < 2) {
mkmanifest_interface_usage();
return -1;
}
Manifest *manifest = NULL;
int result = 0;
char *pkgdir = NULL;
- char path[PATH_MAX];
- memset(path, '\0', PATH_MAX);
- if (argc < 3) {
- pkgdir = SPM_GLOBAL.package_dir;
- strcpy(path, SPM_MANIFEST_FILENAME);
- }
- else {
- pkgdir = argv[1];
- strcpy(path, argv[2]);
- }
+ pkgdir = argv[1];
if (exists(pkgdir) != 0) {
return -1;
@@ -128,7 +119,7 @@ int mkmanifest_interface(int argc, char **argv) {
return -2;
}
- result = manifest_write(manifest, path);
+ result = manifest_write(manifest, pkgdir);
if (result != 0) {
manifest_free(manifest);
return -3;