nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

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 }: 2 3 stdenv.mkDerivation rec { 4 name = "davfs2-1.5.6"; ··· 16 17 buildInputs = [ neon zlib ]; 18 19 - patches = [ ./isdir.patch ./fix-sysconfdir.patch ]; 20 21 configureFlags = [ "--sysconfdir=/etc" ]; 22 23 - makeFlags = ["sbindir=$(out)/sbin" "ssbindir=$(out)/sbin"]; 24 25 meta = { 26 homepage = https://savannah.nongnu.org/projects/davfs2;
··· 1 + { stdenv 2 + , fetchurl 3 + , neon 4 + , procps 5 + , substituteAll 6 + , zlib 7 + }: 8 9 stdenv.mkDerivation rec { 10 name = "davfs2-1.5.6"; ··· 10 11 buildInputs = [ neon zlib ]; 12 13 + patches = [ 14 + ./isdir.patch 15 + ./fix-sysconfdir.patch 16 + (substituteAll { 17 + src = ./0001-umount_davfs-substitute-ps-command.patch; 18 + ps = "${procps}/bin/ps"; 19 + }) 20 + ]; 21 22 configureFlags = [ "--sysconfdir=/etc" ]; 23 24 + makeFlags = [ 25 + "sbindir=$(out)/sbin" 26 + "ssbindir=$(out)/sbin" 27 + ]; 28 29 meta = { 30 homepage = https://savannah.nongnu.org/projects/davfs2;