pm

barely a pack manager
git clone git://z3bra.org/pm
Log | Files | Refs | README | LICENSE

commit 3fd5784d2ea900d1e8ef69be56677d835909695b
parent b613d5ebdb9d76571ae6be652757ec6e3c6baf4d
Author: z3bra <contactatz3bradotorg>
Date:   Fri May  5 08:26:47 +0200

Move program tweaks to config.h

Diffstat:
config.def.h | 5+++++
pm.c | 10++--------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/config.def.h b/config.def.h @@ -0,0 +1,5 @@ +#define REPO_EXEC "repo" +#define PACK_ROOT (getenv("ROOT")?getenv("ROOT"):"") +#define PACK_DATA (getenv("DATA")?getenv("DATA"):"/var/db/pm") +#define PACK_BUFF_SIZE 8192 +#define PACK_FORMAT "\\([-_a-z0-9]*\\)@\\([.a-zA-Z0-9]*\\)\\.t\\(bz\\|gz\\|xz\\)" diff --git a/pm.c b/pm.c @@ -15,12 +15,7 @@ #include <archive_entry.h> #include "arg.h" - -#define REPO_EXEC "repo" -#define PACK_ROOT (getenv("ROOT")?getenv("ROOT"):"") -#define PACK_DATA "var/pm" -#define PACK_BUFF_SIZE 8192 -#define PACK_FORMAT "\\([-_a-z0-9]*\\)#\\([.a-zA-Z0-9]*\\)\\.tar\\.\\(bz2\\|gz\\|xz\\)" +#include "config.h" #define log(l,...) if(verbose>=l){printf(__VA_ARGS__);} @@ -941,8 +936,7 @@ main (int argc, char **argv) strncpy(rootfs, PACK_ROOT, PATH_MAX); strncat(rootfs, "/", PATH_MAX); - strncpy(datadir, rootfs, PATH_MAX); - strncat(datadir, PACK_DATA, PATH_MAX); + strncpy(datadir, PACK_DATA, PATH_MAX); ARGBEGIN{ case 'a':