LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2016, 07:10 AM   #1
jrich
LQ Newbie
 
Registered: Jul 2016
Posts: 5

Rep: Reputation: Disabled
Question Newbie - SlackBuilds: how to apply 'diff' files...


I guess the 'diff' files in some SlackBuilds (for example, blas) (and located on different websites) are meant to somehow 'patch' the project. I've read thru the manpage for 'patch' several times without really understanding it.
Surely there is some standard, simple way to apply a 'diff' file to a particular SlackBuild for which it was designed. After looking around for a while, I've not found such information, and would be most grateful for any help with doing this.
Thanks in advance, jrc
Using Slack 14.2 64-bit with Alien multilib on Dell XPS-410
 
Old 08-01-2016, 07:22 AM   #2
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
You don't have to do anything. Whenever there's a patch included in a SlackBuild, the SlackBuild script does all that for you. Just run the SlackBuild. In the case of blas, it happens here:

Code:
# Fix lots of bugs with the cmake build system and .pc files.
# More importantly, allow building only the BLAS component.
patch -p1 < $CWD/patches/generate-pkgconfig.diff
patch -p1 < $CWD/patches/link-dependencies.diff
patch -p1 < $CWD/patches/target-cleanup.diff
patch -p1 < $CWD/patches/cmake-piecewise.diff
But to answer the question you asked, imagine you have two files. To see the differences between an original file and a new modified version, you use the diff command. Ok so far? You can save the output of the diff command in a file. The patch command performs the reverse process: by reading the file containing the output of the diff command, and a copy of the original file, it outputs a copy of the new modified version.
 
2 members found this post helpful.
Old 08-01-2016, 09:27 AM   #3
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
If the diff is very simple (just added, deleted or edited lines) I do this way
patch old-file <(diff old-file new-file)

For more complex diff, like files in /etc that slackpkg update with .new files,
I run kompare to apply one by one.
 
2 members found this post helpful.
Old 08-01-2016, 09:36 AM   #4
jrich
LQ Newbie
 
Registered: Jul 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks people. Very helpful, both with specific problem and
for general use. - jrc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[REQ] Apply patch(diff) with resources & Compile FriedChicken Linux - Mobile 2 07-14-2012 04:27 AM
not able to apply patch using .diff , reqd for wbar installation!!! harry2006 Linux - Newbie 2 09-18-2008 12:47 AM
How do you apply a diff patch? Thaidog Linux - General 1 02-14-2007 10:15 PM
Apply diff to a file powah Linux - Newbie 1 03-07-2006 02:00 PM
.diff files. How do I apply them? tardigrade Linux - Software 1 08-14-2005 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration