Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Rep:
How to apply patches for application programs?
I think this is a question many newbies like me ask. A lot of times I checkout software on sourceforge which has a section called "patches" but I have never had the opportunity to discover what is a patch excatly, and how to apply it? Lately I came across XCHAT2 which has patches which ar every recommended to install (for security reasons). The patches are in .diff format... Can someone illuminate this argument? Thanks. Ganninu.
//moderator.note: moved to Linux - General, because it isn't about security, but the process of patching. A patch is the output from diff ("diff -Naur oldfile newfile > oldfile.diff"), and to use it you could "cat patch.diff | patch --dry-run -p 1 -b /dir/with/xchat2/sourcecode". The "p 1" strips one directory level in the patch before applying, "-b" makes backups, and using "--dry-run" it won't apply the patch but test if it will work. Note any messages about rejects, because you're supposed to patch those parts manually. If satisfied it will work OK, remove the "--dry-run" switch and let it rip.
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
Ok got it... thanks a lot... I understood the -p1 concept. I applied all the patches except one... It made reference to more than one source file:
# fixes 64bit issues (where a pointer to int was given, instead of gsize).
--- xchat-2.0.5/src/common/server.c 2003-08-11 01:40:15.000000000 +1000
+++ xchat-2.0.6/src/common/server.c 2003-10-07 14:54:26.000000000 +1000
@@ -289,8 +289,8 @@
{
char *conv_line; /* holds a copy of the original string */
int conv_len; /* tells g_convert how much of line to convert */
- int utf_len;
- int read_len;
+ gsize utf_len;
+ gsize read_len;
GError *err;
gboolean retry;
How can I patch the source code then? I tried entering all the filenames after the patch command but it doesn't seem to accept more than 1 filename... Or should I edit the patch myself to split it in several diff files?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.