License info is shown at every session start in FreeBSD 13.2 due to nonportable use of sed in script
#227
Open
opened 2 years ago by Lannig
·
7 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Basic information
Description
Every time I start my TDE session, the licence info window is shown.
I have tracked this down to the /opt/trinity/bin/tde_show_license_info script making a non-portable use of sed to determine TDE_MINOR_VERSION, so it fails to value it under FreeBSD.
Under FreeBSD, the '+' repetition is allowed only when sed is run with the -E option (extended regular expressions).
It should not be quoted as \+ in the RE anyway, although Linux seems to accept this.
Quoted parenthesis \( and \) are NOT accepted by FreeBSD sed if -E option is used but are without this option (doesn't make much sense to me TBH). Parenthesis should not be quoted if -E is used.
Solution: as -E seems to to make things more complex, use the more portable * repetition factor (zero or more) instead of + (one or more) and duplicate the patterns. Suggested patch below.
Steps to reproduce
Screenshots
Suggested patch to /opt/trinity/bin/tde_show_license_info:
Ouch, the backslashes have been stripped out from my post above, making it hard to understand.
In order to create a pull-request on the relevant repository, I added you to the Contributors team. Instead of a patch listed in the comment, you can now create a branch and PR in tdebase repository. See wiki page for TGW.
Fixed it.
Does this work in FreeBSD?
It avoids repeating the pattern and the plus
*
usage, compared to the patch above, which IMO gives a slightly more readable regexSorry for the extremely late reply.
Yes, it works as suggested:
It's still broken in 14.1.2 though.
I have my own little patch that I apply on every installation.
just with posix sh:
@Lannig could you also confirm the last version suggested by @obache works fine for you? it is ok in linux, so if it works also in FreeBSD (which should), I would update based on the more general posix version.