Fix mock: use custom config with extra repos instead of --shell injection
The --init/--shell/--no-clean approach caused a corrupted RPM database in the chroot. Instead, generate a custom mock config that includes both the Forgejo package registry and the xlibre Copr repos directly in config_opts['yum.conf'] before the chroot is created. This is the standard, reliable way to add extra repositories to mock.
This commit is contained in:
parent
b868b75011
commit
d357aae360
1 changed files with 21 additions and 10 deletions
|
|
@ -50,18 +50,29 @@ jobs:
|
||||||
|
|
||||||
- name: Build RPM with mock
|
- name: Build RPM with mock
|
||||||
run: |
|
run: |
|
||||||
|
cat > /tmp/mock-custom.cfg <<'MOCKEOF'
|
||||||
|
include('/etc/mock/alma+epel-10-x86_64.cfg')
|
||||||
|
config_opts['yum.conf'] += """
|
||||||
|
[sonicde-rpm]
|
||||||
|
name=SonicDE RPM
|
||||||
|
baseurl=https://pc-rytteren.dk/forge/api/packages/anders/rpm
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=0
|
||||||
|
|
||||||
|
[xlibre-xserver]
|
||||||
|
name=Copr xlibre-xserver
|
||||||
|
baseurl=https://download.copr.fedorainfracloud.org/results/@xlibre/xlibre-xserver/rhel+epel-10-$basearch/
|
||||||
|
type=rpm-md
|
||||||
|
skip_if_unavailable=True
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=https://download.copr.fedorainfracloud.org/results/@xlibre/xlibre-xserver/pubkey.gpg
|
||||||
|
repo_gpgcheck=0
|
||||||
|
enabled=1
|
||||||
|
"""
|
||||||
|
MOCKEOF
|
||||||
mock \
|
mock \
|
||||||
--root alma+epel-10-x86_64 \
|
-r /tmp/mock-custom.cfg \
|
||||||
--init
|
|
||||||
FORGEJO_REPO=$(curl -fsSL https://pc-rytteren.dk/forge/api/packages/anders/rpm.repo)
|
|
||||||
COPR_REPO=$(curl -fsSL "https://copr.fedorainfracloud.org/coprs/g/xlibre/xlibre-xserver/repo/rhel+epel-10/group_xlibre-xlibre-xserver-rhel+epel-10.repo")
|
|
||||||
mock \
|
|
||||||
--root alma+epel-10-x86_64 \
|
|
||||||
--shell "mkdir -p /etc/yum.repos.d && echo '${FORGEJO_REPO}' > /etc/yum.repos.d/sonicde.repo && echo '${COPR_REPO}' > /etc/yum.repos.d/xlibre-xserver.repo"
|
|
||||||
mock \
|
|
||||||
--root alma+epel-10-x86_64 \
|
|
||||||
--resultdir "${HOME}/mock-results" \
|
--resultdir "${HOME}/mock-results" \
|
||||||
--no-clean \
|
|
||||||
--rebuild "${{ env.SRPM_PATH }}"
|
--rebuild "${{ env.SRPM_PATH }}"
|
||||||
|
|
||||||
- name: Upload RPMs to Forgejo Package Registry
|
- name: Upload RPMs to Forgejo Package Registry
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue