Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2005 00:24:45 -0600
From:      "Paul Schmehl" <pauls@utdallas.edu>
To:        <freebsd-ports@freebsd.org>
Subject:   patching?
Message-ID:  <006201c51582$980f04a0$7702a8c0@officeeagle>
References:  <20050217190549.72c4eb4d@dolphin.local.net><Pine.LNX.4.44.0502171919060.26199-100000@pancho><20050218040730.0bb5933c@it.buh.tecnik93.com><1108693479.663.0.camel@dirk.no.domain><20050218043736.4b34779b@it.buh.tecnik93.com><1108694497.663.3.camel@dirk.no.domain> <20050218045729.64f42437@it.buh.tecnik93.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I hope you guys aren't getting tired of my questions, but the porters 
handbook and googling the lists isn't helping.

I'm trying to patch some files in a new port I'm working on, but the patches 
fail.  The patches are in ${FILEDIR}.  They were created in {$WRKSRC} with 
the original file renamed file.orig.

Even though I've run make distclean, the patches fail.  The error message 
says they been "previously applied"??  This port does not build.  (I'm using 
NO_BUILD=  yes in the Makefile), because there are no files to compile. 
It's written in tcl, and all the files in the distro are text files.

Here's what I get when I make install.

 make install
===>  Extracting for sguil-server-0.5.3
=> Checksum OK for sguil-server-0.5.3.tar.gz.
===>  Patching for sguil-server-0.5.3
===>  Applying FreeBSD patches for sguil-server-0.5.3
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to server/archive_sguildb.tcl.rej
=> Patch patch-archive_sguildb.tcl failed to apply cleanly.
*** Error code 1

Stop in /usr/ports/security/sguil-server.

This happens even after a make distclean.

I'm trying to patch two files to change tclsh to tclsh8.4, because the 
program won't even run without that, and the user shouldn't have to edit 
those files manually.  I'm also trying to patch the conf file to change some 
paths to FreeBSD paths from Linux paths.

I have tried creating patches uisng -u, -ar, -uar, -Naur, -r, -a.  None has 
worked.  I've looked at patches in other ports and read the Makefiles and 
bsd.port.mk to no avail.  I'm sure it's something very simple, but for the 
life of me, I can't figure it out.

I even added PATCH_DEBUG=   yes to see if I could see what was wrong. 
*Then* the patches applied just fine, but *after* prompting me to use -R.

make
===>  Patching for sguil-server-0.5.3
===>  Applying FreeBSD patches for sguil-server-0.5.3
===>   Applying FreeBSD patch 
/usr/ports/security/sguil-server/files/patch-archive_sguildb.tcl
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- server/archive_sguildb.tcl Thu Feb 17 23:14:14 2005
|+++ server/archive_sguildb.tcl.orig    Mon Dec  6 12:27:55 2004
--------------------------
Patching file server/archive_sguildb.tcl using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 1.
done
===>   Applying FreeBSD patch 
/usr/ports/security/sguil-server/files/patch-sguild
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- server/sguild      Thu Feb 17 23:14:16 2005
|+++ server/sguild.orig Mon Nov 22 16:42:40 2004
--------------------------
Patching file server/sguild using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 1.
done
===>   Applying FreeBSD patch 
/usr/ports/security/sguil-server/files/patch-sguild.conf
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- server/sguild.conf Thu Feb 17 23:14:17 2005
|+++ server/sguild.conf.orig    Mon Nov 22 17:53:57 2004
--------------------------
Patching file server/sguild.conf using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 1 with fuzz 1.
Hunk #2 succeeded at 9.
Hunk #3 succeeded at 60.
Hunk #4 succeeded at 71.
done
===>  Configuring for sguil-server-0.5.3

So, I tried using PATCH_ARGS+=  -R in the Makefile, but that failed.

I even edited the patch files to remove the RCS lines from the patch, but 
that didn't change anything.

I'm just about willing to get some chicken entrails, if that will help, but 
this port ain't gonna work unless the patches apply cleanly, so I'm stuck. 
What the heck is the secret to patching files when you don't have to compile 
a binary?

Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/~pauls/ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?006201c51582$980f04a0$7702a8c0>