fritzkink
2023-11-28 0e6b8465e1fa76dd600d4a240e95735e71db5d7c
tools/license-detector
@@ -87,12 +87,21 @@
   cat <<#EOF > "$TMPFILE"
      dos2unix -ascii \\
         | tr -d '\\014' \\
         | sed -E -e 's/^[[:space:]]+\$//g' \\
         | awk '/^#/{next}/^\$/{\$0="\n"}1' ORS=' ' \\
         | sed -E -e 's/[[:space:]]+/ /g' -e 's/^ //' -e 's/ \$//' -e '/^\$/d' \\
   EOF
   # Remove some reStructuredText markup
   if [[ "${F%.rst}" != "$F" ]] ; then
      cat <<#EOF >> "$TMPFILE"
            | sed -e '/^\*\*\$/d' -e 's/^\*\*\([^*]\)/\1/' -e 's/\([^*]\)\*\*\$/\1/' -e 's/\([^*]\)\*\*\([^*]\)/\1\2/g' \\
      EOF
   fi
   # Apply filter if any
   [[ -x "$l.filter" ]] && printf '\t| %s \\\n' "$l.filter" >> "$TMPFILE"
   [[ -x "$l.filter" ]] && printf '\t| LC_ALL=C %s \\\n' "$l.filter" >> "$TMPFILE"
   cat <<#EOF >> "$TMPFILE"
         | LC_ALL=C tr '[:upper:]' '[:lower:]' \\
         | sed -e 's|http://|https://|g' \
         | tr ' ' '\\n' | fmt
   EOF