Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package: make package download from Mercurial repositories more robust
@ 2014-03-05  6:54 Mathias De Maré
  2014-03-05  8:12 ` Thomas De Schampheleire
  0 siblings, 1 reply; 9+ messages in thread
From: Mathias De Maré @ 2014-03-05  6:54 UTC (permalink / raw)
  To: buildroot

Previously, after cloning a Mercurial repository,
an interrupted 'hg archive' operation would leave behind a partial
archive. This caused future archive operations to fail.

Signed-off-by: Mathias De Mar? <mathias.demare@gmail.com>
---
 package/pkg-download.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 85842de..6f53f53 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -176,13 +176,19 @@ define SHOW_EXTERNAL_DEPS_SCP
 endef
 
 
+# Download a file using Mercurial.
+# In case a previous clone failed, remove the directory.
+# To handle interrupted archive operations, use a temporary directory,
+# and remove this directory before archiving again.
 define DOWNLOAD_HG
 	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
 	(pushd $(DL_DIR) > /dev/null && \
 	rm -rf $($(PKG)_BASE_NAME) && \
 	$(HG) clone --noupdate --rev $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \
+	rm -rf $(DL_DIR)/$($(PKG)_SOURCE).tmp && \
 	$(HG) archive --repository $($(PKG)_BASE_NAME) --type tgz --prefix $($(PKG)_BASE_NAME)/ \
-	              --rev $($(PKG)_DL_VERSION) $(DL_DIR)/$($(PKG)_SOURCE) && \
+			--rev $($(PKG)_DL_VERSION) $(DL_DIR)/$($(PKG)_SOURCE).tmp && \
+	mv $(DL_DIR)/$($(PKG)_SOURCE).tmp $(DL_DIR)/$($(PKG)_SOURCE) && \
 	rm -rf $($(PKG)_DL_DIR) && \
 	popd > /dev/null)
 endef
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/1] package: make package download from Mercurial repositories more robust
@ 2013-12-10 18:31 Mathias De Maré
  2013-12-10 20:10 ` Thomas De Schampheleire
  2013-12-25 11:37 ` Thomas Petazzoni
  0 siblings, 2 replies; 9+ messages in thread
From: Mathias De Maré @ 2013-12-10 18:31 UTC (permalink / raw)
  To: buildroot

Previously, when cloning a Mercurial repository,
aborting the clone could (in some cases) leave behind an empty directory.
As a result, a later clone would fail.

Signed-off-by: Mathias De Mar? <mathias.demare@gmail.com>
---
 package/pkg-download.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 758b211..c00689b 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -178,6 +178,7 @@ endef
 define DOWNLOAD_HG
 	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
 	(pushd $(DL_DIR) > /dev/null && \
+	rm -rf $($(PKG)_BASE_NAME) && \
 	$(HG) clone --noupdate --rev $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \
 	$(HG) archive --repository $($(PKG)_BASE_NAME) --type tgz --prefix $($(PKG)_BASE_NAME)/ \
 	              --rev $($(PKG)_DL_VERSION) $(DL_DIR)/$($(PKG)_SOURCE) && \
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-05 16:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05  6:54 [Buildroot] [PATCH 1/1] package: make package download from Mercurial repositories more robust Mathias De Maré
2014-03-05  8:12 ` Thomas De Schampheleire
2014-03-05 10:33   ` Mathias De Maré
2014-03-05 16:59   ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2013-12-10 18:31 Mathias De Maré
2013-12-10 20:10 ` Thomas De Schampheleire
2013-12-11 18:12   ` Thomas De Schampheleire
2013-12-16 12:46     ` Mathias De Maré
2013-12-25 11:37 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox