[projects/pld-builder.new] builder: drop no-op statements
arekm
arekm at pld-linux.org
Wed Aug 12 11:46:56 CEST 2026
commit 44916a7a9112928736ec2b65b4fa58a90bc5828c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Aug 12 11:04:18 2026 +0200
builder: drop no-op statements
global declarations without assignment, an unused exception binding, a dead
local and an f-prefix without placeholders.
PLD_Builder/file_sender.py | 7 -------
PLD_Builder/request.py | 1 -
PLD_Builder/request_fetcher.py | 2 +-
PLD_Builder/request_handler_server.py | 1 -
client/php-rebuild.py | 2 +-
5 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/PLD_Builder/file_sender.py b/PLD_Builder/file_sender.py
index cc9e754..5dd2db9 100644
--- a/PLD_Builder/file_sender.py
+++ b/PLD_Builder/file_sender.py
@@ -36,7 +36,6 @@ def read_name_val(file):
return None
def scp_file(src, target):
- global problems
f = os.popen("scp -v -B %s %s 2>&1 < /dev/null" % (src, target))
p = f.read()
ret = f.close()
@@ -49,14 +48,11 @@ def copy_file(src, target):
shutil.copyfile(src, target)
return 0
except:
- global problems
exctype, value = sys.exc_info()[:2]
problems[src] = "cannot copy file: %s" % traceback.format_exception_only(exctype, value)
return 1
def rsync_file(src, target, host):
- global problems
-
p = open(path.rsync_password_file, "r")
password = ""
for l in p:
@@ -79,7 +75,6 @@ def rsync_file(src, target, host):
return ret
def rsync_ssh_file(src, target):
- global problems
rsync = "rsync --verbose --archive --timeout=360 -e ssh"
f = os.popen("%s %s %s 2>&1 < /dev/null" % (rsync, src, target))
p = f.read()
@@ -89,7 +84,6 @@ def rsync_ssh_file(src, target):
return ret
def post_file(src, url):
- global problems
try:
f = open(src, 'r')
data = f.read().encode('utf-8')
@@ -104,7 +98,6 @@ def post_file(src, url):
return 0
def send_file(src, target):
- global problems
try:
log.notice("sending %s to %s (size %d bytes)" % (src, target, os.stat(src).st_size))
m = re.match(r'rsync://([^/]+)/.*', target)
diff --git a/PLD_Builder/request.py b/PLD_Builder/request.py
index fea5648..0475a66 100644
--- a/PLD_Builder/request.py
+++ b/PLD_Builder/request.py
@@ -354,7 +354,6 @@ class Batch:
else:
bl_name = self.spec[:len(self.spec)-5]
lin_ar = b.replace('noauto-','')
- path = "/%s/%s/%s,%s.bz2" % (lin_ar.replace('-','/'), s, bl_name, rid)
is_ok = 0
if s.startswith("OK"):
is_ok = 1
diff --git a/PLD_Builder/request_fetcher.py b/PLD_Builder/request_fetcher.py
index 7e1c0d8..404f2ad 100644
--- a/PLD_Builder/request_fetcher.py
+++ b/PLD_Builder/request_fetcher.py
@@ -30,7 +30,7 @@ def has_new(control_url):
cnt_f = open(path.last_req_no_file)
try:
last_count = int(cnt_f.readline().strip())
- except ValueError as e:
+ except ValueError:
last_count = 0
cnt_f.close()
diff --git a/PLD_Builder/request_handler_server.py b/PLD_Builder/request_handler_server.py
index b606a2d..4aa9cbf 100644
--- a/PLD_Builder/request_handler_server.py
+++ b/PLD_Builder/request_handler_server.py
@@ -43,7 +43,6 @@ class MyHandler(BaseHTTPRequestHandler):
self.send_error(401);
def do_POST(self):
- global rootnode
filename = None
try:
length = int(self.headers.get('content-length'))
diff --git a/client/php-rebuild.py b/client/php-rebuild.py
index 680fe2d..513bb14 100755
--- a/client/php-rebuild.py
+++ b/client/php-rebuild.py
@@ -407,7 +407,7 @@ def process_spec(spec_arg, opts, passthrough):
if opts['run']:
ok, out = run_cmd(cmd)
if not ok:
- print(f'Error: build failed', file=sys.stderr)
+ print('Error: build failed', file=sys.stderr)
if out:
print(out, file=sys.stderr)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/44916a7a9112928736ec2b65b4fa58a90bc5828c
More information about the pld-cvs-commit
mailing list