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.

Reply via email to