Commit Graph

24 Commits

Author SHA1 Message Date
Simon Dawson 3b8e4fb4aa replace github with GitHub
The correct capitalisation pattern is "GitHub"; fix manual and makefile
commentary.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-04 23:14:08 +02:00
Samuel Martin 507d6a637b pkg-download: update the github helper
Once again, github updates the source download url.
Even if only the zip archive link is advertised on the repositories'
page, the *.tar.gz is still available.

It is worthy to note that the tarball's content differs depending if
it has been fetched from the former and the new url (the root directory
name changes).

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-06 14:32:37 +02:00
Yann E. MORIN 18edb40bf5 pkg-infra: DOWNLOAD is never called with two arguments
Currently, the DOWNLOAD helper accepts one or two arguments:
  - the source URI
  - the source filename; if missing, it is derived from the URI

But we have no caller of DOWNLOAD that passes a second argument.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-02 21:01:40 +01:00
Arnout Vandecappelle af97c94b70 Makefile.legacy: fix recursive invocation with BUILDROOT_DL_DIR and _CONFIG
The legacy support for the old BUILDROOT_DL_DIR and BUILDROOT_CONFIG
breaks down when make is invoked recursively - which is done in a few
cases, e.g. silentoldconfig, external-defs, ... These targets always
give a legacy error.

For BUILDROOT_DL_DIR, this is fixed by making sure that the original
value of BR2_DL_DIR taken from the environment is also exported again.

For BUILDROOT_CONFIG, this is fixed with an additional comparison of
the environment variable's value with the fake value that we introduce
ourselves.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-11 08:14:57 +01:00
Arnout Vandecappelle 6768021c93 infra: replace BUILDROOT_DL_DIR with BR2_DL_DIR.
To make the naming consistent (all user-visible options should be
prefixed BR2_).

An entry is added to Makefile.legacy to warn users who have set
BUILDROOT_DL_DIR but not BR2_DL_DIR.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-09 11:02:42 +01:00
Thomas Petazzoni fecf5b522b pkg-download: make sure git downloads fail for unknown versions
The current git download helper creates the tarball by doing:

    git archive <version> | gzip -c > <tarball>

Unfortunately, even if "git archive" fails and returns a non-zero
error code, gzip ignores that, compresses nothing, and returns success
(zero error code). The consequence of this behavior is that when the
git version provided in the package is incorrect, we are not failing
during the download step, but later on when trying to extract the
tarball (which was incorrectly created as a result of the failing git
archive).

To fix this, we change the tarball creation logic to:

   git archive -o <tarball>.tmp <version> &&
   gzip -c <tarball>.tmp > <tarball> &&
   rm -f <tarball>.tmp

If the build is interrupted during the "gzip" command, we may leave
the .tmp file behind us, but this also happens with wget downloads,
and is generally not considered a problem, since this temporary file
will be overwritten next time we attempt to do download this package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-04 15:15:48 +01:00
Mathias De Maré a10073b6b0 package: make package download from Mercurial repositories more robust
Previously, when cloning a Mercurial repository,
aborting the clone could (in some cases) leave behind an empty directory.
As a result, a later clone would fail.

Signed-off-by: Mathias De Maré <mathias.demare@gmail.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-12-25 12:36:39 +01:00
Mischa Jonker bb083e95cf infra: introduce github helper function
In order to make it easier to cope with changes in github download-URL's,
this patch introduces the github helper function. It generates the site
URL of a github repository. It's usage is $(call github,user,pkg,version).

[Thomas: extracted from Mischa original commit, macro moved to
pkg-download.mk]

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-06 22:34:51 +01:00
Gustavo Zacarias 15eb1fafa3 downloads: add basic CVS support
The support is for pserver mode anonymous CVS.
source-check is based on login since many servers don't support or have
ls/rls disabled.

Usage is pretty straightforward.
PKG_SITE defines the site hostname and remote directory.
The module is defined by the bare package name.
Version is date based.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-13 00:05:43 +02:00
Jerzy Grzegorek e0d9d33cc2 fix white spaces
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-20 21:13:57 +02:00
Alexandre Belloni 8dfd59d114 Normalize separator size to 80
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-06 22:30:24 +02:00
Danomi Manchego 63eabbb11e pkg-download.mk: fix multiple matches in shallow clone test
Move the git reference directly to git-ls-remote rather than
piping the output to grep, to help avoid reporting partial
matches rather than the actual requested reference.  Also,
add quotes to protest "test" from failing when multiple
strings are reported.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-09 21:46:40 +01:00
Stephan Hoffmann d1f5fc29ef pkg-download.mk: Fix shallow clone
Some git versions (e.g. 1.7.0) do not treat trying to shallow clone
a non existing branch or tag as a fatal error but report a warning
and clone HEAD instead. Thus the fallback mechanism does not work
in this case.

