Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haiku/generate-download-pages
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c9e0e9976dfe
Choose a base ref
...
head repository: haiku/generate-download-pages
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 689a104bb24a
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jul 9, 2018

  1. refactor: Put nightly images into subfolder

    * This more closely matches the mess of symlinks on baron.
    * This also gives us a good url for "release" images.
    kallisti5 committed Jul 9, 2018
    Copy the full SHA
    689a104 View commit details
Showing with 14 additions and 58 deletions.
  1. +7 −32 generate-download-pages.py
  2. +7 −26 templates/root/index.html
39 changes: 7 additions & 32 deletions generate-download-pages.py
Original file line number Diff line number Diff line change
@@ -246,6 +246,8 @@ def index_files_for_rss(archive_dir, limit=20):
# Populate static assets
if not os.path.isdir(OUTPUT_DIR):
os.makedirs(OUTPUT_DIR)
if not os.path.isdir(os.path.join(OUTPUT_DIR, "nightly-images")):
os.makedirs(os.path.join(OUTPUT_DIR, "nightly-images"))
shutil.copy(os.path.join(TEMPLATE_DIR, "root", "index.html"), OUTPUT_DIR)

if not os.path.isdir(os.path.join(OUTPUT_DIR, "style")):
@@ -255,8 +257,8 @@ def index_files_for_rss(archive_dir, limit=20):


for variant in variants:
index_output = os.path.join(OUTPUT_DIR, variant)
rss_output = os.path.join(OUTPUT_DIR, variant, "rss")
index_output = os.path.join(OUTPUT_DIR, "nightly-images", variant)
rss_output = os.path.join(OUTPUT_DIR, "nightly-images", variant, "rss")

# make result paths
if not os.path.isdir(index_output):
@@ -268,45 +270,18 @@ def index_files_for_rss(archive_dir, limit=20):

# index html
template = template_lookup.get_template(variant + '.html')
index_path = os.path.join(OUTPUT_DIR, variant, "index.html")
index_path = os.path.join(OUTPUT_DIR, "nightly-images", variant, "index.html")
out_f = open(index_path + uniqueSuffix, "w")
out_f.write(template.render(headers=headers(variant), arch=variant, imageTypes=imageTypes(variant), table=result['table']))
out_f.close()
os.rename(index_path + uniqueSuffix, index_path)

# rss
template = template_lookup.get_template("rss.xml")
rss_path = os.path.join(OUTPUT_DIR, variant, "rss", "atom.xml")
rss_path = os.path.join(OUTPUT_DIR, "nightly-images", variant, "rss", "atom.xml")
out_f = open(rss_path + uniqueSuffix, "w")
out_f.write(template.render(arch=variant,
items=index_files_for_rss(os.path.join(OUTPUT_DIR, variant)),
items=index_files_for_rss(os.path.join(OUTPUT_DIR, "nightly-images", variant)),
variant=variant))
out_f.close()
os.rename(rss_path + uniqueSuffix, rss_path)

# write apache rewrite map file for current images
map_path = os.path.join(OUTPUT_DIR, variant, "currentImages.map.fragment")
out_f = open(map_path + uniqueSuffix, "w")
for key, value in result['currentImages'].iteritems():
out_f.write('%s/current-%s %s/%s\n' % (variant, key, variant, value))
out_f.write('%s/current-%s.sha256 %s/%s.sha256\n' % (variant, key, variant, value))
out_f.close()
os.rename(map_path + uniqueSuffix, map_path)

# write nginx rewrite map file for current images (has trailing semicolon)
map_path = os.path.join(OUTPUT_DIR, variant, "currentImages.map.nginx.fragment")
out_f = open(map_path + uniqueSuffix, "w")
for key, value in result['currentImages'].iteritems():
out_f.write('/%s/current-%s /nightly-images/%s/%s;\n' % (variant, key, variant, value))
out_f.write('/%s/current-%s.sha256 /nightly-images/%s/%s.sha256;\n' % (variant, key, variant, value))
out_f.close()
os.rename(map_path + uniqueSuffix, map_path)

