Re: [PATCH v4 09/15] bugreport: generate config safelist based on docs
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 15, 2019, 20:17 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1912152116030.46@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20191213004312.169753-10-emilyshaffer@google.com>
Hi Emily,
On Thu, 12 Dec 2019, Emily Shaffer wrote:
Show 19 quoted lines
> diff --git a/generate-bugreport-config-safelist.sh b/generate-bugreport-config-safelist.sh
> new file mode 100755
> index 0000000000..06b8e0c3c4
> --- /dev/null
> +++ b/generate-bugreport-config-safelist.sh
> @@ -0,0 +1,22 @@
> +#!/bin/sh
> +
> +cat <<EOF
> +/* Automatically generated by bugreport-generate-config-safelist.sh */
> +
> +
> +static const char *bugreport_config_safelist[] = {
> +EOF
> +
> +# cat all regular files in Documentation/config
> +find Documentation/config -type f -exec cat {} \; |
> +# print the command name which matches the bugreport-include macro
> +sed -n 's/^\(.*\) \+bugreport:include.* ::$/\1/p' |If you use `/ "\1",/` as replacement, you can totally avoid that ugly `while` loop (that is unfortunately quite slow in MSYS2/Cygwin). You can still pipe the result into `sort` just the same.
Ciao, Dscho
Show 13 quoted lines
> +sort | > +while read line > +do > + echo " \"$line\"," > +done > + > +cat <<EOF > +}; > +EOF > -- > 2.24.1.735.g03f4e72817-goog > >