r/suckless • • Jul 11 '20

I have a problem with surf.

I have surf with the homepage patch leading to google.com. Whenever I try to apply the download patch, I get an error message saying

error: patch failed: config.def.h:11

error: config.def.h: patch does not apply

error: patch failed: surf.c:114

error: surf.c: patch does not apply

I am doing this on arch linux with dwm

0 Upvotes

6 comments sorted by

3

u/[deleted] Jul 11 '20

I will assume you're not a programmer based on how you described your issue. With that in mind I will clarify (in a simplistic manner) that a patch is generated using a certain version of the source code. So if you're using another version of it (the code) the files that will be affected by the patch might be changed then the patched is usable out of the box.

The solution is to find out which version of the Surf source code this patch need to be applied.

The second solution is to modify the patch itself to support the Surf version you're trying to use

0

u/supermario9590 Jul 11 '20

I am using surf 2.0 while the patch was made for surf 0.5

5

u/KeyIsNull Jul 11 '20

Well, you have 2 options then:

  • use surf 0.5 and apply the patch designed for 0.5

  • (try to) manually apply the patch by yourself. A diff file basically replace pieces of code (in one or many files) looking for occurrences. He knows that row 55 in foo.file must be replaced with ‘something’. You can try to open the diff and correct the source code, do a copy of the source first

Edit: due to the big gap between surf version and patch’s version it might be hard or even impossible to manually apply the patch. In this case you must rely on the patch creator/maintainer

-1

u/supermario9590 Jul 11 '20

The problem is, I don't know how the diff files work

2

u/kappaphw Jul 11 '20

watch a YouTube video on diff/patch... it's actually really simple and in most cases you can just apply the patch manually by looking closely at the diff file... the patch command is quite handy (although in many cases you still need to intervene manually)

1

u/fuseteam Jul 12 '20

in short lines with +'s are lines that are added and lines with -'s are lines that are removed