# concatenate all fragments to full map file
map_path = os.path.join(OUTPUT_DIR, "currentImages.map")
os.system('cd "%s"; cat */currentImages.map.fragment >%s' % (OUTPUT_DIR, map_path + uniqueSuffix))
os.rename(map_path + uniqueSuffix, map_path)
# same for nginx
map_path = os.path.join(OUTPUT_DIR, "currentImages.map.nginx")
os.system('cd "%s"; cat */currentImages.map.nginx.fragment >%s' % (OUTPUT_DIR, map_path + uniqueSuffix))
os.rename(map_path + uniqueSuffix, map_path)
33 changes: 7 additions & 26 deletions templates/root/index.html
Original file line number Diff line number Diff line change
@@ -122,8 +122,8 @@ <h2>Supported variants</h2>
<li><strong>Architecture:</strong> x86</li>
<li><strong>BeOS Binary Compatibility:</strong> Yes</li>
<li><strong>Compiler:</strong> gcc 2.95.3 + gcc 7.3.0</li>
<li><strong>Download:</strong> <a href="/x86_gcc2_hybrid/">nightly images</a>
<a href="/x86_gcc2_hybrid/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Haiku Development RSS feed" title="Haiku Development RSS feed"></a></li>
<li><strong>Download:</strong> <a href="/nightly-images/x86_gcc2_hybrid/">nightly images</a>
<a href="/nightly-images/x86_gcc2_hybrid/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Haiku Development RSS feed" title="Haiku Development RSS feed"></a></li>
</ul></li>
</ul>
</td><td>
@@ -132,8 +132,8 @@ <h2>Supported variants</h2>
<li><strong>Architecture:</strong> x86_64</li>
<li><strong>BeOS Binary Compatibility:</strong> No</li>
<li><strong>Compiler:</strong> gcc 7.3.0</li>
<li><strong>Download:</strong> <a href="/x86_64/">nightly images</a>
<a href="/x86_64/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Haiku Development RSS feed" title="Haiku Development RSS feed"></a></li>
<li><strong>Download:</strong> <a href="/nightly-images/x86_64/">nightly images</a>
<a href="/nightly-images/x86_64/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Haiku Development RSS feed" title="Haiku Development RSS feed"></a></li>
</ul></li>
</ul>
</td></tr>
@@ -149,20 +149,11 @@ <h2>Unsupported variants</h2>
Releasing software that requires these unsupported builds is discouraged.</strong>
</p></div>
<p style='font-size: 14px; text-align: center;'>
<!--
<b>x86 based unsupported variants</b><br/>
<i>
<a href="/x86_gcc2">x86 GCC 2</a><a href="/x86_gcc2/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported x86-gcc2 RSS feed" title="Unsupported x86-gcc2 RSS feed"></a> |
<a href="/x86">x86 GCC 5</a><a href="/x86/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported x86-gcc5 RSS feed" title="Unsupported x86-gcc5 RSS feed"></a>
<a href="/x86_hybrid">x86 GCC 5 Hybrid</a><a href="/x86_hybrid/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported x86-gcc5hybrid RSS feed" title="Unsupported x86-gcc5hybrid RSS feed"></a>
</i>
<br/>
-->
<b>non-x86 unsupported variants</b><br/>
<i>
<a href="/arm/">ARM</a><a href="/arm/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported ARM RSS feed" title="Unsupported ARM RSS feed"></a> |
<a href="/m68k/">m68k</a><a href="/m68k/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported m68k RSS feed" title="Unsupported m68k RSS feed"></a> |
<a href="/ppc/">PowerPC</a><a href="/ppc/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported PowerPC RSS feed" title="Unsupported PowerPC RSS feed"></a>
<a href="/nightly-images/arm/">ARM</a><a href="/nightly-images/arm/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported ARM RSS feed" title="Unsupported ARM RSS feed"></a> |
<a href="/nightly-images/m68k/">m68k</a><a href="/nightly-images/m68k/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported m68k RSS feed" title="Unsupported m68k RSS feed"></a> |
<a href="/nightly-images/ppc/">PowerPC</a><a href="/nightly-images/ppc/rss/atom.xml"><img class="inline" src="/style/feed_16.png" alt="Unsupported PowerPC RSS feed" title="Unsupported PowerPC RSS feed"></a>
</i>
</p>
</div>
@@ -171,16 +162,6 @@ <h2>Unsupported variants</h2>
<div id="footer">&copy; 2001-2017 Haiku, Inc. &#8212; Haiku&#174; and
the HAIKU logo&#174; are registered trademarks of <a href="http://www.haiku-inc.org">Haiku, Inc.</a><br/>
BeOS is a trademark of <a href="https://www.access-company.com/" target="_BLANK">ACCESS Co., Ltd.</a>
<!--
<p><img class="inline" src="/style/feed_16.png" alt="Haiku Files RSS feeds" title="Haiku Files RSS feeds">
<a href="/rss">x86 GCC 2 Hybrid (Supported)</a> |
<a href="/x86-gcc2/rss">x86 GCC 2</a> |
<a href="/x86-gcc5/rss">x86 GCC 5</a> |
<a href="/x86-gcc5hybrid/rss">x86 GCC 5 Hybrid</a> |
<a href="/arm/rss">ARM</a> |
<a href="/m68k/rss">m68k</a> |
<a href="/ppc/rss">PowerPC</a></p>
-->
</div>
</div>
</body>