By Wai_Wai on
Hi.
How can I apply a *.diff or *.patch?
Is there any difference when applying *.diff AND *.patch?
I use Windows XP Pro, NOT Linux.
I tried to download Cygwin, but I have no clue what package I should install.
Thanks.
Hi.
How can I apply a *.diff or *.patch?
Is there any difference when applying *.diff AND *.patch?
I use Windows XP Pro, NOT Linux.
I tried to download Cygwin, but I have no clue what package I should install.
Thanks.
Comments
Here
http://drupal.org/diffandpatch
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Thanks although I knew the
Thanks although I knew the existence of this page.
I tried to download Cygwin, but I have no clue what package I should install. The help pages tell nothing about that.
What you are doing has a
What you are doing has a learning curve for Windows folks (I am a Windows folk too) so you will need to experiment and test as not a lot of Windows folks have reported back.
I found these recently.
http://gnuwin32.sourceforge.net/
Go to their packages page
http://gnuwin32.sourceforge.net/packages.html
and download the diff and patch files. (Download some others too, lots of playing stuff there). THey seem to work just like the native *nix tools with the same commands and instructions.
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
I just added the information
I just added the information to the handbook too.
http://drupal.org/node/32635
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Thanks! Very helpful!
Thanks so much.
You are very helpful!
As to the documentation, there're some linking problems.
The article flow is supposed to be:
"Next" linkage
Diff on Windows --> Patching with Cygwin --> Gnuwin32 diff and patch
"Previous" linkage
Diff on Windows <-- Patching with Cygwin <-- Gnuwin32 diff and patch
The article flow is actually:
"Next" linkage
Diff on Windows --> Gnuwin32 diff and patch
"Previous" linkage
Diff on Windows <-- Patching with Cygwin <-- Gnuwin32 diff and patch
Menu is also broken (missing "Patching with Cygwin").
And some rework is preferred to merge similar articles/pages together.
Thanks!
I prefer Cygwin
to wai_wai and sepeck:
I prefer to use Cygwin because it is more "unixish" in my opinion. GnuWin32 has no shell, see http://gnuwin32.sourceforge.net/faq.html#How_do_I_run_shell_scripts
and I needed to run msgmerge in shell (look at http://drupal.org/node/11311 ) and Cygwin did it for me. Use Cygwin search to locate diff http://cygwin.com/cgi-bin2/package-grep.cgi?grep=diff, I think the diffutils package is the right one.
questions regarding Cygwin
Hi.
I have questions regarding Cygwin.
I have opened a new section. See here:
http://drupal.org/node/32627#comment-57452
Thanks.
I have not tried this myself but...
I don't have a web host to try this on but it looks like it would work ok if you know php.
http://www.hivemindz.com/using_php_to_do_diff_and_patch_on_the_server
Thanks!
Thanks!
But I'm confused about its code.
It doesn't tell which are variables (that I need to replace with proper file names)
Here's what I understand, see if I'm correct:
1)
old.txt = name of old file (eg abc.engine)
new.txt = name of new file (eg abc-1.engine)
oldnew.patch = name of the patch (eg abc-update.patch). the extension has to be *.patch
Is it true that it doesn't matter what names I use on these 3 files?
They don't need to follow some naming conventions (eg the names of 3 files have to carry the same name or it will not work properly), right?
2)
oldnew.patch = name of the patch (eg abc-update.patch). the extension has to be *.patch
The strange thing is it seems I don't need to specify which file to patch on. How come it knows which file to patch on?
Does "the name of the patch (ie oldnew.patch)" and "the name of the file I wish to patch on (ie old.txt)" have to be the same?
Thanks.
I believe the patch contains
I believe the patch contains the information on the files that are going to be patched in first two lines. So it should work regardless of the names.
$output is the only variable
$output is the only variable. The rest is hardcoded so you have change it by hand or modify the code to use variables.
So which names do I need to
So which names/codes do I need to change?
What you have in your
What you have in your previous post is the right way. But is not clear by the example how to do this.
Step by step - Put
old.module
in the directory
with
some.patch or some.diff (some patches are have *.diff ext).
When you run the some.patch file then old.module should be overwritten with the new information.
(I find this kind of dangerous becaose things might not work so I always take the patch file and change it so that it outputs a new file or do a new file out put on the command line.)
I get stuck at Cygwin.
I get stuck at Cygwin.
From http://drupal.org/node/23164:
I installed it in C:\Cygwin
I tried to run Cygwin once.
The following message shows:
However I can't see there's any "home" folder nor "user" folder created in my "Cygwin" directory.
The most similar one is "usr" folder.
Anyway my question is:
- where is the default folder (so I can put the original file & the patch there and type the "patch" code)?
Thanks.
I don't use cygwin. The
I don't use cygwin. The school computers do not like it trying to write to the c:/ . Something about how they are configured. I can't get cygwin to sit on the the drive I am allowed to write on.
RTFM
http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html
OK, my answer
1. there is a "home" in my installation; c:\cygwin\home\
2. you can mkdir a "drupal" folder there and use diff, patch ...
3. probably the easiest way is to install and use cygwin with your Windows Administrator account.
I can not use cygwin because
I can not use cygwin because when I applied for the system (windows) account I used a space in my name. The scripts they use are very literal. So the install directory I would be working from is set at that name. I have tried to get this changed but have not had any luck so far.