From 1c3e016844f2209463b667c292d694ae0874cb10 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 2 May 2020 11:07:42 +0100 Subject: [PATCH] Upstream patch to fix the --dump-config output. --- ...ver-Fix-binary-in-dump-config-output.patch | 43 +++++++++++++++++++ nbdkit.spec | 7 ++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 0001-server-Fix-binary-in-dump-config-output.patch diff --git a/0001-server-Fix-binary-in-dump-config-output.patch b/0001-server-Fix-binary-in-dump-config-output.patch new file mode 100644 index 0000000..a35bce5 --- /dev/null +++ b/0001-server-Fix-binary-in-dump-config-output.patch @@ -0,0 +1,43 @@ +From 43f7e07c5b087996ea0c7a80dcf44976d81620be Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 2 May 2020 11:00:33 +0100 +Subject: [PATCH] server: Fix binary in --dump-config output. + +As written this will only work on Linux. On platforms which lack +/proc/self/exe the binary name will be missing in the output. + +Fixes: commit a47857b47b88adbf5054772be4d6746ec08ca16f +--- + server/main.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/server/main.c b/server/main.c +index eb04a174..9dd9d400 100644 +--- a/server/main.c ++++ b/server/main.c +@@ -129,11 +129,10 @@ display_version (void) + } + + static void +-dump_config (const char *argv0) ++dump_config (void) + { +- CLEANUP_FREE char *binary; ++ CLEANUP_FREE char *binary = realpath ("/proc/self/exe", NULL); + +- binary = realpath (argv0, NULL); + if (binary != NULL) + printf ("%s=%s\n", "binary", binary); + printf ("%s=%s\n", "bindir", bindir); +@@ -216,7 +215,7 @@ main (int argc, char *argv[]) + + switch (c) { + case DUMP_CONFIG_OPTION: +- dump_config (argv[0]); ++ dump_config (); + exit (EXIT_SUCCESS); + + case DUMP_PLUGIN_OPTION: +-- +2.25.0 + diff --git a/nbdkit.spec b/nbdkit.spec index 255ff66..4414e41 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -38,7 +38,7 @@ ExclusiveArch: x86_64 Name: nbdkit Version: 1.20.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NBD server License: BSD @@ -51,6 +51,9 @@ Source1: http://libguestfs.org/download/nbdkit/%{source_directory}/%{name Source2: libguestfs.keyring %endif +# Upstream patch to fix the --dump-config output. +Patch1: 0001-server-Fix-binary-in-dump-config-output.patch + %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool %endif @@ -972,7 +975,7 @@ make %{?_smp_mflags} check || { %changelog -* Sat May 2 2020 Richard W.M. Jones - 1.20.0-1 +* Sat May 2 2020 Richard W.M. Jones - 1.20.0-2 - New upstream version 1.20.0. * Thu Apr 30 2020 Richard W.M. Jones - 1.19.12-1