From e5693683ebd38f5fb79f91efc290f5a38b440bac Mon Sep 17 00:00:00 2001
From: CentOS Sources <bugs@centos.org>
Date: Sat, 5 Nov 2022 08:12:43 +0000
Subject: [PATCH] Auto sync2gitlab import of osbuild-composer-67-1.el8.src.rpm

---
 .gitignore                                    |  1 +
 osbuild-composer.spec                         | 24 ++++++++----
 sources                                       |  2 +-
 ...sh-copy-RHEL-repo-overrides-using-wi.patch | 38 +++++++++++++++++++
 4 files changed, 56 insertions(+), 9 deletions(-)
 create mode 100644 tools-provision.sh-copy-RHEL-repo-overrides-using-wi.patch

diff --git a/.gitignore b/.gitignore
index 8834b9e..88a87f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
 /osbuild-composer-59.tar.gz
 /osbuild-composer-60.tar.gz
 /osbuild-composer-62.tar.gz
+/osbuild-composer-67.tar.gz
diff --git a/osbuild-composer.spec b/osbuild-composer.spec
index 319135c..f4413ba 100644
--- a/osbuild-composer.spec
+++ b/osbuild-composer.spec
@@ -9,7 +9,7 @@
 
 %global goipath         github.com/osbuild/osbuild-composer
 
-Version:        62
+Version:        67
 
 %gometa
 
@@ -33,6 +33,8 @@ License:        ASL 2.0
 URL:            %{gourl}
 Source0:        %{gosource}
 
+# https://github.com/osbuild/osbuild-composer/pull/3111
+Patch0:         tools-provision.sh-copy-RHEL-repo-overrides-using-wi.patch
 
 BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
 BuildRequires:  systemd
@@ -251,9 +253,6 @@ install -m 0644 -vp test/data/koji/*                               %{buildroot}%
 install -m 0755 -vd                                                %{buildroot}%{_datadir}/tests/osbuild-composer/x509
 install -m 0644 -vp test/data/x509/*                               %{buildroot}%{_datadir}/tests/osbuild-composer/x509/
 
-install -m 0755 -vd                                                %{buildroot}%{_datadir}/tests/osbuild-composer/openshift
-install -m 0644 -vp test/data/openshift/*                          %{buildroot}%{_datadir}/tests/osbuild-composer/openshift/
-
 install -m 0755 -vd                                                %{buildroot}%{_datadir}/tests/osbuild-composer/schemas
 install -m 0644 -vp pkg/jobqueue/dbjobqueue/schemas/*              %{buildroot}%{_datadir}/tests/osbuild-composer/schemas/
 
@@ -309,10 +308,10 @@ The core osbuild-composer binary. This is suitable both for spawning in containe
 Summary:    The worker for osbuild-composer
 Requires:   systemd
 Requires:   qemu-img
-Requires:   osbuild >= 63
-Requires:   osbuild-ostree >= 63
-Requires:   osbuild-lvm2 >= 63
-Requires:   osbuild-luks2 >= 63
+Requires:   osbuild >= 70
+Requires:   osbuild-ostree >= 70
+Requires:   osbuild-lvm2 >= 70
+Requires:   osbuild-luks2 >= 70
 Requires:   %{name}-dnf-json = %{version}-%{release}
 
 %description worker
@@ -353,6 +352,12 @@ The dnf-json binary used by osbuild-composer and the workers.
 %files dnf-json
 %{_libexecdir}/osbuild-composer/dnf-json
 
+%post dnf-json
+# Fix ownership of the rpmmd cache files from previous versions where it was owned by root:root
+if [ -e /var/cache/osbuild-composer/rpmmd ]; then
+    chown -f -R --from root:root _osbuild-composer:_osbuild-composer /var/cache/osbuild-composer/rpmmd
+fi
+
 %if %{with tests} || 0%{?rhel}
 
 %package tests
@@ -424,6 +429,9 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c
 %endif
 
 %changelog
+* Wed Nov 02 2022 imagebuilder-bots+imagebuilder-bot@redhat.com <imagebuilder-bot> - 67-1
+- New upstream release
+
 * Mon Aug 29 2022 Ondřej Budai <ondrej@budai.cz> - 62-1
 - New upstream release
 
diff --git a/sources b/sources
index 70cccc5..766a286 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (osbuild-composer-62.tar.gz) = 4ed1da1779ac0ad1f2a4b45d42f81a5d04bb98d3fa886997c9e37cddf060c317fab3a05f40607d1f692581031ddbe2cd0fd051c639edc02553145d5dfe2fbb36
+SHA512 (osbuild-composer-67.tar.gz) = ca3e0c7cdb92a547108391c45f24c01b22f2eede54cd087eb020651a2122666109f18f8c16790020a23465a5e68b07ca8acef037a5e1472cea5b03bc756dc472
diff --git a/tools-provision.sh-copy-RHEL-repo-overrides-using-wi.patch b/tools-provision.sh-copy-RHEL-repo-overrides-using-wi.patch
new file mode 100644
index 0000000..a0127a2
--- /dev/null
+++ b/tools-provision.sh-copy-RHEL-repo-overrides-using-wi.patch
@@ -0,0 +1,38 @@
+From 1e5a7526369ec0bfd4bd5c536ff16f534f023fd5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= <thozza@redhat.com>
+Date: Wed, 2 Nov 2022 12:18:46 +0100
+Subject: [PATCH] tools/provision.sh: copy RHEL repo overrides using wildcard
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Don't list specific RHEL repos which should be copied over to the repo
+overrides directory, but instead copy all of them, similar to how it's
+done for Fedora and CentOS Stream. This is less error prone when support
+for a new RHEL release is added to composer.
+
+Signed-off-by: Tomáš Hozza <thozza@redhat.com>
+---
+ tools/provision.sh | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/tools/provision.sh b/tools/provision.sh
+index 93f8cccbd..09265f907 100755
+--- a/tools/provision.sh
++++ b/tools/provision.sh
+@@ -140,11 +140,7 @@ else # AUTH_METHOD_NONE
+     # Copy all fedora repo overrides
+     sudo cp -a /usr/share/tests/osbuild-composer/repositories/{fedora,centos}-*.json "$REPODIR"
+     # Copy RHEL point release repos
+-    sudo cp /usr/share/tests/osbuild-composer/repositories/rhel-85.json "$REPODIR"
+-    sudo cp /usr/share/tests/osbuild-composer/repositories/rhel-86.json "$REPODIR"
+-    sudo cp /usr/share/tests/osbuild-composer/repositories/rhel-87.json "$REPODIR"
+-    sudo cp /usr/share/tests/osbuild-composer/repositories/rhel-90.json "$REPODIR"
+-    sudo cp /usr/share/tests/osbuild-composer/repositories/rhel-91.json "$REPODIR"
++    sudo cp -a /usr/share/tests/osbuild-composer/repositories/rhel-*.json "$REPODIR"
+ 
+     # override source repositories to consume content from the nightly compose
+     if [ "${NIGHTLY:=false}" == "true" ]; then
+-- 
+2.37.3
+