All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rrdtool: fix patch fuzz
@ 2024-06-27 22:06 Bernd Kuhls
  2024-06-28  5:50 ` yann.morin
  2024-06-28 20:25 ` Yann E. MORIN
  0 siblings, 2 replies; 3+ messages in thread
From: Bernd Kuhls @ 2024-06-27 22:06 UTC (permalink / raw)
  To: buildroot

Commit 8f88a644ed "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>
---
 ...ix-BUILD_DATE-in-rrdtool-help-output.patch | 57 +++++++++++++++++++
 ... => 0002-Constify-argv-fix-warnings.patch} |  0
 2 files changed, 57 insertions(+)
 create mode 100644 package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
 rename package/rrdtool/{0001-Constify-argv-fix-warnings.patch => 0002-Constify-argv-fix-warnings.patch} (100%)

diff --git a/package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch b/package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
new file mode 100644
index 0000000000..9e5af9c148
--- /dev/null
+++ b/package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
@@ -0,0 +1,57 @@
+From e59f703bbcc0af949ee365206426b6394c340c6f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
+Date: Wed, 23 Mar 2022 17:58:45 +0100
+Subject: [PATCH] Fix BUILD_DATE in rrdtool help output
+
+- This is a followup to #1102
+- Fixes segfault when running "rrdtool --help"
+- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
+  mmm dd yyyy
+
+[1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
+
+Upstream: https://github.com/oetiker/rrdtool-1.x/commit/e59f703bbcc0af949ee365206426b6394c340c6f
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ configure.ac   | 2 +-
+ src/rrd_tool.c | 8 ++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4d2345855..5169b0d49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -695,7 +695,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
+ 
+ # Use reproducible build date and time
+ if test "$SOURCE_DATE_EPOCH"; then
+-	DATE_FMT="%d %b %Y %H:%M:%S"
++	DATE_FMT="%b %d %Y %H:%M:%S"
+ 	BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
+ 	AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducible build date])
+ fi
+diff --git a/src/rrd_tool.c b/src/rrd_tool.c
+index 930d08272..cc6119d9a 100644
+--- a/src/rrd_tool.c
++++ b/src/rrd_tool.c
+@@ -45,11 +45,19 @@ static void PrintUsage(
+     char *cmd)
+ {
+ 
++#ifdef BUILD_DATE
++    const char *help_main =
++        N_("RRDtool %s"
++           "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
++           "               Compiled %s\n\n"
++           "Usage: rrdtool [options] command command_options\n");
++#else
+     const char *help_main =
+         N_("RRDtool %s"
+            "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
+            "               Compiled %s %s\n\n"
+            "Usage: rrdtool [options] command command_options\n");
++#endif
+ 
+     const char *help_list =
+         N_
diff --git a/package/rrdtool/0001-Constify-argv-fix-warnings.patch b/package/rrdtool/0002-Constify-argv-fix-warnings.patch
similarity index 100%
rename from package/rrdtool/0001-Constify-argv-fix-warnings.patch
rename to package/rrdtool/0002-Constify-argv-fix-warnings.patch
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/rrdtool: fix patch fuzz
  2024-06-27 22:06 [Buildroot] [PATCH 1/1] package/rrdtool: fix patch fuzz Bernd Kuhls
@ 2024-06-28  5:50 ` yann.morin
  2024-06-28 20:25 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: yann.morin @ 2024-06-28  5:50 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

Bernd, All,

On 2024-06-28 00:06 +0200, Bernd Kuhls spake thusly:
> Commit 8f88a644ed "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>

To be noted: the new patch touches configure.ac, but that's OK as we
already autoreconf. So, maybe it would be worth a comment in rrdtool.mk,
in addition to the existing one?

Reviewed-by: Yann E. MORIN <yann.morin@orange.com>
Tested-by: Yann E. MORIN <yann.morin@orange.com>

Regards,
Yann E. MORIN.

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/rrdtool: fix patch fuzz
  2024-06-27 22:06 [Buildroot] [PATCH 1/1] package/rrdtool: fix patch fuzz Bernd Kuhls
  2024-06-28  5:50 ` yann.morin
@ 2024-06-28 20:25 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2024-06-28 20:25 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

Bernd, All,

On 2024-06-28 00:06 +0200, Bernd Kuhls spake thusly:
> Commit 8f88a644ed "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>

Applied to master, after expanding the existing comment as suggested,
thanks.

Regards,
Yann E. MORIN.

> ---
>  ...ix-BUILD_DATE-in-rrdtool-help-output.patch | 57 +++++++++++++++++++
>  ... => 0002-Constify-argv-fix-warnings.patch} |  0
>  2 files changed, 57 insertions(+)
>  create mode 100644 package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
>  rename package/rrdtool/{0001-Constify-argv-fix-warnings.patch => 0002-Constify-argv-fix-warnings.patch} (100%)
> 
> diff --git a/package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch b/package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
> new file mode 100644
> index 0000000000..9e5af9c148
> --- /dev/null
> +++ b/package/rrdtool/0001-Fix-BUILD_DATE-in-rrdtool-help-output.patch
> @@ -0,0 +1,57 @@
> +From e59f703bbcc0af949ee365206426b6394c340c6f Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
> +Date: Wed, 23 Mar 2022 17:58:45 +0100
> +Subject: [PATCH] Fix BUILD_DATE in rrdtool help output
> +
> +- This is a followup to #1102
> +- Fixes segfault when running "rrdtool --help"
> +- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
> +  mmm dd yyyy
> +
> +[1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
> +
> +Upstream: https://github.com/oetiker/rrdtool-1.x/commit/e59f703bbcc0af949ee365206426b6394c340c6f
> +
> +Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> +---
> + configure.ac   | 2 +-
> + src/rrd_tool.c | 8 ++++++++
> + 2 files changed, 9 insertions(+), 1 deletion(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 4d2345855..5169b0d49 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -695,7 +695,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
> + 
> + # Use reproducible build date and time
> + if test "$SOURCE_DATE_EPOCH"; then
> +-	DATE_FMT="%d %b %Y %H:%M:%S"
> ++	DATE_FMT="%b %d %Y %H:%M:%S"
> + 	BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
> + 	AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducible build date])
> + fi
> +diff --git a/src/rrd_tool.c b/src/rrd_tool.c
> +index 930d08272..cc6119d9a 100644
> +--- a/src/rrd_tool.c
> ++++ b/src/rrd_tool.c
> +@@ -45,11 +45,19 @@ static void PrintUsage(
> +     char *cmd)
> + {
> + 
> ++#ifdef BUILD_DATE
> ++    const char *help_main =
> ++        N_("RRDtool %s"
> ++           "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
> ++           "               Compiled %s\n\n"
> ++           "Usage: rrdtool [options] command command_options\n");
> ++#else
> +     const char *help_main =
> +         N_("RRDtool %s"
> +            "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
> +            "               Compiled %s %s\n\n"
> +            "Usage: rrdtool [options] command command_options\n");
> ++#endif
> + 
> +     const char *help_list =
> +         N_
> diff --git a/package/rrdtool/0001-Constify-argv-fix-warnings.patch b/package/rrdtool/0002-Constify-argv-fix-warnings.patch
> similarity index 100%
> rename from package/rrdtool/0001-Constify-argv-fix-warnings.patch
> rename to package/rrdtool/0002-Constify-argv-fix-warnings.patch
> -- 
> 2.39.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-28 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 22:06 [Buildroot] [PATCH 1/1] package/rrdtool: fix patch fuzz Bernd Kuhls
2024-06-28  5:50 ` yann.morin
2024-06-28 20:25 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.