[projects/pld-builder.new] builder: rename parameters that hid the log and path modules

arekm arekm at pld-linux.org
Wed Aug 12 11:45:56 CEST 2026


commit 0dc75c0c3cb633c4cc0ca6a61ec30b20884ca9ae
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Aug 12 09:32:08 2026 +0200

    builder: rename parameters that hid the log and path modules
    
    Inside those functions the imported module was unreachable under its own name.

 PLD_Builder/mailer.py     |  8 ++++----
 PLD_Builder/maintainer.py | 12 ++++++------
 PLD_Builder/util.py       | 12 ++++++------
 3 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/PLD_Builder/mailer.py b/PLD_Builder/mailer.py
index a9f2c8f..37bc1ee 100644
--- a/PLD_Builder/mailer.py
+++ b/PLD_Builder/mailer.py
@@ -36,11 +36,11 @@ class Message:
     def write(self, s):
         self.body.write(util.to_str(s))
 
-    def append_log(self, log):
-        s = os.stat(log)
+    def append_log(self, logfile):
+        s = os.stat(logfile)
         if s.st_size > 50000:
             # just head and tail
-            f = open(log)
+            f = open(logfile)
             line_cnt = 0
             for l in f:
                 line_cnt += 1
@@ -53,7 +53,7 @@ class Message:
                     self.body.write("\n\n[...]\n\n")
                 line += 1
         else:
-            shutil.copyfileobj(open(log), self.body)
+            shutil.copyfileobj(open(logfile), self.body)
 
     def set_std_headers(self):
         self.headers["Date"] = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime())
diff --git a/PLD_Builder/maintainer.py b/PLD_Builder/maintainer.py
index 4d909df..b146f7c 100644
--- a/PLD_Builder/maintainer.py
+++ b/PLD_Builder/maintainer.py
@@ -11,14 +11,14 @@ import chroot
 import ftp
 import path
 
-def clean_dir(path, max):
+def clean_dir(dirname, max):
     curtime=time.time()
-    for i in os.listdir(path):
-        if curtime - os.path.getmtime(path+'/'+i) > max:
-            if os.path.isdir(path+'/'+i):
-                util.clean_tmp(path+'/'+i)
+    for i in os.listdir(dirname):
+        if curtime - os.path.getmtime(dirname+'/'+i) > max:
+            if os.path.isdir(dirname+'/'+i):
+                util.clean_tmp(dirname+'/'+i)
             else:
-                os.unlink(path+'/'+i)
+                os.unlink(dirname+'/'+i)
 
 def send_rpmqa():
     tmp = path.build_dir + '/' + util.uuid() + '/'
diff --git a/PLD_Builder/util.py b/PLD_Builder/util.py
index af6b8f1..6c3059c 100644
--- a/PLD_Builder/util.py
+++ b/PLD_Builder/util.py
@@ -32,8 +32,8 @@ def pkg_name(nvr):
 def msg(m):
     sys.stderr.write(m)
 
-def append_to(log, msg):
-    f = open(log, "a")
+def append_to(logfile, msg):
+    f = open(logfile, "a")
     f.write("%s\n" % msg)
     f.close()
 
@@ -41,8 +41,8 @@ def clean_tmp(dir):
     # FIXME: use python
     os.system("rm -f %s/* 2>/dev/null; rmdir %s 2>/dev/null" % (dir, dir))
 
-def collect_files(log, basedir = "/home"):
-    f = open(log, 'r')
+def collect_files(logfile, basedir = "/home"):
+    f = open(logfile, 'r')
     rx = re.compile(r"^Wrote: (%s.*\.rpm)$" % basedir)
     proc = re.compile(r"^Processing files:.*$")
     files = []
@@ -55,8 +55,8 @@ def collect_files(log, basedir = "/home"):
     f.close()
     return files
 
-def find_last_section(log):
-    f = open(log, 'r')
+def find_last_section(logfile):
+    f = open(logfile, 'r')
     rx1 = re.compile(r"^Executing\(%(\w+)\).*$")
     rx2 = re.compile(r"^Processing (files):.*$")
     last_section = None
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/44916a7a9112928736ec2b65b4fa58a90bc5828c



More information about the pld-cvs-commit mailing list