diff --git a/packages/templates/functions.yaml b/packages/templates/functions.yaml index 9951af1a..60927055 100644 --- a/packages/templates/functions.yaml +++ b/packages/templates/functions.yaml @@ -260,10 +260,10 @@ {{- if $value }} cat /etc/portage/make.conf || true; \ grep -qx '^EMERGE_DEFAULT_OPTS=.*' /etc/portage/make.conf || echo 'EMERGE_DEFAULT_OPTS=' >> /etc/portage/make.conf; \ - sed -i -e "/^EMERGE_DEFAULT_OPTS=.*--usepkg-exclude/! s/^\(EMERGE_DEFAULT_OPTS=.*\)/\1 --usepkg-exclude/" /etc/portage/make.conf; \ - sed -i -e "/^EMERGE_DEFAULT_OPTS=.*--usepkg-exclude[ ]*'/! s/^\(EMERGE_DEFAULT_OPTS=.*--usepkg-exclude\)[ ]*/\1 ''/" /etc/portage/make.conf; \ - sed -i -e "/--usepkg-exclude[ ]*'.*{{ $atom.atom | replace "/" "\\/" }}.*'/! s/--usepkg-exclude\([ ]*\)'\(.*\)'/--usepkg-exclude '{{ $atom.atom | replace "/" "\\/" }} \2'/" /etc/portage/make.conf; \ - sed -i -E "s/--usepkg-exclude ' *([^ ']*([^']*[^ ])) *'/--my-option '\1'/g" /etc/portage/make.conf; \ + sed -i -e '/^EMERGE_DEFAULT_OPTS=.*--usepkg-exclude/! s/^\(EMERGE_DEFAULT_OPTS=.*\)/\1 --usepkg-exclude/' /etc/portage/make.conf; \ + sed -i -e '/^EMERGE_DEFAULT_OPTS=.*--usepkg-exclude[ ]*"/! s/^\(EMERGE_DEFAULT_OPTS=.*--usepkg-exclude\)[ ]*/\1 ""/' /etc/portage/make.conf; \ + sed -i -e '/--usepkg-exclude[ ]*".*{{ $atom.atom | replace '/' '\\/' }}.*"/! s/--usepkg-exclude\([ ]*\)"\(.*\)"/--usepkg-exclude "{{ $atom.atom | replace '/' '\\/' }} \2"/' /etc/portage/make.conf; \ + sed -i -E 's/--usepkg-exclude " *([^ "]*([^"]*[^ ])) *"/--my-option "\1"/g' /etc/portage/make.conf; \ cat /etc/portage/make.conf; \ {{- end }}