Article 546FV Need a little Slackbuilds training Re: maintaining patches

Need a little Slackbuilds training Re: maintaining patches

by
thethinker
from LinuxQuestions.org on (#546FV)
I am working on learning how to maintain Slackbuilds packages, and I'm having trouble dealing with patches. I think I understand the basic functionality of diff and patch, but they don't seem to be behaving how I expect.

So sagemath just got updated from 9.0 to 9.1. So I download the current SB, get the new source, change the version number in the Slackbuilds, and when I run it I got an error, apparently a file that is getting patched got a name change.

The patch in question is this:

Code:--- build/pkgs/pynac/spkg-install.orig 2014-08-11 20:52:14.220516400 +0700
+++ build/pkgs/pynac/spkg-install 2014-08-11 20:52:27.906551659 +0700
@@ -31,6 +31,7 @@

build_pynac()
{
+ chmod -R g-w ${PYNACDIR}
cd ${PYNACDIR}
PKG_CONFIG_PATH=${SAGE_LOCAL}/lib/pkgconfig; export PKG_CONFIG_PATH
./configure --disable-static --prefix=${SAGE_LOCAL} --libdir="$SAGE_LOCAL/l
ib"But unzipping the source shows the name change:

Code:$ ls build/pkgs/pynac/
SPKG.txt dependencies spkg-install.in
checksums.ini package-version.txt typeSo here's my attempted fix. Add the change ("add the line chmod.....") to a new file spkg-install-new.in. Then get the diff:

Code:diff -u build/pkgs/pynac/spkg-install.in build/pkgs/pynac/spkg-install-new.in > pynac.patch
$ more pynac.patch
--- build/pkgs/pynac/spkg-install.in 2020-05-20 18:33:41.000000000 -0400
+++ build/pkgs/pynac/spkg-install-new.in 2020-06-01 18:11:44.231568081 -0
400
@@ -9,6 +9,7 @@

build_pynac()
{
+ chmod -R g-w ${PYNACDIR}
cd ${PYNACDIR}
PKG_CONFIG_PATH=${SAGE_LOCAL}/lib/pkgconfig; export PKG_CONFIG_PATH
sdh_configure --disable-static --with-giac=no PYTHON=sage-python23
Then take that new patch and replace the old patch in the SB. However, when I run the Slackbuild, I get

Code:patching file build/pkgs/pynac/spkg-install.in
patching file configure
Reversed (or previously applied) patch detected! Assume -R? [n]But I didn't apply the patch to the tarred sourceball yet, so I don't really understand why the script thinks I have. Do I need to more literally follow the naming scheme used by the original author (rename to .orig before editing)? Or am I just totally borking how this is supposed to work?

BTW, the patch is being applied like

Code:patch -p0 < $CWD/pynac.patchin the SB script.latest?d=yIl2AUoC8zA latest?i=ZAQtLjMOxO8:QyF2d1JGm_s:F7zBnMy latest?i=ZAQtLjMOxO8:QyF2d1JGm_s:V_sGLiP latest?d=qj6IDK7rITs latest?i=ZAQtLjMOxO8:QyF2d1JGm_s:gIN9vFwZAQtLjMOxO8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments