Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Christopher Larson <kergoth@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Christopher Larson <chris_larson@mentor.com>
Subject: [PATCH 3/3] bb.fetch: don't remove the clone when an update fails
Date: Wed, 26 Aug 2015 09:37:47 -0700	[thread overview]
Message-ID: <1440607067-14461-4-git-send-email-kergoth@gmail.com> (raw)
In-Reply-To: <1440607067-14461-1-git-send-email-kergoth@gmail.com>

From: Christopher Larson <chris_larson@mentor.com>

When our clone exists, but is out of date, and the attempt to update it fails,
we don't necessarily want to remove the entire clone, particularly if it's
a large repository.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 lib/bb/fetch2/__init__.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index e229c30..3d53b63 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1590,7 +1590,8 @@ class Fetch(object):
                 os.chdir(self.d.getVar("DL_DIR", True))
 
                 firsterr = None
-                if not localpath and ((not verify_donestamp(ud, self.d)) or m.need_update(ud, self.d)):
+                verified_stamp = verify_donestamp(ud, self.d)
+                if not localpath and (not verified_stamp or m.need_update(ud, self.d)):
                     try:
                         if not trusted_network(self.d, ud.url):
                             raise UntrustedUrl(ud.url)
@@ -1618,7 +1619,8 @@ class Fetch(object):
                             logger.debug(1, str(e))
                         firsterr = e
                         # Remove any incomplete fetch
-                        m.clean(ud, self.d)
+                        if not verified_stamp:
+                            m.clean(ud, self.d)
                         logger.debug(1, "Trying MIRRORS")
                         mirrors = mirror_from_string(self.d.getVar('MIRRORS', True))
                         localpath = try_mirrors(self, self.d, ud, mirrors)
-- 
2.2.1



      parent reply	other threads:[~2015-08-26 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 16:37 [PATCH 0/3] A few fetch bugfixes Christopher Larson
2015-08-26 16:37 ` [PATCH 1/3] bb.fetch.git: remove leading '.' from gitsrcname Christopher Larson
2015-08-26 16:37 ` [PATCH 2/3] bb.fetch: handle checksums consistently for mirrors Christopher Larson
2015-08-26 16:37 ` Christopher Larson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440607067-14461-4-git-send-email-kergoth@gmail.com \
    --to=kergoth@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=chris_larson@mentor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox