[PATCH RSB 1/2] Add clean-cfg.sh script to find and remove unused cfg files

Gedare Bloom gedare at rtems.org
Sat Apr 4 19:56:41 UTC 2020


On Sat, Apr 4, 2020 at 1:29 PM Gedare Bloom <gedare at rtems.org> wrote:
>
> Closes #3273.
> ---
>  clean-cfg.sh | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>  create mode 100644 clean-cfg.sh
>
> diff --git a/clean-cfg.sh b/clean-cfg.sh
> new file mode 100644
> index 0000000..cad678b
> --- /dev/null
> +++ b/clean-cfg.sh
> @@ -0,0 +1,11 @@
> +#!/bin/bash
> +
> +for f in `find . -name "*.cfg" -printf '%f\n' | sed -e 's/\.cfg//g'`
> +do
> +  ack -l $f > /dev/null
I'm using a little bit non-standard ack. I think this can be rewritten
with grep.

I don't know that we actually want to keep the script where it gets
run, but should have it around for reference to clean things up again
in the future?

> +  if [ ! $? -eq 0 ]
> +  then
> +    find . -name ${f}.cfg | xargs git rm
> +  fi
> +done
> +
> --
> 2.17.1
>


More information about the devel mailing list