pm

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

commit 4ea0aa4f385ef8dd95a6747669676f4cee1ab402
parent b5a2a221b195030cfc21db7696651860f9ec535c
Author: z3bra <willyatmailoodotorg>
Date:   Wed Dec 23 13:01:43 2015

Define package structure

Diffstat:
 pm.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/pm.c b/pm.c @@ -11,10 +11,19 @@ #include "arg.h" -#define PACKAGE_ROOT_DIR "." -#define PACKAGE_DATA_DIR "./metadata" +#define PACKAGE_ROOT "test/rootfs" +#define PACKAGE_DATA "test/metadata" +#define PACKAGE_CACHE "test/cache" #define PACKAGE_BUFF_SIZE 8192 +struct pack { + char *name; + char *version; + char *filename; + char *description; + char *deps; +}; + /* possible actions */ enum { ACTION_INSTALL = 0, @@ -29,6 +38,7 @@ enum { ACTION_INVALID = 9 }; +/* error codes */ enum { ERR_INVALID_ACTION = 1, ERR_METADATA = 2, @@ -154,7 +164,6 @@ pack(const char *out, char **filename) return 0; } - /* * extract files into the gien directory */ @@ -247,8 +256,8 @@ main (int argc, char **argv) switch (action) { case ACTION_INSTALL: - if (metadata(PACKAGE_DATA_DIR, packname) == 0) - return unpack(PACKAGE_ROOT_DIR, packname); + if (metadata(PACKAGE_DATA, packname) == 0) + return unpack(PACKAGE_ROOT, packname); fprintf(stderr, "could not write metadata for %s\n", packname); return ERR_METADATA; case ACTION_INSPECT: