Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: git clone instead of git fetch if $dir exists but empty (http://www.linux-archive.org/archlinux-pacman-development/693127-makepkg-git-clone-instead-git-fetch-if-dir-exists-but-empty.html)

Mohammad Alsaleh 08-12-2012 12:24 AM

makepkg: git clone instead of git fetch if $dir exists but empty
 
Before this patch, makepkg would only check if $dir exists as an
indication that a local clone exists. And if $dir does exist, makepkg
will run git fetch inside it unconditionally.

After applying this patch, makepkg will check if the existent $dir is
empty. And if it is, it will be used to store a local clone.

Signed-off-by: Mohammad Alsaleh <msal@i2pmail.org>
---
scripts/makepkg.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 270f988..6c0e821 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -396,7 +396,7 @@ download_git() {
url=${url##*git+}
url=${url%%#*}

- if [[ ! -d "$dir" ]]; then
+ if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
if ! git clone --mirror "$url" "$dir"; then
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
--
1.7.11.4

Mohammad Alsaleh 08-12-2012 12:48 AM

makepkg: git clone instead of git fetch if $dir exists but empty
 
Before this patch, makepkg would only check if $dir exists as an
indication that a local clone exists. And if $dir does exist, makepkg
will run git fetch inside it unconditionally.

After applying this patch, makepkg will check if the existent $dir is
empty. And if it is, it will be used to store a local clone.

Signed-off-by: Mohammad Alsaleh <msal@mail.i2p>
---
scripts/makepkg.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 270f988..6c0e821 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -396,7 +396,7 @@ download_git() {
url=${url##*git+}
url=${url%%#*}

- if [[ ! -d "$dir" ]]; then
+ if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
if ! git clone --mirror "$url" "$dir"; then
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
--
1.7.11.4


All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.