From: munkyu.im Date: Thu, 7 Nov 2013 08:40:46 +0000 (+0900) Subject: proxy: append protocol prefix when export variables X-Git-Tag: submit/tizen_common/20140529.181337~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2969bd9395f560d23e8cadce9d22121d0ecef687;p=platform%2Fadaptation%2Femulator%2Fsystem-plugin-emulator.git proxy: append protocol prefix when export variables http_proxy=http://{address}:{port} https_proxy=https://{address}:{port} ftp_proxy=:ftp//{address}:{port} socks_proxy=socks://{address}:{port} Change-Id: I9d6227a4cdd5eeba955f4351d5d6cb2491f7aab6 Signed-off-by: munkyu.im --- diff --git a/filesystem/etc/profile.d/proxy_setting.sh b/filesystem/etc/profile.d/proxy_setting.sh index 00a6787..cb53de4 100755 --- a/filesystem/etc/profile.d/proxy_setting.sh +++ b/filesystem/etc/profile.d/proxy_setting.sh @@ -1,17 +1,33 @@ #!/bin/sh if grep -q "http_proxy=" /proc/cmdline ; then __proxy=`sed 's/^.*http_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline` - export "http_proxy=${__proxy}" + if [ "x${__proxy}" = "x" ]; then + export "http_proxy=" + else + export "http_proxy=http://${__proxy}/" + fi fi if grep -q "https_proxy=" /proc/cmdline ; then __proxy=`sed 's/^.*https_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline` - export "https_proxy=${__proxy}" + if [ "x${__proxy}" = "x" ]; then + export "https_proxy=" + else + export "https_proxy=https://${__proxy}/" + fi fi if grep -q "ftp_proxy=" /proc/cmdline ; then __proxy=`sed 's/^.*ftp_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline` - export "ftp_proxy=${__proxy}" + if [ "x${__proxy}" = "x" ]; then + export "ftp_proxy=" + else + export "ftp_proxy=ftp://${__proxy}/" + fi fi if grep -q "socks_proxy=" /proc/cmdline ; then __proxy=`sed 's/^.*socks_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline` - export "socks_proxy=${__proxy}" + if [ "x${__proxy}" = "x" ]; then + export "socks_proxy=" + else + export "socks_proxy=socks://${__proxy}/" + fi fi diff --git a/packaging/system-plugin-emulator.spec b/packaging/system-plugin-emulator.spec index 4403aab..8afb272 100644 --- a/packaging/system-plugin-emulator.spec +++ b/packaging/system-plugin-emulator.spec @@ -1,5 +1,5 @@ Name: system-plugin-emulator -Version: 0.0.15 +Version: 0.0.16 Release: 1 %define systemd_dir /usr/lib/systemd