All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: <yocto@yoctoproject.org>
Cc: paul.eggleton@linux.intel.com
Subject: [PATCH 08/12] upgradehelper.py: clean repo only once when recipes are specified
Date: Thu, 7 Dec 2017 15:37:13 +0800	[thread overview]
Message-ID: <e3cb41c1f86590e45d2cd6c253324b2bcd04e34e.1512630627.git.liezhi.yang@windriver.com> (raw)
In-Reply-To: <cover.1512630627.git.liezhi.yang@windriver.com>

E.g.:
$ upgradehelper.py less strace bash git

The commit is removed when failed, and kept when succeed, but it would be
removed when next recipe runs, so only run clean_repo once can keep the commit,
which is helpful for the user.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 upgradehelper.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/upgradehelper.py b/upgradehelper.py
index e38a281..ff27b97 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -57,6 +57,7 @@ from utils.emailhandler import Email
 from statistics import Statistics
 from steps import upgrade_steps
 from steps import compile
+from steps import clean_repo
 from testimage import TestImage
 
 help_text = """Usage examples:
@@ -419,6 +420,10 @@ class Updater(object):
                 else:
                     I(" %s: Save patch in directory: %s." %
                         (pkg_ctx['PN'], pkg_ctx['workdir']))
+                    if pkg_ctx['error']:
+                        I(" %s: Remove it from repo since failed!" % pkg_ctx['PN'])
+                        self.git.reset_hard(1)
+
         except Error as e:
             msg = ''
 
@@ -569,6 +574,7 @@ class Updater(object):
         succeeded_pkgs_ctx = []
         failed_pkgs_ctx = []
         attempted_pkgs = 0
+        repo_cleaned = False
         for pn, _, _ in pkgs_to_upgrade:
             pkg_ctx = pkgs_ctx[pn]
             pkg_ctx['error'] = None
@@ -581,6 +587,12 @@ class Updater(object):
                     if step == compile and self.args.skip_compilation:
                         W(" %s: Skipping compile by user choice" % pkg_ctx['PN'])
                         continue
+                    if step == clean_repo and self.recipes:
+                        if repo_cleaned:
+                            I(" %s: Skipping clean_repo since it had been run by previous recipe" % pkg_ctx['PN'])
+                            continue
+                        else:
+                            repo_cleaned = True
                     if msg is not None:
                         I(" %s: %s" % (pkg_ctx['PN'], msg))
                     step(self.bb, self.git, self.opts, pkg_ctx)
-- 
2.7.4



  parent reply	other threads:[~2017-12-07  7:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  7:37 [PATCH 00/12] [auh] make it easy to use by recipe maintainer Robert Yang
2017-12-07  7:37 ` [PATCH 01/12] upgradehelper.py: fix checking for do_checkpkg Robert Yang
2017-12-07  7:37 ` [PATCH 02/12] upgradehelper.py: support upgrade multiple recipes Robert Yang
2017-12-07  7:37 ` [PATCH 03/12] upgradehelper.py: use UniverseUpdater for all cases Robert Yang
2017-12-07  7:37 ` [PATCH 04/12] modules/steps.py: fix warn when skip compilation Robert Yang
2017-12-07  7:37 ` [PATCH 05/12] " Robert Yang
2017-12-07 12:47   ` Alexander Kanavin
2017-12-07  7:37 ` [PATCH 06/12] upgradehelper.py: only check email settings when -e is specified Robert Yang
2017-12-07  7:37 ` [PATCH 07/12] upgradehelper.py: always do upgrade when recipes are specified Robert Yang
2017-12-07  7:37 ` Robert Yang [this message]
2017-12-07 12:58   ` [PATCH 08/12] upgradehelper.py: clean repo only once " Alexander Kanavin
2017-12-08  1:43     ` Robert Yang
2017-12-08  2:00       ` Robert Yang
2017-12-08 14:18         ` Alexander Kanavin
2017-12-11  6:13           ` Robert Yang
2017-12-12 12:26             ` Alexander Kanavin
2017-12-13  1:16               ` Robert Yang
2017-12-13 13:18                 ` Alexander Kanavin
2017-12-14  2:13                   ` Robert Yang
2017-12-14 16:38                     ` Alexander Kanavin
2017-12-15 13:35                       ` Alexander Kanavin
2017-12-19  7:20                         ` Robert Yang
2017-12-07  7:37 ` [PATCH 09/12] upgradehelper.py: use git user in commit " Robert Yang
2017-12-07 13:02   ` Alexander Kanavin
2017-12-08  1:51     ` Robert Yang
2017-12-08 14:07       ` Alexander Kanavin
2017-12-08 16:20         ` Burton, Ross
2017-12-11  6:14           ` Robert Yang
2017-12-07  7:37 ` [PATCH 10/12] upgradehelper.py: add --apply-failed option Robert Yang
2017-12-07 13:05   ` Alexander Kanavin
2017-12-08  2:02     ` Robert Yang
2017-12-07  7:37 ` [PATCH 11/12] upgradehelper.py: print info when recipe is skipped to upgrade Robert Yang
2017-12-07  7:37 ` [PATCH 12/12] upgradehelper.py: don't build gcc-runtime when --skip-compilation Robert Yang
2017-12-07  7:46 ` [PATCH 00/12] [auh] make it easy to use by recipe maintainer Robert Yang
2017-12-07  8:53 ` Alexander Kanavin

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=e3cb41c1f86590e45d2cd6c253324b2bcd04e34e.1512630627.git.liezhi.yang@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=paul.eggleton@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.