Skip to content

Instantly share code, notes, and snippets.

@Self-Perfection
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Self-Perfection/d03ed332f39038b63899 to your computer and use it in GitHub Desktop.
Save Self-Perfection/d03ed332f39038b63899 to your computer and use it in GitHub Desktop.
Patch: faster shell launch in developer mode on SailfishOS
--- /etc/profile.d/developer-profile.sh 2015-02-11 03:14:12.000000000 +0300
+++ script_versions/developer-profile.sh_v1 2015-04-26 14:42:19.212224189 +0300
@@ -98,13 +98,12 @@
ENV_SET=$(cat /proc/$SESSION_PID/environ | sed -e 's/\x00/\n/g' | grep -wvF "$BLACK_LIST_VALUES")
while read ENV_PAIR
do
- echo $ENV_PAIR | grep -qwF "$WHITE_LIST_VALUES"
- if [ $? -ne 0 ]; then
- echo "NOTICE: Env value ignored $ENV_PAIR"
- else
- eval export `echo $ENV_PAIR | sed -e 's/=\(.*\)/=\"\1\"/'`
- fi
- done < <(echo "$ENV_SET")
+ echo "NOTICE: Env value ignored $ENV_PAIR"
+ done < <(echo "$ENV_SET"| grep -wvF "$WHITE_LIST_VALUES")
+ while read ENV_PAIR
+ do
+ export "$ENV_PAIR"
+ done < <(echo "$ENV_SET"| grep -wF "$WHITE_LIST_VALUES")
else
# No session running
echo "NOTICE: There is no systemd user session running"
@Self-Perfection
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment