From owner-freebsd-questions Wed Oct 17 23:10:37 2001 Delivered-To: freebsd-questions@freebsd.org Received: from isy.liu.se (isy.liu.se [130.236.48.10]) by hub.freebsd.org (Postfix) with ESMTP id 02C9E37B401 for ; Wed, 17 Oct 2001 23:10:33 -0700 (PDT) Received: from lagrange.isy.liu.se (lagrange.isy.liu.se [130.236.49.127]) by isy.liu.se (8.11.4/8.11.4) with ESMTP id f9I6ASJ20678; Thu, 18 Oct 2001 08:10:28 +0200 (MET DST) Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011017150223.A373@blossom.cjclark.org> Date: Thu, 18 Oct 2001 08:10:44 +0200 (CEST) From: Micke Josefsson To: cjclark@alum.mit.edu Subject: Re: Recursive diff? How? Cc: freebsd-questions@FreeBSD.ORG Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 17-Oct-2001 Crist J. Clark wrote: > On Wed, Oct 17, 2001 at 10:58:59AM +0200, Micke Josefsson wrote: >> >> On 17-Oct-2001 Crist J. Clark wrote: >> > On Wed, Oct 17, 2001 at 07:57:24AM +0200, Micke Josefsson wrote: >> >> In my attempt to port uClinux development environment to FreeBSD I have >> >> edited >> >> many files down the uClinux source directory. Is there anyway of doing a >> >> recursive diff so that it would also be easy to patch a newly installed >> >> source? >> >> >> >> diff -r seems ok, but when I patch with the result it wants me to specify >> >> the >> >> exact filenames. Is there a better way? CVS? >> > >> > The 'diff -r' should handle this fine. Are you running the 'diff -r' >> > in the same relative location to where you are running the 'patch' >> > command or using the -p option correctly? Are your running the diff(1) >> > command someplace where you have different directory name in between >> > the pwd and the source files than on the machine you run patch(1)? >> >> >> Thanks for bothering with this but I just can't seem to get it right. >> >> Lets get down to cases (I've tried every combination I can think of:). >> >> in my ~/tmp I have two source trees. One original and one modified: >> >> src src.orig >> >> I make a diff as per man page of diff: >> >> diff -crN src.orig src > src.diff >> >> How do I apply that src.diff onto the 'real' original sources at >> /opt/uClinux/src? >> >> A simple 'cd /opt/uClinux; patch < src.diff' wont do it. Nor any combination >> of >> -p[1-7]. >> >> >> >> I have also tried going down into /opt/uClinux/src etc to no avail. > > I would expect if the 'src.orig' and 'src' trees are structured like > '/opt/uClinux/src', that, > > $ cd /opt/uClinux > $ patch < src.diff > > Should work. That is exactly how I read the man-page too. I got it right yesterday after some more experimenting. Apparently the route I described above DID work only I was too confused at the time to notice it:( The original situation arose from doing as in the snippet below. When I made the diff with -crN however it actually did work. I still do not understand why diff -r barfs. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< (> diff -r src.orig src >src.diff) lagrange# cd /opt/uClinux/ lagrange# patch < /home/mj/tmp/TMP/src.diff Hmm... Looks like a normal diff to me... The text leading up to this was: -------------------------- |diff -r src.orig/Makefile src/Makefile -------------------------- File to patch: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< I am terribly sorry to have taken up your time with this. I'll RTFM better next time... /Micke > What does the prompting from patch(1) look like? What does the top of > one of the diff's look like; the first two lines with the pathnames? diff -r src.orig/Makefile src/Makefile 16c16 : : and diff -crN src.orig/Makefile src/Makefile *** src.orig/Makefile Thu Oct 18 07:48:19 2001 --- src/Makefile Thu Oct 18 07:48:40 2001 : : : ---------------------------------- Michael Josefsson, MSEE mj@isy.liu.se This message was sent by XFMail running on FreeBSD 4.4-STABLE ---------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message