Description of problem: Carefully formatted text in package %description fields is rendered badly in rpmdrake making readability poor and giving a bad impression of Mageia to users. Attached is an example of this in a text file taken from a random package (fldigi). Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Open rpmdrake from MCC 2. enter fldigi in the search 3. try to make sense of the package information :\
Created attachment 11879 [details] Comparison of %description and rendering in rpmdrake
Hi, Thanks reporting this. I don't think such formatted text should appear on rpmdrake / urpmi in description of packages. It should be provided as a README file as it gives some informations. But my thought doesn't matter here. Thanks for the provided screenshot. Assigning to Mageia Tools maintainers.
CC: (none) => anaselli, ouaurelien, thierry.vignaudKeywords: (none) => TriagedAssignee: bugsquad => mageiatools
Maybe 'formatting' is too strong a description. It is only plain text and it seems that line feeds are being stripped out somewhere, which wrecks the display in rpmdrake. Tabs appear to be replaced with spaces which is fine if the line feeds are not removed. This has not changed for years, but I think it is time it was fixed.
For what dnfdragora concern, you're right line feeds are not managed correctly. I've fixed it right now.
Created attachment 11882 [details] dnfdragora info view after fixing
rpmdragora instead should manage it already as you can see here: https://gitweb.mageia.org/software/manatools/tree/lib/ManaTools/Rpmdragora/gui.pm#n1260 dnfdragora widget use richtext so \n is changed to <br> but description is shown as in your attachment, so i'd expect the problem is not in GUI rpmdrake or rpmdragora, but in how description is returned from api. I maybe wrong since it is a lot of time i am not programming perl... but i printed the returned string where <br> replaced \n and it seems not returning same string as dnfdaeomon... see belove Fldigi is a software modem for Amateur Radio use. It is a sound card based program that is used for both transmitting and receiving data in any of the following modes:<br><br>BPSK and QPSK 31, 63, 125, 250 (both), and 63F and 500 (BPSK only) PSKR 125, 250, and 500 CW speeds from 5 to 200 wpm DominoEX 4, 5, 8, 11, 16 and 22; also with FEC Hellschreiber Feld Hell, Slow Hell, Hell x5/x9, FSKHell(-105) and Hell 80 MFSK 4, 8, 11, 16, 22, 31, 32 and 64; most with image support MT63 500, 1000 and 2000 OLIVIA various tones and bandwidths RTTY various baud rates, shifts, nbr. of data bits, etc. THOR 4, 5, 8, 11, 16 and 22 Throb and ThrobX 1, 2, and 4 WWV receive only - calibrate your sound card to WWV Frequency Analysis receive only - measure the frequency of a carrier<br><br>Fldigi can also control a transceiver using Hamlib or RigCAT I/O, perforopen_rpm_db is deprecated use Rpmdragora::DB instead at /usr/share/perl5/vendor_perl/ManaTools/Rpmdragora/pkg.pm line 209. m online or cdrom QRZ queries, log QSOs with the built-in logbook or Xlog, and send reception reports to the PSK Automatic Propagation Reporter.<br><br>
rpmdrake splits the description into paragraphs. A new paragraph is started by either a blank line or a line starting with one of *, -, +, or o (with or without leading white space). So you can use one of those options to maintain your line structure. The description is normally displayed in a proportional font, so your vertical alignment is almost certainly doomed.
CC: (none) => mageia
Are you saying that we use a kind of proprietary mark-up language for description? and do we have an explanation somewhere?
(In reply to Angelo Naselli from comment #8) > Are you saying that we use a kind of proprietary mark-up language for > description? Yes. > and do we have an explanation somewhere? Not that I can find, other than the rpmdrake source code. I vaguely remembered seeing such things when using rpmdrake so went looking. Note that http://ftp.rpm.org/max-rpm/s1-rpm-specref-preamble.html says: "The %description tag is used to define an in-depth description of the packaged software. In the descriptive text, a space in the first column indicates that that line of text should be presented to user as-is, with no formatting done by RPM. Blank lines in the descriptive text denote paragraphs." so we partly comply with that, partly go against it.
CC: (none) => matteo.pasotti
So the conclusion is that this issue has to be addressed to fldigi package maintainer then...
Well it's not only fldigi, that was just the first one that came to mind as having a longish description. There are probably hundreds of packages that this affects. I wonder how many packagers know about this 'mark-up'? I have never come across it and have even commented about this problem in dev-irc in the past. So the easy solution is to add spaces to the start of each line in the %description to at least get line breaks in the right places in rpmdrake. Thanks Martin :) Regarding column alignment, if it's only indentation that is required to make a psudo bulleted list, then it should look OK with a few spaces after the leading space to indent a list.
Indeed, i don't think that's the right way to... at least if rpmdrake is the only one who knows that... anyway let's go on...
@Barry, no, rpmdrake doesn't use the leading space rule, it detects the bullet markers (-, +, *, o). Not using the leading space rule allows multi-line bullet points (and I quite quickly found an example that did that). Running this awk script BEGIN { in_desc = 0; found = 0; count = 0; } in_desc == 1 && /^%/ { if (found) count++; in_desc = 0; } /^%description/ { print FILENAME; in_desc = 1; found = 0; } in_desc == 1 && /^\s*[-+*o]\s/ { print $0; found = 1; } END { print "Found ", count; } over the cauldron spec files tells me that there are 1156 %description sections that use this feature. We should write this up on the Wiki somewhere.
Sorry Martin I thought your explanation in #7 was in addition to the space rule. In that case we have no means of telling rpmdrake to not interfere with the %description as provided in the spec. All line breaks that do not start a new paragraph (like this one) are lost and we can't do anything to keep them. If I now understand correctly? :)
Maybe an example helps: %description This starts a paragraph that will wrap according to the window width and stops here due to the following blank line. This starts a new paragraph: * this starts a new line which continues here and also wraps according to the window width * this also starts a new line - the leading space is removed will be displayed like this: This starts a paragraph that will wrap according to the window width and stops here due to the following blank line. This starts a new paragraph: * this starts a new line which continues here and also wraps according to the window width * this also starts a new line - the leading space is removed For a real example (plucked at random) see libalglib3.
(In reply to Martin Whitaker from comment #13) > We should write this up on the Wiki somewhere. I added last point at https://wiki.mageia.org/en/Packaging_hints linking to this nice example comment 15 for now.
CC: (none) => fri