[PC-BSD Commits] r6870 - pcbsd-projects/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Mon Jun 7 07:43:25 PDT 2010


Author: kris
Date: 2010-06-07 07:43:25 -0700 (Mon, 07 Jun 2010)
New Revision: 6870

Modified:
   pcbsd-projects/pbi-manager/pbi-manager
Log:

Added support for proxys to pbi-manager via CURL flags



Modified: pcbsd-projects/pbi-manager/pbi-manager
===================================================================
--- pcbsd-projects/pbi-manager/pbi-manager	2010-06-07 09:04:18 UTC (rev 6869)
+++ pcbsd-projects/pbi-manager/pbi-manager	2010-06-07 14:43:25 UTC (rev 6870)
@@ -2210,7 +2210,7 @@
 	if [ -z "${PBI_UPDATEURL}" ] ; then return ; fi
 
 	appname="`echo ${PBI_PROGNAME} | tr '[:lower:]' '[:upper:]'`"
-	curl -o ${PBI_TMPDIR}/.upcheck$$ \
+	curl -o ${PBI_TMPDIR}/.upcheck$$ ${PBI_CURLPROXY} \
 		-F "PBIName=${appname}" \
 		-F "PBIVer=${PBI_PROGVERSION}" \
 		-F "PCBSDVER=${PBI_FBSDVER}" \
@@ -2370,7 +2370,7 @@
 	_lf="${2}"
 	if [ -e "${_lf}" ] ; then rm "$_lf" ; fi
 
-	curl -# -o "${_lf}" "${_rf}"
+	curl -# ${PBI_CURLPROXY} -o "${_lf}" "${_rf}"
 	return $?
 }
 
@@ -2637,6 +2637,16 @@
 	PBI_UPDATEURL="`cat ${PBI_ETCCONF} | grep 'PBI_UPDATEURL: ' | sed 's|PBI_UPDATEURL: ||g'`"
 	PBI_PUBKEYS="`cat ${PBI_ETCCONF} | grep 'PBI_PUBKEYS: ' | sed 's|PBI_PUBKEYS: ||g'`"
 	PBI_MIRROR="`cat ${PBI_ETCCONF} | grep 'PBI_MIRROR: ' | sed 's|PBI_MIRROR: ||g'`"
+	PBI_PROXYURL="`cat ${PBI_ETCCONF} | grep 'PBI_PROXYURL: ' | sed 's|PBI_PROXYURL: ||g'`"
+	PBI_PROXYPORT="`cat ${PBI_ETCCONF} | grep 'PBI_PROXYPORT: ' | sed 's|PBI_PROXYPORT: ||g'`"
+	if [ ! -z "$PBI_PROXYURL" ] ; then
+		PBI_CURLPROXY="--proxy ${PBI_PROXYPORT}"
+		if [ ! -z "$PBI_PROXYPORT" ] ; then
+			PBI_CURLPROXY="${PBI_CURLPROXY}:${PBI_PROXYPORT}"
+		fi
+	else
+		PBI_CURLPROXY=""
+	fi
 }
 
 # Main program operation



More information about the Commits mailing list