diff --git a/mkinitcpio/0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch b/mkinitcpio/0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch new file mode 100644 index 0000000..0514846 --- /dev/null +++ b/mkinitcpio/0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch @@ -0,0 +1,26 @@ +From eabdad3798b43fa5e9aacd0d0395a74154e56434 Mon Sep 17 00:00:00 2001 +From: nl6720 +Date: Thu, 8 Dec 2022 10:51:49 +0200 +Subject: [mkinitcpio] [PATCH 1/1] functions: fix overwriting of symlinks with + regular files + +Use `cp --remove-destination` in `add_file` to remove the destination +file. Without this, if the destination file is an existing symlink, it +will be the link target that will get overwritten, not the symlink. +--- + functions | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/functions b/functions +index 9939e25..3b3de05 100644 +--- a/functions ++++ b/functions +@@ -650,7 +650,7 @@ add_file() { + fi + if [[ -z "$mode" ]]; then + add_dir "${dest%/*}" +- command cp -f --preserve=mode,ownership "$src" "${BUILDROOT}${dest}" ++ command cp --remove-destination --preserve=mode,ownership "$src" "${BUILDROOT}${dest}" + else + command install -Dm"$mode" "$src" "${BUILDROOT}${dest}" + fi diff --git a/mkinitcpio/PKGBUILD b/mkinitcpio/PKGBUILD index 159ee56..d68b722 100644 --- a/mkinitcpio/PKGBUILD +++ b/mkinitcpio/PKGBUILD @@ -7,7 +7,7 @@ pkgname=mkinitcpio pkgver=34 -pkgrel=01 +pkgrel=02 pkgdesc="Modular initramfs image creation utility" #url='https://github.com/archlinux/mkinitcpio' #url='https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio' @@ -29,12 +29,15 @@ provides=("mkinitcpio=$pkgver-$pkgrel" source=("$url/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig} nosystemd.patch # "fix-strip.patch::https://github.com/archlinux/mkinitcpio/commit/dece596d569ca90af902bf2403227b478b629c03.patch" - mkinitcpio.conf) + mkinitcpio.conf + 0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch) prepare() { + patch -Np1 -d "$pkgname-$pkgver" < '0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch' cd "${pkgname}-${pkgver}" # patch -Np1 < "$srcdir/fix-strip.patch" patch -Np1 -i ../nosystemd.patch + } check() { @@ -59,5 +62,7 @@ sha256sums=(181a5915fc4e7db4fcfb38fb5fa022ba5a782f6904d6d6455c6b5a0617109bd0 # c7fd8f38a6d15e73276e8faff9dd1b1356a74dc91a38c8f1c566a359757f864f # mkinitcpio-34.tar.gz.sig c4afeb6b3300c4d50c3f01233705b542f59d6e95a7670f7efde097ea209ef5bd # nosystemd.patch # d5ca05e3f2b338f6ac988461ba9bd60c030e7cb092aecf90b43d5a470e7e3652 # fix-strip.patch - c8ec2debd54233927dd97bd25ef4ac00e1ac850f9b34a3d414e1a66608c36040) # mkinitcpio.conf + c8ec2debd54233927dd97bd25ef4ac00e1ac850f9b34a3d414e1a66608c36040 # mkinitcpio.conf + 82a34a48154c384980aa4e61d49bd447c568d5d60676f27c14a2a12a5ea63b4d) # 0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch + diff --git a/mkinitcpio/PKGBUILD-arch b/mkinitcpio/PKGBUILD-arch index 7c497fd..f61d2f1 100644 --- a/mkinitcpio/PKGBUILD-arch +++ b/mkinitcpio/PKGBUILD-arch @@ -5,7 +5,7 @@ pkgname=mkinitcpio pkgver=34 -pkgrel=1 +pkgrel=2 pkgdesc="Modular initramfs image creation utility" arch=('any') url='https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio' @@ -21,15 +21,22 @@ optdepends=('gzip: Use gzip compression for the initramfs image' 'mkinitcpio-nfs-utils: Support for root filesystem on NFS') provides=('initramfs') backup=('etc/mkinitcpio.conf') -source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig}) +source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig} + '0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch') install=mkinitcpio.install sha512sums=('cf8ab66d4609911ca6a1d2af1bfcf320eed99d29657c0ccfeca2fdc8ea00cfb6575e55645424de13fcf37aa12a39ac7b43a330c716e73e9c16a75178738ebe70' - 'SKIP') + 'SKIP' + 'a43e66101edc301ae893a25eee6caa83c56a790cbac1685697fb999008c8210e46ca49e0700242f8321731264084462641285954db55d3daa2c7e8b62d1cc66c') b2sums=('06a6c6a0951b9b6161e2db01e2956d87da303b2ec029bdd183efed3b074b176a9f107e9a723fc6a7fa157ecd703d7627d8aaa0b9290022a09e30daa46784841c' - 'SKIP') + 'SKIP' + 'a2ed9e8ff4b6fab1d6f6c1dae4dcf890b4434cb31ebdfe73ea54fd4af499849e2b98e565915cc331bd97f15f21d9147ee0499cf75b516562bfd7f1793e838e99') validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini 'C100346676634E80C940FB9E9C02FF419FECBE16') # Morten Linderud +prepare() { + patch -Np1 -d "$pkgname-$pkgver" < '0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch' +} + check() { make -C "$pkgname-$pkgver" check } diff --git a/mkinitcpio/deps b/mkinitcpio/deps index 5c13d9f..bbe7912 100644 --- a/mkinitcpio/deps +++ b/mkinitcpio/deps @@ -4,3 +4,4 @@ bash-bats bash-bats-assert lzop +