Jump to content

urpmi broken behind a firewall in 2009.0 [solved]


Recommended Posts

I'm not sure this is the right place as it is about updating/upgrading, not installing… Anyway, here we go:

 

Before the switch to 2009.0, urpmi worked great wether at home (no proxy) or at work (with proxy) because the switch in network profile made the adequate changes to these environment variables: http_proxy, ftp_proxy, https_proxy and no_proxy.

 

Since I switched to 2009.0, I'm unable to install/update/upgrade from work! And I can't set the proxy at the urpmi level since there is no proxy when I use a different network profile.

 

From what I understand, the download is handled by aria2c, so I tried renaming it to aria2c.REAL, and created this script instead:

#!/bin/bash

if [ -n "$http_proxy" ] && ! grep '[-]-http-proxy' <<<"$*" >/dev/null; then
	params=(
			--lowest-speed-limit=0
			--timeout=300
			--http-proxy="${http_proxy#*://}"
			--ftp-via-http-proxy=tunnel
			--metalink-preferred-protocol=http
			--metalink-enable-unique-protocol=true
	)
	count=${#params[*]}
	regex1="^($(tr ' ' '|' <<<"${params[*]}" | sed 's/=[^|]*//g'))"
	regex2="^($(tr ' ' '|' <<<"${params[*]}" | sed 's/=[^|]*/=/g'))"
	while [ $# -gt 0 ]; do
			if ! grep -E "$regex1" <<<"$1" >/dev/null; then
					count=$(($count + 1))
					params[$count]="$1"
			elif ! grep -E "$regex2" <<<"$1" >/dev/null; then
					shift
			fi
			shift
	done
	/usr/bin/aria2c.REAL "${params[@]}"
else
	/usr/bin/aria2c.REAL "$@"
fi

To my dismay, this did not help.

 

What can I do for being seamlessly able to install/update wether I'm behind a proxy or not?

 

Yves.

Edited by theYinYeti
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...