package

simple and robust package manager
Log | Files | Refs | README

commit 6e2304848bc06c489da36a2ba53ffe1c4538613f
parent 26543ba1ff5e186039c41f086aa4649d972eee22
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 16 Jan 2019 23:47:53 +0100

add default paths

Diffstat:
Mpackage-build | 0
Mpackage-build.c | 9++++-----
Mpackage-get | 0
Mpackage-get.c | 4++--
Mpackage-install.c | 6+++---
Mpackage-tree.c | 3+--
Mpackage.h | 3+++
7 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/package-build b/package-build Binary files differ. diff --git a/package-build.c b/package-build.c @@ -54,6 +54,7 @@ patch(package const *p, char *def) if (!stralloc_cats(&sa, "/")) goto err; n = sa.n; + close(2); if ((fd = open_trunc("../log/2-patch")) == -1) goto err; d[0] = "default"; d[1] = p->ver; @@ -77,7 +78,7 @@ patch(package const *p, char *def) if (!stralloc_cat0(&sa)) goto err; close(0); if (open_read(sa.x) == -1) goto err; - if (write(fd, "=== patch ===\n", 23) == -1) goto err; + if (write(fd, "=== patch ===\n", 14) == -1) goto err; if (forkexec_wait_redir(argv, fd) != 0) goto err; if (write(fd, "\n", 1) == -1) goto err; } @@ -242,8 +243,8 @@ main(int argc, char **argv) { package p; tain tn; - char *def; - char *pkg; + char *def = PACKAGE_DEF; + char *pkg = PACKAGE_DIR; char **av = argv; char id[TAIN_FMT + 1]; int x; @@ -256,8 +257,6 @@ main(int argc, char **argv) break; } - if (!def) usage(*argv, "-d"); - if (!pkg) usage(*argv, "-p"); if (!*av) usage(*argv, "packageage[/version]"); if (!stat_isdir(def)) log_diesys1(101, def); diff --git a/package-get b/package-get Binary files differ. diff --git a/package-get.c b/package-get.c @@ -57,8 +57,8 @@ main(int argc, char **argv) package p; buffer b; char buf[1024]; - char *def = NULL; - char *pkg = NULL; + char *def = PACKAGE_DEF; + char *pkg = PACKAGE_DIR; char *cmd = NULL; char **av = argv; int fd = -1; diff --git a/package-install.c b/package-install.c @@ -11,9 +11,9 @@ main(int argc, char **argv) { package p; stralloc sa; - char *def = NULL; - char *pkg = NULL; - char *root = NULL; + char *def = PACKAGE_DEF; + char *pkg = PACKAGE_DIR; + char *root = PACKAGE_ROOT; (void)argc; diff --git a/package-tree.c b/package-tree.c @@ -71,11 +71,10 @@ err: int main(int argc, char **argv) { - char *def; + char *def = PACKAGE_DEF; stralloc sa; package p; - def = "/etc/pack"; if (!stat_isdir(def)) log_diesys1(101, def); if (argc != 2) log_usage(*argv, "packageage[/version]"); diff --git a/package.h b/package.h @@ -5,6 +5,9 @@ #include "genalloc.h" #define PACKAGE_FMT (NAME_MAX * 2 + 1) +#define PACKAGE_DIR "/package" +#define PACKAGE_DEF "/etc/pack" +#define PACKAGE_ROOT "/" typedef struct { char name[NAME_MAX];