Commit Graph

13 Commits

Author SHA1 Message Date
Alexander Larsson
8c78700363 builder: Allow specifying the git commit if the branch is a tag
If the ref specified in "branch" is actually a tag, we were requiring
that the "commit" property must match "git rev-parse $branch", but
in the case of a tagname that actually expands to the id of the
tag object, not the commit id. We now also try to match against
"rev-parse $branch^{commit}" which expands to the actual commit
object.

We still allow the tag object for backwards compat.
2017-05-11 10:52:30 +02:00
Alexander Larsson
3d1b51b5c0 builder: Use mkdtemp for initial git/bzr checkout
Rather than just prepending _tmp this creates a unique
directory name, which means we don't run into issues
when retrying if the first checkout fails.

Fixes https://github.com/flatpak/flatpak/issues/786
2017-05-11 10:29:51 +02:00
Alexander Larsson
48d9cd8eae builder: Strip trailing whitespace in git submodule urls
Seen in the wild in https://github.com/Unvanquished/Unvanquished.git
2017-04-24 21:20:16 +02:00
Alexander Larsson
f4f2625f59 builder: Change how we handle pre-existing git sources
We always have a local git checkout in .flatpak-builder/git
so that we can later update in it. However, if --extra-sources
is used and the git repo exists there, we use the data there
to clone the initial repo, to avoid lots of traffic on the network.

Additionally, if --disable-update is specified we just straight
clone the local cache repo, and then rewrite the origin to the
real one. This means we never do any network i/o to the original
pull.
2017-04-24 14:13:36 +02:00
Alexander Larsson
a5157d445b builder: Use context_find_in_sources_dirs to simplify code
Instead of open-coding the search everywhere. Also some places
are changed to use flatpak_build_file to further simplify
the code.
2017-04-24 09:02:42 +02:00
Simon Schampijer
5d52f93a25 Bundle sources: bundling has to happen before the extracting
In the case of the source-file we have code that handle
the file inline. When we extract the source we do set
the url with that inline data. In get_download_location
that is also used by the bundling code we do then
check against this url and fail.
2017-04-13 13:57:56 +02:00
Simon Schampijer
1bfe54a434 Bundle sources, git_get_mirror_dir: able to pass NULL for is_local
We only need the info in the builder_git_checkout case.
2017-04-13 13:32:33 +02:00
Simon Schampijer
f094ab7e55 Bundle sources: use git clone --shared for local sources checkout
Share the data with the read-only repository from
the extra sources.
2017-04-13 13:32:33 +02:00
Simon Schampijer
894311e243 flatpak-builder: bundle module sources as runtime
This adds a step to the build process to bundle
the module sources, used for building the flatpak,
as a runtime extension.

The sources can then be installed like the
debug or translation runtime.

This also adds an option to flatpak-builder
for specifying sources directories. One can specify
source dirctories with the use-sources argument. This
will skip the download part of the processing
and will extract the sources from the given sources
directory directly for further processing.

Those source directories do need the same
structure as the ones that flatpak-builder
creates during processing in .flatpak-builder
and which is also used in the exported sources
runtime.
2017-04-13 13:32:33 +02:00
Alexander Larsson
3459ef8655 builder: Add disable-fsckobjects to git sources
This lets you work around clone problems for broken
git repositories.

Fixes https://github.com/flatpak/flatpak/issues/661
2017-04-04 14:31:48 +02:00
Alexander Larsson
83600f7c1b builder: Always clone git repos with transport.fsckObjects
This way we detect any corrupt (or malicious) objects
2017-02-27 16:17:57 +01:00
Alexander Larsson
90674fafa0 builder: Don't mirror submodules if told not to 2017-02-22 15:12:59 +01:00
Alexander Larsson
b136e7fdc6 builder: extract git mirroring code to builder-git.c
This way we can resuse it outside the git source
2017-02-21 11:58:35 +01:00