我是 Arch Linux 的新手,只是想通过为 Gnome Tweak Tool 安装 gnome-shell-extension-user-theme 来为我的 Gnome Shell 主题化。但是,当我尝试从 AUR 构建 gnome-shell-extension-common-git 时,我不断收到错误。版本号包含连字符,但如果我编辑 PKGBUILD,它就会被重新写入。
我跑:
yaourt gnome-shell-extension-common-git
查看PKGBUILD的内容:
# Maintainer: Alucryd <alucryd at gmail dot com>
# Contributor: Sebastian Lenz <[email protected]>
pkgname=gnome-shell-extension-common-git
pkgver=3.8.1.7
pkgrel=1
pkgdesc="Common files for the GNOME Shell Extensions"
arch=('any')
url="http://live.gnome.org/GnomeShell/Extensions"
license=('GPL' 'LGPL')
depends=('gnome-shell')
makedepends=('git' 'gnome-common' 'intltool')
provides=('gnome-shell-extension-common')
conflicts=('gnome-shell-extension-git' 'gnome-shell-extension-common')
source=('git+http://git.gnome.org/browse/gnome-shell-extensions#branch=gnome-3-8')
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}"/gnome-shell-extensions
git describe | sed 's|\(.*-.*\)-.*|\1|;s|-|.|'
}
build() {
cd "${srcdir}"/gnome-shell-extensions
./autogen.sh --prefix=/usr --disable-schemas-compile --enable-extensions=""
make
}
package() {
cd "${srcdir}"/gnome-shell-extensions
make DESTDIR="${pkgdir}" install
}
# vim: ts=2 sw=2 et:
构建时出现错误:
==> Starting pkgver()...
==> Updated version: gnome-shell-extension-common-git 3.8.3.1.real-2-1
==> ERROR: pkgver is not allowed to contain colons, hyphens or whitespace.
==> ERROR: Makepkg was unable to build gnome-shell-extension-common-git.
==> Restart building gnome-shell-extension-common-git ? [y/N]
PKGBUILD 的新内容:
# Maintainer: Alucryd <alucryd at gmail dot com>
# Contributor: Sebastian Lenz <[email protected]>
pkgname=gnome-shell-extension-common-git
pkgver=3.8.3.1.real-2
pkgrel=1
pkgdesc="Common files for the GNOME Shell Extensions"
arch=('any')
url="http://live.gnome.org/GnomeShell/Extensions"
license=('GPL' 'LGPL')
depends=('gnome-shell')
makedepends=('git' 'gnome-common' 'intltool')
provides=('gnome-shell-extension-common')
conflicts=('gnome-shell-extension-git' 'gnome-shell-extension-common')
source=('git+http://git.gnome.org/browse/gnome-shell-extensions#branch=gnome-3-8')
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}"/gnome-shell-extensions
git describe | sed 's|\(.*-.*\)-.*|\1|;s|-|.|'
}
build() {
cd "${srcdir}"/gnome-shell-extensions
./autogen.sh --prefix=/usr --disable-schemas-compile --enable-extensions=""
make
}
package() {
cd "${srcdir}"/gnome-shell-extensions
make DESTDIR="${pkgdir}" install
}
# vim: ts=2 sw=2 et:
如果我编辑文件以删除连字符,那么它没有什么区别,因为当我尝试再次构建时它会再次添加。
答案1
改变
git describe | sed 's|\(.*-.*\)-.*|\1|;s|-|.|'
到
git describe | sed 's|\(.*-.*\)-.*|\1|;s|-|.|g'
软件包版本最初有一个连字符。您正在构建的版本有两个连字符。(替换)命令末尾的 导致替换g
多个匹配项,而不是仅替换一个匹配项。s
sed