gentoo-tools

Some Gentoo helper tools
git clone git://r-36.net/gentoo-tools
Log | Files | Refs | LICENSE

commit c559864adec3023b2a03ffbf2e81de83b5b8a047
parent 9e27e1c7c9997bccb0a71cd0a68f57a68f306053
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun,  5 Apr 2020 23:03:20 +0200

Make ehardened more variable in profile ids.

Thanks Spenser Truex for the hint!

Diffstat:
bin/ehardened | 20+++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/bin/ehardened b/bin/ehardened @@ -1,14 +1,24 @@ #!/bin/sh -set -x -pnum="$(eselect profile list | grep hardened \ - | head -n 1 | cut -d '[' -f 2 | cut -d ']' -f 1)" -if [ -z "$pnum" ]; +if [ $# -lt 1 ]; then - printf "hardened profile not available.\n" >&2 + printf "usage: %s profileid\n" "$(basename "$0")" >&2 + printf "Following profile ids are available:" >&2 + eselect profile list exit 1 fi +pnum="$1" + +# TODO: Put old selection back, when this can be more streamlined. +#pnum="$(eselect profile list | grep hardened \ +# | head -n 1 | cut -d '[' -f 2 | cut -d ']' -f 1)" +#if [ -z "$pnum" ]; +#then +# printf "hardened profile not available.\n" >&2 +# exit 1 +#fi + eselect profile set $pnum emerge -1 gcc