Paste number 9606: stumendously small optimization of base-files, OK?

Paste number 9606: stumendously small optimization of base-files, OK?
Pasted by: pogma
When:5 years, 3 weeks ago
Share:Tweet this! | http://paste.lisp.org/+7EU
Channel:#fink
Paste contents:
Raw Source | XML | Display As
Index: init.csh.in
===================================================================
RCS file: /cvsroot/fink/base-files/init.csh.in,v
retrieving revision 1.18
diff -u -3 -p -u -i -r1.18 init.csh.in
--- init.csh.in	1 Jul 2005 15:12:03 -0000	1.18
+++ init.csh.in	3 Jul 2005 14:23:24 -0000
@@ -95,18 +95,22 @@ if ($?version) then
   endif
 endif
 
-set PROXYHTTP=`grep ProxyHTTP BASEPATH/etc/fink.conf | grep -v "#" | cut -d " " -f2`
+if ( ! $?HTTP_PROXY) then
+  set PROXYHTTP=`awk '/^[ \t]*ProxyHTTP/ {print $2}' BASEPATH/etc/fink.conf`
 
-if ( "$PROXYHTTP" != "" ) then
-  setenv HTTP_PROXY $PROXYHTTP
-  setenv http_proxy $PROXYHTTP
+  if ( "$PROXYHTTP" != "" ) then
+    setenv HTTP_PROXY $PROXYHTTP
+    setenv http_proxy $PROXYHTTP
+  endif
 endif
 
-set PROXYFTP=`grep ProxyFTP BASEPATH/etc/fink.conf | grep -v "#" | cut -d " " -f2`
+if ( ! $?FTP_PROXY) then
+  set PROXYFTP=`awk '/^[ \t]*ProxyFTP/ {print $2}' BASEPATH/etc/fink.conf`
 
-if ( "$PROXYFTP" != "" ) then
-  setenv FTP_PROXY $PROXYFTP
-  setenv ftp_proxy $PROXYFTP
+  if ( "$PROXYFTP" != "" ) then
+    setenv FTP_PROXY $PROXYFTP
+    setenv ftp_proxy $PROXYFTP
+  endif
 endif
 
 # read per-package scripts from BASEPATH/etc/profile.d
Index: init.sh.in
===================================================================
RCS file: /cvsroot/fink/base-files/init.sh.in,v
retrieving revision 1.19
diff -u -3 -p -u -i -r1.19 init.sh.in
--- init.sh.in	1 Jul 2005 15:12:03 -0000	1.19
+++ init.sh.in	3 Jul 2005 14:23:24 -0000
@@ -108,24 +108,26 @@ if [ -z "$DYLD_FALLBACK_LIBRARY_PATH" ];
   fi
 fi
 
-PROXYHTTP=`grep ProxyHTTP BASEPATH/etc/fink.conf | grep -v "#" | cut -d " " -f2`
+if [ -z "$HTTP_PROXY" ]; then
+  PROXYHTTP=`awk '/^[ \t]*ProxyHTTP/ {print $2}'  BASEPATH/etc/fink.conf`
 
-if [ "$PROXYHTTP" != "" ]; then
-  HTTP_PROXY=$PROXYHTTP
-  http_proxy=$PROXYHTTP
+  if [ "$PROXYHTTP" != "" ]; then
+    HTTP_PROXY=$PROXYHTTP
+    http_proxy=$PROXYHTTP
 
-  export HTTP_PROXY http_proxy
+    export HTTP_PROXY http_proxy
+  fi
 fi
+if [ -z "$FTP_PROXY" ]; then
+  PROXYFTP=`awk '/^[ \t]*ProxyFTP/ {print $2}'  BASEPATH/etc/fink.conf`
 
-PROXYFTP=`grep ProxyFTP BASEPATH/etc/fink.conf | grep -v "#" | cut -d " " -f2`
+  if [ "$PROXYFTP" != "" ]; then
+    FTP_PROXY=$PROXYFTP
+    ftp_proxy=$PROXYFTP
 
-if [ "$PROXYFTP" != "" ]; then
-  FTP_PROXY=$PROXYFTP
-  ftp_proxy=$PROXYFTP
-
-  export FTP_PROXY ftp_proxy
+    export FTP_PROXY ftp_proxy
+  fi
 fi
-
 # read per-package scripts from BASEPATH/etc/profile.d
 if [ -d BASEPATH/etc/profile.d ]; then
   for i in BASEPATH/etc/profile.d/*.sh ; do

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.