This patch introduces a check for the presence of the requested
version as a branch or tag before trying the shallow clone. It
also removes the need to do two clones when a sha1 is given as
a packege version.

[Peter: use cut -f2-]
Signed-off-by: Stephan Hoffmann <sho@relinux.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-02 08:07:04 -08:00
Arnout Vandecappelle (Essensium/Mind) 3dd4bcf1eb pkg-download: Make a shallow clone for git downloads
When downloading from git, we clone the whole repository and then only
use the latest commit.  That's a lot of redundant stuff.  So instead,
make a shallow clone.  Unfortunately that's only possible when
downloading a branch or tag, so fall back to the old method if git gives
an error.

This speeds up the cloning of a linux git from more than 2 hours to
20 minutes on a 200KB/s link).

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-11-04 00:55:35 +01:00
Peter Korsgaard a77ee7fd40 pkg-download: allow relative BR2_DL_DIR
And move the BUILDROOT_DL_DIR override here as well for consistency.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-09-10 16:00:50 +02:00
Thomas De Schampheleire 5a83e08499 Package downloads: allow restricting to primary site only
This patch adds a new config option BR2_PRIMARY_SITE_ONLY that, when set,
restricts package downloads to the specified BR2_PRIMARY_SITE. If the package
is not present on the primary site, the download fails.

This is useful for project developers who want to ensure that the project can
be built even if the upstream tarball locations disappear.

[thomas.petazzoni@free-electrons.com:
 Extend config option help message with more details coming from the
 commit log. Added a dependency on the fact that a primary site has
 been defined. Without any primary site (the default configuration),
 this new option does not make any sense.]

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-22 18:29:33 +02:00
Thomas De Schampheleire 77e2697218 pkg-download.mk: support detection of URI schemes in DOWNLOAD
When using one of the package infrastructures, the DOWNLOAD function
uses $(PKG)_SITE_METHOD to determine the appropriate download method,
which is autodetected based on the URI if none was explicitly set.

When the DOWNLOAD function is called directly, for example when
downloading a toolchain, or from a package that does not use one of
the package infrastructures, the SITE_METHOD is not autodetected,
and thus the download defaults to wget.

This patch adds URI scheme detection directly to the DOWNLOAD method,
in case no SITE_METHOD was detected yet.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-22 16:53:24 +02:00
Thomas De Schampheleire d57669271d pkg-download.mk: use stripurischeme function in localfiles download method
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-22 16:53:24 +02:00
Thomas De Schampheleire 0603125673 pkg-download.mk: allow using localfiles outside of package infrastructure
The localfiles download method uses $($(PKG)_SITE))) and
$($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only
be used for package downloads (through gentargets, autotargets, ...)
and not for other downloads like external toolchains.

This patch changes localfiles to allow this, just as the wget and scp
download methods already did.
For the version control download methods, nothing changes.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-22 16:53:24 +02:00
Arnout Vandecappelle 96885ca7eb pkg-download: handle interrupted wget downloads
When a wget download is interrupted, the downloaded file is still created.
It will therefore not be re-downloaded in the next build, and the
extraction will fail.

To avoid this, download to a temporary file first and rename when the
download is successful.

The existing mechanism doesn't work for interrupted downloads because the
whole sub-shell is interrupted, so the rm-part never gets executed.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-07-01 00:26:37 +02:00
Thomas De Schampheleire 3ae7d81407 pkg-download.mk: Add missing argument when downloading from primary mirror (scp)
This problem was already fixed by Markos Chandras for wget, but not for scp.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-05-23 21:49:40 +02:00
Markos Chandras 0b93a8cead pkg-download.mk: Add missing argument when downloading from primary mirror
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-05-05 23:55:42 +02:00
Thomas Petazzoni c0e6b52482 pkg-*.mk: add some comments, update some existing comments
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-19 16:08:09 +02:00
Thomas Petazzoni 6e6b99a571 Split Makefile.package.in in pkg-download.mk, pkg-utils.mk and pkg-gentargets.mk
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-19 16:07:15 +02:00