patch worked with the output of diff -rubN. It patched all the files in
that diff in one go.  Changing a local copy to be what is desired is also
key.

Do not use dos2unix on the diff file, that will result in errors.  I had to
add -b because someone else trimmed trailing spaces on the web pages when
they did some mass changes (but had used an old version of the files to
begin with, not all changes were correct but most were... So I've got to
clean up the mess.).

I've got to verify a lot more code diffs are as desired in the next couple
of days, but thanks to y'all I know how to get it done.  Thanks!

On Tue, Sep 22, 2015 at 11:46 PM, Dagmar d'Surreal <[email protected]>
wrote:

> When in doubt, do like the kernel devs do. ` diff -urN olddir newdir` and
> feel free to have your directory names include version numbers, even if
> they have to end in "-patched" or something.  This just plain makes it
> easier for other people to apply the patches you made.
>
> On Tue, Sep 22, 2015 at 6:49 PM, Paul Boniol <[email protected]>
> wrote:
>
>> Did a small test with having run dos2unix on the diff file.  diff reports
>>
>> Hunk #1 FAILED at 35 (different line endings).
>> 1 out of 1 hunk FAILED -- saving rejects to file filename.rej
>>
>> I was thinking "well we could just mount the share with conv=text" but it
>> appears that option isn't available to mount.cifs.
>>
>> On Tue, Sep 22, 2015 at 3:33 PM, Paul Boniol <[email protected]>
>> wrote:
>>
>>> P.S.  I got the file from yesterday processed, one file at a time, that
>>> was using the default output of diff.  I'm working on the diff -rbuN output
>>> now.
>>>
>>> On Tue, Sep 22, 2015 at 3:23 PM, Paul Boniol <[email protected]>
>>> wrote:
>>>
>>>> If I remove the ^M with dos2unix from the diff file... when I do
>>>> patch... is patch smart enough to know to use the DOS line endings?  (Too
>>>> many source files to do dos2unix on every text file, and that's assuming I
>>>> could correctly identify just the text files.)
>>>>
>>>> On Tue, Sep 22, 2015 at 2:47 PM, Alex Smith (K4RNT) <
>>>> [email protected]> wrote:
>>>>
>>>>> Use "dos2unix" to remove the ^M line feeds.
>>>>>
>>>>> -Alex
>>>>>
>>>>> " 'With the first link, the chain is forged. The first speech
>>>>> censured, the first thought forbidden, the first freedom denied, chains us
>>>>> all irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom
>>>>> and warning... The first time any man's freedom is trodden on, we’re all
>>>>> damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG
>>>>> episode "The Drumhead"
>>>>> - Alex Smith
>>>>> - Kent, Washington (metropolitan Seattle area)
>>>>>
>>>>> On Tue, Sep 22, 2015 at 10:16 AM, Paul Boniol <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Yes, there are ^M at the end of the lines of code in the diff.
>>>>>>
>>>>>> I got the existing diff applied, one file at a time last night.
>>>>>> Proceeding with the recommended modified local copy, and recommended diff
>>>>>> format for the next steps.
>>>>>>
>>>>>> Thank you!
>>>>>>
>>>>>> On Tue, Sep 22, 2015 at 8:54 AM, Robert Wohlfarth <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Random thought... I see the source files are under /mnt. If these
>>>>>>> are mounted from a Windows shared drive, you may run into problems with
>>>>>>> line endings (CR/LF instead of CR).
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Sep 21, 2015 at 10:27 PM Paul Boniol <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> cd / && patch -n -p0 </home/paul/mydifffile.txt
>>>>>>>>
>>>>>>>> Said it couldn't find the file and prompted for it.  I specified
>>>>>>>> the full file path.  It changed the first file (of many in the diff 
>>>>>>>> file)
>>>>>>>> and stopped...
>>>>>>>>
>>>>>>>> On Mon, Sep 21, 2015 at 10:00 PM, Paul Boniol <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> I tried
>>>>>>>>> patch -p0 </home/paul/mydifffile.txt   through
>>>>>>>>> patch -p6 </home/paul/mydifffile.txt
>>>>>>>>>
>>>>>>>>> By the documentation for the p option and the cwd in this attempt,
>>>>>>>>> it should work with -p3.  All seven reported "patch: **** Only 
>>>>>>>>> garbage was
>>>>>>>>> found in the patch input."...
>>>>>>>>>
>>>>>>>>> (The paths in the diff file are full paths, and start with a /.)
>>>>>>>>>
>>>>>>>>> On Mon, Sep 21, 2015 at 8:14 PM, Tilghman Lesher <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> You probably need "patch -p3 </path/to/patch".  Essentially what
>>>>>>>>>> you're doing here is removing preceding slashes from the pathname
>>>>>>>>>> of
>>>>>>>>>> each file.  So, for example, if your path was
>>>>>>>>>>
>>>>>>>>>> /path/to/some/directory/file.txt
>>>>>>>>>>
>>>>>>>>>> -p0:  /path/to/some/directory/file.txt
>>>>>>>>>> -p1:  path/to/some/directory/file.txt
>>>>>>>>>> -p2:  to/some/directory/file.txt
>>>>>>>>>> -p3:  some/directory/file.txt
>>>>>>>>>> -p4:  directory/file.txt
>>>>>>>>>> -p5:  file.txt
>>>>>>>>>>
>>>>>>>>>> Remove the number of directories necessary to get a pathname
>>>>>>>>>> relative
>>>>>>>>>> to your current directory.
>>>>>>>>>>
>>>>>>>>>> In the future, I would highly recommend unified patch format:
>>>>>>>>>> (diff
>>>>>>>>>> -uNr <dir1> <dir2>), as the context provided can allow for a
>>>>>>>>>> degree of
>>>>>>>>>> fuzzy matching.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Sep 21, 2015 at 7:53 PM, Paul Boniol <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>> > On 1.  Thanks, but there are lots of changes on both sides of
>>>>>>>>>> the diff input
>>>>>>>>>> > directories.  Some changes are desired on each side. I might be
>>>>>>>>>> able to copy
>>>>>>>>>> > and then mass change the source directory.... Hm.... There are
>>>>>>>>>> possibilities
>>>>>>>>>> > here for the next part.  It would reduce the amount of crud I
>>>>>>>>>> have to look
>>>>>>>>>> > through.  Thanks for the suggestion on the next part of what I
>>>>>>>>>> need to do!
>>>>>>>>>> > (If absolutely necessary, it would cut down on time spend
>>>>>>>>>> redoing what I
>>>>>>>>>> > did.)
>>>>>>>>>> >
>>>>>>>>>> > On 2.  The full paths are specified in the existing diff
>>>>>>>>>> output.  I want to
>>>>>>>>>> > update the file specified first.
>>>>>>>>>> >
>>>>>>>>>> > Here is a sample format of what I've got, spent a lot of time
>>>>>>>>>> on it already,
>>>>>>>>>> > rather not have to redo...
>>>>>>>>>> >
>>>>>>>>>> > diff -r /mnt/files-to-update-dir/file.pl
>>>>>>>>>> > /mnt/files-with-desired-changes/file.pl
>>>>>>>>>> > 6c6
>>>>>>>>>> > < use lib "/mnt/my-old-lib-dir;";
>>>>>>>>>> > ---
>>>>>>>>>> >> use lib "/mnt/my-new-lib-dir";
>>>>>>>>>> >
>>>>>>>>>> > There are more involved changes, but that is the basic format I
>>>>>>>>>> have 531
>>>>>>>>>> > lines in now.  (I must say, I like looking at this diff format
>>>>>>>>>> rather than
>>>>>>>>>> > what patch appears to like.)
>>>>>>>>>> >
>>>>>>>>>> > Paul
>>>>>>>>>> >
>>>>>>>>>> > On Mon, Sep 21, 2015 at 7:34 PM, Csaba Toth <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>> >>
>>>>>>>>>> >> 1. Try changing the situation so the generated file will be
>>>>>>>>>> right away
>>>>>>>>>> >> what you want rather than editing.
>>>>>>>>>> >> Patch file is not a rocket science though, so there's a chance
>>>>>>>>>> you can
>>>>>>>>>> >> edit it nicely.
>>>>>>>>>> >> 2. Always take care the directory level when you apply the
>>>>>>>>>> patch vs the
>>>>>>>>>> >> level at the generation of the patch.
>>>>>>>>>> >> Also take a look at patch, which is a wrapper over diff.
>>>>>>>>>> >>
>>>>>>>>>> >>
>>>>>>>>>> >> On Mon, Sep 21, 2015 at 5:26 PM, Paul Boniol <
>>>>>>>>>> [email protected]>
>>>>>>>>>> >> wrote:
>>>>>>>>>> >>>
>>>>>>>>>> >>> I rarely need to do a diff/patch.. but now I do.  I should
>>>>>>>>>> have Googled
>>>>>>>>>> >>> first or tried a small amount...
>>>>>>>>>> >>>
>>>>>>>>>> >>> If I did
>>>>>>>>>> >>> diff -r   old-file-dir   new-file-dir > mydiff
>>>>>>>>>> >>>
>>>>>>>>>> >>> Edited mydiff to only contain just changes I want applied to
>>>>>>>>>> old-file-dir
>>>>>>>>>> >>> files.  Is there any hope of using patch to apply the
>>>>>>>>>> differences?
>>>>>>>>>> >>>
>>>>>>>>>> >>> Patch says "Only garbage was found in the patch input.".
>>>>>>>>>> >>>
>>>>>>>>>> >>> I now see I should have added more flags to the diff... but
>>>>>>>>>> after a few
>>>>>>>>>> >>> hours of working to get just the changes I want.
>>>>>>>>>> >>>
>>>>>>>>>> >>> Thank you!
>>>>>>>>>> >>>
>>>>>>>>>> >>> --
>>>>>>>>>> >>> --
>>>>>>>>>> >>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups
>>>>>>>>>> >>> "NLUG" group.
>>>>>>>>>> >>> To post to this group, send email to
>>>>>>>>>> [email protected]
>>>>>>>>>> >>> To unsubscribe from this group, send email to
>>>>>>>>>> >>> [email protected]
>>>>>>>>>> >>> For more options, visit this group at
>>>>>>>>>> >>> http://groups.google.com/group/nlug-talk?hl=en
>>>>>>>>>> >>>
>>>>>>>>>> >>> ---
>>>>>>>>>> >>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups
>>>>>>>>>> >>> "NLUG" group.
>>>>>>>>>> >>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>> it, send an
>>>>>>>>>> >>> email to [email protected].
>>>>>>>>>> >>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>> >>
>>>>>>>>>> >>
>>>>>>>>>> >> --
>>>>>>>>>> >> --
>>>>>>>>>> >> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups
>>>>>>>>>> >> "NLUG" group.
>>>>>>>>>> >> To post to this group, send email to
>>>>>>>>>> [email protected]
>>>>>>>>>> >> To unsubscribe from this group, send email to
>>>>>>>>>> >> [email protected]
>>>>>>>>>> >> For more options, visit this group at
>>>>>>>>>> >> http://groups.google.com/group/nlug-talk?hl=en
>>>>>>>>>> >>
>>>>>>>>>> >> ---
>>>>>>>>>> >> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups
>>>>>>>>>> >> "NLUG" group.
>>>>>>>>>> >> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>> it, send an
>>>>>>>>>> >> email to [email protected].
>>>>>>>>>> >> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>> >
>>>>>>>>>> >
>>>>>>>>>> > --
>>>>>>>>>> > --
>>>>>>>>>> > You received this message because you are subscribed to the
>>>>>>>>>> Google Groups
>>>>>>>>>> > "NLUG" group.
>>>>>>>>>> > To post to this group, send email to [email protected]
>>>>>>>>>> > To unsubscribe from this group, send email to
>>>>>>>>>> > [email protected]
>>>>>>>>>> > For more options, visit this group at
>>>>>>>>>> > http://groups.google.com/group/nlug-talk?hl=en
>>>>>>>>>> >
>>>>>>>>>> > ---
>>>>>>>>>> > You received this message because you are subscribed to the
>>>>>>>>>> Google Groups
>>>>>>>>>> > "NLUG" group.
>>>>>>>>>> > To unsubscribe from this group and stop receiving emails from
>>>>>>>>>> it, send an
>>>>>>>>>> > email to [email protected].
>>>>>>>>>> > For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Tilghman
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> --
>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups "NLUG" group.
>>>>>>>>>> To post to this group, send email to [email protected]
>>>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>>>> [email protected]
>>>>>>>>>> For more options, visit this group at
>>>>>>>>>> http://groups.google.com/group/nlug-talk?hl=en
>>>>>>>>>>
>>>>>>>>>> ---
>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups "NLUG" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send an email to [email protected].
>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "NLUG" group.
>>>>>>>> To post to this group, send email to [email protected]
>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>> [email protected]
>>>>>>>> For more options, visit this group at
>>>>>>>> http://groups.google.com/group/nlug-talk?hl=en
>>>>>>>>
>>>>>>>> ---
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "NLUG" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to [email protected].
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>> --
>>>>>>> Robert Wohlfarth
>>>>>>>
>>>>>>> --
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "NLUG" group.
>>>>>>> To post to this group, send email to [email protected]
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> [email protected]
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/nlug-talk?hl=en
>>>>>>>
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "NLUG" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "NLUG" group.
>>>>>> To post to this group, send email to [email protected]
>>>>>> To unsubscribe from this group, send email to
>>>>>> [email protected]
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/nlug-talk?hl=en
>>>>>>
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "NLUG" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "NLUG" group.
>>>>> To post to this group, send email to [email protected]
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected]
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/nlug-talk?hl=en
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "NLUG" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>
>> --
>> --
>> You received this message because you are subscribed to the Google Groups
>> "NLUG" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nlug-talk?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "NLUG" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Sent from an actual computer.
>
> --
> --
> You received this message because you are subscribed to the Google Groups
> "NLUG" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nlug-talk?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "NLUG" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to