You are not logged in.

#1 2014-06-28 22:10:34

saultdon
Member
From: Treaty 08
Registered: 2013-06-25
Posts: 41

[WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

I'm trying to update (QGIS) in the AUR to use git so that I can make use of patches as they become available.

I have

source=("$pkgname"::'git+https://github.com/qgis/QGIS/tree/release-2_4')

but this pulls a lot of data (750+ MB) and the pull or clone should only be ~80MB for that specific branch.

Changing the source to

source=("$pkgname"::'git://github.com/qgis/QGIS.git#branch=release-2_4')

it does the same thing and grabs a lot of data.
I noticed the fragment(branch) is ignored and it clones "master" instead.

From the terminal I can do

git clone -b release-2_4 --single-branch --depth 1 git://github.com/qgis/QGIS.git qgis

which works perfectly.

Is there a way to make "git clone" in the PKGBUILD use those flags like "-b release-2_4 --single-branch --depth 1"?

Last edited by saultdon (2014-06-29 02:03:54)


"We don't inherit the land from our ancestors - we borrow it from our children."

Offline

#2 2014-06-28 22:15:57

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

Offline

#3 2014-06-28 22:20:09

saultdon
Member
From: Treaty 08
Registered: 2013-06-25
Posts: 41

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

That is for qgis development version.

The one I'm building is for the stable release.


"We don't inherit the land from our ancestors - we borrow it from our children."

Offline

#4 2014-06-28 22:37:24

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

What's wrong with using the tarball?

source=("https://github.com/qgis/QGIS/archive/final-2_4_0.tar.gz")

"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#5 2014-06-28 22:45:45

saultdon
Member
From: Treaty 08
Registered: 2013-06-25
Posts: 41

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

Just that you have to download it every single time you want to recompile (~98MB). Not that big of a deal and I was doing that originally.

But with git, you just download the branch once, then subsequent fetches only pull in changes or revised files.

I'm going to use the tarball if it's not possible to customize the git pull in a PKGBUILD.
It's also strange that the fragment is ignored and pulls master instead of the release/branch in the fragment.


"We don't inherit the land from our ancestors - we borrow it from our children."

Offline

#6 2014-06-28 22:53:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

You don't have to re-download the source, you just add patches. Or am I missing something?

Offline

#7 2014-06-28 23:04:50

saultdon
Member
From: Treaty 08
Registered: 2013-06-25
Posts: 41

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

The tarball is updated from the git branch/release whenever a new commit is made.

So if github receives some commits (which could be patches or enhancements) then I should re-download the archive tarball to make use of them (they should be in the new tarball).

With QGIS, that 2.4 branch (or whatever version it's at) will be receiving patches (some backported from master) and if I try to make patches out of every single commit, the PKGBUILD could have a lot of patches (that may fail or skipped if the tarball has already been updated). That's going to be a packaging nightmare sad

Also, if a user isn't following the commit history of that specific branch, they won't know if they need to re-download the tarball and could either miss some patches or re-download for no reason.

Using git seems more efficient and practical for this specific package.


"We don't inherit the land from our ancestors - we borrow it from our children."

Offline

#8 2014-06-29 01:12:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,560

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

When you use a git source in a PKGBUILD, it downloads the entire repo, no matter what. When you specify a branch, it switches to that branch to do the build.

Offline

#9 2014-06-29 01:53:40

saultdon
Member
From: Treaty 08
Registered: 2013-06-25
Posts: 41

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

Yea, I noticed that, and if you specify a branch, maybe it would be better for makepkg to only download that branch. Git has the ability to do that (see my first post), because it seems wasteful to download the entire git repo for some packages. Especially if they've got lots of branches from several releases because they've been around for a while. You end up downloading the source several times...

I'm still wondering if it's possible to maybe manually make the git pull in the PKGBUILD with the --single-branch or the --depth 1 options.

Maybe I'll open a feature request for makepkg to only download the branch or release needed instead of the entire repo.

Because in this case, for QGIS, it downloads the entire repo at over 700MB, then switches to a branch that's only ~80MB.

It looks like the deprecated proto in /usr/share/pacman/PKGBUILD-git.proto shows that the git clone was called manually. Maybe using a pushd or something I can change to the current users directory and call it, then it would save a copy of the repo without having to fetch it every time you compile.


"We don't inherit the land from our ancestors - we borrow it from our children."

Offline

#10 2014-06-29 01:56:12

apg
Developer
Registered: 2012-11-10
Posts: 211

Offline

#11 2014-06-29 02:03:14

saultdon
Member
From: Treaty 08
Registered: 2013-06-25
Posts: 41

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

"Reason for closing:  Won't implement"

So it looks like my idea of using the old VCS pkgbuild would be the next best thing to try and if that fails, just tell users to check for latest commits since their last compile and re-download the tarball if needed (really didn't want to do that... it's much better to only have to fetch changes instead of the entire source).

Comment by Allan McRae (Allan) - Wednesday, 21 August 2013, 16:49 GMT-7
That breaks the second checkout that is done by makepkg when "extracting sources".

Just don't use the source array and manually download the source in prepare(). (i.e. basically the old style of VCS package)


"We don't inherit the land from our ancestors - we borrow it from our children."

Offline

#12 2014-06-29 03:02:24

progandy
Member
Registered: 2012-05-17
Posts: 5,196

Re: [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

Since git 1.9/2.0 the shallow clones apparently work better, maybe that could be implemented now, maybe like this:

gitdir::git+URI#shallow
git://URI#shallow:branch=foo
git+URI#shallow:tag=baz

http://stackoverflow.com/a/21217267
Edit: Well, cloning works, but git won't be able to use hardlinks to avoid duplicates of history files.
Edit: You might also consider creating a non-bare git repository and symlink it into the source directory. Then use git clean and git reset to roll back to the clean working directory:

$ git clean -qxdf
$ git reset -q --hard

Last edited by progandy (2014-06-29 03:37:23)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB