davfs2: substitute ps command

umount.davfs2 uses ps to get a process list to terminate gracefully.

On NixOS, this currently fails:

```
sh: ps: command not found
/run/current-system/sw/bin/umount.davfs:
can't find mount.davfs-process with pid 4085;
trying to unmount anyway.
you propably have to remove /var/run/mount.davfs/root-x.pid manually
sh: umount: command not found
```

Fix this by patching ${procps}/bin/ps into the ps_command.

Afterwards:

```
umount.davfs: waiting for mount.davfs (pid 4106) to terminate gracefully .. OK
```

authored by Florian Klink and committed by Bjørn Forsman 1ec5d824 eed30dfa

+44 -3
+25
pkgs/tools/filesystems/davfs2/0001-umount_davfs-substitute-ps-command.patch
··· 1 + From 0cb1321c4cbb2978318ddad73c9ee6f2a19c55c8 Mon Sep 17 00:00:00 2001 2 + From: Florian Klink <flokli@flokli.de> 3 + Date: Sat, 11 Jan 2020 21:06:33 +0100 4 + Subject: [PATCH] umount_davfs: substitute ps command 5 + 6 + --- 7 + src/umount_davfs.c | 2 +- 8 + 1 file changed, 1 insertion(+), 1 deletion(-) 9 + 10 + diff --git a/src/umount_davfs.c b/src/umount_davfs.c 11 + index b7019c3..a278679 100644 12 + --- a/src/umount_davfs.c 13 + +++ b/src/umount_davfs.c 14 + @@ -157,7 +157,7 @@ main(int argc, char *argv[]) 15 + } 16 + fclose(file); 17 + 18 + - char *ps_command = ne_concat("ps -p ", pid, NULL); 19 + + char *ps_command = ne_concat("@ps@ -p ", pid, NULL); 20 + FILE *ps_in = popen(ps_command, "r"); 21 + if (!ps_in) { 22 + error(0, 0, 23 + -- 24 + 2.24.1 25 +
+19 -3
pkgs/tools/filesystems/davfs2/default.nix
··· 1 - { stdenv, fetchurl, neon, zlib }: 1 + { stdenv 2 + , fetchurl 3 + , neon 4 + , procps 5 + , substituteAll 6 + , zlib 7 + }: 2 8 3 9 stdenv.mkDerivation rec { 4 10 name = "davfs2-1.5.6"; ··· 10 16 11 17 buildInputs = [ neon zlib ]; 12 18 13 - patches = [ ./isdir.patch ./fix-sysconfdir.patch ]; 19 + patches = [ 20 + ./isdir.patch 21 + ./fix-sysconfdir.patch 22 + (substituteAll { 23 + src = ./0001-umount_davfs-substitute-ps-command.patch; 24 + ps = "${procps}/bin/ps"; 25 + }) 26 + ]; 14 27 15 28 configureFlags = [ "--sysconfdir=/etc" ]; 16 29 17 - makeFlags = ["sbindir=$(out)/sbin" "ssbindir=$(out)/sbin"]; 30 + makeFlags = [ 31 + "sbindir=$(out)/sbin" 32 + "ssbindir=$(out)/sbin" 33 + ]; 18 34 19 35 meta = { 20 36 homepage = https://savannah.nongnu.org/projects/davfs2;