JJB init script: Remove superfluous lines from autogenerated files
[releng/builder.git] / scripts / jjb-init-project.py
index ef7ec41a0e69754590af61606b6d2dd28e19b8d1..f5608d198109bf6178391377fd75d50b22eb6952 100644 (file)
@@ -194,5 +194,8 @@ with open(project_file, "w") as outfile:
                     line = re.sub("EMAIL_PREFIX", email_prefix, line)
                     line = re.sub("SONAR_BRANCH", sonar_branch, line)
                     line = re.sub("ARCHIVE_ARTIFACTS", archive_artifacts, line)
+                    # The previous command may have created superfluous lines.
+                    # If a line has no non-whitespace, it has to be '\n' only.
+                    line = re.sub(r'^\s+\n', "", line)
                 outfile.write(line)
         outfile.write("\n")