]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Introduce packaging sources as submodules 31673/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 8 Mar 2024 10:33:25 +0000 (11:33 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 13 Mar 2024 11:07:49 +0000 (12:07 +0100)
By always cloning the latest branch commit, we can't bisect properly
using mkosi as when bisecting wildly different packaging sources will
be used compared to when the commit was merged. By using submodules, we
track individual commits which means when bisecting the same packaging
sources will be used.

We use git submodules as dependabot has support for automatically making
PRs to update git submodules. This commit also includes the necessary
dependabot configuration to enable this.

We make ubuntu/debian use the same submodule instead of adding the debian
packaging sources twice by introducing a new $PKG_SUBDIR environment variable
and using it instead of $DISTRIBUTION.

13 files changed:
.github/dependabot.yml
.gitmodules [new file with mode: 0644]
mkosi.images/base/mkosi.conf.d/10-arch/mkosi.conf
mkosi.images/base/mkosi.conf.d/10-centos/mkosi.conf
mkosi.images/base/mkosi.conf.d/10-debian-ubuntu/mkosi.conf
mkosi.images/base/mkosi.conf.d/10-fedora/mkosi.conf
mkosi.images/base/mkosi.conf.d/10-opensuse/mkosi.conf
mkosi.images/base/mkosi.sync
pkg/arch [new submodule]
pkg/centos [new submodule]
pkg/debian [new submodule]
pkg/fedora [new submodule]
pkg/opensuse [new submodule]

index 3e067c176fd4f9258104336379c8b7b6cf16812a..54593c50f7bd04119cc8bc520c66af1ad07da760 100644 (file)
@@ -17,3 +17,8 @@ updates:
     schedule:
       interval: "monthly"
     open-pull-requests-limit: 2
+  - package-ecosystem: "gitsubmodule"
+    directory: "/"
+    schedule:
+      interval: "daily"
+    open-pull-requests-limit: 2
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..c69576e
--- /dev/null
@@ -0,0 +1,20 @@
+[submodule "pkg/fedora"]
+       path = pkg/fedora
+       url = https://src.fedoraproject.org/rpms/systemd
+       branch = rawhide
+[submodule "pkg/opensuse"]
+       path = pkg/opensuse
+       url = https://code.opensuse.org/package/systemd
+       branch = master
+[submodule "pkg/debian"]
+       path = pkg/debian
+       url = https://salsa.debian.org/systemd-team/systemd
+       branch = debian/master
+[submodule "pkg/centos"]
+       path = pkg/centos
+       url = https://git.centos.org/rpms/systemd
+       branch = c9s-sig-hyperscale
+[submodule "pkg/arch"]
+       path = pkg/arch
+       url = https://gitlab.archlinux.org/daandemeyer/systemd
+       branch = strip
index 75dbbb2ddead62d866277418044f60bd65ed9024..9cb45cc954d8d3f67d89c58af7b9b97ca0384d41 100644 (file)
@@ -10,8 +10,6 @@ InitrdInclude=initrd/
 # https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/merge_requests/8 is merged.
 [Content]
 Environment=
-        PKG_URL="https://gitlab.archlinux.org/daandemeyer/systemd"
-        PKG_BRANCH="strip"
         PKG_SUBDIR="arch"
         SYSTEMD_PACKAGES="systemd systemd-ukify systemd-sysvcompat systemd-resolvconf"
 
index 607c2d2dafef7b1e8f314d81f7c8b5e3d8bf1947..0f57319c2a2f402aaf3e742a9cc7e144bcff36d8 100644 (file)
@@ -5,8 +5,6 @@ Distribution=centos
 
 [Content]
 Environment=
-        PKG_URL="https://git.centos.org/rpms/systemd"
-        PKG_BRANCH="c9s-sig-hyperscale"
         PKG_SUBDIR="centos"
 
 Packages=
index f6fc43a8480dc4ae2df9c81145ca8e926063094f..47f3b7f488b9ebf81bca7ca10ab97b6e5f71766c 100644 (file)
@@ -9,8 +9,6 @@ InitrdInclude=initrd/
 
 [Content]
 Environment=
-        PKG_URL="https://salsa.debian.org/systemd-team/systemd"
-        PKG_BRANCH="debian/master"
         PKG_SUBDIR="debian"
         SYSTEMD_PACKAGES="systemd
                           systemd-userdbd
index 1424709cef0aa54de0eb10fb5f8769690603094a..a0b9f6f0fe4e577c15e1209920a214e017d9fa8d 100644 (file)
@@ -5,8 +5,6 @@ Distribution=fedora
 
 [Content]
 Environment=
-        PKG_URL="https://src.fedoraproject.org/rpms/systemd"
-        PKG_BRANCH="rawhide"
         PKG_SUBDIR="fedora"
 
 Packages=
index 1fca47b7cbb731a07d124ccf56c5c8e784f1a9a6..63498c5098ed461633935fff811f9d3c072d17eb 100644 (file)
@@ -8,8 +8,6 @@ InitrdInclude=initrd/
 
 [Content]
 Environment=
-        PKG_URL="https://code.opensuse.org/package/systemd"
-        PKG_BRANCH="master"
         PKG_SUBDIR="opensuse"
         SYSTEMD_PACKAGES="systemd
                           udev
index b95a73bc08bb6b258e804d4facf29a36f38d6d4d..72b5cf7c335f66b41ed0bb842a3bbe8ea112fcb4 100755 (executable)
@@ -2,12 +2,7 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 set -e
 
-if ((CACHED)); then
-    exit 0
-fi
-
-if [ -z "$(ls --almost-all "pkg/$PKG_SUBDIR")" ]; then
-    git clone "$PKG_URL" --branch "$PKG_BRANCH" "pkg/$PKG_SUBDIR"
-elif [ -d "pkg/$PKG_SUBDIR/.git" ] && [ "$(git -C "pkg/$PKG_SUBDIR" rev-parse --abbrev-ref HEAD)" = "$PKG_BRANCH" ]; then
-    git -C "pkg/$PKG_SUBDIR" pull
+if [ -z "$(ls --almost-all "pkg/$PKG_SUBDIR")" ] || [ -f "pkg/$PKG_SUBDIR/.git" ]; then
+    git submodule sync "pkg/$PKG_SUBDIR"
+    git submodule update --init "pkg/$PKG_SUBDIR"
 fi
diff --git a/pkg/arch b/pkg/arch
new file mode 160000 (submodule)
index 0000000..733045c
--- /dev/null
+++ b/pkg/arch
@@ -0,0 +1 @@
+Subproject commit 733045c8f6b0acf2f0cfaac207500483a678f4d2
diff --git a/pkg/centos b/pkg/centos
new file mode 160000 (submodule)
index 0000000..3cf4510
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 3cf45106c8bc5a050901851be6b2ac85b6f5c571
diff --git a/pkg/debian b/pkg/debian
new file mode 160000 (submodule)
index 0000000..49132a8
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 49132a870dfe281e1973a8c44acffb87a1db5336
diff --git a/pkg/fedora b/pkg/fedora
new file mode 160000 (submodule)
index 0000000..2822a03
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 2822a03dded26b9453bddbba7c6a152de8204aec
diff --git a/pkg/opensuse b/pkg/opensuse
new file mode 160000 (submodule)
index 0000000..37aca18
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 37aca188c2ef606319217b30ff8b0c66df6c60f1