AUR中的“ * -git date”软件包是怎么回事?


10

我将要移至Arch Linux。在AUR中检出软件包时,有许多遵循“ project-name-git date”命名方案的软件包,例如:

adonthell-git 20100408-1
akonadi-facebook-git 20111117-1
wesnoth-svn 40587-1
vimprobable-git 20110829-1
vimprobable2-git 20111214-1

这些包是什么?它们只是指定时间点的adonthell / wesnoth / etc存储库中的快照吗?如果是这样,则必须在不更改其名称的情况下更新软件包,这会使软件包管理变得非常复杂。

如果我想从git repo中获取最新版本的信息,我应该使用AUR还是自己编译?


1
日期不是软件包名称的一部分,它是版本号(答案中说明了为什么使用日期)。
Wieland

Answers:


9

简而言之:只需构建软件包,它将是git repo的最新版本;这是由自动处理的makepkg

通过阅读软件包PKGBUILD文件-git(例如adonthell-git),您可以看到:

cd $_gitname && git pull origin
msg "The local files are updated."

因此,每次makepkg运行时,它都会从git存储库下载最新版本。

pkgver参数是因为在最终包makepkg中的PKGBUILD和中需要版本号。日期是最有意义的。

如果从git中检测到它是一个包,则相应地makepkg处理特殊情况:

(行1687至1771年makepkg,函数devel_check

elif [[ -n ${_gitroot} && -n ${_gitname} ]] ; then
    if ! type -p git >/dev/null; then
            warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "git" "git"
            return 0
        fi
        msg "$(gettext "Determining latest %s revision...")" 'git'
        newpkgver=$(date +%Y%m%d)

[剪断许多其他案件的darcshgsvn等...]

(行1773至1792年makepkg,函数devel_update

# This is lame, but if we're wanting to use an updated pkgver for
# retrieving svn/cvs/etc sources, we'll update the PKGBUILD with
# the new pkgver and then re-source it. This is the most robust
# method for dealing with PKGBUILDs that use, e.g.:

因此,您最终得到一个软件包,其版本号为构建日期。


谢谢。这是否意味着pacman -Syu不会自动检测到有新版本并再次编译?
2012年

确实,您需要自己检查新版本。但是您可以仅通过重建软件包来对其进行升级。
雷南

2

使用Git日期与使用任何其他形式的版本编号一样有效。

至于如何获取软件包/程序的最新版本,请从git下载并自行编译(如果可能)是获取软件包“最新”版本的最佳方法。

另一方面,如果您想要一个已经至少经过少量测试并且找到适度稳定的已编译版本,那么我建议从存储库中推荐该软件包。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.