Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 657706 Details for
Bug 704416
env-update: Consider transforming /etc/env.d into systemd environment.d files on env-update
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-Add-gentoo-env-to-systemd.patch
0001-Add-gentoo-env-to-systemd.patch (text/plain), 1.79 KB, created by
Florian Schmaus
on 2020-09-01 07:39:19 UTC
(
hide
)
Description:
0001-Add-gentoo-env-to-systemd.patch
Filename:
MIME Type:
Creator:
Florian Schmaus
Created:
2020-09-01 07:39:19 UTC
Size:
1.79 KB
patch
obsolete
>From 2ffe758ed848086439e5bc6c5723a4e77511c989 Mon Sep 17 00:00:00 2001 >From: Florian Schmaus <flo@geekplace.eu> >Date: Tue, 1 Sep 2020 09:32:00 +0200 >Subject: [PATCH] Add gentoo-env-to-systemd > >This script transforms Gentoo's /etc/profile.env to a systemd user >unit environment configuration file placed in /usr/lib/environment.d >named gentoo-env.conf. > >The script is meant to be invoked by a, not yet existing, env-update >hook that is invoked after /etc/profile.env was (re-)generated. > >Bug: https://bugs.gentoo.org/704416 >Signed-off-by: Florian Schmaus <flo@geekplace.eu> >--- > gentoo-env-to-systemd | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > create mode 100755 gentoo-env-to-systemd > >diff --git a/gentoo-env-to-systemd b/gentoo-env-to-systemd >new file mode 100755 >index 0000000..74d53d0 >--- /dev/null >+++ b/gentoo-env-to-systemd >@@ -0,0 +1,33 @@ >+#!/usr/bin/env bash >+# Copyright 2020 Gentoo Authors >+# Distributed under the terms of the GNU General Public License v3 (or any later version) >+set -euo pipefail >+ >+while getopts :d OPT; do >+ case $OPT in >+ d) >+ set -x >+ ;; >+ *) >+ echo "usage: ${0##*/} [-d]" >+ exit 2 >+ esac >+done >+ >+readonly GENTOO_PROFILE_ENV_PATH="/etc/profile.env" >+readonly GENTOO_SYSTEMD_ENV_CONF="/usr/lib/environment.d/gentoo-env.conf" >+ >+# Strip "export " to transform gentoo's profile.env syntax, which is >+# shell, to systemd's environment.d syntax (which is shell-like >+# without explicit "export" keyword). >+readonly STRIP_EXPORT_REGEX="s;^export ;;" >+# Strip comments. >+readonly STRIP_COMMENTS_REGEX="/^[ \t]*#/d" >+# Strip emtpy lines. >+readonly STRIP_EMPTY_LINES_REGEX="/^[ \t]*$/d" >+ >+sed -e "${STRIP_EXPORT_REGEX}" \ >+ -e "${STRIP_COMMENTS_REGEX}" \ >+ -e "${STRIP_EMPTY_LINES_REGEX}" \ >+ "${GENTOO_PROFILE_ENV_PATH}" \ >+ > "${GENTOO_SYSTEMD_ENV_CONF}" >-- >2.26.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 704416
: 657706 |
657948