Skip to content

Enable downloading build files using git#346

Closed
markusgrosser wants to merge 3 commits intofosskers:masterfrom
markusgrosser:use-git-clone-libgit2
Closed

Enable downloading build files using git#346
markusgrosser wants to merge 3 commits intofosskers:masterfrom
markusgrosser:use-git-clone-libgit2

Conversation

@markusgrosser
Copy link
Contributor

This adds a flag that enables downloading of build files (PKGBUILD, .install etc.) using git, which was made possible with AUR4.

While this currently doesn't give any benefit over the old method of downloading a tarball*, it is intended to serve as a baseline for possible future changes, like using git for diffs.

It also adds hlibgit2 as a dependency, which currently doesn't have an AUR package. I'm willing to create and maintain one (as well as dependencies), should this get merged.

As a useless side effect, this makes aura the first AUR Helper to have all features in the AUR Helper comparison table.

 

*In fact, this just downloads more data since it needs to fetch the complete history.

This commit adds a flag telling aura to use git clone to download
PKGBUILDs for building packages and adds a corresponding setting.

Note that this does not actually add said functionality to aura, but
only the flag to use as a baseline for possible implementations (using
either CLI or calling libgit directly).
When the --use-git/-g flag is given, use the clone functionality from
libgit2 to fetch build files, instead of downloading a tarball.
@fosskers
Copy link
Owner

If we're going to do this, let's just make it the default.

@flamusdiu
Copy link

@fosskers I would have to agree. All the AUR packages are going to be in a git repo anyway. It would support better downloading too.

Aura now always downloads build files using git. This removes the
-g/--use-git flag.
@fosskers
Copy link
Owner

fosskers commented Oct 3, 2015

How does this affect -Aw? Will it just clone the repo to the pwd?

@fosskers
Copy link
Owner

@markusgrosser , I just checked Hackage and there are quite a few git packages. What was the motivation for choosing the one you did?

@markusgrosser
Copy link
Contributor Author

The main reasons were feature-completeness and documentation, in which gitlib was (and still is) sadly lacking.

libgit (not to be confused with libgit2 which is the C library) might be an alternative, but it's only a wrapper around the git executable, whereas I personally preferred a "native" implementation.

I didn't see hit when I initially searched for a git library, but it seems like a good alternative, which I'll definitely look into. It doesn't support cloning though, so that'll probably have to be done by calling git clone ... directly.

Regarding -Aw, it seems to not do … anything, which I can't say I really understand. Cloning into $PDW/$pkgname seems like a sane choice though, so I'll probably implement that.

@fosskers
Copy link
Owner

git

gitlib was the main one I looked at, but was fairly quickly turned off by it. The main things we're looking for are cloning and the ability to branch, to be able to hotedit PKGBUILDs.

Cloning into $PDW/$pkgname seems like a sane choice

I agree, that's the end result of what -Aw does, after you've untar'd the file it downloads.

@DuncanvR
Copy link
Contributor

DuncanvR commented Aug 6, 2017

@markusgrosser

*In fact, this just downloads more data since it needs to fetch the complete history.

Not sure how this is achieved using hlibgit2, but on the command line you can use the --depth argument to control the amount of history that's fetched. E.g. git clone --depth 1 https://github.com/aurapm/aura.git only retrieves the last commit -- but still with all files in place.

@fosskers fosskers mentioned this pull request May 30, 2018
12 tasks
@fosskers fosskers closed this Jun 26, 2018
@AladW
Copy link
Contributor

AladW commented Jul 23, 2018

Impressive work on Aura 2.0! The wiki entry for aura should probably be updated...

@AladW
Copy link
Contributor

AladW commented Jul 23, 2018

Or I'll wait until the AUR pkgver is bumped: #489

@fosskers
Copy link
Owner

The README has been updated, but both Aura's wiki entry on the Arch wiki and the AUR helpers chart need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants