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

时间:2018-06-07 14:20:09

标签: linux bash archlinux pkgbuild

我正在尝试用PKGBUILD构建我自己的mariaDB arch linux软件包我有可以安装的binries。我有bash脚本(arch linux PKGBUILD),它运行fime并创建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脚本,所以.. ..

1 个答案:

答案 0 :(得分:3)

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

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

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