Bug 7906 - viewvc displays many spec files incorrectly.
Summary: viewvc displays many spec files incorrectly.
Status: RESOLVED FIXED
Alias: None
Product: Websites
Classification: Unclassified
Component: svn.mageia.org (show other bugs)
Version: trunk
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Sysadmin Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-26 11:47 CEST by Barry Jackson
Modified: 2013-02-09 23:22 CET (History)
4 users (show)

See Also:
Source RPM: python-pygments-1.5-2.mga3
CVE:
Status comment:


Attachments

Description Barry Jackson 2012-10-26 11:47:13 CEST
Description of problem:
Any spec file with Name: or Epoch: etc. on line one displays with every plain text word outlined in red.
This seems to result from a change in the viewvc code in revision 2658 just prior to the release of 1.1.12 that we are using.

Here is an example:-
http://svnweb.mageia.org/packages/cauldron/yaflight/current/SPECS/yaflight.spec?view=markup&pathrev=310060

I reported this upstream and the initial reply is:-

"Yup.  That's one ugly display, all right!
Would it be possible for you to set the mime-type for .spec files to
something like "text/plain" in your mimetypes.conf file?"

I'm not sure but I think this would also remove the special rendering of comments.
An alternative fix I found was to disable the red error highlighting in the styles.css file - this works without affecting the comments, but may upset something else that I am unaware of.

--- styles.css~	2012-10-25 21:57:21.000000000 +0100
+++ styles.css	2012-10-25 22:09:49.845625732 +0100
@@ -126,7 +126,7 @@
   width: 100%;
 }
 .pygments-c { color: #408080; font-style: italic } /* Comment */
-.pygments-err { border: 1px solid #FF0000 } /* Error */
+/*.pygments-err { border: 1px solid #FF0000 } /* Error */
 .pygments-k { color: #008000; font-weight: bold } /* Keyword */
 .pygments-o { color: #666666 } /* Operator */
 .pygments-cm { color: #408080; font-style: italic } /* Comment.Multiline */

It certainly needs fixing one way or another.
I will post a link to the discussion topic at viewvc dev when their site is running - it's down at the moment.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 2 David Walser 2012-10-26 16:51:30 CEST
If we knew what mimetype it is detecting as when it highlights spec files *correctly*, we could manually set it to that.

CC: (none) => luigiwalser

Comment 3 Barry Jackson 2012-10-26 18:40:39 CEST
Having searched the pygments site, it seems there is no lexer for rpm spec files.

I have tried a whole range of pygments lexers on a spec file and I cannot replicate the "normal" view that we are seeing where only text preceded by "%" has a colour change.

I don't think that is very useful anyway, so I would vote for "text/plain" until a lexer for .spec becomes available (if ever).
Manuel Hiebel 2012-10-26 22:21:23 CEST

Keywords: (none) => PATCH

Comment 4 Barry Jackson 2012-10-28 13:58:05 CET
Any python experts feel like writing one? :-

http://pygments.org/docs/lexerdevelopment/
Comment 5 David Walser 2012-10-28 15:50:31 CET
(In reply to comment #4)
> Any python experts feel like writing one? :-
> 
> http://pygments.org/docs/lexerdevelopment/

That'd be worth asking on the -dev list, maybe there will be interest.
Comment 6 Barry Jackson 2012-10-28 21:28:31 CET
(In reply to comment #5)
> 
> That'd be worth asking on the -dev list, maybe there will be interest.
>
Done :)
Comment 7 Barry Jackson 2012-11-13 13:23:44 CET
Good news - an RPMspec lexer has been written and it tests OK here.

https://bitbucket.org/gentoo90/pygments-main/changeset/346513eed7b5767e7e456c0b85361fd2

Not sure when it will be available in a tarball so we can update our package but I will keep a lookout :)
Comment 8 Barry Jackson 2013-01-19 15:30:09 CET
Pygments Release 1.6 rc 1 is out!
...and it includes the above RPM spec lexer.

Can we get this into Cauldron to fix this bug before Mga3 ?

Component: svn.mageia.org => RPM Packages
Version: trunk => Cauldron
Assignee: sysadmin-bugs => bugsquad
Product: Websites => Mageia
Target Milestone: --- => Mageia 3
Source RPM: (none) => python-pygments-1.5-2.mga3

Manuel Hiebel 2013-01-19 16:15:12 CET

CC: (none) => sysadmin-bugs

David Walser 2013-01-19 16:20:30 CET

CC: (none) => makowski.mageia
Assignee: bugsquad => makowski.mageia

Comment 9 Barry Jackson 2013-01-19 23:37:46 CET
Philippe,

See -dev ML subject "Update question about python-pygments"

I have updated package ready - if you wish I can commit for your review. 

Barry
Comment 10 Barry Jackson 2013-01-20 13:45:33 CET
Since time is critical I have committed the new version and also patched it to fix highlighting of 'Suggests:' that I noticed was missing.
I will report it upstream.
I will also request a submit on -dev ML
Comment 11 Philippe Makowski 2013-01-20 15:28:22 CET
sorry for the delay, I did not saw the emails
and thanks for having taking care of
Comment 12 Barry Jackson 2013-01-22 10:27:53 CET
(In reply to comment #11)
> sorry for the delay, I did not saw the emails
> and thanks for having taking care of

OK no problem.

This is now in Cauldron, and needs to be applied to the Mageia server that handles ViewVC

Keywords: PATCH => (none)
Component: RPM Packages => svn.mageia.org
Version: Cauldron => trunk
Assignee: makowski.mageia => sysadmin-bugs
Product: Mageia => Websites
Target Milestone: Mageia 3 => ---

Comment 13 Barry Jackson 2013-01-22 10:36:40 CET
(In reply to comment #12)
> (In reply to comment #11)

> This is now in Cauldron, and needs to be applied to the Mageia server that
> handles ViewVC

"This" may not now be obvious. 

It refers to python-pygments package
Comment 14 Thomas Backlund 2013-02-09 16:49:12 CET
 python-pygments-1.6-0.rc1.1 installed on svnweb

Status: NEW => RESOLVED
CC: (none) => tmb
Resolution: (none) => FIXED

Comment 15 Barry Jackson 2013-02-09 23:22:29 CET
\o/ Yay :)

Note You need to log in before you can comment on or make changes to this bug.