Skip to content

Commit 4928032

Browse files
bkuhlsyann-morin-1998
authored andcommitted
package/rrdtool: fix patch fuzz
Commit 8f88a64 "support/scripts/apply-patches.sh: set the maximum fuzz factor to 0" reduced the fuzz factor. Due to this change, rrdtool fails to build with output: patching file src/rrd_tool.c Hunk #2 FAILED at 42. Hunk #3 succeeded at 435 (offset -8 lines). Hunk #4 succeeded at 518 (offset -8 lines). Hunk #5 succeeded at 564 (offset -8 lines). Hunk #6 succeeded at 879 (offset -8 lines). 1 out of 6 hunks FAILED -- saving rejects to file src/rrd_tool.c.rej Because this was caused by an upstream patch we do not change it but add another upstream patch to be applied before our current patch to avoid the problem. Fixes: http://autobuild.buildroot.net/results/6996dbd764b0066da49dd009f1385196342c89dc/ Signed-off-by: Bernd Kuhls <bernd@kuhls.net> Reviewed-by: Yann E. MORIN <yann.morin@orange.com> Tested-by: Yann E. MORIN <yann.morin@orange.com> [yann.morin.1998@free.fr: - add comment as suggested by yann.morin@orange.com ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
1 parent 2097314 commit 4928032

3 files changed

Lines changed: 61 additions & 1 deletion

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From e59f703bbcc0af949ee365206426b6394c340c6f Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
3+
Date: Wed, 23 Mar 2022 17:58:45 +0100
4+
Subject: [PATCH] Fix BUILD_DATE in rrdtool help output
5+
6+
- This is a followup to #1102
7+
- Fixes segfault when running "rrdtool --help"
8+
- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
9+
mmm dd yyyy
10+
11+
[1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
12+
13+
Upstream: https://github.com/oetiker/rrdtool-1.x/commit/e59f703bbcc0af949ee365206426b6394c340c6f
14+
15+
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
16+
---
17+
configure.ac | 2 +-
18+
src/rrd_tool.c | 8 ++++++++
19+
2 files changed, 9 insertions(+), 1 deletion(-)
20+
21+
diff --git a/configure.ac b/configure.ac
22+
index 4d2345855..5169b0d49 100644
23+
--- a/configure.ac
24+
+++ b/configure.ac
25+
@@ -695,7 +695,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
26+
27+
# Use reproducible build date and time
28+
if test "$SOURCE_DATE_EPOCH"; then
29+
- DATE_FMT="%d %b %Y %H:%M:%S"
30+
+ DATE_FMT="%b %d %Y %H:%M:%S"
31+
BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
32+
AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducible build date])
33+
fi
34+
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
35+
index 930d08272..cc6119d9a 100644
36+
--- a/src/rrd_tool.c
37+
+++ b/src/rrd_tool.c
38+
@@ -45,11 +45,19 @@ static void PrintUsage(
39+
char *cmd)
40+
{
41+
42+
+#ifdef BUILD_DATE
43+
+ const char *help_main =
44+
+ N_("RRDtool %s"
45+
+ " Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
46+
+ " Compiled %s\n\n"
47+
+ "Usage: rrdtool [options] command command_options\n");
48+
+#else
49+
const char *help_main =
50+
N_("RRDtool %s"
51+
" Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
52+
" Compiled %s %s\n\n"
53+
"Usage: rrdtool [options] command command_options\n");
54+
+#endif
55+
56+
const char *help_list =
57+
N_
File renamed without changes.

package/rrdtool/rrdtool.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ RRDTOOL_SITE = https://github.com/oetiker/rrdtool-1.x/releases/download/v$(RRDTO
99
RRDTOOL_LICENSE = GPL-2.0+ with FLOSS license exceptions as explained in COPYRIGHT
1010
RRDTOOL_LICENSE_FILES = COPYRIGHT LICENSE
1111
RRDTOOL_DEPENDENCIES = host-pkgconf libglib2 $(TARGET_NLS_DEPENDENCIES)
12-
# autoreconf needed to avoid link failure due to missing -lintl,
12+
13+
# 0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
14+
# autoreconf also needed to avoid link failure due to missing -lintl,
1315
# autopoint needed as a consequence of autoreconf
1416
RRDTOOL_AUTORECONF = YES
1517
RRDTOOL_AUTOPOINT = YES
18+
1619
RRDTOOL_INSTALL_STAGING = YES
1720
RRDTOOL_CONF_OPTS = \
1821
--disable-examples \

0 commit comments

Comments
 (0)