AUR 中的“*-git date”包怎么了?

AUR 中的“*-git date”包怎么了?

我正准备迁移到 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 存储库中的 vimprobable 的最新版本,我应该使用 AUR 还是自己编译它?

答案1

简而言之:只需构建包,它将是 Git 存储库中的最新版本;这是由 . 自动处理的makepkg

从读取包PKGBUILD的文件-git(例如adonthell git),你可以看到:

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

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

pkgver参数是因为需要在最终包中makepkg提供版本号;PKGBUILD在这里,约会是最有意义的。

如果检测到它是来自 Git 的包,则makepkg相应地处理特殊情况:

makepkg函数的第 1687-1771 行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)

[剪掉了很多其他案例darcshg等等svn...]

makepkg函数的第 1773-1792 行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.:

因此,您最终会得到一个包,其版本号是您构建它的日期。

答案2

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

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

另一方面,如果您想要一个已编译的版本,至少经过了一定程度的测试并发现具有一定的稳定性,那么我会推荐存储库中的包。

相关内容