diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-05-11 14:03:30 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-05-11 14:17:00 +0200 |
commit | 4ad5ba7351447713ee7a6f79032bd4544c05987d (patch) | |
tree | 13e67de3b96a1fd94005953668b3cbad967cde01 | |
parent | 6047da31cfeb7f9fb33499dcc8db3b6fabc75428 (diff) | |
download | geocode-glib-4ad5ba7351447713ee7a6f79032bd4544c05987d.tar.gz |
ci: Fix undoing delangification when package isn't available
We need to install or reinstall glib2 and glibc packages after removing
/etc/rpm/macros.image-language-conf or we won't have the translation
files we want installed. But in some cases, the package might not be
available for reinstall, so try to install the dependencies and only
reinstall the package if a newer version didn't get installed.
Installed package XXX (from koji-override-1) not available
-rwxr-xr-x | .ci/undo-delangification.sh | 26 | ||||
-rw-r--r-- | .gitlab-ci.yml | 8 |
2 files changed, 28 insertions, 6 deletions
diff --git a/.ci/undo-delangification.sh b/.ci/undo-delangification.sh new file mode 100755 index 0000000..cd3844b --- /dev/null +++ b/.ci/undo-delangification.sh @@ -0,0 +1,26 @@ +#!/bin/sh -x + +GLIB2_VER=`rpm -q glib2` +GLIBC_VER=`rpm -q glibc` + +# Undo delangification present in the Fedora Docker images +rm -f /etc/rpm/macros.image-language-conf + +dnf install -y $@ + +# Only reinstall glibc and glib2 if they weren't updated +RPMS="" +if [ "$GLIB2_VER" == "`rpm -q glib2`" ] ; then + RPMS="glib2" +fi +if [ "$GLIBC_VER" == "`rpm -q glibc`" ] ; then + if [ -z "$RPMS" ] ; then + RPMS="glibc" + else + RPMS="$RPMS glibc" + fi +fi + +if [ ! -z "$RPMS" ] ; then + dnf reinstall -y $RPMS +fi diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b29b36d..484c01e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,9 +38,7 @@ build-fedora-soup2: SOUP2_ENABLED: 'true' before_script: # Undo delangification present in the Fedora Docker images - - rm -f /etc/rpm/macros.image-language-conf - - dnf reinstall -y glib2 glibc - - dnf install -y $COMMON_DEPS $SOUP2_DEPS + - .ci/undo-delangification.sh $COMMON_DEPS $SOUP2_DEPS script: - meson _build - ninja -C _build install @@ -54,9 +52,7 @@ build-fedora-soup3: SOUP2_ENABLED: 'false' before_script: # Undo delangification present in the Fedora Docker images - - rm -f /etc/rpm/macros.image-language-conf - - dnf reinstall -y glib2 glibc - - dnf install -y $COMMON_DEPS $SOUP3_DEPS + - .ci/undo-delangification.sh $COMMON_DEPS $SOUP3_DEPS # Tasks specific to soup3 (glib 2.70, libsoup 3) - git clone https://gitlab.gnome.org/GNOME/glib.git && pushd glib - git checkout 2.69.3 |