在 CentOS 8-stream 中启用源代码下载的正确方法是什么?

在 CentOS 8-stream 中启用源代码下载的正确方法是什么?

所以我尝试这样做:-

yumdownloader --source sendmail

但遇到这个问题:-

Last metadata expiration check: 0:08:48 ago on Wed 16 Dec 2020 10:34:00 AM GMT.
No package sendmail-8.15.2-34.el8.src available.
Exiting due to strict setting.
Error: No package sendmail-8.15.2-34.el8.src available.

所以我确保安装了 epel 等,并且启用了 /etc/yum.repos.d 中的所有内容 - 但没有现有的源信息。

CensOS 文档毫无帮助地说:-

Source RPMs will also be published once the release is done, in the usual location at http://vault.centos.org/centos/8/

From a CentOS machine you can easily retrieve sources using the yumdownloader --source <packagename> command.

他们的定义easily显然不同于

现在;这溪流release 不是“CentOS-Stream-AppStream.repo”中的 /8/ - 它实际上是 /8-stream/ - 果然,我可以找到我的 sendmail 二进制文件http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/sendmail-8.15.2-34.el8.x86_64.rpm- 正如你可以从中看出的cd /etc/dnf/vars;cat `grep . *`那样,它揭示了它们的变量contentdir:centos infra:stock stream:8-stream:( CentOS-Stream-AppStream.repo 基本 URL 是http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/)

然而...

https://vault.centos.org/centos/8-stream/仅包含空文件夹 - 没有 repodata 或源文件,并且 /8/ 树不包含流源... grrr。

我创建了以下文件来启用所有 /8/ 源文件,但sendmail-8.15.2-34.el8.src.rpm不是其中之一:-(

cat CentOS-Stream-Source.repo


[baseos-source]
name=CentOS Stream $releasever - BaseOS - Source
#baseurl=http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/
baseurl=https://vault.centos.org/$contentdir/$releasever/BaseOS/Source
#  /usr/libexec/platform-python -c 'import dnf, json; db = dnf.dnf.Base(); print(json.dumps(db.conf.substitutions, indent=2))' => { "arch": "x86_64", "basearch": "x86_64", "releasever": "8" }
#  See also: cd /etc/dnf/vars;grep . *  =>  contentdir:centos infra:stock stream:8-stream
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

[appstream-source]
name=CentOS Stream $releasever - AppStream - Source
baseurl=https://vault.centos.org/$contentdir/$releasever/AppStream/Source
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

[highavailability-source]
name=CentOS Stream $releasever - HighAvailability - Source
baseurl=https://vault.centos.org/$contentdir/$releasever/HighAvailability/Source
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

[powertools-source]
name=CentOS Stream $releasever - PowerTools - Source
baseurl=https://vault.centos.org/$contentdir/$releasever/PowerTools/Source
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

[centosplus-source]
name=CentOS Stream $releasever - centosplus - Source
baseurl=https://vault.centos.org/$contentdir/$releasever/centosplus/Source
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

[extras-source]
name=CentOS Stream $releasever - extras - Source
baseurl=https://vault.centos.org/$contentdir/$releasever/extras/Source
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

所以,是的,一个很长的问题(抱歉),但是他们在 tarnation 中把那些可怜的源文件藏在哪里 - 有人知道吗? (是的,我在输入之前做了 JFGI...截至撰写本文时有 0 个结果)

答案1

更新:SRPM 现已推出https://vault.centos.org/centos/8-stream/AppStream/Source/SPackages/


SRPM 当前不可用。

根据约翰尼·休斯CentOS 邮件列表(2020 年 12 月 17 日):

我确信 src rpm 将来也将可用,一旦所有硬件和镜像都就位(我们不支持直接从控制所有构建的主 koji 机器下载)。

但在我们的构建系统中,SRPMS 是从 git 的 commitid 中实时构建的。我们不直接使用 srpm,而是从 git 存储库构建。

他提供了以下关于构建您自己的 SRPM 的说明:

如果您想创建 SRPM ..您将:

======= git 克隆https://git.centos.org/rpms/Thermald

热敏CD

git结帐14acf460654c5788d9c7792f36fed45c7e00a387

进入_srpm.sh

=======

然后,您将在 git 存储库的 SRPM 目录中找到 SRPM。它也将被分解并准备好供您在 SPECS 和 SOURCES 中使用以进行更改。

如果您没有下载 git 工具.. into_srpm.sh 的来源,您可以从这里获取:

克隆https://git.centos.org/centos-git-common

相关内容