All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Do not skip packages that were attempted recently.
@ 2018-03-21 16:19 Alexander Kanavin
  2018-03-21 16:19 ` [PATCH 2/2] When 'devtool upgrade' fails to rebase patches, stop and report a failure Alexander Kanavin
  2018-03-21 16:20 ` [PATCH 1/2] Do not skip packages that were attempted recently Alexander Kanavin
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Kanavin @ 2018-03-21 16:19 UTC (permalink / raw)
  To: yocto

This was undocumented and made a number of hardcoded assumptions.
The options were to make it configurable, or just remove the logic,
and I chose the latter.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
---
 upgradehelper.py | 40 ----------------------------------------
 1 file changed, 40 deletions(-)

diff --git a/upgradehelper.py b/upgradehelper.py
index b5e696e..8fb27d3 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -564,17 +564,6 @@ class UniverseUpdater(Updater):
                 E(" -t is only supported when upgrade one recipe\n")
                 exit(1)
 
-        # read history file
-        self.history_file = os.path.join(get_build_dir(), "upgrade-helper", "history.uh")
-        self.history = dict()
-        if os.path.exists(self.history_file):
-            with open(self.history_file) as history_file:
-                for line in history_file:
-                    line = line.strip()
-                    self.history[line.split(',')[0]] = [line.split(',')[1],
-                                                        line.split(',')[2],
-                                                        line.split(',')[3],
-                                                        line.split(',')[4]]
     def _get_recipes_by_layer(self):
         recipes = []
 
@@ -689,21 +678,6 @@ class UniverseUpdater(Updater):
                         (pn, maintainer))
                 return False
 
-        if pn in self.history:
-            # did we already try this version?
-            if next_ver == self.history[pn][0]:
-                retry_delta = \
-                    date.toordinal(date.today()) - \
-                    date.toordinal(datetime.strptime(self.history[pn][2], '%Y-%m-%d'))
-                # retry recipes that had fetch errors or other errors after
-                # more than 30 days
-                if (self.history[pn][3] == str(FetchError()) or
-                        self.history[pn][3] == str(Error())) and retry_delta > 30:
-                    return True
-
-                D(" Skipping upgrade of %s: is in history and not 30 days passed" % pn)
-                return False
-
         # drop native/cross/cross-canadian recipes. We deal with native
         # when upgrading the main recipe but we keep away of cross* pkgs...
         # for now
@@ -727,22 +701,8 @@ class UniverseUpdater(Updater):
 
         return pkgs_list
 
-    def _update_history(self, pn, new_ver, maintainer, upgrade_status):
-        with open(self.history_file + ".tmp", "w+") as tmp_file:
-            if os.path.exists(self.history_file):
-                with open(self.history_file) as history:
-                    for line in history:
-                        if not line.startswith(pn):
-                            tmp_file.write(line)
-            tmp_file.write(pn + "," + new_ver + "," + maintainer +
-                           "," + date.isoformat(date.today()) + "," +
-                           upgrade_status + "\n")
-        os.rename(self.history_file + ".tmp", self.history_file)
-
     def pkg_upgrade_handler(self, pkg_ctx):
         super(UniverseUpdater, self).pkg_upgrade_handler(pkg_ctx)
-        self._update_history(pkg_ctx['PN'], pkg_ctx['NPV'], pkg_ctx['MAINTAINER'],
-                self._get_status_msg(pkg_ctx['error']))
 
     def run(self):
         self._prepare()
-- 
2.16.1



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

* [PATCH 2/2] When 'devtool upgrade' fails to rebase patches, stop and report a failure
  2018-03-21 16:19 [PATCH 1/2] Do not skip packages that were attempted recently Alexander Kanavin
@ 2018-03-21 16:19 ` Alexander Kanavin
  2018-03-21 16:20 ` [PATCH 1/2] Do not skip packages that were attempted recently Alexander Kanavin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Kanavin @ 2018-03-21 16:19 UTC (permalink / raw)
  To: yocto

Previously it would continue, which eventually resulted in an unhelpful, generic
error message printed by 'devtool finish'.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
---
 modules/steps.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/steps.py b/modules/steps.py
index 5bbe38e..2eb4499 100644
--- a/modules/steps.py
+++ b/modules/steps.py
@@ -82,6 +82,10 @@ def devtool_upgrade(devtool, bb, git, opts, pkg_ctx):
 
     try:
         devtool_output = devtool.upgrade(pkg_ctx['PN'], pkg_ctx['NPV'], pkg_ctx['NSRCREV'])
+        D(" 'devtool upgrade' printed:\n%s" %(devtool_output))
+        # If devtool failed to rebase patches, it does not fail, but we should
+        if 'conflict' in devtool_output:
+            raise DevtoolError("Running 'devtool upgrade' for recipe %s failed." %(pkg_ctx['PN']), devtool_output)
     except DevtoolError as e1:
         try:
             devtool_output = devtool.reset(pkg_ctx['PN'])
@@ -96,7 +100,6 @@ def devtool_upgrade(devtool, bb, git, opts, pkg_ctx):
         with open(os.path.join(pkg_ctx['workdir'], pkg_ctx['license_diff_fn']), 'wb') as f:
             f.write(b"".join(license_diff_info))
 
-    D(" 'devtool upgrade' printed:\n%s" %(devtool_output))
 
 def _compile(bb, pkg, machine, workdir):
         try:
-- 
2.16.1



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

* Re: [PATCH 1/2] Do not skip packages that were attempted recently.
  2018-03-21 16:19 [PATCH 1/2] Do not skip packages that were attempted recently Alexander Kanavin
  2018-03-21 16:19 ` [PATCH 2/2] When 'devtool upgrade' fails to rebase patches, stop and report a failure Alexander Kanavin
@ 2018-03-21 16:20 ` Alexander Kanavin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Kanavin @ 2018-03-21 16:20 UTC (permalink / raw)
  To: yocto@yoctoproject.org >> Yocto Project

On 03/21/2018 06:19 PM, Alexander Kanavin wrote:
> This was undocumented and made a number of hardcoded assumptions.
> The options were to make it configurable, or just remove the logic,
> and I chose the latter.

Uh, forgot to add the [auh] prefix to these two.

Alex


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

end of thread, other threads:[~2018-03-21 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-21 16:19 [PATCH 1/2] Do not skip packages that were attempted recently Alexander Kanavin
2018-03-21 16:19 ` [PATCH 2/2] When 'devtool upgrade' fails to rebase patches, stop and report a failure Alexander Kanavin
2018-03-21 16:20 ` [PATCH 1/2] Do not skip packages that were attempted recently Alexander Kanavin

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.