diff --git a/scripts/setup_redirections.py b/scripts/setup_redirections.py index 3c31c39..b44ff06 100644 --- a/scripts/setup_redirections.py +++ b/scripts/setup_redirections.py @@ -2,8 +2,12 @@ import sys import os +import apt_pkg + from jinja2 import Template +apt_pkg.init() + args = sys.argv[1:] pre_release = False @@ -27,7 +31,17 @@ files = glob.glob("*.deb") repo = args[0] -tag = args[1] +tag = args[1] # for the stable version +alpha_tag = None + +if pre_release: # if this is a pre-release, then give tag the value of the current stable version + alpha_tag = tag + with open("Packages", "r") as fp: + for p in apt_pkg.TagFile(fp): + if not p["Package"].endswith("alpha"): # get the latest stable version + tag = p["Version"] + break + with open("templates/_headers_template", "r") as f: template_header = Template(f.read()) @@ -47,7 +61,8 @@ latest_packages=latest_packages, alpha_packages=alpha_packages, repo=repo, - tag=tag + tag=tag, + alpha_tag=alpha_tag )) for deb in files: diff --git a/templates/_headers_template b/templates/_headers_template index 0972f63..21dc0e4 100644 --- a/templates/_headers_template +++ b/templates/_headers_template @@ -4,12 +4,13 @@ {% for p in latest_packages %} /{{p}}.html Content-Disposition: attachment; filename="{{p}}" - Location: https://github.com/{{repo}}/releases/download/{{tag}}/{{p}}.html + Location: https://github.com/{{repo}}/releases/download/{{tag}}/{{p}} {% endfor %} {% for a in alpha_packages %} /{{a}}.html Content-Disposition: attachment; filename="{{a}}" - Location: https://github.com/{{repo}}/releases/download/{{tag}}/{{a}}.html + Location: https://github.com/{{repo}}/releases/download/{{alpha_tag}}/{{a}} + {% endfor %} \ No newline at end of file diff --git a/templates/index_template b/templates/index_template index a1f7120..9aac321 100644 --- a/templates/index_template +++ b/templates/index_template @@ -94,7 +94,7 @@

Debian Repository

-

Welcome to thttps://www.youtube.com/watch?v=y0RTfxgSHfghe Debian repository of the Gama platform.
+

Welcome to the Debian repository of the Gama platform.
Below is a list of the latest debian/ubuntu packages available for download.


@@ -143,7 +143,7 @@ echo "deb [trusted=yes] https://ppa.gama-platform.org ./" | tee -a /etc/apt/sour

The following apt packages can be installed the same way as the usual ones, however these are unstable and thus not recommended