pm

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

commit 7b061f1009b6ce1177e5d5cf694c507009bb5761
parent b5e9210a1157c7316f3de603ae7731f084135b7f
Author: z3bra <willyatmailoodotorg>
Date:   Wed Jun 22 07:14:32 +0200

Add xz(1) compression support

Diffstat:
config.mk | 2+-
pm.c | 4+++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/config.mk b/config.mk @@ -6,4 +6,4 @@ MANDIR = ${PREFIX}/man CFLAGS = -Wall -Wextra -pedantic LDFLAGS = -static -LIBS = -larchive -lbz2 -lz +LIBS = -larchive -lbz2 -llzma -lz diff --git a/pm.c b/pm.c @@ -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__);} @@ -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 */ @@ -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);