Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Having issues applying patches to DWM
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Thu Aug 11, 2022 7:23 pm    Post subject: [SOLVED] Having issues applying patches to DWM Reply with quote

Hey, im in the process of configuring DWM for my first gentoo install and wanted to patch it with dwm-gaps-6.0.diff . i am aware that the current version is 6.3 but its the latest patch available. I read through the handbook and created the neccessary folder and gave the file an index number. However when running 'sudo emerge --ask dwm' i get following error.

Code:

>>> Failed to emerge x11-wm/dwm-6.3, Log file:

>>>  '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'

 * Messages for package x11-wm/dwm-6.3:

 * ERROR: x11-wm/dwm-6.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/x11-wm/dwm/01-dwm-gaps-6.0.diff
 *
 * Call stack:
 *               ebuild.sh, line  122:  Called src_prepare
 *             environment, line 1339:  Called default
 *      phase-functions.sh, line  862:  Called default_src_prepare
 *      phase-functions.sh, line  927:  Called __eapi6_src_prepare
 *             environment, line  200:  Called eapply_user
 *             environment, line  532:  Called eapply '/etc/portage/patches/x11-wm/dwm/01-dwm-gaps-6.0.diff'
 *             environment, line  495:  Called _eapply_patch '/etc/portage/patches/x11-wm/dwm/01-dwm-gaps-6.0.diff'
 *             environment, line  433:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-wm/dwm/01-dwm-gaps-6.0.diff'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=x11-wm/dwm-6.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/dwm-6.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'
 * S: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'


Google didnt help much, so i hope to find a solution here.


Last edited by cl0q on Thu Aug 18, 2022 7:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3875

PostPosted: Thu Aug 11, 2022 7:34 pm    Post subject: Reply with quote

Hi
Code:

 *   patch -p1  failed with /etc/portage/patches/x11-wm/dwm/01-dwm-gaps-6.0.diff


The hierarchy should have been
Code:

 /etc/portage/patches/x11-wm/dwm-6.3/01-dwm-gaps-6.0.diff

Plz run
Code:

mv /etc/portage/patches/x11-wm/dwm /etc/portage/patches/x11-wm/dwm-6.3

Yet again if the patch is not appropriate it might fail.
_________________
:)
Back to top
View user's profile Send private message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Thu Aug 11, 2022 7:40 pm    Post subject: Reply with quote

alamahant,

ran your command, still same error

Code:

>>> Failed to emerge x11-wm/dwm-6.3, Log file:

>>>  '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'

 * Messages for package x11-wm/dwm-6.3:

 * ERROR: x11-wm/dwm-6.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/01-dwm-gaps-6.0.diff
 *
 * Call stack:
 *               ebuild.sh, line  122:  Called src_prepare
 *             environment, line 1339:  Called default
 *      phase-functions.sh, line  862:  Called default_src_prepare
 *      phase-functions.sh, line  927:  Called __eapi6_src_prepare
 *             environment, line  200:  Called eapply_user
 *             environment, line  532:  Called eapply '/etc/portage/patches/x11-wm/dwm-6.3/01-dwm-gaps-6.0.diff'
 *             environment, line  495:  Called _eapply_patch '/etc/portage/patches/x11-wm/dwm-6.3/01-dwm-gaps-6.0.diff'
 *             environment, line  433:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/01-dwm-gaps-6.0.diff'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=x11-wm/dwm-6.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/dwm-6.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'
 * S: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Thu Aug 11, 2022 7:41 pm    Post subject: Reply with quote

It seems the patch not work for 6.3 verson
Code:
$ patch -p1 --dry-run < dwm-gaps-6.0.diff
checking file config.def.h
Hunk #1 succeeded at 2 with fuzz 2 (offset -7 lines).
checking file dwm.c
Hunk #1 FAILED at 1703.
Hunk #2 FAILED at 1711.
2 out of 2 hunks FAILED
you should recreate it
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Thu Aug 11, 2022 7:44 pm    Post subject: Reply with quote

this is what i get:

Code:

user@gentoo /etc/portage/patches/x11-wm/dwm-6.3 $ patch -p1 --dry-run < 01-dwm-gaps-6.0.diff
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:
--------------------------
|diff --git a/config.def.h b/config.def.h
|index 77ff358..a4e496b 100644
|--- a/config.def.h
|+++ b/config.def.h
--------------------------
File to patch:


