]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: switch to github mirror of openSUSE sources from build.opensuse.org 35789/head
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 30 Dec 2024 16:39:16 +0000 (17:39 +0100)
committerAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 30 Dec 2024 16:39:16 +0000 (17:39 +0100)
The current src.opensuse.org is very unstable and commit hashes are reset (or
even removed) every now and then. While the official repo is not fixed, let's
move to a more stable source, the github mirror of code.opensuse.org, maintained
since 2019.

mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot
mkosi.images/build/mkosi.conf.d/opensuse/mkosi.conf
mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare

index c9089b78c43aac844c2eafe29ae47ff94a2f2a66..8c4fb9bd6f0014ebfbec676007b18946cde1a698 100755 (executable)
@@ -4,8 +4,8 @@ set -e
 
 . mkosi.functions
 
-if [[ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]]; then
-    echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
+if [[ ! -f "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec" ]]; then
+    echo "spec not found at pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
     exit 1
 fi
 
@@ -14,7 +14,7 @@ TS="${SOURCE_DATE_EPOCH:-$(date +%s)}"
 # The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we
 # disable manpage compression as the files cannot be found. Fix the issue by removing the compression
 # extension.
-find "pkg/$PKG_SUBDIR" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
+find "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
 
 if [[ "$(rpm --eval "%{lua:print(rpm.vercmp('$(rpm --version | cut -d ' ' -f3)', '4.20'))}")" == "-1" ]]; then
     # Fix the %install override so debuginfo packages are generated.
@@ -58,10 +58,10 @@ if ((COVERAGE)); then
 fi
 
 # TODO: Drop when the spec is fixed (either the patch is adapted or not applied when building for upstream).
-sed --in-place '/0009-pid1-handle-console-specificities-weirdness-for-s390.patch/d' "pkg/$PKG_SUBDIR/systemd.spec"
+sed --in-place '/0009-pid1-handle-console-specificities-weirdness-for-s390.patch/d' "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec"
 
 # TODO: Drop when the opensuse spec uses README.md instead of README.testsuite.
-sed --in-place 's/README.testsuite/README.md/' "pkg/$PKG_SUBDIR/systemd.spec"
+sed --in-place 's/README.testsuite/README.md/' "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec"
 
 build() {
     IFS=
@@ -81,7 +81,7 @@ build() {
         --with upstream \
         $( ((WITH_TESTS)) || echo "--nocheck") \
         --define "_topdir /var/tmp" \
-        --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \
+        --define "_sourcedir $PWD/pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}" \
         --define "_rpmdir $BUILDDIR" \
         ${BUILDDIR:+"--define=_vpath_builddir $BUILDDIR"} \
         --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
@@ -103,7 +103,7 @@ build() {
         --define "_find_debuginfo_opts --unique-debug-src-base \"%{name}\"" \
         --noclean \
         "$@" \
-        "pkg/$PKG_SUBDIR/systemd.spec"
+        "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec"
 
     EXIT_STATUS=$?
 
@@ -127,7 +127,7 @@ if ! build; then
     # warnings.
     rm systemd.lang
 
-    grep -v ".debug" /tmp/unpackaged-files >>"pkg/$PKG_SUBDIR/files.systemd"
+    grep -v ".debug" /tmp/unpackaged-files >>"pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/files.systemd"
     build --noprep --nocheck
 fi
 
index 4e83002c914007146209fbe62232bbadc9a3f2f3..a374207e4deeee867da57f4377cdd657ef873534 100644 (file)
@@ -5,9 +5,10 @@ Distribution=opensuse
 
 [Build]
 Environment=
-        GIT_URL=https://src.opensuse.org/pool/systemd
-        GIT_BRANCH=devel
-        GIT_COMMIT=cfdec97b3a3d459b1a74a6be33372fed9558fe6d5bef4ece4d7fb94905057c75
+        GIT_URL=https://github.com/bmwiedemann/openSUSE
+        GIT_SUBDIR=packages/s/systemd
+        GIT_BRANCH=master
+        GIT_COMMIT=1477f2646dd26ee3b166f26bd380a173fb649939
         PKG_SUBDIR=opensuse
 
 [Content]
index c4a95807155e142cd23618ef63ae4709d311b80a..de736a570f165659451c8fb4d5f8f4044cb2dd51 100755 (executable)
@@ -6,13 +6,13 @@ if [[ "$1" == "build" ]]; then
     exit 0
 fi
 
-if [[ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]]; then
-    echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
+if [[ ! -f "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec" ]]; then
+    echo "spec not found at pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
     exit 1
 fi
 
 # TODO: Drop when the spec is fixed (either the patch is adapted or not applied when building for upstream).
-sed --in-place '/0009-pid1-handle-console-specificities-weirdness-for-s390.patch/d' "pkg/$PKG_SUBDIR/systemd.spec"
+sed --in-place '/0009-pid1-handle-console-specificities-weirdness-for-s390.patch/d' "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec"
 
 mkosi-chroot \
     rpmspec \
@@ -20,8 +20,8 @@ mkosi-chroot \
     --query \
     --buildrequires \
     --define "_topdir /var/tmp" \
-    --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \
-    "pkg/$PKG_SUBDIR/systemd.spec" |
+    --define "_sourcedir $PWD/pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}" \
+    "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec" |
         grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
         sort --unique |
         tee /tmp/buildrequires |
@@ -34,9 +34,9 @@ until mkosi-chroot \
     --build-in-place \
     --with upstream \
     --define "_topdir /var/tmp" \
-    --define "_sourcedir $PWD/pkg/$PKG_SUBDIR" \
+    --define "_sourcedir $PWD/pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}" \
     --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
-    "pkg/$PKG_SUBDIR/systemd.spec"
+    "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec"
 do
     EXIT_STATUS=$?
     if [[ $EXIT_STATUS -ne 11 ]]; then