aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-24 17:16:06 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-24 17:16:06 +0100
commit0709d31d5ef3ec19331abcd97545add26b7b0e13 (patch)
tree4895cc87c32df9ea2ee1707951ee85019b90536c
parent3c79472a773210127bec1768aaf85e540daa3f9f (diff)
Cleanup: move canonicalize_name back to libfstree.a
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--difftool/Makemodule.am2
-rw-r--r--include/fstree.h9
-rw-r--r--include/util/util.h9
-rw-r--r--lib/fstree/Makemodule.am1
-rw-r--r--lib/fstree/canonicalize_name.c (renamed from lib/util/canonicalize_name.c)5
-rw-r--r--lib/util/Makemodule.am3
-rw-r--r--tar/Makemodule.am4
-rw-r--r--tests/Makemodule.am2
-rw-r--r--tests/canonicalize_name.c3
-rw-r--r--unpack/Makemodule.am2
10 files changed, 19 insertions, 21 deletions
diff --git a/difftool/Makemodule.am b/difftool/Makemodule.am
index e827a8b..7eb6600 100644
--- a/difftool/Makemodule.am
+++ b/difftool/Makemodule.am
@@ -2,6 +2,6 @@ sqfsdiff_SOURCES = difftool/sqfsdiff.c difftool/sqfsdiff.h difftool/util.c
sqfsdiff_SOURCES += difftool/compare_dir.c difftool/node_compare.c
sqfsdiff_SOURCES += difftool/compare_files.c difftool/super.c
sqfsdiff_SOURCES += difftool/extract.c difftool/options.c
-sqfsdiff_LDADD = libcommon.a libsquashfs.la libutil.la $(LZO_LIBS)
+sqfsdiff_LDADD = libcommon.a libsquashfs.la libutil.la $(LZO_LIBS) libfstree.a
bin_PROGRAMS += sqfsdiff
diff --git a/include/fstree.h b/include/fstree.h
index a63c593..44428cd 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -183,4 +183,13 @@ void tree_node_sort_recursive(tree_node_t *root);
*/
sqfs_u32 get_source_date_epoch(void);
+/*
+ Convert back to forward slashed, remove all preceeding and trailing slashes,
+ collapse all sequences of slashes, remove all path components that are '.'
+ and returns failure state if one of the path components is '..'.
+
+ Returns 0 on success.
+*/
+int canonicalize_name(char *filename);
+
#endif /* FSTREE_H */
diff --git a/include/util/util.h b/include/util/util.h
index a133067..7aa4f31 100644
--- a/include/util/util.h
+++ b/include/util/util.h
@@ -33,13 +33,4 @@ void *alloc_flex(size_t base_size, size_t item_size, size_t nmemb);
SQFS_INTERNAL
void *alloc_array(size_t item_size, size_t nmemb);
-/*
- Convert back to forward slashed, remove all preceeding and trailing slashes,
- collapse all sequences of slashes, remove all path components that are '.'
- and returns failure state if one of the path components is '..'.
-
- Returns 0 on success.
-*/
-SQFS_INTERNAL int canonicalize_name(char *filename);
-
#endif /* UTIL_H */
diff --git a/lib/fstree/Makemodule.am b/lib/fstree/Makemodule.am
index be5f8fc..6638480 100644
--- a/lib/fstree/Makemodule.am
+++ b/lib/fstree/Makemodule.am
@@ -6,6 +6,7 @@ libfstree_a_SOURCES += lib/fstree/add_by_path.c
libfstree_a_SOURCES += include/fstree.h
libfstree_a_SOURCES += lib/fstree/gen_file_list.c
libfstree_a_SOURCES += lib/fstree/source_date_epoch.c
+libfstree_a_SOURCES += lib/fstree/canonicalize_name.c
libfstree_a_CFLAGS = $(AM_CFLAGS)
libfstree_a_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/lib/util/canonicalize_name.c b/lib/fstree/canonicalize_name.c
index 33e1c0b..f35307f 100644
--- a/lib/util/canonicalize_name.c
+++ b/lib/fstree/canonicalize_name.c
@@ -1,12 +1,11 @@
-/* SPDX-License-Identifier: LGPL-3.0-or-later */
+/* SPDX-License-Identifier: GPL-3.0-or-later */
/*
* canonicalize_name.c
*
* Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
*/
#include "config.h"
-
-#include "util/util.h"
+#include "fstree.h"
static void normalize_slashes(char *filename)
{
diff --git a/lib/util/Makemodule.am b/lib/util/Makemodule.am
index 6a1a6a8..07e94e2 100644
--- a/lib/util/Makemodule.am
+++ b/lib/util/Makemodule.am
@@ -1,6 +1,5 @@
libutil_la_SOURCES = include/util/util.h include/util/str_table.h
-libutil_la_SOURCES += lib/util/str_table.c lib/util/canonicalize_name.c
-libutil_la_SOURCES += lib/util/alloc.c
+libutil_la_SOURCES += lib/util/str_table.c lib/util/alloc.c
libutil_la_CFLAGS = $(AM_CFLAGS)
libutil_la_CPPFLAGS = $(AM_CPPFLAGS)
libutil_la_LDFLAGS = $(AM_LDFLAGS)
diff --git a/tar/Makemodule.am b/tar/Makemodule.am
index 4d28bb7..63b309c 100644
--- a/tar/Makemodule.am
+++ b/tar/Makemodule.am
@@ -1,9 +1,9 @@
sqfs2tar_SOURCES = tar/sqfs2tar.c
sqfs2tar_LDADD = libcommon.a libsquashfs.la libtar.a libcompat.a libutil.la
-sqfs2tar_LDADD += $(LZO_LIBS)
+sqfs2tar_LDADD += libfstree.a $(LZO_LIBS)
tar2sqfs_SOURCES = tar/tar2sqfs.c
tar2sqfs_LDADD = libcommon.a libsquashfs.la libtar.a
-tar2sqfs_LDADD += libfstree.a libcompat.a libutil.la $(LZO_LIBS)
+tar2sqfs_LDADD += libfstree.a libcompat.a libutil.la libfstree.a $(LZO_LIBS)
bin_PROGRAMS += sqfs2tar tar2sqfs
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index 93f286d..007b087 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -1,5 +1,5 @@
test_canonicalize_name_SOURCES = tests/canonicalize_name.c
-test_canonicalize_name_LDADD = libutil.la
+test_canonicalize_name_LDADD = libfstree.a
test_str_table_SOURCES = tests/str_table.c
test_str_table_LDADD = libutil.la libcompat.a
diff --git a/tests/canonicalize_name.c b/tests/canonicalize_name.c
index cabf716..3601569 100644
--- a/tests/canonicalize_name.c
+++ b/tests/canonicalize_name.c
@@ -5,8 +5,7 @@
* Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
*/
#include "config.h"
-
-#include "util/util.h"
+#include "fstree.h"
#include <string.h>
#include <stdlib.h>
diff --git a/unpack/Makemodule.am b/unpack/Makemodule.am
index 16d7ce1..f2832a3 100644
--- a/unpack/Makemodule.am
+++ b/unpack/Makemodule.am
@@ -3,6 +3,6 @@ rdsquashfs_SOURCES += unpack/list_files.c unpack/options.c
rdsquashfs_SOURCES += unpack/restore_fstree.c unpack/describe.c
rdsquashfs_SOURCES += unpack/fill_files.c unpack/dump_xattrs.c
rdsquashfs_LDADD = libcommon.a libcompat.a libsquashfs.la libutil.la
-rdsquashfs_LDADD += $(LZO_LIBS)
+rdsquashfs_LDADD += libfstree.a $(LZO_LIBS)
bin_PROGRAMS += rdsquashfs