only ask once for all overwritten files
[auto-debuild.git] / auto_debuild.py
index 208010984fcc4da949235725420e0f2609598595..5de381e86b6f36d3497ea2e8cfef45c95eabeb5c 100755 (executable)
@@ -383,10 +383,10 @@ if __name__ == "__main__":
                        deleteDebianFolder()
                files = createDebianFiles(config)
                # check if a file is overwritten
-               for file in files:
-                       if os.path.exists(file):
-                               if input("Do you want to overwrite %s (y/N)? " % file).lower() != "y":
-                                       sys.exit(1)
+               overwritten_files = list(filter(lambda file: os.path.exists(file), files))
+               if overwritten_files:
+                       if input("Do you want to overwrite {} (y/N)? ".format(', '.join(overwritten_files))).lower() != "y":
+                               sys.exit(1)
                # run compilation
                buildDebianPackage(config)
                # install files