LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-13-2006, 11:20 PM   #1
judgex
LQ Newbie
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 4 and Cygwin
Posts: 14

Rep: Reputation: 0
Modifying a patchfile


Someone used

diff -Naur olddir newdir

and gave me a patchfile. I want to modify the patchfile to prevent certain changes from being applied. What is the best way to do that?
 
Old 10-14-2006, 12:13 AM   #2
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
patch files are written pretty plainly im not sure I understand the question. You could just comment out the fields that dont apply. maybe this link will be helpfull http://www.cpqlinux.com/patch.html
 
Old 10-14-2006, 12:25 AM   #3
judgex
LQ Newbie
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 4 and Cygwin
Posts: 14

Original Poster
Rep: Reputation: 0
What character starts a comment in a patchfile? Does it use '#'?

Last edited by judgex; 10-14-2006 at 12:26 AM.
 
Old 10-14-2006, 12:30 AM   #4
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Ahh further inspection of diff and patch yeilds not comment charecter so just remove the lines.

man diff
man patch

good places to start




of course if this doesnt help my neibors dog says that he cant help anymore cause hes gotta help charlie
 
Old 10-14-2006, 12:47 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The patch mechanism is pretty robust, but if I was to be doing significant changes (say removing entire hunks, and deleting only some of others), I'd be inclined to create a test directory structure.
Hit that with the patch, then edit "in place". Create a new (customized) patch from that (against the original target source), and then use that new patch.
Less angst all round I would have thought.

Minor changes can be done in the (shipped) patchfile.
 
Old 10-14-2006, 01:21 AM   #6
judgex
LQ Newbie
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 4 and Cygwin
Posts: 14

Original Poster
Rep: Reputation: 0
Exvor. When I remove lines from the patchfile the patch stops working and patch emits errors. Here is one of them:

patch: **** malformed patch at line 20: @@ -132,6 +130,7 @@

Syg00. There are too many files that need to be changed after the patch is applied.

Last edited by judgex; 10-14-2006 at 01:31 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Modifying Kweather zmaster Linux - Software 4 06-29-2005 12:40 PM
modifying the installer soybean pete Slackware - Installation 2 06-15-2005 04:30 PM
Help modifying FSTAB LinuxCrusader Linux - General 3 12-27-2004 01:26 AM
Modifying Desktop ElementNine Linux - General 1 10-09-2003 04:20 AM
Modifying afterstep naima Programming 0 11-02-2001 08:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:58 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