<commit_before>{ stdenv }:

{ paths }:

with stdenv.lib;
let installSanePath = path: ''
      if [ -e "${path}/lib/sane" ]; then
        find "${path}/lib/sane" -maxdepth 1 -not -type d | while read backend; do
          symlink "$backend" "$out/lib/sane/$(basename "$backend")"
        done
      fi

      if [ -e "${path}/etc/sane.d" ]; then
        find "${path}/etc/sane.d" -maxdepth 1 -not -type d | while read conf; do
          name="$(basename $conf)"
          if [ "$name" = "dll.conf" ] || [ "$name" = "saned.conf" ] || [ "$name" = "net.conf" ]; then
            cat "$conf" >> "$out/etc/sane.d/$name"
          else
            symlink "$conf" "$out/etc/sane.d/$name"
          fi
        done
      fi

      if [ -e "${path}/etc/sane.d/dll.d" ]; then
        find "${path}/etc/sane.d/dll.d" -maxdepth 1 -not -type d | while read conf; do
          symlink "$conf" "$out/etc/sane.d/dll.d/$(basename $conf)"
        done
      fi
    '';
in
stdenv.mkDerivation {
  name = "sane-config";
  phases = "installPhase";

  installPhase = ''
    function symlink () {
      local target=$1 linkname=$2
      if [ -e "$linkname" ]; then
        echo "warning: conflict for $linkname. Overriding."
      fi
      ln -sfn "$target" "$linkname"
    }

    mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane
  '' + concatMapStrings installSanePath paths;
}<commit_msg>sane module: make warning more explicit<commit_after>{ stdenv }:

{ paths }:

with stdenv.lib;
let installSanePath = path: ''
      if [ -e "${path}/lib/sane" ]; then
        find "${path}/lib/sane" -maxdepth 1 -not -type d | while read backend; do
          symlink "$backend" "$out/lib/sane/$(basename "$backend")"
        done
      fi

      if [ -e "${path}/etc/sane.d" ]; then
        find "${path}/etc/sane.d" -maxdepth 1 -not -type d | while read conf; do
          name="$(basename $conf)"
          if [ "$name" = "dll.conf" ] || [ "$name" = "saned.conf" ] || [ "$name" = "net.conf" ]; then
            cat "$conf" >> "$out/etc/sane.d/$name"
          else
            symlink "$conf" "$out/etc/sane.d/$name"
          fi
        done
      fi

      if [ -e "${path}/etc/sane.d/dll.d" ]; then
        find "${path}/etc/sane.d/dll.d" -maxdepth 1 -not -type d | while read conf; do
          symlink "$conf" "$out/etc/sane.d/dll.d/$(basename $conf)"
        done
      fi
    '';
in
stdenv.mkDerivation {
  name = "sane-config";
  phases = "installPhase";

  installPhase = ''
    function symlink () {
      local target=$1 linkname=$2
      if [ -e "$linkname" ]; then
        echo "warning: conflict for $linkname. Overriding $(readlink $linkname) with $target."
      fi
      ln -sfn "$target" "$linkname"
    }

    mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane
  '' + concatMapStrings installSanePath paths;
}
{'fraction_non_alphanumeric': 0.17949627527492018, 'fraction_numerical': 0.0035473572188719402, 'mean_word_length': 2.038793103448276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1678898', 'n_tokens_mistral': 1034, 'n_tokens_neox': 1006, 'n_words': 249}