[arch-general] [pkgstats] Patch to allow pkgstats to submit info through a proxy (if this is setted on http_proxy)

Angel Velásquez angvp at archlinux.com.ve
Mon Dec 21 09:13:53 EST 2009


Hi,

I've been trying to submit my stats to the statistics page [1], then I
realized that I wasn't submitting anything (I had pkgstats running on
a cron). Then I decided to find the reason and it's simply I am behing
a noisy and non-transparent proxy (ISA Server which is even worst).

So, I decided to do a little patch to pkgstats, I've tested and now
it's working .. (I am checking if the http_proxy env var is empty and
else I am setting a variable called prox which have the value of the
proxy).

Just that ;), patch attached

[1] https://www.archlinux.de/?page=PackageStatistics

-- 
Angel Velásquez
angvp @ irc.freenode.net
Arch Linux Trusted User
Linux Counter: #359909
http://www.angvp.com
-------------- next part --------------
--- /usr/bin/pkgstats	2009-10-22 15:15:45.000000000 -0300
+++ pkgstats	2009-12-21 11:06:37.000000000 -0300
@@ -36,8 +36,13 @@
 	echo "arch=$(uname -m)"
 	echo "pkgstatsver=${pkgstatsver}"
 else
+    if [ -z ${http_proxy} ]; then 
+        prox=""
+    else
+        prox="--proxy ${http_proxy}"
+    fi
 	echo 'Submitting data...'
-	curl ${debug} -f -H 'Expect: ' \
+	curl ${prox} ${debug} -f -H 'Expect: ' \
 		--data-urlencode "packages@${pkglist}" \
 		--data-urlencode "arch=$(uname -m)" \
 		--data-urlencode "pkgstatsver=${pkgstatsver}" \


More information about the arch-general mailing list