From 076f14f0802046e43e00dbd54b9b3c2d1e03057f Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Sun, 11 Oct 2026 14:21:19 +0900
Subject: tdedistutils: remove dry_run flag.

This resolves issued #28.

Co-authored-by: Opencode/Step 5 Preview
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 setup.py            |  2 +-
 src/tdedistutils.py | 52 ++++++++++++++++++++++------------------------------
 2 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/setup.py b/setup.py
index 7211137..5b9b6b8 100755
--- a/setup.py
+++ b/setup.py
@@ -307,7 +307,7 @@ class InstallLibpythonize(Command):
         return self.outfiles
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
         
 main()
diff --git a/src/tdedistutils.py b/src/tdedistutils.py
index 9ed1efd..cd34508 100644
--- a/src/tdedistutils.py
+++ b/src/tdedistutils.py
@@ -363,18 +363,18 @@ class InstallApplicationDataAndLinks(install_data):
         prefix = self.install_dir
         if prefix[-1] != os.sep:
             prefix = prefix + os.sep
-        self.outfiles.extend(compile_tqtdesigner(self.outfiles, force=1, prefix=prefix, base_dir=install_cmd.prefix, dry_run=self.dry_run))
+        self.outfiles.extend(compile_tqtdesigner(self.outfiles, force=1, prefix=prefix, base_dir=install_cmd.prefix))
 
         if not sys.dont_write_bytecode:
             # Byte compile the .py files (unless it is disabled)
             from distutils.util import byte_compile
-            byte_compile(self.outfiles, optimize=0, force=1, prefix=prefix, base_dir=install_cmd.prefix, dry_run=self.dry_run)
+            byte_compile(self.outfiles, optimize=0, force=1, prefix=prefix, base_dir=install_cmd.prefix)
 
         # Add the .pyc files to the list of outfiles.
         self.outfiles.extend( [item+'c' for item in self.outfiles if item.endswith('.py')] )
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
 
 ###########################################################################
@@ -407,17 +407,16 @@ class InstallExecutableLinks(Command):
                 symname = os.path.join(install_script_cmd.install_dir,link[0])
                 target = os.path.join(destination_dir,link[1])
                 log.info("symlinking %s -> %s", symname, target)
-                if not self.dry_run:
-                    if os.path.islink(symname):
-                        os.remove(symname)
-                    os.symlink(target,symname)
+                if os.path.islink(symname):
+                    os.remove(symname)
+                os.symlink(target,symname)
                 self.outfiles.append(symname)
 
     def get_outputs(self):
         return self.outfiles or []
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
 
 ###########################################################################
@@ -471,11 +470,10 @@ class Uninstall(Command):
             item = item.strip()
             if os.path.isfile(item) or os.path.islink(item):
                 self.announce("removing '%s'" % item)
-                if not self.dry_run:
-                    try:
-                        os.remove(item)
-                    except OSError as details:
-                        self.warn("Could not remove file: %s" % details)
+                try:
+                    os.remove(item)
+                except OSError as details:
+                    self.warn("Could not remove file: %s" % details)
             elif not os.path.isdir(item):
                 self.announce("skipping removal of '%s' (does not exist)" % item)
 
@@ -487,11 +485,10 @@ class Uninstall(Command):
             item = item.strip()
             if os.path.isdir(item):
                 self.announce("removing '%s'" % item)
-                if not self.dry_run:
-                    try:
-                        os.rmdir(item)
-                    except OSError as details:
-                        self.warn("Could not remove directory: %s" % details)
+                try:
+                    os.rmdir(item)
+                except OSError as details:
+                    self.warn("Could not remove directory: %s" % details)
 
 ###########################################################################
 class BuildKControlModule(Command):
@@ -1124,7 +1121,7 @@ class InstallKControlModule(Command):
         return self.outfiles or []
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
 
 ###########################################################################
@@ -1244,7 +1241,7 @@ class InstallDocbookHTML(Command):
         return self.outfiles or []
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
 
 ###########################################################################
@@ -1436,7 +1433,7 @@ class InstallI18NMessages(Command):
         return self.outfiles
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
 
 
@@ -2006,7 +2003,7 @@ class InstallTdeioslave(Command):
         return self.outfiles or []
 
     def mkpath(self, name, mode=0o777):
-        dir_util.mkpath(name, mode, dry_run=self.dry_run)
+        dir_util.mkpath(name, mode)
         return name
 
 ###########################################################################
@@ -2226,12 +2223,8 @@ def get_tqt_kde_versions():
 def compile_tqtdesigner(ui_files,
                   force=0,
                   prefix=None, base_dir=None,
-                  verbose=1, dry_run=0):
-    """Compile a collection of TQT Designer UI files to .py
-
-    If 'dry_run' is true, doesn't actually do anything that would
-    affect the filesystem.
-    """
+                  verbose=1):
+    """Compile a collection of TQT Designer UI files to .py"""
     generated_files = []
     for file in ui_files:
         if not file.endswith(".ui"):
@@ -2249,8 +2242,7 @@ def compile_tqtdesigner(ui_files,
         pyfile_base = os.path.basename(pyfile)
         if force or newer(uifile, pyfile):
             log.info("compiling TQt-Designer UI %s to %s", file, pyfile_base)
-            if not dry_run:
-                tqtuicompiler.CompileUI(uifile, pyfile)
+            tqtuicompiler.CompileUI(uifile, pyfile)
             generated_files.append(pyfile)
         else:
             log.debug("skipping TQt-Designer compilation of %s to %s",
-- 
cgit v1.2.3

