From 6524611ce1fe6f371a42086065ac48452db7da59 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
Date: Aug 14 2023 06:13:42 +0000
Subject: [PATCH 1/2] test f37 f38 f39 in staging


add version 37, 38 and 39 in stage
remove 34, 35, 36 from stage

---

diff --git a/dnf/dnf_stg_34.conf b/dnf/dnf_stg_34.conf
deleted file mode 100644
index 3e93fde..0000000
--- a/dnf/dnf_stg_34.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-[main]
-gpgcheck=1
-installonly_limit=3
-clean_requirements_on_remove=True
-best=False
-skip_if_unavailable=True
-reposdir=
-
-[fedora-source]
-name=Fedora 34 - Source
-baseurl=https://infrastructure.fedoraproject.org/pub/fedora/linux/releases/34/Everything/source/tree
-enabled=1
-metadata_expire=7d
-repo_gpgcheck=0
-type=rpm
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
-skip_if_unavailable=False
diff --git a/dnf/dnf_stg_35.conf b/dnf/dnf_stg_35.conf
deleted file mode 100644
index 31a4109..0000000
--- a/dnf/dnf_stg_35.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-[main]
-gpgcheck=1
-installonly_limit=3
-clean_requirements_on_remove=True
-best=False
-skip_if_unavailable=True
-reposdir=
-
-[fedora-source]
-name=Fedora 35 - Source
-baseurl=https://infrastructure.fedoraproject.org/pub/fedora/linux/releases/35/Everything/source/tree
-enabled=1
-metadata_expire=7d
-repo_gpgcheck=0
-type=rpm
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-35-$basearch
-skip_if_unavailable=False
diff --git a/dnf/dnf_stg_36.conf b/dnf/dnf_stg_36.conf
deleted file mode 100644
index 4da7ef8..0000000
--- a/dnf/dnf_stg_36.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-[main]
-gpgcheck=1
-installonly_limit=3
-clean_requirements_on_remove=True
-best=False
-skip_if_unavailable=True
-reposdir=
-
-[fedora-source]
-name=Fedora 36 - Source
-baseurl=https://infrastructure.fedoraproject.org/pub/fedora/linux/releases/36/Everything/source/tree
-enabled=1
-metadata_expire=7d
-repo_gpgcheck=0
-type=rpm
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-36-$basearch
-skip_if_unavailable=False
diff --git a/dnf/dnf_stg_37.conf b/dnf/dnf_stg_37.conf
new file mode 100644
index 0000000..bc71a27
--- /dev/null
+++ b/dnf/dnf_stg_37.conf
@@ -0,0 +1,19 @@
+[main]
+gpgcheck=1
+installonly_limit=3
+clean_requirements_on_remove=True
+best=False
+skip_if_unavailable=True
+reposdir=
+
+[fedora-source]
+name=Fedora 37 - Source
+metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-37&arch=$basearch
+#baseurl=https://dl.fedoraproject.org/pub/fedora/linux/development/37/Everything/source/tree
+enabled=1
+metadata_expire=7d
+repo_gpgcheck=0
+type=rpm
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-x86_64
+skip_if_unavailable=False
diff --git a/dnf/dnf_stg_38.conf b/dnf/dnf_stg_38.conf
new file mode 100644
index 0000000..d72d4e7
--- /dev/null
+++ b/dnf/dnf_stg_38.conf
@@ -0,0 +1,19 @@
+[main]
+gpgcheck=1
+installonly_limit=3
+clean_requirements_on_remove=True
+best=False
+skip_if_unavailable=True
+reposdir=
+
+[fedora-source]
+name=Fedora 38 - Source
+metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-38&arch=$basearch
+#baseurl=https://dl.fedoraproject.org/pub/fedora/linux/development/38/Everything/source/tree
+enabled=1
+metadata_expire=7d
+repo_gpgcheck=0
+type=rpm
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-x86_64
+skip_if_unavailable=False
diff --git a/dnf/dnf_stg_39.conf b/dnf/dnf_stg_39.conf
new file mode 100644
index 0000000..d74fe15
--- /dev/null
+++ b/dnf/dnf_stg_39.conf
@@ -0,0 +1,19 @@
+[main]
+gpgcheck=1
+installonly_limit=3
+clean_requirements_on_remove=True
+best=False
+skip_if_unavailable=True
+reposdir=
+
+[fedora-source]
+name=Fedora 39 - Source
+metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-39&arch=$basearch
+#baseurl=https://dl.fedoraproject.org/pub/fedora/linux/development/39/Everything/source/tree
+enabled=1
+metadata_expire=7d
+repo_gpgcheck=0
+type=rpm
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-x86_64
+skip_if_unavailable=False

From b521714f59e32a6115aca9a081ea415517e7d6dc Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
Date: Aug 17 2023 05:30:04 +0000
Subject: [PATCH 2/2] update build image to fedora 38


add a script to test the whole process using the docker image

---

diff --git a/Dockerfile b/Dockerfile
index 442d9a5..d21d76e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM registry.fedoraproject.org/fedora:36
+FROM registry.fedoraproject.org/fedora:38
 
 RUN dnf install -y lbzip2 unzip xz cpio dnf-plugins-core rsync python3-pip hugo gettext git rubygem-asciidoctor glibc-gconv-extra
 COPY requirements.txt /src/requirements.txt
@@ -17,4 +17,4 @@ RUN chmod -R g+rwX /src/website
 COPY templates /src/templates/
 COPY CLDR-raw /src/CLDR-raw/
 VOLUME /src/results
-ENV VERS f34
+ENV VERS f38
diff --git a/check_dnf_files.sh b/check_dnf_files.sh
new file mode 100755
index 0000000..916afe1
--- /dev/null
+++ b/check_dnf_files.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+set -xe
+
+release="$1"
+
+packages_regex="blue.*"
+
+WORK_DIR=$(mktemp -d)
+# deletes the temp directory
+mkdir -p "$WORK_DIR"/results
+
+function cleanup {
+  rm -rf "$WORK_DIR"
+  echo "Deleted temp working directory $WORK_DIR"
+}
+
+function call_sall {
+    conf=$1
+    rel=$2
+    results="f$rel"
+    podman run -it --rm -v ./:/src:z -v "$WORK_DIR"/results:/src/results:z -v ./srpms:/srpms:z --tmpfs /tmp:size=4G -e DNF_CONF=/src/"$dnf_conf" fedlocstats:latest \
+      /src/build.py --results "f$rel" "$packages_regex"
+
+    podman run -it --rm -v ./:/src:z -v "$WORK_DIR"/results:/src/results:z -v ./srpms:/srpms:z --tmpfs /tmp:size=4G -e DNF_CONF=/src/"$dnf_conf" fedlocstats:latest \
+      /src/build_language_list.py --results "$results"
+
+    podman run -it --rm -v ./:/src:z -v "$WORK_DIR"/results:/src/results:z -v ./srpms:/srpms:z --tmpfs /tmp:size=4G -e DNF_CONF=/src/"$dnf_conf" fedlocstats:latest \
+      /src/build_language_list.py --results "$results" --analyzealllang
+
+    podman run -it --rm -v ./:/src:z -v "$WORK_DIR"/results:/src/results:z -v ./srpms:/srpms:z --tmpfs /tmp:size=4G -e DNF_CONF=/src/"$dnf_conf" fedlocstats:latest \
+      /src/build_tm.py --results "$results" --compress
+
+    podman run -it --rm -v ./:/src:z -v "$WORK_DIR"/results:/src/results:z -v ./srpms:/srpms:z --tmpfs /tmp:size=4G -e DNF_CONF=/src/"$dnf_conf" fedlocstats:latest \
+      /src/build_stats.py --results "$results"
+
+    podman run -it --rm -v ./:/src:z -v "$WORK_DIR"/results:/src/results:z -v ./srpms:/srpms:z --tmpfs /tmp:size=4G -e DNF_CONF=/src/"$dnf_conf" fedlocstats:latest \
+      /src/build_website.py --results "$results"
+}
+
+# register the cleanup function to be called on the EXIT signal
+trap cleanup EXIT
+
+echo "STG configurations"
+
+for dnf_conf in "dnf"/dnf_stg_*
+do
+  releases=(${dnf_conf//_/ })
+  release=${releases[2]%.*}
+
+  echo "STG  Fedora $release"
+  call_sall $dnf_conf $release
+
+done
+
+echo "PROD configurations"
+
+for dnf_conf in "dnf"/dnf_[0-9]*
+do
+  releases=(${dnf_conf//_/ })
+  release=${releases[1]%.*}
+
+  echo "PROD  Fedora $release"
+  call_sall $dnf_conf $release
+done
+
+# ~ 1 m
+(
+    cd website
+    hugo server -D
+)

