Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf5 copr enable not expanding $distname variable in runtime dependencies #3387

Open
jchecahi opened this issue Aug 26, 2024 · 1 comment
Open

Comments

@jchecahi
Copy link

We found this out in the llvm daily builds in copr. We have a runtime dependency repo that uses $distname as we have fedora and rhel chroots. See https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-big-merge-20240825/ for example.

We've seen that from Fedora 41 that variable is not being expanded when dnf is used:

# dnf copr -y enable -y @fedora-llvm-team/llvm-snapshots-big-merge-20240825 fedora-rawhide-x86_64
[...]
  1. [coprdep:https_download_copr_fedorainfracloud_org_results_40fedora_llvm_team_llvm_compat_packages_distname_releasever_basearch]
     baseurl=https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/$distname-$releasever-$basearch

These repositories are being enabled together with the main
repository.

# grep llvm-compat /etc/yum.repos.d/*llvm-snapshots*
baseurl=https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/$distname-$releasever-$basearch

However, when using dnf4 the $distname variable is expanded with no problem:

# dnf copr  -y disable -y @fedora-llvm-team/llvm-snapshots-big-merge-20240825
Copr repository 'copr.fedorainfracloud.org/@fedora-llvm-team/llvm-snapshots-big-merge-20240825' in '/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:group_fedora-llvm-team:llvm-snapshots-big-merge-20240825.repo' disabled.
# dnf-3 copr -y enable -y @fedora-llvm-team/llvm-snapshots-big-merge-20240825 fedora-rawhide-x86_64
[...]
 1. [coprdep:https_download_copr_fedorainfracloud_org_results_40fedora_llvm_team_llvm_compat_packages_distname_releasever_basearch]
    baseurl=https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/fedora-$releasever-$basearch

These repositories have been enabled automatically.
# grep llvm-compat /etc/yum.repos.d/*llvm-snapshots*
baseurl=https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/fedora-$releasever-$basearch
@praiskup
Copy link
Member

Thank you for the report!

This needs to be done for the DNF5 API call, too:

repo_url = repo_url.replace("$chroot", chroot)
repo_url = repo_url.replace("$distname", chroot.rsplit("-", 2)[0])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In 3 months
Development

No branches or pull requests

2 participants