Author Topic: How to use the patch  (Read 5136 times)

Offline Schmatze

  • Jr. Member
  • **
  • Posts: 31
How to use the patch
« on: October 06, 2010, 02:26:25 PM »
Sry, for me its the first time to use a diff file.

So I copied the file into the roundcube directory and wrote:

Code: [Select]
~> patch < roundcubemail-patch-0.4.2.diff
patching file CHANGELOG
can't find file to patch at input line 25
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: skins/default/functions.js
|===================================================================
|--- skins/default/functions.js (revision 4045)
|+++ skins/default/functions.js (working copy)
--------------------------
File to patch:


then I tried:

Code: [Select]
~> patch -p1 < roundcubemail-patch-0.4.2.diff
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: CHANGELOG
|===================================================================
|--- CHANGELOG  (revision 4045)
|+++ CHANGELOG  (working copy)
--------------------------
File to patch:


Whats wrong?

Thanks

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
How to use the patch
« Reply #1 on: October 06, 2010, 02:40:12 PM »
the command should be
Code: [Select]
patch -d [path to rc dir] -p0 < roundcubemail-patch-0.4.2.diff i think
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Schmatze

  • Jr. Member
  • **
  • Posts: 31
How to use the patch
« Reply #2 on: October 07, 2010, 09:13:02 AM »
This looks better, but there's still a little problem:

Code: [Select]
patching file program/js/app.js
Hunk #1 FAILED at 1292.
Hunk #2 FAILED at 1463.
2 out of 2 hunks FAILED -- saving rejects to file program/js/app.js.rej


Code: [Select]
cat program/js/app.js.rej
***************
*** 1292,1298 ****
        }
      }
 
-     this.http_post('utils/save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
      this.set_unread_count_display(id, false);
    };
 
--- 1292,1298 ----
        }
      }
 
+     this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
      this.set_unread_count_display(id, false);
    };
 
***************
*** 1463,1469 ****
      if ((found = $.inArray('subject', this.env.coltypes)) >= 0)
        this.set_env('subject_col', found);
 
-     this.http_post('utils/save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' });
    };
 
    this.check_droptarget = function(id)
--- 1463,1469 ----
      if ((found = $.inArray('subject', this.env.coltypes)) >= 0)
        this.set_env('subject_col', found);
 
+     this.http_post('save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' });
    };
 
    this.check_droptarget = function(id)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
How to use the patch
« Reply #3 on: October 07, 2010, 02:10:08 PM »
i think you should have a file called app.js.src in the folder [rc root]/program/js/ rename the file app.js to app.js.old and then app.js.src to app.js and try the patch again
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Schmatze

  • Jr. Member
  • **
  • Posts: 31
How to use the patch
« Reply #4 on: October 07, 2010, 02:52:03 PM »
Thanks this worked now perfectly.

Offline drewb0y

  • Newbie
  • *
  • Posts: 4
How to use the patch
« Reply #5 on: October 12, 2010, 12:24:01 PM »
I got exactly the same error as the other user.
After renaming the app.js and copying app.js.src back to app.js, I run the command again and get

Code: [Select]
patching file CHANGELOG
Reversed (or previously applied) patch detected!  Assume -R? [n]


Not having used patch before I'm not sure what I should answer here.

Offline drewb0y

  • Newbie
  • *
  • Posts: 4
Resolved
« Reply #6 on: October 12, 2010, 12:37:30 PM »
Figured it out. I reversed the previous changes using

Code: [Select]
patch -d [path to rc dir] -p0 < roundcubemail-patch-0.4.2.diff -R

And then

Code: [Select]
patch -d [path to rc dir] -p0 < roundcubemail-patch-0.4.2.diff

Which resulted in


Code: [Select]
patching file CHANGELOG
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n] y
Hunk #1 succeeded at 10 with fuzz 2 (offset 9 lines).
patching file skins/default/functions.js
patching file index.php
patching file program/include/iniset.php
patching file program/include/rcube_imap_generic.php
patching file program/include/rcube_vcard.php
patching file program/js/app.js
patching file program/steps/mail/func.inc


So I guess the -R reversed everything but CHANGELOG, and then after re running the patch command all is well.

(I did back it all up first just in case) :)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
How to use the patch
« Reply #7 on: October 12, 2010, 12:55:51 PM »
just wondering, you applied it against a copy of 0.4.1 right?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline ABerglund

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 673
How to use the patch
« Reply #8 on: October 12, 2010, 10:38:13 PM »
So does there is no patch to go against 0.4-stable? I did not upgrade to 0.4.1 before the bug was discovered, so I'll need to go from that instead.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
How to use the patch
« Reply #9 on: October 14, 2010, 02:25:57 AM »
i understood the patch was against 0.4.1 yes but i have no tested this.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…