Skip to content

Commit

Permalink
Merge pull request #39 from Schroeffu/fix/old-releases
Browse files Browse the repository at this point in the history
Fix/old releases
  • Loading branch information
fadnincx authored Jan 4, 2024
2 parents 7825bf6 + 36e0bec commit ae13433
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:22.04
WORKDIR /potos-iso

# Install ISO creation depencies
RUN apt update && apt install -y gfxboot p7zip-full xorriso wget curl libhtml-parser-perl cpio whois python3 python3-pip fdisk squashfs-tools
RUN apt update && apt install -y gfxboot p7zip-full xorriso wget curl libhtml-parser-perl cpio whois python3 python3-pip fdisk squashfs-tools python3-requests
COPY requirements.txt .
RUN pip3 install -r requirements.txt

Expand Down
17 changes: 11 additions & 6 deletions container/build-iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import shutil
import jinja2
import requests
from datetime import date
import subprocess
from pprint import pprint
Expand Down Expand Up @@ -61,9 +62,7 @@
if config['os'] == "jammy":
config['input'] = {}
config['input']['iso_filename'] = "ubuntu-22.04.3-live-server-amd64.iso"
config['input']['iso_url'] = (
"https://releases.ubuntu.com/22.04/ubuntu-22.04.3-live-server-amd64.iso"
)
config['input']['iso_url'] = "https://releases.ubuntu.com/22.04/" + config['input']['iso_filename']
config['input']['sha256_filename'] = "SHA256SUMS"
config['input']['sha256_url'] = "https://releases.ubuntu.com/22.04/SHA256SUMS"
config['packages'] = {}
Expand All @@ -75,12 +74,18 @@
"ldap-utils",
"yad",
]
#Test the URL, if 404 use old-releases.ubuntu.com
response = requests.get(config['input']['iso_url'])
if response.status_code == 404:
#extract figures in between first both dashes.
version = config['input']['iso_filename'].split("-")[1]
config['input']['iso_url'] = "https://releases.ubuntu.com/22.04/" + config['input']['iso_filename']
config['input']['iso_url'] = "https://old-releases.ubuntu.com/releases/" + version + "/" + config['input']['iso_filename']
config['input']['sha256_url'] = "https://old-releases.ubuntu.com/releases/" + version + "/" + config['input']['sha256_filename']
elif config['os'] == "focal":
config['input'] = {}
config['input']['iso_filename'] = "ubuntu-20.04.6-live-server-amd64.iso"
config['input']['iso_url'] = (
"https://releases.ubuntu.com/20.04/ubuntu-20.04.6-live-server-amd64.iso"
)
config['input']['iso_url'] = "https://releases.ubuntu.com/20.04/" + config['input']['iso_filename']
config['input']['sha256_filename'] = "SHA256SUMS"
config['input']['sha256_url'] = "https://releases.ubuntu.com/20.04/SHA256SUMS"
config['packages'] = {}
Expand Down

0 comments on commit ae13433

Please sign in to comment.