URI: 
       tDefine package structure - pm - barely a pack manager
  HTML git clone git://z3bra.org/pm
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 4ea0aa4f385ef8dd95a6747669676f4cee1ab402
   DIR parent b5a2a221b195030cfc21db7696651860f9ec535c
  HTML Author: z3bra <willyatmailoodotorg>
       Date:   Wed, 23 Dec 2015 13:01:43 +0100
       
       Define package structure
       
       Diffstat:
         M pm.c                                |      19 ++++++++++++++-----
       
       1 file changed, 14 insertions(+), 5 deletions(-)
       ---
   DIR diff --git a/pm.c b/pm.c
       t@@ -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,
       t@@ -29,6 +38,7 @@ enum {
                ACTION_INVALID     = 9
        };
        
       +/* error codes */
        enum {
                ERR_INVALID_ACTION = 1,
                ERR_METADATA       = 2,
       t@@ -154,7 +164,6 @@ pack(const char *out, char **filename)
                return 0;
        }
        
       -
        /*
         * extract files into the gien directory
         */
       t@@ -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: