是否有一种简单的方法来检索构建给定/usr/bin/*
命令的源文件(也意味着通过 AUR 放置在那里的源文件)?我是否可以通过一个pacman
包装器发出一个命令来为我检索这些文件,或者我是否必须通过谷歌搜索到 git 页面或维护者页面?
根据这问题,我正在寻找类似于apt-get source
基于 debian 的发行版的命令。同样,根据这问题,asp
(以前abs
)具有核心包的此功能的基础asp export
,但不扩展到从 AUR 构建的那些。
我想开始为社区做出贡献,简化检查 AUR 源文件的过程将大有帮助,帮助我选择适合我的技能水平和专业知识的软件包,因为我之前可能会这样做数十次甚至数百次找到一个既需要我的帮助又我有兴趣/有能力提供帮助的软件包。
答案1
您正在寻找拱门构建系统:
Arch 构建系统是一个类似端口的系统,用于从源代码构建和打包软件。虽然 pacman 是用于二进制包管理(包括使用 ABS 构建的包)的专用 Arch 工具,但 ABS 是用于将源代码编译为可安装的 .pkg.tar.xz 包的工具集合。
正如您所注意到的,这仅适用于官方存储库中的软件包。对于 AUR 中的包,不需要特定的工具,因为 AUR 不托管二进制文件,因此您只需获取必要的构建文件 ( git clone
),然后在使用 构建之前检查或修改 PKGBUILD makepkg
。
答案2
~ $ pacman -Qi $(pacman -Qoq $(which ssh-add))
Name : openssh
Version : 8.9p1-1
Description : Premier connectivity tool for remote login with the SSH protocol
Architecture : x86_64
URL : https://www.openssh.com/portable.html
Licenses : custom:BSD
Groups : None
Provides : None
Depends On : glibc krb5 openssl libedit ldns libxcrypt libcrypt.so=2-64 zlib pam
Optional Deps : xorg-xauth: X11 forwarding [installed]
x11-ssh-askpass: input passphrase in X [installed]
libfido2: FIDO/U2F support
Required By : gcr gnome-keyring openmpi
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 4.18 MiB
Packager : Giancarlo Razzolini <[email protected]>
Build Date : Wed 23 Feb 2022 18:48:29 GMT
Install Date : Sun 27 Feb 2022 18:14:02 GMT
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature
从man pacman
:
OPERATIONS
[...]
-Q, --query
Query the package database. This operation
allows you to view installed packages and
their files, as well as meta-information about
individual packages (dependencies, conflicts,
install date, build date, size). This can be
run against the local package database or can
be used on individual package files. In the
first case, if no package names are provided
in the command line, all installed packages
will be queried. Additionally, various filters
can be applied on the package list. See Query
Options below.
[...]
QUERY OPTIONS (APPLY TO -Q)
[...]
-i, --info
Display information on a given package. The -p
option can be used if querying a package file
instead of the local database. Passing two
--info or -i flags will also display the list
of backup files and their modification states.
[...]
-o, --owns <file>
Search for packages that own the specified
file(s). The path can be relative or absolute,
and one or more files can be specified.
[...]
-q, --quiet
Show less information for certain query
operations. This is useful when pacman’s
output is processed in a script. Search will
only show package names and not version,
group, and description information; owns will
only show package names instead of "file is
owned by pkg" messages; group will only show
package names and omit group names; list will
only show files and omit package names; check
will only show pairs of package names and
missing files; a bare query will only show
package names rather than names and versions.