?

Log in

No account? Create an account
4.5.3 screening patch UPDATED - LogJam [entries|archive|friends|userinfo]
LogJam

[ website | LogJam ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

4.5.3 screening patch UPDATED [Mar. 8th, 2006|08:31 am]
LogJam

logjam

[unixronin]

I've just fixed the problem in my patch for Logjam-4.5.3 to add support for comment screening which was causing the preference to view screening not to be saved.  (It was a single #define that I failed to update.)  A couple of minor cosmetic issues remain.

I have updated the patch, which is posted to logjam_dev here.

LinkReply

Comments:
[User Picture]From: bastardo
2006-03-27 06:30 am (UTC)
Sorry for my stupid question - but how can I apply the patch?

linux:/home/jinjiru # patch < logjam-4.5.3-screening.diff
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -U3 -r logjam-4.5.3ps/src/jamdoc.c logjam-4.5.3psc/src/jamdoc.c
|--- logjam-4.5.3ps/src/jamdoc.c Fri Sep 9 21:45:01 2005
|+++ logjam-4.5.3psc/src/jamdoc.c Mon Mar 6 11:10:43 2006
--------------------------
File to patch:
(Reply) (Thread)
[User Picture]From: unixronin
2006-03-27 11:37 am (UTC)
1. cd into your logjam source directory
2. patch -p0 --dry-run ../logjam-4.5.3-screening.diff
3. if it applies cleanly, do it again without the --dry-run
4. configure if you haven't already, and make.

Let me know if you have any further problems please.

I also have a more extensive patch that adds a lot of additional HTML inserts and rearranges the menus into an order I personally find more intuitive.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 09:45 am (UTC)
:((

jinjiru@linux:~/RPM/logjam-4.5.3$ patch -p0 --dry-run ../logjam-4.5.3-screening.diff



and silence falls :( no reaction, no feedback :(
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 01:07 pm (UTC)
Hmm. You ARE building from source, right? You can't apply the patch against an existing precompiled rpm package.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 01:14 pm (UTC)
Sure! I downloaded the tarball, unpacked it, entered the directory and tried to apply patch :(
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 01:19 pm (UTC)
Huh. I don't know why it's not giving any output then. .... OH! Yes I do. And it's my fault -- I forgot that HTML would eat the < character that I typed unless I escaped it.

So let's try this again:

patch -p0 --dry-run < ../logjam-4.5.3-screening.diff

Try it that way.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 01:24 pm (UTC)
Well it gives some output so it's definetely a progress :)

jinjiru@linux:~/RPM/logjam-4.5.3$ patch -p0 --dry-run <../logjam-4.5.3-screening.diff
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -U3 -r logjam-4.5.3ps/src/jamdoc.c logjam-4.5.3psc/src/jamdoc.c
|--- logjam-4.5.3ps/src/jamdoc.c Fri Sep 9 21:45:01 2005
|+++ logjam-4.5.3psc/src/jamdoc.c Mon Mar 6 11:10:43 2006
--------------------------
File to patch:


Is it ok that my unpacked directory is called logjam-4.5.3 and patch is searching for something like logjam-4.5.3ps?
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 01:27 pm (UTC)
I'm sorry, I just wasn't on the ball when I gave you those instructions. Not only did I forget to escape the <, but I typed -p0 when I meant -p1.

(-p1 says, "Strip the topmost element from all paths referenced in this patch." It's precisely to get around the different directory name.)
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 01:37 pm (UTC)

Wheee :)

jinjiru@linux:~/RPM/logjam-4.5.3$ patch -p1 --dry-run <../logjam-4.5.3-screening.diff
patching file src/jamdoc.c
patching file src/jamdoc.h
patching file src/jamview.c
patching file src/jamview.h
patching file src/menu.c
Hunk #3 FAILED at 478.
1 out of 3 hunks FAILED -- saving rejects to file src/menu.c.rej
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 01:57 pm (UTC)

Re: Wheee :)

Hmm ... I'm curious why it failed there. The change to menu.c should add a single line:

{ N_("/View/Scr_eening"), NULL, menu_view_cb, ACTION_VIEW_SCREENING, "<CheckItem>" },

added after:

{ N_("/View/_Comments"), NULL, menu_view_cb, ACTION_VIEW_COMMENTS, "<CheckItem>" },

You could try making that change by hand. It's possible the changed menu item doesn't match because of internationalization.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 01:59 pm (UTC)

Re: Wheee :)

Ok I'll try to change manually and report the result :)

I don't think it's because of internationalization - I use english menus (applications and system-wide) and en_US locale :\
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 02:00 pm (UTC)

Re: Wheee :)

(the change that failed, that is)
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-31 06:23 am (UTC)

Re: Wheee :)

Well I added the line manually to src/menu.c but I stilll get the same error:

jinjiru@linux:~/RPM/logjam-4.5.3$ patch -p1 --dry-run <../logjam-4.5.3-screening.diff
patching file src/jamdoc.c
patching file src/jamdoc.h
patching file src/jamview.c
patching file src/jamview.h
patching file src/menu.c
Hunk #3 FAILED at 478.
1 out of 3 hunks FAILED -- saving rejects to file src/menu.c.rej
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-31 04:24 pm (UTC)

Re: Wheee :)

The thing to do is make that manual change after running the patch. At that point, everything the patch was supposed to do is now done, and you're ready to compile. You don't need to rerun the patch again.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-04-03 08:33 am (UTC)

Re: Wheee :)

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -I../protocol/liblivejournal -I../util/gxr -pthread -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/include/libpng12 -I/usr/include/libxml2 -I/opt/gnome/include/gtk-2.0 -I/opt/gnome/lib/gtk-2.0/include -I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/pango-1.0 -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include -I/opt/gnome/include/libsoup-2.2 -g -O2 -MT menu.o -MD -MP -MF ".deps/menu.Tpo" \
-c -o menu.o `test -f 'menu.c' || echo './'`menu.c; \
then mv -f ".deps/menu.Tpo" ".deps/menu.Po"; \
else rm -f ".deps/menu.Tpo"; exit 1; \
fi
menu.c: In function ‘menu_make_bar’:
menu.c:424: error: ‘ACTION_VIEW_SCREENING’ undeclared (first use in this function)
menu.c:424: error: (Each undeclared identifier is reported only once
menu.c:424: error: for each function it appears in.)
make[3]: *** [menu.o] Error 1
make[3]: Leaving directory `/home/jinjiru/RPM/logjam-4.5.3/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/jinjiru/RPM/logjam-4.5.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jinjiru/RPM/logjam-4.5.3'
make: *** [all] Error 2
jinjiru@linux:~/RPM/logjam-4.5.3$
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-04-03 10:51 am (UTC)

Re: Wheee :)

Huh, I thought you'd said that chunk applied correctly ......


OK, look in menu.c.rej and make sure thare are no other hunks in it that haven't been applied. The patch for menu.c looks like this:


--- logjam-4.5.3ps/src/menu.c Mon Mar 6 09:43:23 2006
+++ logjam-4.5.3psc/src/menu.c Mon Mar 6 11:15:44 2006
@@ -59,6 +59,7 @@
ACTION_VIEW_PREFORMATTED,
ACTION_VIEW_DATESEL,
ACTION_VIEW_COMMENTS,
+ ACTION_VIEW_SCREENING,

ACTION_JOURNAL,
ACTION_JOURNAL_USE,
@@ -197,6 +198,13 @@
}

static void
+screening_cb(JamWin *jw, int action, GtkCheckMenuItem *item) {
+ if (!gtk_check_menu_item_get_active(item))
+ return;
+ jam_doc_set_screening(jw->doc, action - ACTION_ENTRY_SCREENING_DEFAULT);
+}
+
+static void
backdated_cb(JamWin *jw, int action, GtkCheckMenuItem *item) {
jam_doc_set_backdated(jw->doc, gtk_check_menu_item_get_active(item));
}
@@ -470,6 +478,7 @@
{ N_("/View/M_usic"), NULL, menu_view_cb, ACTION_VIEW_MUSIC, "" },
{ N_("/View/_Preformatted"), NULL, menu_view_cb, ACTION_VIEW_PREFORMATTED, "" },
{ N_("/View/_Comments"), NULL, menu_view_cb, ACTION_VIEW_COMMENTS, "" },
+{ N_("/View/Scr_eening"), NULL, menu_view_cb, ACTION_VIEW_SCREENING, "" },

{ N_("/HTML/_Bold"), "B", menu_html_mark_bold },
{ N_("/HTML/_Italic"), "I", menu_html_mark_italic },



Better check ALL of those hunks by hand and make sure they made it. If not, add them by hand.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-04-03 11:09 am (UTC)

Re: Wheee :)

I feel really stupid :(
So I ran the patch. When it was applied, I added
{ N_("/View/Scr_eening"), NULL, menu_view_cb, ACTION_VIEW_SCREENING, "" },

after

{ N_("/View/_Comments"), NULL, menu_view_cb, ACTION_VIEW_COMMENTS, "" },

- just as you said. Then I tried to configure and make and recieved this error.
Looks like it's a bad luck :)
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-04-03 11:18 am (UTC)

Re: Wheee :)

OK, but did you check that the other hunks had applied correctly to menu.c? Your patch output only SAID that hunk 3 failed, not all three menu.c hunks. Normally, if one of three hunks for a file fails, patch will apply the other two.

What you may want to do is go back to your menu.c.orig file and try applying all three patch hunks for menu.c by hand from the patch file. I don't know why patch is being so difficult about it for you. If that still gives you problems, I'll go back and regenerate a separate patch for menu.c from the untouched source, and post that as well.
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-04-03 11:26 am (UTC)

Re: Wheee :)

Thank you for your patience :))
I've checked all the hunks and it looks like patch has not applied none of them :)
So I've added them manually and now it's working :)

And I can see the Screeing menu item but when I try to activate it, logjam falls with Segmentation fault.

I have Suse 10.0 with 2.6.13-15.8 kernel, KDE 3.5.2, gcc version 4.0.2
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-04-03 01:21 pm (UTC)

Re: Wheee :)

Huh. I don't know why it's SEGVing. It works here.

The other stuff all applied, right...?
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-04-03 01:24 pm (UTC)

Re: Wheee :)

Yes, everything is applied :)
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-27 11:39 am (UTC)
Oh ... and I forgot to add: It's not a stupid question. There are surprisingly few stupid questions.

(Now I wish I could read Russian.)
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 01:15 pm (UTC)
Thank you for compliment :))

Russian is not so difficult as it's thought of :)
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 01:24 pm (UTC)
That's probably easy to say as a native speaker. :) Russian has, what, five genders, and then another layer of modifiers as well?

I might be able to learn it if I took a proper course. I tried some "Learn Russian" CDs once and they were useless, just random vocabulary words with no grammar at all and no explanation of why words changed at different times. I've been interested in learning Russian for some time (also Finnish, Japanese, and Irish Gaelic), but at the moment I'm afraid almost all of what I know is military jargon. I don't even properly know all of the Cyrillic alphabet. (Enough to be able to recognize the names of a few Russian cities and one or two composers, and that's all.)
(Reply) (Parent) (Thread)
[User Picture]From: bastardo
2006-03-28 01:38 pm (UTC)
It's not easy to speak as a native speaker at all :) There are people who don't know how to write some words, particularly if the word can have different suffixes depending on the situation :) But Russian is definetely easier than Hungarian, for example :)

We have 3 genders to be precise :) And 6 cases: nominative, genitive, dative, accusative, ablative and so-called "prepositional case" :)) Compare to 15 cases in Finnish and 32 in Hungarian :)
(Reply) (Parent) (Thread)
[User Picture]From: unixronin
2006-03-28 01:59 pm (UTC)
OK, that actually sounds a lot simpler than a Russian emigré that I know made it sound. But perhaps I misunderstood her explanation. Something about the number of genders, and then there being animate and inanimate modifiers as well...?

Hungarian sounds very complex. I have difficulty imagining what any language would do with 32 cases.
(Reply) (Parent) (Thread)