[pacman-dev] [PATCH] Add support for setting git-clone options to be used by makepkg (e.g. allowing user to set options like --depth=1)
Signed-off-by: Clayton Craft <craftyguy@gmail.com> --- etc/makepkg.conf.in | 3 +++ scripts/libmakepkg/source/git.sh.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 71ec624..4520318 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -19,6 +19,9 @@ DLAGENTS=('ftp::/usr/bin/curl -qfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o # /usr/bin/lftpget -c # /usr/bin/wget +#-- Git-clone options +GITCLONEOPTS="" + #-- The package required by makepkg to download VCS sources # Format: 'protocol::package' VCSCLIENTS=('bzr::bzr' diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index 4d2f2d7..b1c7c38 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -42,7 +42,7 @@ download_git() { if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git" - if ! git clone --mirror "$url" "$dir"; then + if ! git clone ${GITCLONEOPTS} --mirror "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 -- 2.6.1
On 9 October 2015 at 04:55, Clayton Craft <craftyguy@gmail.com> wrote:
Signed-off-by: Clayton Craft <craftyguy@gmail.com> --- etc/makepkg.conf.in | 3 +++ scripts/libmakepkg/source/git.sh.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
+#-- Git-clone options +GITCLONEOPTS="" +
I don't like this at all, as it is specific to a single VCS. If something like that was to be introduced, it should be in my opinion applicable to any VCS. I think configuration similar to DLAGENTS would be nice. Lukas
On 09/10/15 18:08, Lukas Jirkovsky wrote:
On 9 October 2015 at 04:55, Clayton Craft <craftyguy@gmail.com> wrote:
Signed-off-by: Clayton Craft <craftyguy@gmail.com> --- etc/makepkg.conf.in | 3 +++ scripts/libmakepkg/source/git.sh.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
+#-- Git-clone options +GITCLONEOPTS="" +
I don't like this at all, as it is specific to a single VCS. If something like that was to be introduced, it should be in my opinion applicable to any VCS. I think configuration similar to DLAGENTS would be nice.
This can be done by dropping a file into libmakepkg that provides a stupidgit:// protocol. Allan
participants (3)
-
Allan McRae
-
Clayton Craft
-
Lukas Jirkovsky