pm

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

commit 070bae1b48719edc68bd7975cc5a536274eb8fa7
parent c96c002a084e780cea693b4de0cc8a88b786fdc0
Author: z3bra <willyatmailoodotorg>
Date:   Tue Jan  5 01:46:45 2016

Make .tar.bz2 the only supported format

.tar.bz2 is now the only supported format. This enable simpler
package handling, as well as making static linking easier.

static binaries can now be built by adding "-static" to the LDFLAGS
macro in config.mk

Diffstat:
 config.mk | 4 ++--
 makefile  | 3 +++
 pm.c      | 8 ++++----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/config.mk b/config.mk @@ -4,5 +4,5 @@ LD = $(CC) PREFIX = /usr/local MANPREFIX = $(PREFIX)/man -CFLAGS = -Wall -g -LDFLAGS = -larchive +CFLAGS = -Wall -Wextra -g +LDFLAGS = -larchive -lbz2 -lz diff --git a/makefile b/makefile @@ -4,6 +4,9 @@ BIN = pm all: $(BIN) +.c: + $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ + clean: rm -f $(BIN) diff --git a/pm.c b/pm.c @@ -156,8 +156,8 @@ list_archive(int fd, char *filename) /* configure archive to support all types */ a = archive_read_new(); - archive_read_support_filter_all(a); - archive_read_support_format_all(a); + archive_read_support_filter_bzip2(a); + archive_read_support_format_tar(a); /* set blocksize to 0 as libarchive will choose the best size anyway */ r = archive_read_open_filename(a, filename, 0); @@ -307,8 +307,8 @@ unpack(char *root, char *in) |ARCHIVE_EXTRACT_SECURE_NODOTDOT; a = archive_read_new(); - archive_read_support_filter_all(a); - archive_read_support_format_all(a); + archive_read_support_filter_bzip2(a); + archive_read_support_format_tar(a); w = archive_write_disk_new(); archive_write_disk_set_options(w, mask);