uncommitted - paraglob
Ready changes
Summary
Import uploads missing from VCS:Diff
diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches
new file mode 100644
index 0000000..6857a8d
--- /dev/null
+++ b/.pc/.quilt_patches
@@ -0,0 +1 @@
+debian/patches
diff --git a/.pc/.quilt_series b/.pc/.quilt_series
new file mode 100644
index 0000000..c206706
--- /dev/null
+++ b/.pc/.quilt_series
@@ -0,0 +1 @@
+series
diff --git a/.pc/.version b/.pc/.version
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/.pc/.version
@@ -0,0 +1 @@
+2
diff --git a/.pc/applied-patches b/.pc/applied-patches
new file mode 100644
index 0000000..8dac375
--- /dev/null
+++ b/.pc/applied-patches
@@ -0,0 +1 @@
+fix-link.patch
diff --git a/.pc/fix-link.patch/src/ahocorasick/CMakeLists.txt b/.pc/fix-link.patch/src/ahocorasick/CMakeLists.txt
new file mode 100644
index 0000000..55bdc8a
--- /dev/null
+++ b/.pc/fix-link.patch/src/ahocorasick/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+add_library(ahocorasick STATIC ahocorasick.c node.c mpool.c replace.c AhoCorasickPlus.cpp)
diff --git a/.update-changes.cfg b/.update-changes.cfg
index c9aa250..7d7205b 100644
--- a/.update-changes.cfg
+++ b/.update-changes.cfg
@@ -5,5 +5,4 @@ function new_version_hook
{
version=$1
replace_version_in_rst README.md $version
- replace_version_in_c_header paraglob.h $version
}
diff --git a/CHANGES b/CHANGES
index 9c959c3..e602304 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,51 @@
+0.6.0 | 2020-12-07 17:50:29 +0000
+
+ * Release 0.6.0.
+
+0.5.0-10 | 2020-12-07 14:16:50 +0000
+
+ * Baseline refresh to reflect btest 0.64 (Christian Kreibich, Corelight)
+
+0.5.0-8 | 2020-12-02 11:06:31 -0800
+
+ * Update minimum required CMake to 3.5 (Jon Siwek, Corelight)
+
+0.5.0-6 | 2020-12-01 09:54:14 -0800
+
+ * Fix compiler warning about copying loop variable. (Robin Sommer, Corelight)
+
+0.5.0-4 | 2020-11-24 15:12:15 -0800
+
+ * Rely on GNUInstallDirs for libdir selection (Christian Kreibich, Corelight)
+
+ This allows libdir overrides to be inherited in Zeek-bundled installs.
+
+0.5.0-2 | 2020-09-21 13:35:55 -0700
+
+ * Avoid calling qsort() with null pointer argument (Jon Siwek, Corelight)
+
+ Likely no ill-effects of doing so since number of elements was always
+ observed to be zero whenever a null pointer was passed, but qsort() may
+ technically be annotated with a `nonnull` attribute, so that triggers an
+ error when using `-fsanitize=nonnull-attribute`.
+
+0.5.0 | 2020-02-18 15:21:21 -0800
+
+ * Release 0.5.0.
+
+0.4-3 | 2020-02-18 15:19:21 -0800
+
+ * GH-16: fix undefined references in libparaglob.a (Jon Siwek, Corelight)
+
+0.4-2 | 2020-02-18 14:49:20 -0800
+
+ * Remove empty paraglob.h (Jon Siwek, Corelight)
+
+0.4-1 | 2020-02-18 10:18:50 -0800
+
+ * Replace non-standard variable-length-array usage in benchmark (Jon Siwek, Corelight)
+
0.4 | 2020-01-13 11:32:09 +0000
* Release 0.4.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9605b4e..f5835ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
-cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(paraglob)
+include(GNUInstallDirs)
+
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)
@@ -15,10 +17,6 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
-if (NOT INSTALL_LIB_DIR)
- set(INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
-endif ()
-
add_subdirectory(src)
add_subdirectory(tools)
diff --git a/VERSION b/VERSION
index bd73f47..a918a2a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.4
+0.6.0
diff --git a/debian/changelog b/debian/changelog
index 3dbf10e..997445a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
+paraglob (0.6.0-1) unstable; urgency=medium
+
+ * New upstream version 0.6.0
+ * Drop patch
+
+ -- Hilko Bengen <bengen@debian.org> Mon, 27 Dec 2021 14:33:51 +0100
+
+paraglob (0.5.0-1) unstable; urgency=medium
+
+ * New upstream version 0.5.0
+ * Rebase patch
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 10 Sep 2020 21:51:27 +0200
+
+paraglob (0.4.1-1) unstable; urgency=medium
+
+ * New upstream version 0.4.1
+ * Add git-buildpackage configuration
+
+ -- Hilko Bengen <bengen@debian.org> Sun, 31 May 2020 20:53:18 +0200
+
paraglob (0.4-1) experimental; urgency=medium
* Initial release (Closes: #951346)
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..e73ec50
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,4 @@
+[DEFAULT]
+debian-branch=debian/master
+upstream-branch=upstream
+pristine-tar=True
diff --git a/debian/patches/fix-link.patch b/debian/patches/fix-link.patch
index 6055852..eb7fc78 100644
--- a/debian/patches/fix-link.patch
+++ b/debian/patches/fix-link.patch
@@ -1,7 +1,16 @@
-Index: paraglob/src/ahocorasick/CMakeLists.txt
+From: Hilko Bengen <bengen@debian.org>
+Date: Mon, 27 Dec 2021 14:21:50 +0100
+Subject: fix-link
+
===================================================================
---- paraglob.orig/src/ahocorasick/CMakeLists.txt
-+++ paraglob/src/ahocorasick/CMakeLists.txt
+---
+ src/ahocorasick/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ahocorasick/CMakeLists.txt b/src/ahocorasick/CMakeLists.txt
+index 55bdc8a..3b81b3b 100644
+--- a/src/ahocorasick/CMakeLists.txt
++++ b/src/ahocorasick/CMakeLists.txt
@@ -1,2 +1,2 @@
-add_library(ahocorasick STATIC ahocorasick.c node.c mpool.c replace.c AhoCorasickPlus.cpp)
diff --git a/debian/patches/install-dir.patch b/debian/patches/install-dir.patch
deleted file mode 100644
index f899176..0000000
--- a/debian/patches/install-dir.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: paraglob/src/CMakeLists.txt
-===================================================================
---- paraglob.orig/src/CMakeLists.txt
-+++ paraglob/src/CMakeLists.txt
-@@ -5,4 +5,4 @@ add_library(paraglob STATIC paraglob.cpp
- target_link_libraries(paraglob ahocorasick)
- set_target_properties(paraglob PROPERTIES OUTPUT_NAME paraglob)
-
--install(TARGETS paraglob DESTINATION lib)
-+install(TARGETS paraglob)
diff --git a/debian/patches/series b/debian/patches/series
index 3c35973..8dac375 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
-install-dir.patch
fix-link.patch
diff --git a/paraglob.h b/paraglob.h
deleted file mode 100644
index e69de29..0000000
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 74de59b..ae17376 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,8 +1,19 @@
+set(AHOCORASICK_SRCS
+ ahocorasick/ahocorasick.c
+ ahocorasick/node.c
+ ahocorasick/mpool.c
+ ahocorasick/replace.c
+ ahocorasick/AhoCorasickPlus.cpp
+)
+
add_subdirectory(ahocorasick)
-add_library(paraglob STATIC paraglob.cpp paraglob_serializer.cpp)
-target_link_libraries(paraglob ahocorasick)
+add_library(paraglob STATIC
+ paraglob.cpp
+ paraglob_serializer.cpp
+ ${AHOCORASICK_SRCS}
+)
set_target_properties(paraglob PROPERTIES OUTPUT_NAME paraglob)
-install(TARGETS paraglob DESTINATION lib)
+install(TARGETS paraglob DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/src/ahocorasick/CMakeLists.txt b/src/ahocorasick/CMakeLists.txt
index 55bdc8a..3b81b3b 100644
--- a/src/ahocorasick/CMakeLists.txt
+++ b/src/ahocorasick/CMakeLists.txt
@@ -1,2 +1,2 @@
-add_library(ahocorasick STATIC ahocorasick.c node.c mpool.c replace.c AhoCorasickPlus.cpp)
+add_library(ahocorasick OBJECT ahocorasick.c node.c mpool.c replace.c AhoCorasickPlus.cpp)
diff --git a/src/ahocorasick/node.c b/src/ahocorasick/node.c
index c504561..e9c6e9b 100644
--- a/src/ahocorasick/node.c
+++ b/src/ahocorasick/node.c
@@ -320,6 +320,9 @@ static int node_edge_compare (const void *l, const void *r)
*****************************************************************************/
void node_sort_edges (ACT_NODE_t *nod)
{
+ if ( ! nod->outgoing )
+ return;
+
qsort ((void *)nod->outgoing, nod->outgoing_size,
sizeof(struct act_edge), node_edge_compare);
}
diff --git a/src/paraglob_serializer.cpp b/src/paraglob_serializer.cpp
index 78c9e52..9664aec 100644
--- a/src/paraglob_serializer.cpp
+++ b/src/paraglob_serializer.cpp
@@ -9,7 +9,7 @@ std::unique_ptr<std::vector<uint8_t>>
for (const std::string &s: v) {
add_int(s.length(), *ret);
- for (const uint8_t &c : s) {
+ for (uint8_t c : s) { // copy here because of type change
ret->push_back(c);
}
}
diff --git a/testing/Baseline/driver.basic_matches/out b/testing/Baseline/driver.basic_matches/out
index c1a319e..fb33c52 100644
--- a/testing/Baseline/driver.basic_matches/out
+++ b/testing/Baseline/driver.basic_matches/out
@@ -1,3 +1,4 @@
+### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
4
paraglob:
meta words: [ d g og ]
diff --git a/testing/Baseline/driver.empty_patterns/out b/testing/Baseline/driver.empty_patterns/out
index 5db77e9..a5dd287 100644
--- a/testing/Baseline/driver.empty_patterns/out
+++ b/testing/Baseline/driver.empty_patterns/out
@@ -1,3 +1,4 @@
+### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
1
paraglob:
meta words: [ cat dog fish horse frog lion ]
diff --git a/testing/Baseline/driver.serial/out b/testing/Baseline/driver.serial/out
index b0aad4d..d82e3f3 100644
--- a/testing/Baseline/driver.serial/out
+++ b/testing/Baseline/driver.serial/out
@@ -1 +1,2 @@
+### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
passed
diff --git a/testing/Baseline/driver.serial/out2 b/testing/Baseline/driver.serial/out2
index b0aad4d..d82e3f3 100644
--- a/testing/Baseline/driver.serial/out2
+++ b/testing/Baseline/driver.serial/out2
@@ -1 +1,2 @@
+### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
passed
diff --git a/testing/Baseline/driver.time/out b/testing/Baseline/driver.time/out
index 0287692..7282ece 100644
--- a/testing/Baseline/driver.time/out
+++ b/testing/Baseline/driver.time/out
@@ -1 +1,2 @@
+### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
Passed.
diff --git a/tools/benchmark.cpp b/tools/benchmark.cpp
index 8527545..1ef2ed3 100644
--- a/tools/benchmark.cpp
+++ b/tools/benchmark.cpp
@@ -2,6 +2,7 @@
#include "benchmark.h"
#include <random>
+#include <memory>
std::random_device dev;
std::mt19937 rng(dev());
@@ -52,7 +53,7 @@ double benchmark_n(long num_patterns, long num_queries, long match_prob, bool si
}
// Create the patterns.
- std::string patterns[num_patterns];
+ std::unique_ptr<std::string[]> patterns(new std::string[num_patterns]);
char buffer[1024];
int i, j;
@@ -80,7 +81,7 @@ double benchmark_n(long num_patterns, long num_queries, long match_prob, bool si
// Create the queries.
- std::string queries[num_queries];
+ std::unique_ptr<std::string[]> queries(new std::string[num_queries]);
for ( i = 0; i < num_queries; i++ ) {
@@ -112,7 +113,8 @@ double benchmark_n(long num_patterns, long num_queries, long match_prob, bool si
}
auto build_start = std::chrono::high_resolution_clock::now();
paraglob::Paraglob myGlob;
- for (std::string p : patterns) {
+ for ( i = 0; i < num_patterns; ++i ) {
+ const auto& p = patterns[i];
myGlob.add(p);
}
myGlob.compile();
@@ -124,7 +126,8 @@ double benchmark_n(long num_patterns, long num_queries, long match_prob, bool si
if (!silent) {
std::cout << "making queries \n";
}
- for (std::string q : queries) {
+ for ( i = 0; i < num_queries; ++i ) {
+ const auto& q = queries[i];
myGlob.get(q);
}
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files