From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] Add tool to format rootfiles Date: Thu, 17 Sep 2020 08:22:38 +0100 Message-ID: In-Reply-To: <7422a6608885564ff0399b8d9fc7f94d7024b4a4.camel@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4283820844785583181==" List-Id: --===============4283820844785583181== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, > On 14 Sep 2020, at 12:02, Jonatan Schlag wrot= e: >=20 > Hi Michael, >=20 > this approach would be similar to the root file checker already > included in the "tools directory. Maybe this approach is now the > better one because we can recheck this tool against existing correct > root files, which should make it easy to find errors in the > expressions. Hmm=E2=80=A6 Two tools doing exactly the same does not seem to be a good idea. > As such a tool should be well tested and I have to try out BDD > (Behaviour Driven Development) I will try, to combine these and create > a little software for this task.=20 BDD? Someone has been paying attention in uni :) Let=E2=80=99s discuss any ideas here first. You can prototype things of cours= e, but do not fully build it out before you have collected a couple of opinio= ns from other people, please. Best, -Michael > I will report back when I have results. >=20 > Jonatan >=20 > Am Donnerstag, den 10.09.2020, 12:45 +0100 schrieb Michael Tremer: >> Hello Jonatan, >>=20 >> We have already talked about this patch on the last telephone >> conference, but I would still like to put forward this: >>=20 >> 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 =E2=80=9C/usr/lib/libabc.so is a development file and should n= ot >> be included=E2=80=9D. >>=20 >> Wouldn=E2=80=99t that avoid the problem of any automatic errors and we sti= ll >> have a helper that makes the whole process easier for developers? >>=20 >> For that, the sed statements simply have to be changed to grep and >> the output of that has to be dealt with. >>=20 >> -Michael >>=20 >>> On 5 Sep 2020, at 09:40, Jonatan Schlag >>> wrote: >>>=20 >>> 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 :-; >>>=20 >>> 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. >>>=20 >>> Signed-off-by: Jonatan Schlag >>> --- >>> make.sh | 37 ++++++++++++++++++++++++++++++++++++- >>> 1 file changed, 36 insertions(+), 1 deletion(-) >>>=20 >>> 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=3D"$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|toolchai >>> n|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 >>> --=20 >>> 2.20.1 >>>=20 >=20 --===============4283820844785583181==--