linux - 存在于 PKGBUILD for arch linux 的文件系统中(由文件系统拥有)

标签 linux bash archlinux pkgbuild

我正在尝试使用 PKGBUILD 构建我自己的 mariaDB arch linux 包,我有可以轻松安装的二进制文件。我有 bash 脚本(arch linux PKGBUILD),它运行时间并创建 pkg.tar 文件。当我尝试用 pacman 安装它时,我得到了这个:-

%sudo pacman -U mariadb-bin-10.3.7-1-x86_64.pkg.tar                           :(
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) mariadb-bin-10.3.7-1

Total Installed Size:  539.71 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                         [########################################] 100%
(1/1) checking package integrity                                       [########################################] 100%
(1/1) loading package files                                            [########################################] 100%
(1/1) checking for file conflicts                                      [########################################] 100%
error: failed to commit transaction (conflicting files)
mariadb-bin: /usr/lib64 exists in filesystem (owned by filesystem)
mariadb-bin: /usr/sbin exists in filesystem (owned by filesystem)
Errors occurred, no packages were upgraded.

这是我的 PKGBUILD 文件:-

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name <youremail@domain.com>
pkgname='mariadb-bin'
pkgver=10.3.7
pkgrel=1
pkgdesc="MariaDB for arch linux"
arch=('x86_64')
url="http://mirror.truenetwork.ru/mariadb/"
license=('GPL')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=("mariadb=${pkgver}")
conflicts=('mariadb')
replaces=()
backup=('etc/mysql/my.cnf',
        'etc/mysql/wsrep.cnf')
options=()
install=mariadb-bin.install
changelog=
source=()
noextract=()
md5sums=()
validpgpkeys=()

prepare() {
    echo "I am prepare fn";
    pwd
}


build() {
    echo "I am buid fn ";
    pwd
}

check() {
    echo "I am check fn";
    pwd
}

package() {
    echo "I am package fn";
    cp ../usr ${pkgdir} -r
    cp ../etc ${pkgdir} -r
    pwd
    cd ${pkgdir}
    find ${pkgdir}/ -name *.so -exec chmod 777 {} \;
    chmod 755 ${pkgdir}/usr/bin/*
}

我该怎么办?我在 arch 论坛上更了解这个问题套件,但由于我们可以询问 bash 和 shell 脚本,所以 ..

最佳答案

Arch Linux 实现了 UsrMerge2013从那时起,要求 Arch Linux 软件包使用 libdir“/usr/lib”和 sbindir“/usr/bin”。如果不这样做,那么您尝试安装的文件将与磁盘上的符号链接(symbolic link)发生冲突,这是 pacman 不允许的。

您需要在 package() 函数中修复目录位置。

如您所见,这实际上与 bash 脚本无关,而与 pacman 的打包格式和策略的性质有关。 :)

关于linux - 存在于 PKGBUILD for arch linux 的文件系统中(由文件系统拥有),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50743619/

相关文章:

linux - linux下大括号扩展和grep可以一起使用吗

linux - 在bash中获取确切的Linux发行版名称

bash - 如何使用单个命令将目录中的每个文件解压缩到与文件同名的新的唯一目录中

html5 - 如何在qutebrowser中启用HTML5视频?

linux - NodeJS 永远无法在启动时工作

linux - 为从头组装运行三位一体

linux - 如何大写所有文件名

compiler-errors - 与VTK相关的PCL链接器错误

linux - 如何将 "tail -f"压缩为压缩(gzipped)文件?

bash - 如何同步两个本地文件结构