From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] Add tool to format rootfiles
Date: Thu, 10 Sep 2020 12:45:26 +0100 [thread overview]
Message-ID: <F6ED050E-9F79-4B42-B28E-CFFD9F31AEE0@ipfire.org> (raw)
In-Reply-To: <20200905084008.29873-1-jonatan.schlag@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 3225 bytes --]
Hello Jonatan,
We have already talked about this patch on the last telephone conference, but I would still like to put forward this:
Can we not change this patch, so that it only tells us what could/should potentially be changed? So the command will simply say things like “/usr/lib/libabc.so is a development file and should not be included”.
Wouldn’t that avoid the problem of any automatic errors and we still have a helper that makes the whole process easier for developers?
For that, the sed statements simply have to be changed to grep and the output of that has to be dealt with.
-Michael
> On 5 Sep 2020, at 09:40, Jonatan Schlag <jonatan.schlag(a)ipfire.org> wrote:
>
> There are some rules which files should be definitely not included in a
> rootfile. Applying these rules by hand is error prone and annoying. So I
> wrote these simple command, because computer can apply these rules
> faster and better than humans :-;
>
> It removes all lines starting with '-' and comment out all lines which
> point to files which should not be included in the distribution. This
> list needs to be extended, but I think this is a good starting point to
> make the creating of rootfiles easier.
>
> Signed-off-by: Jonatan Schlag <jonatan.schlag(a)ipfire.org>
> ---
> make.sh | 37 ++++++++++++++++++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/make.sh b/make.sh
> index 4a9dd3cb6..909d4a4de 100755
> --- a/make.sh
> +++ b/make.sh
> @@ -1895,6 +1895,41 @@ downloadsrc)
> fi
> cd - >/dev/null 2>&1
> ;;
> +format-rootfile)
> + if [ ! -f $2 ]; then
> + echo -n "'$2' is not a regular file"
> + beautify message FAIL
> + exit 1
> + fi
> +
> + ROOTFILE_TO_FORMAT="$2"
> +
> + # Remove all .so files in /usr/lib
> + sed -i '/^\+usr\/lib\/.*\.so$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> + # Remove all .a files in /usr/lib
> + sed -i '/^\+usr\/lib\/.*\.a$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> +
> + # Remove all .la files in /usr/lib
> + sed -i '/^\+usr\/lib\/.*\.la$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> + # Remove all .hpp files in /usr/include
> + sed -i '/^\+usr\/include\/.*\.hpp$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> + # Remove all .h files in /usr/include
> + sed -i '/^\+usr\/include\/.*\.h$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> + # Remove all .ipp files in /usr/include
> + sed -i '/^\+usr\/include\/.*\.ipp$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> + # Remove all .m4 files in /usr/share/aclocal
> + sed -i '/^\+usr\/share\/aclocal\/.*\.h$/s/+/#/g' "$ROOTFILE_TO_FORMAT"
> +
> + # Remove all lines starting with -
> + sed -i '/^-.*$/d' "$ROOTFILE_TO_FORMAT"
> +
> +;;
> toolchain)
> # Clear screen
> ${INTERACTIVE} && clear
> @@ -1990,7 +2025,7 @@ find-dependencies)
> exec "${BASEDIR}/tools/find-dependencies" "${BASEDIR}/build" "$@"
> ;;
> *)
> - echo "Usage: $0 {build|changelog|clean|gettoolchain|downloadsrc|shell|sync|toolchain|update-contributors|find-dependencies}"
> + echo "Usage: $0 {build|changelog|clean|format-rootfile|gettoolchain|downloadsrc|shell|sync|toolchain|update-contributors|find-dependencies}"
> cat doc/make.sh-usage
> ;;
> esac
> --
> 2.20.1
>
next prev parent reply other threads:[~2020-09-10 11:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-05 8:40 Jonatan Schlag
2020-09-05 19:14 ` Adolf Belka
2020-09-05 19:30 ` Adolf Belka
2020-09-10 11:45 ` Michael Tremer [this message]
2020-09-14 11:02 ` Jonatan Schlag
2020-09-17 7:22 ` Michael Tremer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F6ED050E-9F79-4B42-B28E-CFFD9F31AEE0@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox