From 3379ed0351ab179e7445735ae3355298cae05a2b Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Tue, 14 Nov 2023 19:53:25 +0100 Subject: [PATCH 1/5] Added settings submodule --- .gitmodules | 3 +++ scripts/librewolf-patches.py | 6 +++--- scripts/update_settings.sh | 22 ++++++++++++++++++++++ settings | 1 + 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 scripts/update_settings.sh create mode 160000 settings diff --git a/.gitmodules b/.gitmodules index e69de29..7709269 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "settings"] + path = settings + url = https://codeberg.org/librewolf/settings.git diff --git a/scripts/librewolf-patches.py b/scripts/librewolf-patches.py index 42e939d..9982979 100755 --- a/scripts/librewolf-patches.py +++ b/scripts/librewolf-patches.py @@ -117,9 +117,9 @@ def librewolf_patches(): exec('mkdir -p lw') enter_srcdir('lw') - exec('wget -q https://codeberg.org/librewolf/settings/raw/branch/master/librewolf.cfg') - exec('wget -q https://codeberg.org/librewolf/settings/raw/branch/master/distribution/policies.json') - exec('wget -q https://codeberg.org/librewolf/settings/raw/branch/master/defaults/pref/local-settings.js') + exec('cp -v ../../settings/librewolf.cfg .') + exec('cp -v ../../settings/distribution/policies.json .') + exec('cp -v ../../settings/defaults/pref/local-settings.js .') leave_srcdir(); diff --git a/scripts/update_settings.sh b/scripts/update_settings.sh new file mode 100644 index 0000000..abb22f8 --- /dev/null +++ b/scripts/update_settings.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Navigate to the root directory of your repository +cd /path/to/your/repo + +# Update the submodule +echo "Checking for updates in the settings submodule..." +cd settings +git checkout master +git pull origin master +cd .. + +# Check if there are any changes +if [ -n "$(git diff --submodule)" ]; then + echo "Updates found in the submodule. Committing them..." + git add settings + git commit -m "Updated settings submodule to the latest version" + git push + echo "Updates committed and pushed." +else + echo "No updates in the submodule." +fi diff --git a/settings b/settings new file mode 160000 index 0000000..b587388 --- /dev/null +++ b/settings @@ -0,0 +1 @@ +Subproject commit b587388bdbe63511c478cb8b5f82c2e80040414c From 01970b591063f0014d676f918a8a899cb4d0d88d Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Tue, 14 Nov 2023 19:58:40 +0100 Subject: [PATCH 2/5] Updated settings submodule to the latest version --- scripts/{update_settings.sh => update-settings-module.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{update_settings.sh => update-settings-module.sh} (100%) diff --git a/scripts/update_settings.sh b/scripts/update-settings-module.sh similarity index 100% rename from scripts/update_settings.sh rename to scripts/update-settings-module.sh From 5d96af844527092a45b4339c4626a5690021edee Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Tue, 14 Nov 2023 20:13:39 +0100 Subject: [PATCH 3/5] Tue Nov 14 08:13:39 PM CET 2023 --- .gitlab-ci.yml | 4 ++++ Makefile | 5 +++-- scripts/update-settings-module.sh | 20 +++++--------------- 3 files changed, 12 insertions(+), 17 deletions(-) mode change 100644 => 100755 scripts/update-settings-module.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91c2a5e..49b373c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,10 @@ stages: - release +before_script: + - git submodule sync --recursive + - git submodule update --init --recursive + Linux: stage: test diff --git a/Makefile b/Makefile index c137cd0..31247f4 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ help : @echo "docker:" $(docker_targets) check : + -bash -c ./scripts/update-settings-module.sh python3 scripts/update-version.py cut -f1 version > version.tmp mv -vf version.tmp version @@ -55,9 +56,9 @@ check : @echo "LibreWolf release : " $$(cat release) @echo "" - update : - git submodule update --recursive --remote + -bash -c ./scripts/update-settings-module.sh +# git submodule update --recursive --remote all : $(lw_source_tarball) diff --git a/scripts/update-settings-module.sh b/scripts/update-settings-module.sh old mode 100644 new mode 100755 index abb22f8..1621361 --- a/scripts/update-settings-module.sh +++ b/scripts/update-settings-module.sh @@ -1,22 +1,12 @@ -#!/bin/bash +#!/usr/bin/env bash -# Navigate to the root directory of your repository -cd /path/to/your/repo +set -eu -# Update the submodule -echo "Checking for updates in the settings submodule..." cd settings git checkout master git pull origin master cd .. -# Check if there are any changes -if [ -n "$(git diff --submodule)" ]; then - echo "Updates found in the submodule. Committing them..." - git add settings - git commit -m "Updated settings submodule to the latest version" - git push - echo "Updates committed and pushed." -else - echo "No updates in the submodule." -fi +git add settings +git commit -m "Updated settings submodule to the latest version" +git push From 432595896923551e7142644ca07674f18ce41f31 Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Tue, 14 Nov 2023 20:19:20 +0100 Subject: [PATCH 4/5] Tue Nov 14 08:19:20 PM CET 2023 --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49b373c..c76163f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,14 +4,11 @@ stages: - release -before_script: - - git submodule sync --recursive - - git submodule update --init --recursive - - Linux: stage: test allow_failure: true + variables: + GIT_SUBMODULE_STRATEGY: recursive tags: - autoscale image: debian @@ -29,6 +26,8 @@ Linux: macOS: stage: test allow_failure: true + variables: + GIT_SUBMODULE_STRATEGY: recursive when: manual tags: - autoscale @@ -47,6 +46,8 @@ macOS: Windows: stage: test allow_failure: true + variables: + GIT_SUBMODULE_STRATEGY: recursive when: manual tags: - autoscale From 1631a76053046f11902ee38366dc17f845536823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Tue, 14 Nov 2023 21:18:04 +0100 Subject: [PATCH 5/5] Fix forgejo push workflow --- .forgejo/workflows/push.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/push.yaml b/.forgejo/workflows/push.yaml index dc8140d..f2ff906 100644 --- a/.forgejo/workflows/push.yaml +++ b/.forgejo/workflows/push.yaml @@ -8,6 +8,8 @@ jobs: - run: apk update -U && apk add make gnupg patch python3 bash xz nodejs git shell: sh - uses: actions/checkout@v3 + with: + submodules: true - run: make fetch-upstream-woodpecker - run: make check-patchfail-woodpecker - run: make all