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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...