Commit Graph

11 Commits

Author SHA1 Message Date
Ed Bartosh 0ebe2e64ba oe-git-proxy: create usage output
Created usage output for oe-git-proxy script.

[YOCTO #10751]

(From OE-Core rev: ec0fdb5e896fc20dbafcc8ae507b17c011dc56fd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:21 +00:00
André Draszik bffb0fbfcc oe-git-proxy: don't depend on syslinux
gethostip comes from syslinux. It seems odd to depend on a bootloader
to clone a git repository.

Switch to using getent from the c-library, which should be available
on every system.

We now also support the case where a hostname resolves to more than
one IP address.

(From OE-Core rev: c91dbf3ca2faec95195c85b65aa6cab7de9bca2c)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:51 +01:00
André Draszik 9ac1b6fc39 oe-git-proxy: support username / password in http proxy
We also make sure to correctly support usernames that contain spaces.

For simplicity sed + regex has been replaced with shell parameter expansion,
which works in both, bash and dash.

(From OE-Core rev: ce4ff3dd80379e1bf71a967e0512591aaa046308)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:49 +01:00
André Draszik a15541dc27 oe-git-proxy: also check all_proxy and http_proxy env variables
(From OE-Core rev: 00fe3004aa624afee62315d5ea7566853b926931)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:49 +01:00
Peter Kjellerstedt f32a6e1f59 oe-git-proxy: Allow socks4 as protocol in $ALL_PROXY
The current default is to use SOCKS4a when socks is specified as
protocol in $ALL_PROXY. However, not all socks servers support
SOCKS4a. By allowing socks4 as an additional protocol, this script
will happily work with SOCKS4 only servers.

(From OE-Core rev: da9ddf48ed4a13cdc47649e22ab6ef7e36e01fdf)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:56 +01:00
Peter Kjellerstedt 18309f0893 oe-git-proxy: Correct the parsing of a port in $ALL_PROXY
Due to an error in the regular expression used to extract a port
number specified in $ALL_PROXY, rather than allowing the port number
to be followed by an optional "/", the port was required to be
followed by "/?".

This corrects the regular expression to allow an optional "/". It also
allows the odd "/?" suffix for backwards compatibility.

(From OE-Core rev: 39eb19e2ae9add58c763b71b54bdb3739041b2d0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:55 +01:00
Peter Kjellerstedt c035f3575b oe-git-proxy: Allow explicit IP addresses in $NO_PROXY
Without this fix, if one specified, e.g., 127.0.0.1 in $NO_PROXY, the
oe-git-proxy script would fail with a message like this:

/home/pkj/yocto/poky/scripts/oe-git-proxy: line 64: 32-127.0.0.1: syntax error: invalid arithmetic operator (error token is ".0.0.1")

(From OE-Core rev: c01e61d8b79d644880415986bdb1ba925f194329)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:55 +01:00
Juro Bystricky 88340ad522 oe-git-proxy: Redirect error messages to STDERR
oe-git-proxy script needs socat. If socat is not found,
an error message is issued on STDOUT. This leads to a misleading
git message:

fatal: protocol error: bad line length character: ERRO

instead of the intended message:

ERROR: socat binary not in PATH

Redirecting the error message to STDERR fixes this issue.

(From OE-Core rev: 960a7f7ae24e72efc165a431f8b91b3f3b176916)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31 22:23:15 +01:00
Ross Burton 1d00f3e0d9 oe-git-proxy: use SOCKS4a instead of SOCKS4
In some situations where a proxy is required the client can't even do DNS
lookups, so instead of using SOCKS4 use SOCKS4a which moves the name resolution
from the client to the proxy.

(From OE-Core rev: 984455a95b4302d527ff54e019d8ed00611f3664)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-10 16:44:31 +01:00
Darren Hart 9902eb341a oe-git-proxy: Use socat instead of BSD nc
BSD nc was commonly available on the current distros until Fedora 18
appears to have dropped it. socat appears to be a reasonable replacement
with availability on Fedora and Ubuntu and going back some time as well.

Update the script to use the socat syntax.
Simplify the logic a bit by using exec for the no-proxy-needed cases.

(From OE-Core rev: 795b1ea370b8a1d9152c171a50e80bd0b4b8dc60)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 22:54:04 +00:00
Darren Hart 0c988bfbb2 oe-git-proxy: Add a new comprehensive git proxy script
oe-git-proxy.sh is a simple tool to be used via GIT_PROXY_COMMAND. It
uses BSD netcat to make SOCKS5 or HTTPS proxy connections. It uses
ALL_PROXY to determine the proxy server, protocol, and port. It uses
NO_PROXY to skip using the proxy for a comma delimited list of hosts,
host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24). It is
known to work with both bash and dash shells.

V2: Implement recommendations by Enrico Scholz:
    o Use exec for the nc calls
    o Use "$@" instead of $* to avoid quoting issues inherent with $*
    o Use bash explicitly and simplify some of the string manipulations
    Also:
    o Drop the .sh in the name per Otavio Salvador
    o Remove a stray debug statement

V3: Implement recommendations by Otavio Salvador
    o GPL license blurb
    o Fix minor typo in comment block

(From OE-Core rev: 62867f56da0e0904f0108f113324c2432659fbac)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: Otavio Salvador <otavio@ossystems.com.br>

git-proxy cleanup

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 22:54:04 +00:00