tAdd xz(1) compression support - pm - barely a pack manager
 (HTM) git clone git://z3bra.org/pm
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 7b061f1009b6ce1177e5d5cf694c507009bb5761
 (DIR) parent b5e9210a1157c7316f3de603ae7731f084135b7f
 (HTM) Author: z3bra <willyatmailoodotorg>
       Date:   Wed, 22 Jun 2016 07:14:32 +0200
       
       Add xz(1) compression support
       
       Diffstat:
         M config.mk                           |       2 +-
         M pm.c                                |       4 +++-
       
       2 files changed, 4 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/config.mk b/config.mk
       t@@ -6,4 +6,4 @@ MANDIR = ${PREFIX}/man
        
        CFLAGS = -Wall -Wextra -pedantic
        LDFLAGS = -static
       -LIBS = -larchive -lbz2 -lz
       +LIBS = -larchive -lbz2 -llzma -lz
 (DIR) diff --git a/pm.c b/pm.c
       t@@ -18,7 +18,7 @@
        #define PACK_ROOT  (getenv("ROOT")?getenv("ROOT"):"")
        #define PACK_DATA  "var/pm"
        #define PACK_BUFF_SIZE 8192
       -#define PACK_FORMAT "\\(.*\\)#\\(.*\\)\\.tar\\.\\(bz2\\|gz\\)"
       +#define PACK_FORMAT "\\([-_a-z0-9]*\\)#\\([.a-zA-Z0-9]*\\)\\.tar\\.\\(bz2\\|gz\\|xz\\)"
        
        #define log(l,...) if(verbose>=l){printf(__VA_ARGS__);}
        
       t@@ -308,6 +308,7 @@ pack_extract(const char *rootfs, const char *datadir, struct pack *p)
                a = archive_read_new();
                archive_read_support_filter_gzip(a);
                archive_read_support_filter_bzip2(a);
       +        archive_read_support_filter_xz(a);
                archive_read_support_format_tar(a);
        
                /* try and open the tarball of our pack */
       t@@ -492,6 +493,7 @@ inspect_collision(const char *rootfs, struct pack *p)
                a = archive_read_new();
                archive_read_support_filter_gzip(a);
                archive_read_support_filter_bzip2(a);
       +        archive_read_support_filter_xz(a);
                archive_read_support_format_tar(a);
        
                r = archive_read_open_filename(a, p->path, 0);