dpkg output is folded like quoted text in comments

Bug #121735 reported by Curtis Hovey
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Curtis Hovey

Bug Description

The likes starting with '|' are being misinterpreted as quotes. We may want to drop the bar as a quote indicator.

From Brian Murry:
This might really need to a bug report, but I wanted to talk about it
first. Today I noticed that launchpad has collapsed information in the
comments most notably quoted e-mails which is great! However, in
comment 10 on bug 114816[0] this becomes problematic where I asked for
the output of 'dpkg -l' to determine the specific package version. I
was talking to another launchpad user and it didn't bother them so I
wanted to see if I was alone.

[0] https://bugs.launchpad.net/ubuntu/+bug/114816/comments/10

Revision history for this message
Curtis Hovey (sinzui) wrote :

I have another bug regarding adding PGP blocks to folding. I will fix this bug at the same time,

Changed in launchpad:
assignee: nobody → sinzui-is
status: New → Confirmed
Revision history for this message
Curtis Hovey (sinzui) wrote :

My 40526-121735 branch that is in review fixes this.

Changed in launchpad:
status: Confirmed → In Progress
Christian Reis (kiko)
Changed in launchpad:
importance: Undecided → High
Revision history for this message
Curtis Hovey (sinzui) wrote :

Fixed in RF 4507.

Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Doesn't seem to be fixed. Please re-assess for 1.1.8

Changed in launchpad:
status: Fix Committed → Confirmed
Revision history for this message
Curtis Hovey (sinzui) wrote :

It is fixed. Examine:
https://bugs.staging.launchpad.net/ubuntu/+bug/114816/
Post number 11 by R Gavin is correctly handled because it is dpkg output.
Post number 10 by R Gavin has been tempered with either by him of his mail client. The first line of output is split in two--A line that with an opening quote identifier and no dpkg output is not a dpkg message. I don't think can, or should try, to predict how dpkg out might be garbled.

Curtis Hovey (sinzui)
Changed in launchpad:
status: Confirmed → Fix Committed
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Thanks for the feedback Curtis.
I did the following test:
$ dpkg -l xchat | cpaste 'dpkg -l xchat output'
https://devpad.canonical.com/~andrew/paste/fileESuOs4.html

where cpaste is a bash alias to the paste utility inside our launchpad tree (i.e. /home/matsubara/devel/launchpad/rocketfuel/utilities/paste).
I copied the output found in the above URL and pasted it as a bug comment.
The result was a folded comment.

It seems to me that the comment 11 is a tampered dpkg output, because it starts with whitespace.

Changed in launchpad:
status: Fix Committed → Incomplete
Revision history for this message
Curtis Hovey (sinzui) wrote :

so If I paste that dpkg output here it will fold?

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii xchat 2.8.0-0ubuntu4 IRC client for X similar to AmIRC

Revision history for this message
Curtis Hovey (sinzui) wrote :

Diogo, example you generated display correctly. How much corruption must I accommodate to close this bug? I may be able to test for:
    Desired=Unknown/Install
which precedes the tree and switch the '|' match off.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Since quotes text must start with a | or > lines that start with whitespace will never be folded. The issue with the tampered one is that a | is on a line of its own--saying start the fold.

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Curtis, the test I did can be seen on staging:
https://bugs.staging.launchpad.net/launchpad/+bug/121735

I don't know why but when I pasted your examples it didn't fold. When I pasted the one in the pastebin, it did fold.

Now I'm confused. And from a user's point of view, this bug doesn't seem fixed.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Don't worry about this issue. My tests were pasted from my terminal into for form. I did not use an automated process since I considered that to be safe. I have a cunning plan (developed on my 15 minute coffee break) that will quash this bug.

I will not look for dpkg as a clue that there is dpkg output, nor will I test for conflicting output. The only text from the dpkg output that reliably displays is 'Desired=Unknown/Install'. I will test for that in any part of line, then disable bar (|) matching before we get to the corrupted output. There will be a few HTML email messages that quote the output that will not be folded. I think that is acceptable.

Revision history for this message
Curtis Hovey (sinzui) wrote :

My branch 121735-dpkg_folding is in review. We now disable hiding lines when we see evidence of the dpkg header. Corrupted dpkg output will display so long as the first part of the dpkg header (Desired=Unknown/) is before the output.

Changed in launchpad:
status: Incomplete → In Progress
Revision history for this message
Curtis Hovey (sinzui) wrote :

Fixed in RF 4614.

Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Curtis Hovey (sinzui) wrote :

Fix released in Launchpad 1.1.8.

Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.