it lets me decide what file to patch, not sure which one to choose
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54097
Location: 56N 3W

PostPosted: Thu Aug 11, 2022 8:08 pm    Post subject: Reply with quote

cl0q,

portage assumes that patches will be prepared to strip of one path element, so
Code:

|--- a/config.def.h
|+++ b/config.def.h
means to patch config.def.in pqrtages working directory, that's /var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3/

Therefore the patch will be applied to the file /var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3/config.def.h.
If that file does not exist, you may need to fix the --- a and +++ b throughout the file.
e.g. look is lower level directories.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Thu Aug 11, 2022 8:28 pm    Post subject: Reply with quote

so, from my understanding now, portage will, by default, apply the patch to the default config.h file in /var/.. instead of my dwm-6.3.h file. So what edits do i have to perform on the dwm-gaps.diff file?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54097
Location: 56N 3W

PostPosted: Thu Aug 11, 2022 9:00 pm    Post subject: Reply with quote

Not quite

Portage want to patch a file called config.def.h, not config.h. That's two diffierent file names.
Code:
/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3 # ls
config.def.h  config.mk  drw.h  dwm    dwm.c  dwm.png  Makefile  transient.c  util.h
config.h      drw.c      drw.o  dwm.1  dwm.o  LICENSE  README    util.c       util.o


The file exists in /var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3

fedeliallalineas post shows that
Code:
$ patch -p1 --dry-run < dwm-gaps-6.0.diff
checking file config.def.h
Hunk #1 succeeded at 2 with fuzz 2 (offset -7 lines).
work but that the patch contains hunks for dwc.c that failed.
Code:
checking file dwm.c
Hunk #1 FAILED at 1703.
Hunk #2 FAILED at 1711.
2 out of 2 hunks FAILED


A single patch file can patch a whole directory tree.

You need to find out why patching dwm.c failed and fix it.

You patch (from suckless) reads
Code:
diff --git a/config.def.h b/config.def.h
index 77ff358..a4e496b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -9,6 +9,7 @@ static const char selbordercolor[]  = "#005577";
 static const char selbgcolor[]      = "#005577";
 static const char selfgcolor[]      = "#eeeeee";
 static const unsigned int borderpx  = 1;        /* border pixel of windows */
+static const unsigned int gappx     = 1;        /* gap pixel between windows */
 static const unsigned int snap      = 32;       /* snap pixel */
 static const Bool showbar           = True;     /* False means no bar */
 static const Bool topbar            = True;     /* False means bottom bar */
diff --git a/dwm.c b/dwm.c
index 1d78655..6cc96ff 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1703,7 +1703,7 @@ textnw(const char *text, unsigned int len) {
 
 void
 tile(Monitor *m) {
-   unsigned int i, n, h, mw, my, ty;
+   unsigned int i, n, h, r, g = 0, mw, my, ty;
    Client *c;
 
    for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
@@ -1711,19 +1711,21 @@ tile(Monitor *m) {
       return;
 
    if(n > m->nmaster)
-      mw = m->nmaster ? m->ww * m->mfact : 0;
+      mw = m->nmaster ? (m->ww - (g = gappx)) * m->mfact : 0;
    else
       mw = m->ww;
    for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
       if(i < m->nmaster) {
-         h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+         r = MIN(n, m->nmaster) - i;
+         h = (m->wh - my - gappx * (r - 1)) / r;
          resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
-         my += HEIGHT(c);
+         my += HEIGHT(c) + gappx;
       }
       else {
-         h = (m->wh - ty) / (n - i);
-         resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
-         ty += HEIGHT(c);
+         r = n - i;
+         h = (m->wh - ty - gappx * (r - 1)) / r;
+         resize(c, m->wx + mw + g, m->wy + ty, m->ww - mw - g - (2*c->bw), h - (2*c->bw), False);
+         ty += HEIGHT(c) + gappx;
       }
 }


The first fragment is there

Code:
void
tile(Monitor *m)
{
        unsigned int i, n, h, mw, my, ty;
        Client *c;

        for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);

The change is to remove
Code:
-   unsigned int i, n, h, mw, my, ty;
and replace it with
Code:
+   unsigned int i, n, h, r, g = 0, mw, my, ty;


The second fragment is there too, a few lines further down.
Code:
        for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
        if (n == 0)
                return;

        if (n > m->nmaster)
                mw = m->nmaster ? m->ww * m->mfact : 0;
        else
                mw = m->ww;
        for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)

The change there is remove
Code:
-      mw = m->nmaster ? m->ww * m->mfact : 0;

and replace it with
Code:
+      mw = m->nmaster ? (m->ww - (g = gappx)) * m->mfact : 0;

The - means remove, the + means add, in the same place.

The rest is left as an exercise for the reader :)

