Hello community, here is the log from the commit of package orcania for openSUSE:Factory checked in at 2019-01-08 12:27:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/orcania (Old) and /work/SRC/openSUSE:Factory/.orcania.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "orcania" Tue Jan 8 12:27:19 2019 rev:3 rq:662384 version:1.2.9 Changes: -------- --- /work/SRC/openSUSE:Factory/orcania/orcania.changes 2018-08-27 12:58:53.308786002 +0200 +++ /work/SRC/openSUSE:Factory/.orcania.new.28833/orcania.changes 2019-01-08 12:29:56.896175968 +0100 @@ -1,0 +2,16 @@ +Fri Dec 28 16:18:34 UTC 2018 - [email protected] + +- Update to version 1.2.9 + * Fix build with Makefile. + * Improve build config file and install headers. + * Add config file orcania-cfg.h dynamically built with the options. + * Fix pkgconfig file + * Fix CMake build when /usr/local is not present in default build + path. + * Fix Makefile soname. +- Remove patches: + * 0001-Fix-pkg-config-information-add-requires-fields-as-me.patch + * 0002-Fix-pkg-config-got-mixed-between-requires-and-requir.patch + * orcania-fix-build.patch + +------------------------------------------------------------------- Old: ---- 0001-Fix-pkg-config-information-add-requires-fields-as-me.patch 0002-Fix-pkg-config-got-mixed-between-requires-and-requir.patch orcania-1.2.4.tar.gz orcania-fix-build.patch New: ---- orcania-1.2.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ orcania.spec ++++++ --- /var/tmp/diff_new_pack.a7kdeR/_old 2019-01-08 12:29:57.352175471 +0100 +++ /var/tmp/diff_new_pack.a7kdeR/_new 2019-01-08 12:29:57.356175467 +0100 @@ -1,6 +1,7 @@ # # spec file for package orcania # +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2018, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -18,16 +19,13 @@ %define sover 1_2 Name: orcania -Version: 1.2.4 +Version: 1.2.9 Release: 0 Summary: MISC function Library -License: LGPL-2.1+ +License: LGPL-2.1-or-later Group: Development/Languages/C and C++ URL: https://github.com/babelouest/orcania Source: https://github.com/babelouest/orcania/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch0: orcania-fix-build.patch -Patch1: 0001-Fix-pkg-config-information-add-requires-fields-as-me.patch -Patch2: 0002-Fix-pkg-config-got-mixed-between-requires-and-requir.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -55,9 +53,6 @@ %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 %build %cmake @@ -76,6 +71,7 @@ %files devel %{_includedir}/orcania.h +%{_includedir}/orcania-cfg.h %{_libdir}/liborcania.so %{_libdir}/pkgconfig/liborcania.pc ++++++ orcania-1.2.4.tar.gz -> orcania-1.2.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/.gitignore new/orcania-1.2.9/.gitignore --- old/orcania-1.2.4/.gitignore 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/.gitignore 2018-12-07 04:05:00.000000000 +0100 @@ -6,3 +6,4 @@ split_test memory_test jansson_test +orcania-cfg.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/.travis.yml new/orcania-1.2.9/.travis.yml --- old/orcania-1.2.4/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/orcania-1.2.9/.travis.yml 2018-12-07 04:05:00.000000000 +0100 @@ -0,0 +1,28 @@ +# travis configuration file +# Copyright 2018 Ilya Shipitsin <[email protected]> +# Nicolas Mora <[email protected]> +sudo: required +language: c +addons: + apt: + packages: [ libjansson-dev, check, libsubunit-dev, cppcheck ] +matrix: + include: + - os: linux + compiler: gcc + - os: linux + compiler: clang + - env: LABEL=cppcheck + os: linux + script: + - cppcheck --force --enable=warning,missingInclude --error-exitcode=1 . >build.log 2>&1 || (cat build.log && exit 1) +script: + - mkdir build && cd build + - cmake -DBUILD_ORCANIA_TESTING=on .. + - make test package + - sudo make install + - cmake -DBUILD_ORCANIA_TESTING=on -DWITH_JANSSON=off .. + - make test package + - cd ../src + - make + - make JANSSONFLAG=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/CHANGELOG.md new/orcania-1.2.9/CHANGELOG.md --- old/orcania-1.2.4/CHANGELOG.md 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/CHANGELOG.md 2018-12-07 04:05:00.000000000 +0100 @@ -1,5 +1,31 @@ # Orcania Changelog +## 1.2.9 + +- Add build flag to force inline implementation of strstr if the host system is + not known to implement strstr but isn't listed as so, like FreeRTOS + Thanks to Dirk Uhlemann +- Avoid babelouest/ulfius#84 + +## 1.2.8 + +- Fix build with Makefile +- Improve build config file and install headers + +## 1.2.7 + +- Add config file orcania-cfg.h dynamically built with the options + +## 1.2.6 + +- Add Travis CI +- Change cmake option BUILD_TESTING to BUILD_YDER_TESTING +- Add RPM in CMake script package + +## 1.2.5 + +- Fix pkgconfig file + ## 1.2.4 - Fix CMake build when /usr/local is not present in default build path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/CMakeLists.txt new/orcania-1.2.9/CMakeLists.txt --- old/orcania-1.2.4/CMakeLists.txt 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/CMakeLists.txt 2018-12-07 04:05:00.000000000 +0100 @@ -24,11 +24,13 @@ # library info set(PROJECT_DESCRIPTION "Potluck with different functions for different purposes that can be shared among programs") +set(PROJECT_HOMEPAGE_URL "https://github.com/babelouest/orcania/") set(PROJECT_BUGREPORT_PATH "https://github.com/babelouest/orcania/issues") - set(LIBRARY_VERSION_MAJOR "1") set(LIBRARY_VERSION_MINOR "2") -set(LIBRARY_VERSION_PATCH "4") +set(LIBRARY_VERSION_PATCH "9") + +set(PROJECT_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") set(LIBRARY_SOVERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}") @@ -67,6 +69,13 @@ ${SRC_DIR}/memory.c ${SRC_DIR}/orcania.c) +option(WITH_STRSTR "Use inline implementation of strstr" OFF) +if (WITH_STRSTR) + set(STRSTR ON) +else () + set(STRSTR OFF) +endif () + # dependencies option(WITH_JANSSON "Use jansson library" ON) @@ -78,11 +87,26 @@ if (JANSSON_FOUND) set(LIBS ${JANSSON_LIBRARIES}) include_directories(${JANSSON_INCLUDE_DIRS}) + set(DISABLE_JANSSON OFF) endif () else () add_definitions(-DU_DISABLE_JANSSON) + set(DISABLE_JANSSON ON) endif () +if (WITH_JANSSON) + set(PKGCONF_REQ "") + set(PKGCONF_REQ_PRIVATE "jansson >= 2.1") +else () + set(PKGCONF_REQ "") + set(PKGCONF_REQ_PRIVATE "") +endif () + +# build orcania-cfg.h file +configure_file(${INC_DIR}/orcania-cfg.h.in ${PROJECT_BINARY_DIR}/orcania-cfg.h) +set (CMAKE_EXTRA_INCLUDE_FILES ${PROJECT_BINARY_DIR}) +include_directories(${PROJECT_BINARY_DIR}) + # static library option(BUILD_STATIC "Build static library." OFF) @@ -99,7 +123,7 @@ add_library(orcania SHARED ${LIB_SRC}) set_target_properties(orcania PROPERTIES COMPILE_OPTIONS -Wextra - PUBLIC_HEADER ${INC_DIR}/orcania.h + PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h" VERSION "${LIBRARY_VERSION}" SOVERSION "${LIBRARY_SOVERSION}") if (WIN32) @@ -109,9 +133,9 @@ # tests -option(BUILD_TESTING "Build the testing tree." OFF) # because we don not use include(CTest) +option(BUILD_ORCANIA_TESTING "Build the testing tree." OFF) # because we don not use include(CTest) -if (BUILD_TESTING) +if (BUILD_ORCANIA_TESTING) include(FindCheck) find_package(Check) if (CHECK_FOUND) @@ -162,7 +186,7 @@ configure_file(liborcania.pc.in liborcania.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liborcania.pc - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) set(TARGETS orcania) if (BUILD_STATIC) @@ -209,13 +233,28 @@ set(PACKAGE_IGNORED_FILES "${CMAKE_CURRENT_BINARY_DIR}/;/.git/;.gitignore;~$;${CPACK_SOURCE_IGNORE_FILES}") +set(CPACK_PACKAGE_NAME "liborcania") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Potluck for C programs") set(CPACK_GENERATOR "TGZ;DEB") +set(CPACK_PACKAGE_VERSION_MAJOR ${LIBRARY_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${LIBRARY_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${LIBRARY_VERSION_PATCH}) + +option(BUILD_RPM "Build a RPM for your system" OFF) +if (BUILD_RPM) + set(CPACK_GENERATOR "TGZ;DEB;RPM") + set(CPACK_RPM_PACKAGE_LICENSE "LGPL") + set(CPACK_RPM_PACKAGE_URL "http://babelouest.github.io/orcania/") +endif () -set(CPACK_DEBIAN_PACKAGE_NAME "liborcania") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION}) set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/babelouest/orcania") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4), libcurl3-gnutls (>= 7.16.2), libjansson4 (>= 2.1)") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4)") +if (WITH_JANSSON) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjansson4 (>= 2.1)") +endif () +set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME}) set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME}) set(CPACK_SOURCE_GENERATOR "TGZ") @@ -226,3 +265,10 @@ add_custom_target(dist_o COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + +message(STATUS "Jansson library support: ${WITH_JANSSON}") +message(STATUS "Force inline implementation of strstr: ${WITH_STRSTR}") +message(STATUS "Build static library: ${BUILD_STATIC}") +message(STATUS "Build testing tree: ${BUILD_ULFIUS_TESTING}") +message(STATUS "Install the header files: ${INSTALL_HEADER}") +message(STATUS "Build RPM package: ${BUILD_RPM}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/Makefile new/orcania-1.2.9/Makefile --- old/orcania-1.2.4/Makefile 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/Makefile 2018-12-07 04:05:00.000000000 +0100 @@ -34,5 +34,5 @@ uninstall: cd $(LIBORCANIA_LOCATION) && $(MAKE) uninstall -liborcania.so: +release: cd $(LIBORCANIA_LOCATION) && $(MAKE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/README.md new/orcania-1.2.9/README.md --- old/orcania-1.2.4/README.md 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/README.md 2018-12-07 04:05:00.000000000 +0100 @@ -2,6 +2,8 @@ Potluck with different functions for different purposes that can be shared among C programs. +[](https://travis-ci.com/babelouest/orcania) + ## Installation ### Distribution packages @@ -53,8 +55,10 @@ The available options for cmake are: - `-DBUILD_STATIC=[on|off]` (default `off`): Build the static archive in addition to the shared library - `-DWITH_JANSSON=[on|off]` (default `on`): Build with Jansson dependency -- `-DBUILD_TESTING=[on|off]` (default `off`): Build unit tests +- `-DWITH_STRSTR=[on|off]` (default `off`): Force using inline implementation of strstr +- `-DBUILD_ORCANIA_TESTING=[on|off]` (default `off`): Build unit tests - `-DINSTALL_HEADER=[on|off]` (default `on`): Install header file `orcania.h` +- `-DBUILD_RPM=[on|off]` (default `off`): Build RPM package when running `make package` - `-DCMAKE_BUILD_TYPE=[Debug|Release]` (default `Release`): Compile with debugging symbols or not #### Good ol' Makefile - Linux only @@ -68,11 +72,18 @@ This will install Orcania's files under `/usr/local/` DESTDIR. -If you don't want/need `libjansson` specific functions, you can skip it with the build option `JANSSONFLAG=-DU_DISABLE_JANSSON` +If you don't want/need `libjansson` specific functions, you can skip it with the build option `JANSSONFLAG=1` + +``` +$ cd src +$ make JANSSONFLAG=1 +``` + +If you want to force using inline implementation of `strstr`, you can append the build option `STRSTRFLAG=1`. This is useful if your systemdoesn't have an implementation of the function `strstr` but isn't listed as one in Orcania. Like FreeRTOS. ``` $ cd src -$ make JANSSONFLAG=-DU_DISABLE_JANSSON +$ make STRSTRFLAG=1 ``` To build and install as a static archive, use the make commands `make static*`: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/include/orcania-cfg.h.in new/orcania-1.2.9/include/orcania-cfg.h.in --- old/orcania-1.2.4/include/orcania-cfg.h.in 1970-01-01 01:00:00.000000000 +0100 +++ new/orcania-1.2.9/include/orcania-cfg.h.in 2018-12-07 04:05:00.000000000 +0100 @@ -0,0 +1,34 @@ +/** + * + * Orcania library + * + * Different functions for different purposes but that can be shared between + * other projects + * + * orcania-cfg.h.in: configuration file + * + * Copyright 2018 Nicolas Mora <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef _ORCANIA_CFG_H_ +#define _ORCANIA_CFG_H_ + +#define ORCANIA_VERSION ${PROJECT_VERSION} +#cmakedefine DISABLE_JANSSON +#cmakedefine STRSTR + +#endif /* _ORCANIA_CFG_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/include/orcania.h new/orcania-1.2.9/include/orcania.h --- old/orcania-1.2.4/include/orcania.h 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/include/orcania.h 2018-12-07 04:05:00.000000000 +0100 @@ -5,16 +5,37 @@ * Different functions for different purposes but that can be shared between * other projects * + * orcania.h: public header file + * + * Copyright 2015-2018 Nicolas Mora <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * */ #ifndef __ORCANIA_H__ #define __ORCANIA_H__ +#include "orcania-cfg.h" + #ifndef U_DISABLE_JANSSON #include <jansson.h> +#else +#include <stdio.h> +#include <stdlib.h> #endif -#define ORCANIA_VERSION 1.2.4 /** * char * str_replace(const char * source, char * old, char * new) * replace all occurences of old by new in the string source diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/liborcania.pc.in new/orcania-1.2.9/liborcania.pc.in --- old/orcania-1.2.4/liborcania.pc.in 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/liborcania.pc.in 2018-12-07 04:05:00.000000000 +0100 @@ -7,5 +7,7 @@ Description: @PROJECT_DESCRIPTION@ URL: @PROJECT_BUGREPORT_PATH@ Version: @LIBRARY_VERSION@ +Requires: @PKGCONF_REQ@ +Requires.private: @PKGCONF_REQ_PRIVATE@ Libs: -L${libdir} -lorcania -Cflags: -I${includedir} \ No newline at end of file +Cflags: -I${includedir} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/src/Makefile new/orcania-1.2.9/src/Makefile --- old/orcania-1.2.4/src/Makefile 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/src/Makefile 2018-12-07 04:05:00.000000000 +0100 @@ -19,45 +19,79 @@ # License along with this library. If not, see <http://www.gnu.org/licenses/>. # DESTDIR=/usr/local +ORCANIA_INCLUDE=../include +CONFIG_TEMPLATE=$(ORCANIA_INCLUDE)/orcania-cfg.h.in +CONFIG_FILE=$(ORCANIA_INCLUDE)/orcania-cfg.h CC=gcc -CFLAGS+=-c -fPIC -Wall -Werror -Wextra -D_REENTRANT $(ADDITIONALFLAGS) $(JANSSONFLAG) +CFLAGS+=-c -fPIC -Wall -Werror -Wextra -I$(ORCANIA_INCLUDE) -D_REENTRANT $(ADDITIONALFLAGS) $(CPPFLAGS) OUTPUT=liborcania.so -VERSION=1.2.4 +VERSION=1.2.9 +OBJECTS=orcania.o memory.o base64.o +LIBS=-lc ifndef JANSSONFLAG -LJANSSON=-ljansson +DISABLE_JANSSON=0 +LIBS+= -ljansson +else +DISABLE_JANSSON=1 endif -LIBS=-lc $(LJANSSON) +ifdef STRSTRFLAG +STRSTR=1 +else +STRSTR=0 +endif all: release -liborcania.so: memory.o orcania.o base64.o - $(CC) -shared -fPIC -Wl,-soname,$(OUTPUT) -o $(OUTPUT).$(VERSION) orcania.o memory.o base64.o $(LIBS) $(LDFLAGS) +$(CONFIG_FILE): + @cp $(CONFIG_TEMPLATE) $(CONFIG_FILE) + @echo Config file $(CONFIG_FILE) generated + @sed -i -e 's/$${PROJECT_VERSION}/$(VERSION)/g' $(CONFIG_FILE) + @if [ "$(DISABLE_JANSSON)" = "1" ]; then \ + sed -i -e 's/\#cmakedefine DISABLE_JANSSON/\#define U_DISABLE_JANSSON/g' $(CONFIG_FILE); \ + echo "JANSSON SUPPORT DISABLED"; \ + else \ + sed -i -e 's/\#cmakedefine DISABLE_JANSSON/\/* #undef U_DISABLE_JANSSON *\//g' $(CONFIG_FILE); \ + echo "JANSSON SUPPORT ENABLED"; \ + fi + @if [ "$(STRSTR)" = "1" ]; then \ + sed -i -e 's/\#cmakedefine STRSTR/\#define O_STRSTR/g' $(CONFIG_FILE); \ + echo "FORCE IMPLEMENT STRSTR ENABLED"; \ + else \ + sed -i -e 's/\#cmakedefine STRSTR/\/* #undef O_STRSTR *\//g' $(CONFIG_FILE); \ + echo "FORCE IMPLEMENT STRSTR DISABLED"; \ + fi + +liborcania.so: $(OBJECTS) + $(CC) -shared -fPIC -Wl,-soname,$(OUTPUT) -o $(OUTPUT).$(VERSION) $(OBJECTS) $(LIBS) $(LDFLAGS) ln -sf $(OUTPUT).$(VERSION) $(OUTPUT) -liborcania.a: memory.o orcania.o base64.o - ar rcs liborcania.a memory.o orcania.o base64.o +liborcania.a: $(OBJECTS) + ar rcs liborcania.a $(OBJECTS) -%.o: %.c ../include/orcania.h +%.o: %.c $(CONFIG_FILE) ../include/orcania.h $(CC) $(CFLAGS) $(CPPFLAGS) $< clean: - rm -f *.o *.so *.a $(OUTPUT) $(OUTPUT).* + rm -f *.o *.so *.a $(OUTPUT) $(OUTPUT).* $(CONFIG_FILE) install: all install $(OUTPUT).$(VERSION) $(DESTDIR)/lib - install ../include/orcania.h $(DESTDIR)/include + install -m644 ../include/orcania.h $(DESTDIR)/include + install -m644 $(CONFIG_FILE) $(DESTDIR)/include -ldconfig static-install: static install liborcania.a $(DESTDIR)/lib - install ../include/orcania.h $(DESTDIR)/include + install -m644 ../include/orcania.h $(DESTDIR)/include + install -m644 $(CONFIG_FILE) $(DESTDIR)/include uninstall: rm -f $(DESTDIR)/lib/$(OUTPUT) $(DESTDIR)/lib/liborcania.a rm -f $(DESTDIR)/lib/$(OUTPUT).* rm -f $(DESTDIR)/include/orcania.h + rm -f $(DESTDIR)/include/orcania-cfg.h debug: ADDITIONALFLAGS=-DDEBUG -g -O0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/src/orcania.c new/orcania-1.2.9/src/orcania.c --- old/orcania-1.2.4/src/orcania.c 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/src/orcania.c 2018-12-07 04:05:00.000000000 +0100 @@ -1,3 +1,29 @@ +/** + * + * Orcania library + * + * Different functions for different purposes but that can be shared between + * other projects + * + * orcania.c: main functions definitions + * + * Copyright 2015-2018 Nicolas Mora <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif @@ -83,6 +109,8 @@ out_len = vsnprintf(NULL, 0, message, argp); out = o_malloc(out_len+sizeof(char)); if (out == NULL) { + va_end(argp); + va_end(argp_cpy); return NULL; } vsnprintf(out, (out_len+sizeof(char)), message, argp_cpy); @@ -132,7 +160,7 @@ return 0; } else if (p1 != NULL && p2 == NULL) { return -1; - } else if (p1 == NULL && p2 != NULL) { + } else if (p1 == NULL) { return 1; } else { return strcmp(p1, p2); @@ -148,7 +176,7 @@ return 0; } else if (p1 != NULL && p2 == NULL) { return -1; - } else if (p1 == NULL && p2 != NULL) { + } else if (p1 == NULL) { return 1; } else { return strncmp(p1, p2, n); @@ -247,7 +275,7 @@ } } -#if defined(__linux__) || defined(__GLIBC__) || defined(_WIN32) +#if defined(__linux__) || defined(__GLIBC__) || defined(_WIN32) || defined(O_STRSTR) static char *strnstr(const char *haystack, const char *needle, size_t len) { int i; size_t needle_len; @@ -503,9 +531,9 @@ * If needle is not found, return NULL */ json_t * json_search(json_t * haystack, json_t * needle) { - json_t * value1, * value2; - size_t index; - const char * key; + json_t * value1 = NULL, * value2 = NULL; + size_t index = 0; + const char * key = NULL; if (!haystack || !needle) return NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/test/Makefile new/orcania-1.2.9/test/Makefile --- old/orcania-1.2.4/test/Makefile 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/test/Makefile 2018-12-07 04:05:00.000000000 +0100 @@ -20,8 +20,9 @@ # CC=gcc -CFLAGS=-Wall -D_REENTRANT -DDEBUG -g -O0 +CFLAGS=-Wall -D_REENTRANT -DDEBUG -g -O0 -I$(INCLUDE_LOCATION) ORCANIA_LOCATION=../src +INCLUDE_LOCATION=../include LIBS=-lc -lorcania -ljansson -lcheck -lpthread -lm -lrt -lsubunit -L$(ORCANIA_LOCATION) all: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/test/jansson_test.c new/orcania-1.2.9/test/jansson_test.c --- old/orcania-1.2.4/test/jansson_test.c 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/test/jansson_test.c 2018-12-07 04:05:00.000000000 +0100 @@ -8,7 +8,7 @@ #include <check.h> #include <jansson.h> -#include "../include/orcania.h" +#include "orcania.h" START_TEST(test_json_search) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/test/memory_test.c new/orcania-1.2.9/test/memory_test.c --- old/orcania-1.2.4/test/memory_test.c 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/test/memory_test.c 2018-12-07 04:05:00.000000000 +0100 @@ -7,12 +7,12 @@ #include <time.h> #include <check.h> -#include "../include/orcania.h" +#include "orcania.h" START_TEST(test_o_malloc) { void * var; - var = malloc(8); + var = o_malloc(8); ck_assert_ptr_ne(var, NULL); o_free(var); } @@ -21,11 +21,13 @@ START_TEST(test_o_realloc) { void * var; - var = malloc(8); + var = o_malloc(8); ck_assert_ptr_ne(var, NULL); - var = realloc(var, 16); + var = o_realloc(var, 16); ck_assert_ptr_ne(var, NULL); - o_free(var); + if (var != NULL) { + o_free(var); + } } END_TEST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/test/split_test.c new/orcania-1.2.9/test/split_test.c --- old/orcania-1.2.4/test/split_test.c 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/test/split_test.c 2018-12-07 04:05:00.000000000 +0100 @@ -7,7 +7,7 @@ #include <time.h> #include <check.h> -#include "../include/orcania.h" +#include "orcania.h" START_TEST(test_split_string) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orcania-1.2.4/test/str_test.c new/orcania-1.2.9/test/str_test.c --- old/orcania-1.2.4/test/str_test.c 2018-07-28 01:28:38.000000000 +0200 +++ new/orcania-1.2.9/test/str_test.c 2018-12-07 04:05:00.000000000 +0100 @@ -7,7 +7,7 @@ #include <time.h> #include <check.h> -#include "../include/orcania.h" +#include "orcania.h" START_TEST(test_str_replace) {
