1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-22 04:49:46 +01:00

Move abstract file list handling code to seperate utility library

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-02-04 15:39:43 +01:00
parent 4d8b8f52d5
commit 6a80140c59
9 changed files with 18 additions and 14 deletions

View file

@ -9,20 +9,23 @@ libutil_a_SOURCES += lib/util/write_retry.c lib/util/read_retry.c
libutil_a_SOURCES += lib/util/canonicalize_name.c libutil_a_SOURCES += lib/util/canonicalize_name.c
libutil_a_SOURCES += include/util/util.h include/util/input_file.h libutil_a_SOURCES += include/util/util.h include/util/input_file.h
libfilelist_a_SOURCES = lib/filelist/dump_toc.c lib/filelist/image_entry.c
libfilelist_a_SOURCES += lib/filelist/image_entry_sort.c
libfilelist_a_SOURCES += include/filelist/image_entry.h
# application core # application core
GLOBALHDR = include/pkgformat.h include/pkgreader.h GLOBALHDR = include/pkgformat.h include/pkgreader.h
GLOBALHDR += include/compressor.h include/command.h include/pkgwriter.h GLOBALHDR += include/compressor.h include/command.h include/pkgwriter.h
GLOBALHDR += include/image_entry.h include/pkgio.h GLOBALHDR += include/pkgio.h
MAIN = main/pkg.c main/compressor.c main/command.c main/pkgreader.c MAIN = main/pkg.c main/compressor.c main/command.c main/pkgreader.c
MAIN += main/pkgwriter.c main/image_entry.c main/image_entry_sort.c MAIN += main/pkgwriter.c main/pkgio_rd_image_entry.c main/pkg_unpack.c
MAIN += main/pkgio_rd_image_entry.c main/pkg_unpack.c main/dump_toc.c
pkg_SOURCES = $(GLOBALHDR) $(MAIN) pkg_SOURCES = $(GLOBALHDR) $(MAIN)
pkg_CFLAGS = $(AM_CFLAGS) pkg_CFLAGS = $(AM_CFLAGS)
pkg_LDADD = libutil.a pkg_LDADD = libutil.a libfilelist.a
noinst_LIBRARIES = libutil.a noinst_LIBRARIES = libutil.a libfilelist.a
bin_PROGRAMS = pkg bin_PROGRAMS = pkg
EXTRA_DIST = autogen.sh EXTRA_DIST = autogen.sh

View file

@ -4,8 +4,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
#include "pkgreader.h"
typedef struct image_entry_t { typedef struct image_entry_t {
struct image_entry_t *next; struct image_entry_t *next;
char *name; char *name;

View file

@ -2,7 +2,7 @@
#define PKGIO_H #define PKGIO_H
#include "pkgreader.h" #include "pkgreader.h"
#include "image_entry.h" #include "filelist/image_entry.h"
enum { enum {
UNPACK_NO_CHOWN = 0x01, UNPACK_NO_CHOWN = 0x01,

View file

@ -2,7 +2,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
#include "image_entry.h" #include "filelist/image_entry.h"
typedef int (*print_fun_t)(image_entry_t *ent, const char *root); typedef int (*print_fun_t)(image_entry_t *ent, const char *root);

View file

@ -2,7 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "image_entry.h" #include "filelist/image_entry.h"
void image_entry_free(image_entry_t *ent) void image_entry_free(image_entry_t *ent)
{ {

View file

@ -1,7 +1,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h> #include <string.h>
#include "image_entry.h" #include "filelist/image_entry.h"
static int compare_ent(image_entry_t *a, image_entry_t *b) static int compare_ent(image_entry_t *a, image_entry_t *b)
{ {

View file

@ -9,7 +9,8 @@
#include "util/util.h" #include "util/util.h"
#include "image_entry.h" #include "filelist/image_entry.h"
#include "pkgformat.h" #include "pkgformat.h"
#include "pkgreader.h" #include "pkgreader.h"
#include "command.h" #include "command.h"

View file

@ -11,7 +11,8 @@
#include "util/util.h" #include "util/util.h"
#include "image_entry.h" #include "filelist/image_entry.h"
#include "pkgreader.h" #include "pkgreader.h"
#include "command.h" #include "command.h"
#include "pkgio.h" #include "pkgio.h"

View file

@ -17,7 +17,8 @@
#include "util/input_file.h" #include "util/input_file.h"
#include "util/util.h" #include "util/util.h"
#include "image_entry.h" #include "filelist/image_entry.h"
#include "compressor.h" #include "compressor.h"
#include "pkgformat.h" #include "pkgformat.h"
#include "pkgwriter.h" #include "pkgwriter.h"