The patch you have does not apply as the locations and context have changed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Fri Aug 12, 2022 4:45 am    Post subject: Reply with quote

You can try this patch.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Fri Aug 12, 2022 7:49 am    Post subject: Reply with quote

I'm sorry, I dont really understand much here. NeddySeagoon, the changes you have suggested, why are they neccessary and how did you get to them? I easily spend an hour trying to understand what the issue is/are and tried other gap patches (like fullgaps https://dwm.suckless.org/patches/fullgaps/ ) but its not working either. It told me
Code:

user@gentoo ~ $ sudo emerge --ask dwm

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-wm/dwm-6.3

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) x11-wm/dwm-6.3::gentoo
 * dwm-6.3.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                [ ok ]
>>> Unpacking source...
>>> Unpacking dwm-6.3.tar.gz to /var/tmp/portage/x11-wm/dwm-6.3/work
>>> Source unpacked in /var/tmp/portage/x11-wm/dwm-6.3/work
>>> Preparing source in /var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3 ...
 * =================================================================================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying 01-dwm-fullgaps.diff ...
patching file config.def.h
Hunk #2 succeeded at 86 (offset 1 line).
patching file dwm.c
Hunk #2 succeeded at 201 (offset 1 line).
Hunk #3 succeeded at 641 (offset 1 line).
Hunk #4 succeeded at 1504 (offset 4 lines).
Hunk #5 FAILED at 1696.
1 out of 5 hunks FAILED -- saving rejects to file dwm.c.rej                                                                                                                                                  [ !! ]
 * ERROR: x11-wm/dwm-6.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/01-dwm-fullgaps.diff
 *
 * Call stack:
 *               ebuild.sh, line  122:  Called src_prepare
 *             environment, line 1339:  Called default
 *      phase-functions.sh, line  862:  Called default_src_prepare
 *      phase-functions.sh, line  927:  Called __eapi6_src_prepare
 *             environment, line  200:  Called eapply_user
 *             environment, line  532:  Called eapply '/etc/portage/patches/x11-wm/dwm-6.3/01-dwm-fullgaps.diff'
 *             environment, line  495:  Called _eapply_patch '/etc/portage/patches/x11-wm/dwm-6.3/01-dwm-fullgaps.diff'
 *             environment, line  433:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/01-dwm-fullgaps.diff'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=x11-wm/dwm-6.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/dwm-6.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'
 * S: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'


So I looked into dwm.c:1696 but couldn't figure out how to resolve this issue. And google hasn't really been of much help.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Fri Aug 12, 2022 3:21 pm    Post subject: Reply with quote

Is there a reason you are trying to use dwm like this? The suckless tools are (in)famous for needing end-user patching instead of having proper configure flags, which is why this is so hard for you. Most other window managers would be easier to install. We do not know your needs to know if you need dwm specifically.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54097
Location: 56N 3W

PostPosted: Fri Aug 12, 2022 5:11 pm    Post subject: Reply with quote

cl0q,

Lets look at the first "Hunk" of your patch.
Code:
--- a/config.def.h
+++ b/config.def.h
@@ -9,6 +9,7 @@ static const char selbordercolor[]  = "#005577";
 static const char selbgcolor[]      = "#005577";
 static const char selfgcolor[]      = "#eeeeee";
 static const unsigned int borderpx  = 1;        /* border pixel of windows */
+static const unsigned int gappx     = 1;        /* gap pixel between windows */
 static const unsigned int snap      = 32;       /* snap pixel */
 static const Bool showbar           = True;     /* False means no bar */
 static const Bool topbar            = True;     /* False means bottom bar */


