File: 0004-Check-for-mke2fs-in-sbin-dirs-configure-path-into-li.patch

package info (click to toggle)
nbdkit 1.42.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,648 kB
  • sloc: ansic: 59,061; sh: 16,778; makefile: 6,417; python: 1,848; cpp: 1,116; perl: 502; ml: 498; tcl: 62
file content (43 lines) | stat: -rw-r--r-- 1,491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Hilko Bengen <bengen@debian.org>
Date: Fri, 28 Feb 2020 14:16:06 +0100
Subject: Check for mke2fs in sbin dirs, configure path into linuxdisk plugin

---
 configure.ac                   | 7 +++++--
 plugins/linuxdisk/filesystem.c | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9131d45..de515ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1534,11 +1534,14 @@ AC_ARG_ENABLE([linuxdisk],
     [],
     [enable_linuxdisk=check])
 
+AC_PATH_PROG([MKE2FS], [mke2fs], [no], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_DEFINE_UNQUOTED([MKE2FS], ["$MKE2FS"], [path to mke2fs binary])
+
 mke2fs_with_d=no
 AS_IF([test "$enable_linuxdisk" != "no"], [
     AC_MSG_CHECKING([for mke2fs supporting the -d option])
-    AS_IF([mke2fs -V >/dev/null 2>&1], [
-        AS_IF([LANG=C mke2fs -d 2>&1 | grep -sq "option requires an argument"], [
+    AS_IF([$MKE2FS -V >/dev/null 2>&1], [
+        AS_IF([LANG=C $MKE2FS -d 2>&1 | grep -sq "option requires an argument"], [
             mke2fs_with_d=yes
         ])
     ])
diff --git a/plugins/linuxdisk/filesystem.c b/plugins/linuxdisk/filesystem.c
index 3e4e2f3..92b064e 100644
--- a/plugins/linuxdisk/filesystem.c
+++ b/plugins/linuxdisk/filesystem.c
@@ -219,7 +219,7 @@ mke2fs (const char *filename)
     return -1;
   }
 
-  fprintf (fp, "mke2fs -q -F -t %s ", type);
+  fprintf (fp, MKE2FS " -q -F -t %s ", type);
   if (label) {
     fprintf (fp, "-L ");
     shell_quote (label, fp);