From 9effec0c4e2f50342254d42458275edbe7fd0ee3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 24 Apr 2020 12:32:09 +0200 Subject: [PATCH] Move all external code to lib/external. --- LICENSE.3RDPARTY | 10 +++---- configure | 24 +++++++-------- lib/Makefile | 30 +++++++++---------- lib/{ => external}/fetch/common.c | 0 lib/{ => external}/fetch/common.h | 0 lib/{ => external}/fetch/errlist.sh | 0 lib/{ => external}/fetch/fetch.c | 0 lib/{ => external}/fetch/fetch.h | 0 lib/{ => external}/fetch/file.c | 0 lib/{ => external}/fetch/ftp.c | 0 lib/{ => external}/fetch/ftp.errors | 0 lib/{ => external}/fetch/http.c | 0 lib/{ => external}/fetch/http.errors | 0 lib/{compat => external}/humanize_number.c | 0 .../portableproplib/prop/prop_array.h | 0 .../portableproplib/prop/prop_bool.h | 0 .../portableproplib/prop/prop_data.h | 0 .../portableproplib/prop/prop_dictionary.h | 0 .../portableproplib/prop/prop_ingest.h | 0 .../portableproplib/prop/prop_number.h | 0 .../portableproplib/prop/prop_object.h | 0 .../portableproplib/prop/prop_string.h | 0 .../portableproplib/prop/proplib.h | 0 .../portableproplib/prop/rbtree.h | 0 .../portableproplib/prop_array.c | 0 .../portableproplib/prop_array_util.c | 0 .../portableproplib/prop_bool.c | 0 .../portableproplib/prop_data.c | 0 .../portableproplib/prop_dictionary.c | 0 .../portableproplib/prop_dictionary_util.c | 0 .../portableproplib/prop_ingest.c | 0 .../portableproplib/prop_number.c | 0 .../portableproplib/prop_object.c | 0 .../portableproplib/prop_object_impl.h | 0 .../portableproplib/prop_rb_impl.h | 0 .../portableproplib/prop_stack.c | 0 .../portableproplib/prop_stack.h | 0 .../portableproplib/prop_string.c | 0 .../portableproplib/prop_zlib.c | 0 lib/{ => external}/portableproplib/rb.c | 0 lib/{compat => external}/strcasestr.c | 0 lib/{compat => external}/strlcat.c | 0 lib/{compat => external}/strlcpy.c | 0 lib/{compat => external}/vasprintf.c | 0 44 files changed, 32 insertions(+), 32 deletions(-) rename lib/{ => external}/fetch/common.c (100%) rename lib/{ => external}/fetch/common.h (100%) rename lib/{ => external}/fetch/errlist.sh (100%) rename lib/{ => external}/fetch/fetch.c (100%) rename lib/{ => external}/fetch/fetch.h (100%) rename lib/{ => external}/fetch/file.c (100%) rename lib/{ => external}/fetch/ftp.c (100%) rename lib/{ => external}/fetch/ftp.errors (100%) rename lib/{ => external}/fetch/http.c (100%) rename lib/{ => external}/fetch/http.errors (100%) rename lib/{compat => external}/humanize_number.c (100%) rename lib/{ => external}/portableproplib/prop/prop_array.h (100%) rename lib/{ => external}/portableproplib/prop/prop_bool.h (100%) rename lib/{ => external}/portableproplib/prop/prop_data.h (100%) rename lib/{ => external}/portableproplib/prop/prop_dictionary.h (100%) rename lib/{ => external}/portableproplib/prop/prop_ingest.h (100%) rename lib/{ => external}/portableproplib/prop/prop_number.h (100%) rename lib/{ => external}/portableproplib/prop/prop_object.h (100%) rename lib/{ => external}/portableproplib/prop/prop_string.h (100%) rename lib/{ => external}/portableproplib/prop/proplib.h (100%) rename lib/{ => external}/portableproplib/prop/rbtree.h (100%) rename lib/{ => external}/portableproplib/prop_array.c (100%) rename lib/{ => external}/portableproplib/prop_array_util.c (100%) rename lib/{ => external}/portableproplib/prop_bool.c (100%) rename lib/{ => external}/portableproplib/prop_data.c (100%) rename lib/{ => external}/portableproplib/prop_dictionary.c (100%) rename lib/{ => external}/portableproplib/prop_dictionary_util.c (100%) rename lib/{ => external}/portableproplib/prop_ingest.c (100%) rename lib/{ => external}/portableproplib/prop_number.c (100%) rename lib/{ => external}/portableproplib/prop_object.c (100%) rename lib/{ => external}/portableproplib/prop_object_impl.h (100%) rename lib/{ => external}/portableproplib/prop_rb_impl.h (100%) rename lib/{ => external}/portableproplib/prop_stack.c (100%) rename lib/{ => external}/portableproplib/prop_stack.h (100%) rename lib/{ => external}/portableproplib/prop_string.c (100%) rename lib/{ => external}/portableproplib/prop_zlib.c (100%) rename lib/{ => external}/portableproplib/rb.c (100%) rename lib/{compat => external}/strcasestr.c (100%) rename lib/{compat => external}/strlcat.c (100%) rename lib/{compat => external}/strlcpy.c (100%) rename lib/{compat => external}/vasprintf.c (100%) diff --git a/LICENSE.3RDPARTY b/LICENSE.3RDPARTY index 4c335830..6361147d 100644 --- a/LICENSE.3RDPARTY +++ b/LICENSE.3RDPARTY @@ -1,4 +1,4 @@ -[lib/mkpath.c, lib/compat/strcasestr.c, include/queue.h] +[lib/external/mkpath.c, lib/external/strcasestr.c, include/queue.h] /* * Copyright (c) 1983, 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -57,7 +57,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -[lib/download.c, lib/fetch] +[lib/download.c, lib/external/fetch] /*- * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. @@ -86,7 +86,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -[lib/compat/strlc{at,py}.c] +[lib/external/strlc{at,py}.c] /* * Copyright (c) 1998 Todd C. Miller * @@ -103,7 +103,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -[lib/compat/vasprintf.c lib/plist_fetch.c] +[lib/external/vasprintf.c lib/plist_fetch.c] /*- * Copyright (c) 2007, 2008, 2009 Joerg Sonnenberger . * All rights reserved. @@ -133,7 +133,7 @@ * SUCH DAMAGE. */ -[lib/compat/humanize_number.c, lib/external/fexec.c] +[lib/external/humanize_number.c, lib/external/fexec.c] /* * Copyright (c) 1997, 1998, 1999, 2002, 2003 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/configure b/configure index 1459d01d..f8895d79 100755 --- a/configure +++ b/configure @@ -192,10 +192,10 @@ fi [ -z "$DEBUG" ] && DEBUG=yes echo "CC = $CC" >>$CONFIG_MK -echo "CFLAGS = -O2" >>$CONFIG_MK +echo "CFLAGS += -O2" >>$CONFIG_MK -echo "LDFLAGS = -L\$(TOPDIR)/lib" >>$CONFIG_MK -echo "CPPFLAGS = -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK +echo "LDFLAGS += -L\$(TOPDIR)/lib" >>$CONFIG_MK +echo "CFLAGS += -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_SYSCONF_PATH=\\\"${ETCDIR}\\\"" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_SYSDEFCONF_PATH=\\\"${SHAREDIR}/xbps.d\\\"" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_VERSION=\\\"${VERSION}\\\"" >>$CONFIG_MK @@ -369,13 +369,13 @@ if [ "$CC" = "tcc" ]; then fi # libfetch -echo "CPPFLAGS += -I\$(TOPDIR)/lib/fetch" >>$CONFIG_MK +echo "CFLAGS += -I\$(TOPDIR)/lib/external/fetch" >>$CONFIG_MK echo "LDFLAGS += -lssl" >>$CONFIG_MK echo "STATIC_LIBS = \$(TOPDIR)/lib/libxbps.a" >>$CONFIG_MK # proplib -echo "CPPFLAGS += -I\$(TOPDIR)/lib/portableproplib" >>$CONFIG_MK -echo "CPPFLAGS += -I\$(TOPDIR)/lib/portableproplib/prop" >>$CONFIG_MK +echo "CFLAGS += -I\$(TOPDIR)/lib/external/portableproplib" >>$CONFIG_MK +echo "CFLAGS += -I\$(TOPDIR)/lib/external/portableproplib/prop" >>$CONFIG_MK echo "CFLAGS += -pthread" >>$CONFIG_MK # @@ -433,7 +433,7 @@ fi if test -n "$HAVE_VASPRINTF"; then echo "CPPFLAGS += -DHAVE_VASPRINTF" >> $CONFIG_MK else - echo "COMPAT_OBJS+= compat/vasprintf.o" >>$CONFIG_MK + echo "COMPAT_OBJS+= external/vasprintf.o" >>$CONFIG_MK fi # @@ -456,7 +456,7 @@ if $XCC _$func.c -o _$func 2>/dev/null; then echo "CPPFLAGS += -DHAVE_STRCASESTR" >>$CONFIG_MK else echo no. - echo "COMPAT_OBJS += compat/strcasestr.o" >>$CONFIG_MK + echo "COMPAT_OBJS += external/strcasestr.o" >>$CONFIG_MK fi rm -f _$func _$func.c @@ -479,7 +479,7 @@ if $XCC _$func.c -o _$func 2>/dev/null; then echo "CPPFLAGS += -DHAVE_STRLCPY" >> $CONFIG_MK else echo no. - echo "COMPAT_OBJS += compat/strlcpy.o" >>$CONFIG_MK + echo "COMPAT_OBJS += external/strlcpy.o" >>$CONFIG_MK fi rm -f _$func.c _$func @@ -501,7 +501,7 @@ if $XCC _$func.c -o _$func 2>/dev/null; then echo "CPPFLAGS += -DHAVE_STRLCAT" >>$CONFIG_MK else echo no. - echo "COMPAT_OBJS += compat/strlcat.o" >>$CONFIG_MK + echo "COMPAT_OBJS += external/strlcat.o" >>$CONFIG_MK fi rm -f _$func.c _$func @@ -544,7 +544,7 @@ if $XCC _$func.c -lutil -o _$func 2>/dev/null; then echo "CPPFLAGS+= -DHAVE_HUMANIZE_NUMBER" >>$CONFIG_MK else echo no. - echo "COMPAT_OBJS+= compat/humanize_number.o" >>$CONFIG_MK + echo "COMPAT_OBJS+= external/humanize_number.o" >>$CONFIG_MK fi rm -f _$func.c _$func @@ -565,7 +565,7 @@ if $XCC _$func.c -o _$func 2>/dev/null; then echo "CPPFLAGS += -DHAVE_RBTREE" >>$CONFIG_MK else echo no. - echo "LIBPROP_OBJS += portableproplib/rb.o" >>$CONFIG_MK + echo "LIBPROP_OBJS += external/portableproplib/rb.o" >>$CONFIG_MK fi rm -f _$func.c _$func diff --git a/lib/Makefile b/lib/Makefile index 5c10bf6f..8d52c6f4 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -9,24 +9,24 @@ LIBXBPS_SHLIB = libxbps.so.$(LIBXBPS_MAJOR).$(LIBXBPS_MINOR).$(LIBXBPS_MICRO) LDFLAGS += $(LIBXBPS_LDFLAGS) -shared -Wl,-soname,libxbps.so.$(LIBXBPS_MAJOR) # portableproplib -LIBPROP_OBJS += portableproplib/prop_array.o portableproplib/prop_bool.o -LIBPROP_OBJS += portableproplib/prop_dictionary.o portableproplib/prop_ingest.o -LIBPROP_OBJS += portableproplib/prop_object.o -LIBPROP_OBJS += portableproplib/prop_stack.o portableproplib/prop_string.o -LIBPROP_OBJS += portableproplib/prop_array_util.o portableproplib/prop_number.o -LIBPROP_OBJS += portableproplib/prop_dictionary_util.o portableproplib/prop_zlib.o -LIBPROP_OBJS += portableproplib/prop_data.o +LIBPROP_OBJS += external/portableproplib/prop_array.o external/portableproplib/prop_bool.o +LIBPROP_OBJS += external/portableproplib/prop_dictionary.o external/portableproplib/prop_ingest.o +LIBPROP_OBJS += external/portableproplib/prop_object.o +LIBPROP_OBJS += external/portableproplib/prop_stack.o external/portableproplib/prop_string.o +LIBPROP_OBJS += external/portableproplib/prop_array_util.o external/portableproplib/prop_number.o +LIBPROP_OBJS += external/portableproplib/prop_dictionary_util.o external/portableproplib/prop_zlib.o +LIBPROP_OBJS += external/portableproplib/prop_data.o LIBPROP_CFLAGS = -Wno-unused-parameter -fvisibility=hidden # libfetch -LIBFETCH_OBJS = fetch/common.o fetch/fetch.o fetch/file.o -LIBFETCH_OBJS += fetch/ftp.o fetch/http.o +LIBFETCH_OBJS = external/fetch/common.o external/fetch/fetch.o external/fetch/file.o +LIBFETCH_OBJS += external/fetch/ftp.o external/fetch/http.o LIBFETCH_CPPFLAGS = -DFTP_COMBINE_CWDS -DINET6 -DWITH_SSL ifdef HAVE_VISIBILITY LIBFETCH_CFLAGS= -fvisibility=hidden endif -LIBFETCH_INCS = fetch/common.h -LIBFETCH_GEN = fetch/ftperr.h fetch/httperr.h +LIBFETCH_INCS = external/fetch/common.h +LIBFETCH_GEN = external/fetch/ftperr.h external/fetch/httperr.h # External code used by libxbps EXTOBJS = external/dewey.o external/fexec.o external/mkpath.o @@ -54,13 +54,13 @@ OBJS += $(EXTOBJS) $(COMPAT_OBJS) .PHONY: all all: libxbps.so libxbps.a -fetch/ftperr.h: fetch/ftp.errors +external/fetch/ftperr.h: external/fetch/ftp.errors @printf " [GEN]\t\t$@\n" - ${SILENT}./fetch/errlist.sh ftp_errlist FTP $< > $@ + ${SILENT}./external/fetch/errlist.sh ftp_errlist FTP $< > $@ -fetch/httperr.h: fetch/http.errors +external/fetch/httperr.h: external/fetch/http.errors @printf " [GEN]\t\t$@\n" - @./fetch/errlist.sh http_errlist HTTP $< > $@ + @./external/fetch/errlist.sh http_errlist HTTP $< > $@ $(LIBFETCH_OBJS): %.o: %.c $(LIBFETCH_INCS) $(LIBFETCH_GEN) @printf " [CC]\t\t$@\n" diff --git a/lib/fetch/common.c b/lib/external/fetch/common.c similarity index 100% rename from lib/fetch/common.c rename to lib/external/fetch/common.c diff --git a/lib/fetch/common.h b/lib/external/fetch/common.h similarity index 100% rename from lib/fetch/common.h rename to lib/external/fetch/common.h diff --git a/lib/fetch/errlist.sh b/lib/external/fetch/errlist.sh similarity index 100% rename from lib/fetch/errlist.sh rename to lib/external/fetch/errlist.sh diff --git a/lib/fetch/fetch.c b/lib/external/fetch/fetch.c similarity index 100% rename from lib/fetch/fetch.c rename to lib/external/fetch/fetch.c diff --git a/lib/fetch/fetch.h b/lib/external/fetch/fetch.h similarity index 100% rename from lib/fetch/fetch.h rename to lib/external/fetch/fetch.h diff --git a/lib/fetch/file.c b/lib/external/fetch/file.c similarity index 100% rename from lib/fetch/file.c rename to lib/external/fetch/file.c diff --git a/lib/fetch/ftp.c b/lib/external/fetch/ftp.c similarity index 100% rename from lib/fetch/ftp.c rename to lib/external/fetch/ftp.c diff --git a/lib/fetch/ftp.errors b/lib/external/fetch/ftp.errors similarity index 100% rename from lib/fetch/ftp.errors rename to lib/external/fetch/ftp.errors diff --git a/lib/fetch/http.c b/lib/external/fetch/http.c similarity index 100% rename from lib/fetch/http.c rename to lib/external/fetch/http.c diff --git a/lib/fetch/http.errors b/lib/external/fetch/http.errors similarity index 100% rename from lib/fetch/http.errors rename to lib/external/fetch/http.errors diff --git a/lib/compat/humanize_number.c b/lib/external/humanize_number.c similarity index 100% rename from lib/compat/humanize_number.c rename to lib/external/humanize_number.c diff --git a/lib/portableproplib/prop/prop_array.h b/lib/external/portableproplib/prop/prop_array.h similarity index 100% rename from lib/portableproplib/prop/prop_array.h rename to lib/external/portableproplib/prop/prop_array.h diff --git a/lib/portableproplib/prop/prop_bool.h b/lib/external/portableproplib/prop/prop_bool.h similarity index 100% rename from lib/portableproplib/prop/prop_bool.h rename to lib/external/portableproplib/prop/prop_bool.h diff --git a/lib/portableproplib/prop/prop_data.h b/lib/external/portableproplib/prop/prop_data.h similarity index 100% rename from lib/portableproplib/prop/prop_data.h rename to lib/external/portableproplib/prop/prop_data.h diff --git a/lib/portableproplib/prop/prop_dictionary.h b/lib/external/portableproplib/prop/prop_dictionary.h similarity index 100% rename from lib/portableproplib/prop/prop_dictionary.h rename to lib/external/portableproplib/prop/prop_dictionary.h diff --git a/lib/portableproplib/prop/prop_ingest.h b/lib/external/portableproplib/prop/prop_ingest.h similarity index 100% rename from lib/portableproplib/prop/prop_ingest.h rename to lib/external/portableproplib/prop/prop_ingest.h diff --git a/lib/portableproplib/prop/prop_number.h b/lib/external/portableproplib/prop/prop_number.h similarity index 100% rename from lib/portableproplib/prop/prop_number.h rename to lib/external/portableproplib/prop/prop_number.h diff --git a/lib/portableproplib/prop/prop_object.h b/lib/external/portableproplib/prop/prop_object.h similarity index 100% rename from lib/portableproplib/prop/prop_object.h rename to lib/external/portableproplib/prop/prop_object.h diff --git a/lib/portableproplib/prop/prop_string.h b/lib/external/portableproplib/prop/prop_string.h similarity index 100% rename from lib/portableproplib/prop/prop_string.h rename to lib/external/portableproplib/prop/prop_string.h diff --git a/lib/portableproplib/prop/proplib.h b/lib/external/portableproplib/prop/proplib.h similarity index 100% rename from lib/portableproplib/prop/proplib.h rename to lib/external/portableproplib/prop/proplib.h diff --git a/lib/portableproplib/prop/rbtree.h b/lib/external/portableproplib/prop/rbtree.h similarity index 100% rename from lib/portableproplib/prop/rbtree.h rename to lib/external/portableproplib/prop/rbtree.h diff --git a/lib/portableproplib/prop_array.c b/lib/external/portableproplib/prop_array.c similarity index 100% rename from lib/portableproplib/prop_array.c rename to lib/external/portableproplib/prop_array.c diff --git a/lib/portableproplib/prop_array_util.c b/lib/external/portableproplib/prop_array_util.c similarity index 100% rename from lib/portableproplib/prop_array_util.c rename to lib/external/portableproplib/prop_array_util.c diff --git a/lib/portableproplib/prop_bool.c b/lib/external/portableproplib/prop_bool.c similarity index 100% rename from lib/portableproplib/prop_bool.c rename to lib/external/portableproplib/prop_bool.c diff --git a/lib/portableproplib/prop_data.c b/lib/external/portableproplib/prop_data.c similarity index 100% rename from lib/portableproplib/prop_data.c rename to lib/external/portableproplib/prop_data.c diff --git a/lib/portableproplib/prop_dictionary.c b/lib/external/portableproplib/prop_dictionary.c similarity index 100% rename from lib/portableproplib/prop_dictionary.c rename to lib/external/portableproplib/prop_dictionary.c diff --git a/lib/portableproplib/prop_dictionary_util.c b/lib/external/portableproplib/prop_dictionary_util.c similarity index 100% rename from lib/portableproplib/prop_dictionary_util.c rename to lib/external/portableproplib/prop_dictionary_util.c diff --git a/lib/portableproplib/prop_ingest.c b/lib/external/portableproplib/prop_ingest.c similarity index 100% rename from lib/portableproplib/prop_ingest.c rename to lib/external/portableproplib/prop_ingest.c diff --git a/lib/portableproplib/prop_number.c b/lib/external/portableproplib/prop_number.c similarity index 100% rename from lib/portableproplib/prop_number.c rename to lib/external/portableproplib/prop_number.c diff --git a/lib/portableproplib/prop_object.c b/lib/external/portableproplib/prop_object.c similarity index 100% rename from lib/portableproplib/prop_object.c rename to lib/external/portableproplib/prop_object.c diff --git a/lib/portableproplib/prop_object_impl.h b/lib/external/portableproplib/prop_object_impl.h similarity index 100% rename from lib/portableproplib/prop_object_impl.h rename to lib/external/portableproplib/prop_object_impl.h diff --git a/lib/portableproplib/prop_rb_impl.h b/lib/external/portableproplib/prop_rb_impl.h similarity index 100% rename from lib/portableproplib/prop_rb_impl.h rename to lib/external/portableproplib/prop_rb_impl.h diff --git a/lib/portableproplib/prop_stack.c b/lib/external/portableproplib/prop_stack.c similarity index 100% rename from lib/portableproplib/prop_stack.c rename to lib/external/portableproplib/prop_stack.c diff --git a/lib/portableproplib/prop_stack.h b/lib/external/portableproplib/prop_stack.h similarity index 100% rename from lib/portableproplib/prop_stack.h rename to lib/external/portableproplib/prop_stack.h diff --git a/lib/portableproplib/prop_string.c b/lib/external/portableproplib/prop_string.c similarity index 100% rename from lib/portableproplib/prop_string.c rename to lib/external/portableproplib/prop_string.c diff --git a/lib/portableproplib/prop_zlib.c b/lib/external/portableproplib/prop_zlib.c similarity index 100% rename from lib/portableproplib/prop_zlib.c rename to lib/external/portableproplib/prop_zlib.c diff --git a/lib/portableproplib/rb.c b/lib/external/portableproplib/rb.c similarity index 100% rename from lib/portableproplib/rb.c rename to lib/external/portableproplib/rb.c diff --git a/lib/compat/strcasestr.c b/lib/external/strcasestr.c similarity index 100% rename from lib/compat/strcasestr.c rename to lib/external/strcasestr.c diff --git a/lib/compat/strlcat.c b/lib/external/strlcat.c similarity index 100% rename from lib/compat/strlcat.c rename to lib/external/strlcat.c diff --git a/lib/compat/strlcpy.c b/lib/external/strlcpy.c similarity index 100% rename from lib/compat/strlcpy.c rename to lib/external/strlcpy.c diff --git a/lib/compat/vasprintf.c b/lib/external/vasprintf.c similarity index 100% rename from lib/compat/vasprintf.c rename to lib/external/vasprintf.c