Commit 3ec5116d authored by Oliver Pinter's avatar Oliver Pinter
Browse files

HBSD: partially move shortlog generation to update_meta.py



TODO: move the drupal related stuffs too
Signed-off-by: default avatarOliver Pinter <oliver.pinter@hardenedbsd.org>
parent b09406e3
......@@ -223,7 +223,7 @@ echo "%%SIGNATURE%%" >> ${gen_prefix}/drupal-${_tag}.template
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.template
awk 'BEGIN{print "<strong>Changelog:</strong>"; c=0; prev_c=0}; /^[A-Za-z]/{if (c != prev_c) {print "</ul>"; print "<br>"; prev_c = c}; print "<strong>"; print; print "</strong>"; print "<ul>"; c++}; /^[ ]/{print "\t<li>"; print; print "\t</li>"}; END{print "</ul>"}' ${gen_prefix}/shortlog-${_tag}.template >> ${gen_prefix}/drupal-${_tag}.template
awk 'BEGIN{print "<strong>Changelog:</strong>"; c=0; prev_c=0}; /^[A-Za-z]/{if (c != prev_c) {print "</ul>"; print "<br>"; prev_c = c}; print "<strong>"; print; print "</strong>"; print "<ul>"; c++}; /^[ ]/{print "\t<li>"; print; print "\t</li>"}; END{print "</ul>"}' ${gen_prefix}/shortlog-${_tag}.txt >> ${gen_prefix}/drupal-${_tag}.template
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "Highlights:" > ${gen_prefix}/github-${_tag}.template
......@@ -231,7 +231,7 @@ echo "%%NOTES%%" >> ${gen_prefix}/github-${_tag}.template
echo >> ${gen_prefix}/github-${_tag}.template
echo "Changelog" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
cat ${gen_prefix}/shortlog-${_tag}.template >> ${gen_prefix}/github-${_tag}.template
echo "%%SHORTLOG%%" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
echo >> ${gen_prefix}/github-${_tag}.template
echo "Installer images: http://installer.hardenedbsd.org/pub/HardenedBSD/releases/amd64/amd64/ISO-IMAGES/${_tag}/" >> ${gen_prefix}/github-${_tag}.template
......
......@@ -29,22 +29,30 @@ with open("github-{version}.template".format(version=cwd), "r") as f:
github_formatted_lines = []
drupal_formatted_lines = []
f_notes = open("NOTES", "r")
for line in f_notes:
formatted_line = line.replace("\n", "")
github_formatted_line = [ " * " + formatted_line ]
github_formatted_lines += github_formatted_line
drupal_formatted_line = [ " <li>" + formatted_line + "</li>" ]
drupal_formatted_lines += drupal_formatted_line
f_notes.close()
github_notes = "\n".join(github_formatted_lines)
drupal_notes = "\n".join(drupal_formatted_lines)
github_text = "\n".join(github_formatted_lines)
drupal_text = "\n".join(drupal_formatted_lines)
github_formatted_lines = []
drupal_formatted_lines = []
f_shortlog = open("shortlog-{version}.txt".format(version=cwd), "r")
for line in f_shortlog:
formatted_line = line.replace("\n", "")
github_formatted_lines += [ formatted_line ]
drupal_formatted_lines += [ formatted_line ]
github_shortlog = "\n".join(github_formatted_lines)
drupal_shortlog = "\n".join(drupal_formatted_lines)
with open("drupal-{version}.txt".format(version=cwd), "w+") as f:
drupal = drupal_template.replace("%%NOTES%%", drupal_text)
drupal = drupal_template.replace("%%NOTES%%", drupal_notes)
#drupal = drupal.replace("%%SHORTLOG%%", drupal_shortlog)
if update_checksum:
drupal = drupal.replace("%%CHECKSUM%%", checksum)
if update_signature:
......@@ -52,7 +60,8 @@ with open("drupal-{version}.txt".format(version=cwd), "w+") as f:
f.write(drupal)
with open("github-{version}.txt".format(version=cwd), "w+") as f:
github = github_template.replace("%%NOTES%%", github_text)
github = github_template.replace("%%NOTES%%", github_notes)
github = github.replace("%%SHORTLOG%%", github_shortlog)
if update_checksum:
github = github.replace("%%CHECKSUM%%", checksum)
if update_signature:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment