Merge pull request #293022 from symphorien/nixos_module_sane_disabled_backed_word_boundary

nixos/sane: fix disabling backends which are subwords of other backends
This commit is contained in:
Pol Dellaiera 2024-06-01 22:39:00 +02:00 committed by GitHub
commit 439832d6bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,8 +29,8 @@ installSanePath = path: ''
fi
'';
disableBackend = backend: ''
grep -q '${backend}' $out/etc/sane.d/dll.conf || { echo '${backend} is not a default plugin in $SANE_CONFIG_DIR/dll.conf'; exit 1; }
substituteInPlace $out/etc/sane.d/dll.conf --replace '${backend}' '# ${backend} disabled in nixos config'
grep -w -q '${backend}' $out/etc/sane.d/dll.conf || { echo '${backend} is not a default plugin in $SANE_CONFIG_DIR/dll.conf'; exit 1; }
sed -i 's/\b${backend}\b/# ${backend} disabled by nixos config/' $out/etc/sane.d/dll.conf
'';
in
stdenv.mkDerivation {