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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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
--- /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}" \

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux