Skip to contentSkip to conversation

server/process: Drop unused import

PATCH New Richard Purdie 1 participant 11 messages Apr 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/11 server/process: Drop unused import

---
 lib/bb/server/process.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/server/process.py +0 -1
index 19ef83980f..613956f30f 100644
@@ -20,7 +20,6 @@ import os
 import sys
 import time
 import select
-import signal
 import socket
 import subprocess
 import errno
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/11 ui/buildinfohelper: Drop unused import

---
 lib/bb/ui/buildinfohelper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/ui/buildinfohelper.py +1 -1
index 0761f73b3b..9c4215f9a2 100644
@@ -45,7 +45,7 @@ from pprint import pformat
 import logging
 from datetime import datetime, timedelta
 
-from django.db import transaction, connection
+from django.db import transaction
 
 
 # pylint: disable=invalid-name
Signature · 1 line
2.32.0
#2 lore raw

PATCH 3/11 cooker: Drop unused loop

In reply to Richard Purdie
---
 lib/bb/cooker.py | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
lib/bb/cooker.py +12 -13
index 7685db11f3..701e49339a 100644
@@ -763,19 +763,18 @@ class BBCooker:
                     taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc])
                     mcdeps |= set(taskdata[mc].get_mcdepends())
                 new = False
-                for mc in self.multiconfigs:
-                    for k in mcdeps:
-                        if k in seen:
-                            continue
-                        l = k.split(':')
-                        depmc = l[2]
-                        if depmc not in self.multiconfigs:
-                            bb.fatal("Multiconfig dependency %s depends on nonexistent multiconfig configuration named configuration %s" % (k,depmc))
-                        else:
-                            logger.debug("Adding providers for multiconfig dependency %s" % l[3])
-                            taskdata[depmc].add_provider(localdata[depmc], self.recipecaches[depmc], l[3])
-                            seen.add(k)
-                            new = True
+                for k in mcdeps:
+                    if k in seen:
+                        continue
+                    l = k.split(':')
+                    depmc = l[2]
+                    if depmc not in self.multiconfigs:
+                        bb.fatal("Multiconfig dependency %s depends on nonexistent multiconfig configuration named configuration %s" % (k,depmc))
+                    else:
+                        logger.debug("Adding providers for multiconfig dependency %s" % l[3])
+                        taskdata[depmc].add_provider(localdata[depmc], self.recipecaches[depmc], l[3])
+                        seen.add(k)
+                        new = True
 
         for mc in self.multiconfigs:
             taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc])
Signature · 1 line
2.32.0
#3 lore raw

PATCH 4/11 msg: Drop unused local variable

In reply to Richard Purdie
---
 lib/bb/msg.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/msg.py +0 -1
index c95a874beb..93575d89c4 100644
@@ -133,7 +133,6 @@ class LogFilterShowOnce(logging.Filter):
         self.seen_errors = set()
 
     def filter(self, record):
-        msg = record.msg
         if record.levelno == bb.msg.BBLogFormatter.WARNONCE:
             if record.msg in self.seen_warnings:
                 return False
Signature · 1 line
2.32.0
#4 lore raw

PATCH 5/11 buildinfohelper: Drop unused function

In reply to Richard Purdie

The function has a loop where the variable is never used which I was going to fix but the entire function never seems to be called so remove it entirely.

---
 lib/bb/ui/buildinfohelper.py | 21 ---------------------
 1 file changed, 21 deletions(-)
lib/bb/ui/buildinfohelper.py +0 -21
index 9c4215f9a2..c4ca267783 100644
@@ -1062,27 +1062,6 @@ class BuildInfoHelper(object):
 
         return recipe_info
 
-    def _get_path_information(self, task_object):
-        self._ensure_build()
-
-        assert isinstance(task_object, Task)
-        build_stats_format = "{tmpdir}/buildstats/{buildname}/{package}/"
-        build_stats_path = []
-
-        for t in self.internal_state['targets']:
-            buildname = self.internal_state['build'].build_name
-            pe, pv = task_object.recipe.version.split(":",1)
-            if pe:
-                package = task_object.recipe.name + "-" + pe + "_" + pv
-            else:
-                package = task_object.recipe.name + "-" + pv
-
-            build_stats_path.append(build_stats_format.format(tmpdir=self.tmp_dir,
-                                                     buildname=buildname,
-                                                     package=package))
-
-        return build_stats_path
-
 
     ################################
     ## external available methods to store information
Signature · 1 line
2.32.0
#5 lore raw

PATCH 6/11 fetch2/crate: Drop unused import

In reply to Richard Purdie
---
 lib/bb/fetch2/crate.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/fetch2/crate.py +0 -1
index aac1221c87..f4ddc782a9 100644
@@ -13,7 +13,6 @@ BitBake 'Fetch' implementation for crates.io
 import hashlib
 import json
 import os
-import shutil
 import subprocess
 import bb
 from   bb.fetch2 import logger, subprocess_setup, UnpackError
Signature · 1 line
2.32.0
#6 lore raw

PATCH 7/11 siggen: Drop pointless break statement

In reply to Richard Purdie
---
 lib/bb/siggen.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/siggen.py +0 -1
index 130b38d8a7..9fa568f614 100644
@@ -40,7 +40,6 @@ def init(d):
     for sg in siggens:
         if desired == sg.name:
             return sg(d)
-            break
     else:
         logger.error("Invalid signature generator '%s', using default 'noop'\n"
                      "Available generators: %s", desired,
Signature · 1 line
2.32.0
#7 lore raw

PATCH 8/11 ui/knotty: Drop pointless pass statement

In reply to Richard Purdie
---
 lib/bb/ui/knotty.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/ui/knotty.py +0 -1
index 3f410fd525..61cf0a37f4 100644
@@ -877,7 +877,6 @@ def main(server, eventHandler, params, tf = TerminalFilter):
                     state_force_shutdown()
 
             main.shutdown = main.shutdown + 1
-            pass
         except Exception as e:
             import traceback
             sys.stderr.write(traceback.format_exc())
Signature · 1 line
2.32.0
#8 lore raw

PATCH 9/11 persist_data: Use a valid exception for missing implementation

In reply to Richard Purdie
---
 lib/bb/persist_data.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/persist_data.py +1 -1
index 9e20a837a4..ce84a15825 100644
@@ -208,7 +208,7 @@ class SQLTable(collections.abc.MutableMapping):
 
     def __lt__(self, other):
         if not isinstance(other, Mapping):
-            raise NotImplemented
+            raise NotImplementedError()
 
         return len(self) < len(other)
 
Signature · 1 line
2.32.0
#9 lore raw

PATCH 10/11 runqueue: Drop pointless variable assignment

In reply to Richard Purdie

This is set at the start of the loop anyway so it does nothing. Drop the pointless code.

---
 lib/bb/runqueue.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/runqueue.py +0 -1
index a7a84630d7..a4e82f375c 100644
@@ -2664,7 +2664,6 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq):
             sq_revdeps_squash[point] = set()
             if point in rqdata.runq_setscene_tids:
                 sq_revdeps_squash[point] = tasks
-                tasks = set()
                 continue
             for dep in rqdata.runtaskentries[point].depends:
                 if point in sq_revdeps[dep]:
Signature · 1 line
2.32.0
#10 lore raw

PATCH 11/11 buildinfohelper: Drop unused variables

In reply to Richard Purdie
---
 lib/bb/ui/buildinfohelper.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/ui/buildinfohelper.py +2 -2
index c4ca267783..129bb329c3 100644
@@ -496,7 +496,7 @@ class ORMWrapper(object):
             if not parent_path:
                 parent_path = "/"
             parent_obj = self._cached_get(Target_File, target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY)
-            tf_obj = Target_File.objects.create(
+            Target_File.objects.create(
                         target = target_obj,
                         path = path,
                         size = size,
@@ -561,7 +561,7 @@ class ORMWrapper(object):
 
             parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY)
 
-            tf_obj = Target_File.objects.create(
+            Target_File.objects.create(
                         target = target_obj,
                         path = path,
                         size = size,
Signature · 1 line
2.32.0