Talk:Patching packages

From ArchWiki
Latest comment: 18 April by Lahwaacz in topic Wrong patching command?

Wrong patching command?

My recent small change to fix the patching command when used without previous cd was removed. I still think this is incorrect, and the issue comes from some time ago when $srcdir was removed from that command. As it is at the moment, the patch is not found because the directory is changed. So the correct way is to use either ../eject.patch or < eject.patch. To test this, for example, use the current PKGBUILD for Dolphin:

prepare() {
  patch -d $pkgname-$pkgver -p1 < a07f2422.patch # This works
  patch -d $pkgname-$pkgver -p1 -i a07f2422.patch # This does not work
  patch -d $pkgname-$pkgver -p1 -i "$srcdir"/a07f2422.patch # This works
  patch -d $pkgname-$pkgver -p1 -i ../a07f2422.patch # This works
}

Iyanmv (talk) 22:41, 17 April 2024 (UTC)Reply[reply]

Oh, I was wrong. Thanks! — Lahwaacz (talk) 05:49, 18 April 2024 (UTC)Reply[reply]