FS#36226 - [pacman-4.1] 'git clone --recursive' for source=()

Attached to Project: Pacman
Opened by UnicornDarkness (Xorg) - Sunday, 21 July 2013, 15:06 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 21 July 2013, 16:41 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
«Pacman 4.1 supports the following VCS sources: bzr, git, hg and svn. See the fragment section of man PKGBUILD or PKGBUILD(5) for a list of supported VCS.» (URL : https://wiki.archlinux.org/index.php/Arch_CVS/SVN_PKGBUILD_guidelines#VCS_sources)

In a PKGBUILD, when we use a git source in source=(), it doesn't clone submodules.


Steps to reproduce:
Command 'git clone' clone only one git repository.
Command 'git clone --recursive' clone one git repository with all his submodules.


Example :
If you don't understand me, I've an example for you (it is not publicity for a project).
'git clone https://github.com/LubosD/darling.git'; will clone "darling".
But 'git clone --recursive https://github.com/LubosD/darling.git'; will clone "darling", and repository git://github.com/LubosD/darling-mach.git into "darling/src/darling-mach" & git://git.dolezel.info/libsshcxx.git into "darling/src/darling-mach"

Yes, it is possible to use 'git clone --recursive' in build(), but I thing it is deprecated (and not proper with Pacman 4.1).
Or it's possible to add multiple git sources, like :
source=('https://github.com/LubosD/darling.git'
'git://github.com/LubosD/darling-mach.git'
'git://git.dolezel.info/libsshcxx.git')
And move them into the good path... BUT, if initial project changes his submodules, PKGBUILD will be broken.


I think it can be useful for everybody who use git in source=(). Thanks in advance.
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 21 July 2013, 16:41 GMT
Reason for closing:  Won't implement
Additional comments about closing:  previously discussed: https://mailman.archlinux.org/pipermail/ pacman-dev/2013-March/016781.html
Comment by Andrew Gregory (andrewgregory) - Sunday, 21 July 2013, 16:38 GMT
This was previously discussed on the mailing list and rejected because it downloads the submodules again each build and prevents building without an internet connection.

https://mailman.archlinux.org/pipermail/pacman-dev/2013-March/016781.html
Comment by Dave Reisner (falconindy) - Sunday, 21 July 2013, 16:41 GMT
Yeah, definitely agreed that prepare is the right place to do this...
Comment by UnicornDarkness (Xorg) - Sunday, 21 July 2013, 17:04 GMT
Ok. I'm sorry to haven't looked previously the mailing list.

So I have to use this :
prepare() {
cd "$srcdir"
msg "Connecting to GIT server...."

if [[ -d "$_gitname" ]]; then
cd "$_gitname" && git pull origin
msg "The local files are updated."
else
git clone "$_gitroot" "$_gitname"
fi

msg "GIT checkout done or server timeout"
msg "Starting build..."

rm -rf "$srcdir/$_gitname-build"
git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
cd "$srcdir/$_gitname-build"
}

?
Comment by Dave Reisner (falconindy) - Sunday, 21 July 2013, 17:15 GMT
prepare runs after the source is downloaded... You just have to cd into the source directory and run 'git submodule init; git submodule update' (or something like that)
Comment by UnicornDarkness (Xorg) - Monday, 22 July 2013, 07:41 GMT
Thank you very much. You introduced me to discover this command.

Loading...