<feed xmlns='http://www.w3.org/2005/Atom'>
<title>buildroot/support/download/dl-wrapper, branch 2019.02-op-build</title>
<subtitle>OpenPOWER buildroot sources</subtitle>
<id>https://git.raptorcs.com/git/buildroot/atom?h=2019.02-op-build</id>
<link rel='self' href='https://git.raptorcs.com/git/buildroot/atom?h=2019.02-op-build'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/'/>
<updated>2018-12-09T16:16:04+00:00</updated>
<entry>
<title>support/download/dl-wrapper: fix urlencode option never being sent to backend</title>
<updated>2018-12-09T16:16:04+00:00</updated>
<author>
<name>Damien Thébault</name>
<email>damien.thebault@vitec.com</email>
</author>
<published>2018-12-07T12:41:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=bb7c13273fbe2da0969e14ddfd61a46b78d79db2'/>
<id>urn:sha1:bb7c13273fbe2da0969e14ddfd61a46b78d79db2</id>
<content type='text'>
Since commit 38de434123 ("download: fix file:// BR2_PRIMARY_SITE
(download cache)"), the urlencode option is no longer passed to the
download backend, because we use ${backend} instead of
${backend_urlencode}.

We must get the urlencode information from backend_urlencode.

Signed-off-by: Damien Thébault &lt;damien.thebault@vitec.com&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
[Thomas: rework commit log]
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next'</title>
<updated>2018-09-07T11:13:17+00:00</updated>
<author>
<name>Peter Korsgaard</name>
<email>peter@korsgaard.com</email>
</author>
<published>2018-09-07T11:08:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=721e4cbb529d247c9c1ebef68275e70a3086ae0b'/>
<id>urn:sha1:721e4cbb529d247c9c1ebef68275e70a3086ae0b</id>
<content type='text'>
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>download: fix file:// BR2_PRIMARY_SITE (download cache)</title>
<updated>2018-08-20T22:24:29+00:00</updated>
<author>
<name>Hollis Blanchard</name>
<email>hollis_blanchard@mentor.com</email>
</author>
<published>2018-08-15T23:44:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=38de43412327b68de1943ead3fea512ec42be625'/>
<id>urn:sha1:38de43412327b68de1943ead3fea512ec42be625</id>
<content type='text'>
wget is the only downloader currently usable with BR2_PRIMARY_SITE, and that
doesn't work at all for file:// URLs. The symptoms are these:

	support/download/dl-wrapper -c '2.4.47' -d '/PATH/build/sw/source/attr' -D '/PATH/build/sw/source' -f 'attr-2.4.47.src.tar.gz' -H 'package/attr//attr.hash' -n 'attr-2.4.47' -N 'attr' -o '/PATH/build/sw/source/attr/attr-2.4.47.src.tar.gz'  -u file\|urlencode+file:///NFS/buildroot_dl_cache/attr -u file\|urlencode+file:///NFS/buildroot_dl_cache -u http+http://download.savannah.gnu.org/releases/attr -u http\|urlencode+http://sources.buildroot.net/attr -u http\|urlencode+http://sources.buildroot.net  --
	file:///NFS/buildroot_dl_cache/attr/attr-2.4.47.src.tar.gz: Unsupported scheme `file'.
	ERROR: attr-2.4.47.src.tar.gz has wrong sha256 hash:
	ERROR: expected: 25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859
	ERROR: got     : e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
	ERROR: Incomplete download, or man-in-the-middle (MITM) attack

In the case of custom Linux kernel versions, this is fatal, because there isn't
necessarily a hash file to indicate that wget's empty tarball is wrong.

This seems to have been broken by commit c8ef0c03b0b, because:
1. BR2_PRIMARY_SITE always appends "urlencode" (package/pkg-download.mk)
2. Anything with the "|urlencode" suffix in $uri will end up using wget due to
   the backend case wildcarding.
3. The wget backend rejects file:/// URLs ("unsupported scheme"), and we end up
   with an empty .tar.gz file in the downloads directory.

Fix that by shell-extracting the backend name from the left of "|". I'm not
positive if all URLs will have a "|", so this code only looks for a "|" left of
the "+".

Signed-off-by: Hollis Blanchard &lt;hollis_blanchard@mentor.com&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Tested-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>support/download: remove help from wrapper</title>
<updated>2018-08-09T21:47:54+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2018-08-04T16:33:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=4dc6c43703fc4eb0721a0d34ad5eeebf57527b44'/>
<id>urn:sha1:4dc6c43703fc4eb0721a0d34ad5eeebf57527b44</id>
<content type='text'>
The download wrapper is a purely internal helper, and is not supposed to
be callable manually. No need to offer some help.

Besides, the help text was way out-dated.

Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>dl-wrapper: Fix support for URIs containing '+'</title>
<updated>2018-06-04T19:59:55+00:00</updated>
<author>
<name>Robert Beckett</name>
<email>bbeckett@netvu.org.uk</email>
</author>
<published>2018-06-04T13:32:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=a5ba72946ebf597a163bae9b12453dfa68993d54'/>
<id>urn:sha1:a5ba72946ebf597a163bae9b12453dfa68993d54</id>
<content type='text'>
'+' is a valid character in a url. The current dl-wrapper gets the
URI scheme by dropping everything after the last '+' character, with
the intension of finding 'git' from e.g. 'git+https://uri'.

If a uri has a '+' anywhere in it, it ends up using too much of the
string as a scheme, and fails to match the handler properly.

An example of where this form of URI is used is when using deploy tokens
in gitlab. It uses a form like https://&lt;username&gt;:&lt;password&gt;@gitlab.com/&lt;group&gt;/&lt;repo.git&gt;
where username for deploy token is of the form 'gitlab+deploy-token-&lt;number&gt;'.

Use the %% operator to search backwards until the last '+' character when
dropping the rest of the string as we know that the first '+'
in the string should be the scheme.

Signed-off-by: Robert Beckett &lt;bbeckett@netvu.org.uk&gt;
Acked-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>support/download/dl-wrapper: pass the correct -N option</title>
<updated>2018-04-12T20:54:00+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@bootlin.com</email>
</author>
<published>2018-04-11T08:10:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=26794449807648284439c6e03a405418d34f523f'/>
<id>urn:sha1:26794449807648284439c6e03a405418d34f523f</id>
<content type='text'>
${raw_name} is never defined in dl-wrapper, and therefore the value
passed to the -N option is always empty. This causes a problem for the
'cvs' backend, which uses the value of this option as the CVS module
to be downloaded.

If the name of the CVS module is omitted, all the CVS modules from
that CVS repository are downloaded, which creates a tarball with a lot
more contents, and the actual useful contents in a sub-directory,
obviously breaking patches that should be applied, and the entire
build process that follows.

Fixes:

  http://autobuild.buildroot.net/results/fcee0e3d7eeeb373313b1794092c729b1b052348/

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
Tested-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Acked-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>support/download/dl-wrapper: fix passing remaining options to helper scripts</title>
<updated>2018-04-12T20:53:55+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@bootlin.com</email>
</author>
<published>2018-04-11T07:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=0cf077a209596f34a109b641c90d85a87876f605'/>
<id>urn:sha1:0cf077a209596f34a109b641c90d85a87876f605</id>
<content type='text'>
When calling the backend-specific helper scripts, the remaining
options are in ${@}. However, in order to let the helper script know
that those remaining options should not be parsed, but instead passed
as-is to the download tool, they must be separated from the main
options by "--".

Without this, packages that use &lt;pkg&gt;_DL_OPTS, such as the
amd-catalyst package, cannot download their tarball anymore.

Fixes:

  http://autobuild.buildroot.net/results/de818f6e4c8e63d5e8a49c445d10c34eccc40410/

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
Tested-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Acked-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>core/download: fix when the BR2_DL_DIR does not accept hardlinks</title>
<updated>2018-04-03T20:45:00+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2018-04-03T18:54:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=0d19fcf6c24f7dcf585ad3423518068b5789f3b0'/>
<id>urn:sha1:0d19fcf6c24f7dcf585ad3423518068b5789f3b0</id>
<content type='text'>
When the BR2_DL_DIR is a mountpoint (presumably shared between various
machine, or mounted from the local host when running in a VM), it is
possible that it does not support hardlinks (e.g. samba, or the VMWare
VMFS, etc...).

If the hardlink fails, fallback to copying the file. As a last resort,
if that also fails, eventually fallback to doing the download.

Note: this means that the dl-wrapper is no longer atomic-safe: the code
suffers of a TOCTTOU condition: the file may be created in-between the
check and the moment we try to ln/cp it. Fortunately, the dl-wrapper is
now run under an flock, so we're still safe. If we eventually go for a
more fine-grained implementation, we'll have to be careful then.

Reported-by: Arnout Vandecappelle &lt;arnout@mind.be&gt;
Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Cc: Arnout Vandecappelle &lt;arnout@mind.be&gt;
Cc: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Cc: Maxime Hadjinlian &lt;maxime.hadjinlian@gmail.com&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>core/download: look for archives in the global download dir first</title>
<updated>2018-04-02T15:48:56+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2018-04-02T15:13:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=e80d1d0af448c33f93a9a913cd0a34c406a29cf4'/>
<id>urn:sha1:e80d1d0af448c33f93a9a913cd0a34c406a29cf4</id>
<content type='text'>
For existing setups, the global donload directory may have a lot of the
required archives, so look into there before attempting a download.

We simply hard-link them if found there and not in the new per-package
loaction. Then we resume the existing procedure (which means the new
hardlink will get removed if it happened to not match the hash).

Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Cc: Maxime Hadjinlian &lt;maxime.hadjinlian@gmail.com&gt;
Cc: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Cc: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>download: add missing '-d' option</title>
<updated>2018-04-02T15:48:56+00:00</updated>
<author>
<name>Maxime Hadjinlian</name>
<email>maxime.hadjinlian@gmail.com</email>
</author>
<published>2018-04-02T14:58:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=5d2a018ddf950b53d1d50d09d3af92849d8f5994'/>
<id>urn:sha1:5d2a018ddf950b53d1d50d09d3af92849d8f5994</id>
<content type='text'>
The infrastructure needs to give the 'dl_dir' to the dl-wrapper which in its
turn needs to give it to the helper.  It will only be used by the 'git'
helper as of now.

Signed-off-by: Maxime Hadjinlian &lt;maxime.hadjinlian@gmail.com&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
</feed>