Code:
-- a/config.def.h
+++ b/config.def.h

Tells that the original file was called config.def.h and the patched file will be called config.def.h. The a/ and b/ an the front are thrown away by patch -p1.
Code:
@@ -9,6 +9,7 @@ 
tells patch where to look.
It means that at line 9 there are six lines and after the patch at line 9 there will be are seven lines.
Patch keeps track of the line count as it changes. Here, it's one hunk in one file, but where there are several separate hunks in a file, it matters to patch finding it's way around.
Code:
 static const char selbgcolor[]      = "#005577";
 static const char selfgcolor[]      = "#eeeeee";
 static const unsigned int borderpx  = 1;        /* border pixel of windows */
is the context before the patch.
If that's not found, the patch will not apply.

Likewise, there are three lines of context after the patch
Code:
 static const unsigned int snap      = 32;       /* snap pixel */
 static const Bool showbar           = True;     /* False means no bar */
 static const Bool topbar            = True;     /* False means bottom bar */


In the middle of the context is the patch.
Code:
+static const unsigned int gappx     = 1;        /* gap pixel between windows */

The + at the start tells patch to add the line. The + will be stripped,
So the six lines become seven. The file gets one line longer and everything below it is moved down a line.

The next two Hunks are
Code:
--- a/dwm.c
+++ b/dwm.c
@@ -1703,7 +1703,7 @@ textnw(const char *text, unsigned int len) {
 
 void
 tile(Monitor *m) {
-   unsigned int i, n, h, mw, my, ty;
+   unsigned int i, n, h, r, g = 0, mw, my, ty;
    Client *c;
 
    for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
@@ -1711,19 +1711,21 @@ tile(Monitor *m) {
       return;
 
    if(n > m->nmaster)
-      mw = m->nmaster ? m->ww * m->mfact : 0;
+      mw = m->nmaster ? (m->ww - (g = gappx)) * m->mfact : 0;
    else
       mw = m->ww;
    for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
       if(i < m->nmaster) {
-         h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+         r = MIN(n, m->nmaster) - i;
+         h = (m->wh - my - gappx * (r - 1)) / r;
          resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
-         my += HEIGHT(c);
+         my += HEIGHT(c) + gappx;
       }
       else {
-         h = (m->wh - ty) / (n - i);
-         resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
-         ty += HEIGHT(c);
+         r = n - i;
+         h = (m->wh - ty - gappx * (r - 1)) / r;
+         resize(c, m->wx + mw + g, m->wy + ty, m->ww - mw - g - (2*c->bw), h - (2*c->bw), False);
+         ty += HEIGHT(c) + gappx;
       }
 }   


Code:
--- a/dwm.c
+++ b/dwm.c
@@ -1703,7 +1703,7 @@

Says at at line 1703 in the old file, there are seven lines, and after the patch there are still seven lines.
The context starts with a blank line. That matters. Patch will look for a blank line.
Code:
 

 void
 tile(Monitor *m) {

The patch is
Code:
-      mw = m->nmaster ? m->ww * m->mfact : 0;
+      mw = m->nmaster ? (m->ww - (g = gappx)) * m->mfact : 0;
Which is remove a line and add a line, so no change to the line count.

The patch site is not at line 1703 and the context has changed. Patch will cope with changed line numbers, It reports "Hunk X applied with offset Y"
Once the context is changed, the way ahead is to make a new patch.

The hard bit of that can be finding the code to change, sometimes is gone completely.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Fri Aug 12, 2022 8:02 pm    Post subject: Reply with quote

NeddySeagoon,

i have to thank you very much, i had no idea how a patch file works, with its plus and minuses, aswell as the line numerations used.
Since i found another patch, which aims to be better i hope, didnt work either, ive spent some time trying around and got a different error now. The patch i am using is this one https://dwm.suckless.org/patches/fullgaps/dwm-fullgaps-6.2.diff and i left the beginning untouched. Im will post the changes i have made:
Code:

@@ -1700,16 +1714,15 @@ tile(Monitor *m)i
        if (n > m->nmaster)
                mw = m->nmaster ? m->ww * m->mfact : 0;
        else
-               mw = m->ww;
-       for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+               mw = m->ww - m->gappx;
+       for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
                if (i < m->nmaster) {
-                       h = (m->wh - my) / (MIN(n, m->nmaster) - i);
-                       resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
-                       if (my + HEIGHT(c) < m->wh)
-                       my += HEIGHT(c);
+                       h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
+                       resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
+                       my += HEIGHT(c) + m->gappx;
                } else {
-                       h = (m->wh - ty) / (n - i);
-                       resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
-                       if (ty + HEIGHT(c) < m->wh)
-                       ty += HEIGHT(c);
+                       h = (m->wh - ty) / (n - i) - m->gappx;
+                       resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
+                       ty += HEIGHT(c) + m->gappx;
                }
 }

--
2.20.1


However i am getting the following error now:
Code:

 * Applying user patches from /etc/portage/patches ...
 * Applying dwm-fullgaps.diff ...
patching file config.def.h
Hunk #2 succeeded at 86 (offset 1 line).
patching file dwm.c
Hunk #2 succeeded at 201 (offset 1 line).
Hunk #3 succeeded at 641 (offset 1 line).
Hunk #4 succeeded at 1504 (offset 4 lines).
patch: **** malformed patch at line 93:  }
                                                                                     [ !! ]
 * ERROR: x11-wm/dwm-6.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff
 *
 * Call stack:
 *               ebuild.sh, line  122:  Called src_prepare
 *             environment, line 1339:  Called default
 *      phase-functions.sh, line  862:  Called default_src_prepare
 *      phase-functions.sh, line  927:  Called __eapi6_src_prepare
 *             environment, line  200:  Called eapply_user
 *             environment, line  532:  Called eapply '/etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff'
 *             environment, line  495:  Called _eapply_patch '/etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff'
 *             environment, line  433:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=x11-wm/dwm-6.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/dwm-6.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'
 * S: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'

>>> Failed to emerge x11-wm/dwm-6.3, Log file:

>>>  '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'

 * Messages for package x11-wm/dwm-6.3:

 * ERROR: x11-wm/dwm-6.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff
 *
 * Call stack:
 *               ebuild.sh, line  122:  Called src_prepare
 *             environment, line 1339:  Called default
 *      phase-functions.sh, line  862:  Called default_src_prepare
 *      phase-functions.sh, line  927:  Called __eapi6_src_prepare
 *             environment, line  200:  Called eapply_user
 *             environment, line  532:  Called eapply '/etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff'
 *             environment, line  495:  Called _eapply_patch '/etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff'
 *             environment, line  433:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-wm/dwm-6.3/dwm-fullgaps.diff'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=x11-wm/dwm-6.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/dwm-6.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/dwm-6.3/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'
 * S: '/var/tmp/portage/x11-wm/dwm-6.3/work/dwm-6.3'


Are you able and willing to help me with this one?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54097
Location: 56N 3W

PostPosted: Fri Aug 12, 2022 9:50 pm    Post subject: Reply with quote

cl0q,

@@ -1700,16 +1714,15 @@
Says that 16 lines in the old file at line 1700 will become 15 lines at line 1714 in the new file.
That is, a total of one line has been removed.

Looking at the hunk, (look at the + and - signs) the hunk is two lines shorter.

Don't edit patches. Make a new patch. That's what diff is for.
Make a copy of the directory tree you want to patch thaw will become the a/ which patch will later strip.
Patch the original, this is now the b/

We expect some hunks to fail, so b/ is partly patched and has files ended in .rej that patch could not deal with.
Using the .rej files, fix the intent of the rejected hunks and delete the .rej files as you go. If you don't do that, the .rej files may be included in your patch file.
Patch can add/remove whole files to a directory tree.

You now have a/ (before) and b/ patched directory trees.
Use the diff command to make a patch file.
Read both
Code:
man diff
and
Code:
man patch


Hint:
Code:
man patch
tells the command to give to diff to keep patch happy.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cl0q
n00b
n00b


Joined: 04 Aug 2022
Posts: 43

PostPosted: Thu Aug 18, 2022 7:16 pm    Post subject: Reply with quote

alright, so after a fair bit of trying around from my side, ive found out that the useflag savedconfig had been making issues all along for ru_gaps.diff. i thank you for the provided help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum