myunity depends upon DISTRIB_RELEASE being the second entry in /etc/lsb-release

Bug #999771 reported by Joel Ebel
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
MyUnity
New
Undecided
Unassigned
Precise Backports
Fix Released
Undecided
Unassigned
myunity (Ubuntu)
Invalid
Undecided
Unassigned
Precise
Won't Fix
Undecided
Unassigned
Quantal
Won't Fix
Undecided
Unassigned

Bug Description

myunity incorrectly parses the lsb-release file in Main.module. It makes assumptions about the order of lines. Since lsb-release is a list of shell variables which can be sourced by other programs, perhaps it would be better to use the shell to parse it, rather than just cat it. Something more like:
SHELL "source /etc/lsb-release; echo $DISTRIB_RELEASE" to Uversion

Tags: patch
Revision history for this message
Joel Ebel (jbebel) wrote :

correction:
SHELL "source /etc/lsb-release; echo -n $DISTRIB_RELEASE" to Uversion

The -n is needed to prevent Uversion having a newline at the end of it.

Revision history for this message
Margarita Manterola (marga-9) wrote :

Hi, I have tested and verified that the solution proposed by Joel work. I have prepared a debdiff with the change applied as a quilt patch. Can this be applied to the package, please?

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch and changelog entry for the change" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: myunity incorrectly parses lsb-release

The is present:
* upstream
* precise-backports
* precise
* not quantal, as myunity was removed from quantal

Changed in myunity (Ubuntu Quantal):
status: New → Invalid
status: Invalid → Won't Fix
Revision history for this message
Margarita Manterola (marga-9) wrote :

Indeed, this is not present in quantal, but it would be nice if this could be fixed for precise. I'm attaching a full debdiff that fixes this bug and the two others for which I have created a patch.

Can someone please sponsor this upload?

Revision history for this message
Margarita Manterola (marga-9) wrote :

Hi,

As suggested by Colin Watson on IRC, I changed the source line to a dot line, not to use an unnecessary bashism. I also modified the name of the first patch so that they all follow the same scheme.

Revision history for this message
Michael Terry (mterry) wrote :

What is the effect of the misparse? Does it always misparse or only on some machines/configs? See https://wiki.ubuntu.com/StableReleaseUpdates#Procedure about the kind of information that should be in the description.

Revision history for this message
Michael Terry (mterry) wrote :

I'll drop ubuntu-sponsors. Please re-add once the description is updated. Thanks!

Revision history for this message
Joel Ebel (jbebel) wrote :

myunity checks the version of ubuntu by taking the last 5 characters of the second line of lsb-release. In a default install, this is the DISTRIB_VERSION, but this is very fragile. If anything should reorder the lsb-release file, as often happens in customized installations, this no longer works. Actually using the shell to parse the variables in the file is much more robust.

summary: - myunity incorrectly parses lsb-release
+ myunity depends upon DISTRIB_RELEASE being the second entry in /etc/lsb-
+ release
Revision history for this message
Margarita Manterola (marga-9) wrote :

Hi,

If the package was still present in quantal, this would be a normal upload+backport, instead of an sru. But since it's not in quantal, can the backport already present in precise-backports be updated, please?

The bugs fixed are not "critical" in the sense that they do not break the installation, but they are bad enough to worsen user experience. Fixing the current backport would make it a more usable program for precise users. The three bugs are:

1) myunity depends upon DISTRIB_RELEASE being the second entry in /etc/lsb-release
2) myunity depends on no user running unity-2d on the machine, regardless of which user is running it.
3) myunity depends on no user running any command with "myunity" as part of its command line.

Revision history for this message
Iain Lane (laney) wrote :

OK I uploaded and accepted it. I'm not sure about the version number (we don't really have precedent for this), but it should be alright.

I'd really appreciate someone backporting these fixes to the precise (release) package.

and you could use pgrep (from procps) instead of that ps | grep -v grep stuff ;-).

Revision history for this message
Alec Warner (antarus) wrote : Re: [Bug 999771] Re: myunity depends upon DISTRIB_RELEASE being the second entry in /etc/lsb-release

As an example:

antarus@goats3 ~ $ cat /etc/lsb-release
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu precise (development branch)"
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
GOOGLE_CODENAME=precise
GOOGLE_ID=Goobuntu
GOOGLE_RELEASE="12.04 <redacted>"
GOOGLE_ROLE=desktop
GOOGLE_TRACK=<redacted>

I'm unsure if this is actually kosher (we have done it for at least 6
years), but the file is basically shell, from my understanding.

-A

On Fri, Oct 5, 2012 at 11:45 AM, Iain Lane <email address hidden> wrote:
> OK I uploaded and accepted it. I'm not sure about the version number (we
> don't really have precedent for this), but it should be alright.
>
> I'd really appreciate someone backporting these fixes to the precise
> (release) package.
>
> and you could use pgrep (from procps) instead of that ps | grep -v grep
> stuff ;-).
>
> --
> You received this bug notification because you are a member of Goobuntu
> Team, which is subscribed to the bug report.
> https://bugs.launchpad.net/bugs/999771
>
> Title:
> myunity depends upon DISTRIB_RELEASE being the second entry in /etc
> /lsb-release
>
> Status in MyUnity:
> New
> Status in Precise Backports:
> New
> Status in “myunity” package in Ubuntu:
> Invalid
> Status in “myunity” source package in Precise:
> New
> Status in “myunity” source package in Quantal:
> Won't Fix
>
> Bug description:
> myunity incorrectly parses the lsb-release file in Main.module. It makes assumptions about the order of lines. Since lsb-release is a list of shell variables which can be sourced by other programs, perhaps it would be better to use the shell to parse it, rather than just cat it. Something more like:
> SHELL "source /etc/lsb-release; echo $DISTRIB_RELEASE" to Uversion
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/myunity/+bug/999771/+subscriptions

Revision history for this message
Colin Watson (cjwatson) wrote :

It's not guaranteed to be shell. See bug 214861. I suggest borrowing the lsb_extract shell function from localechooser instead.

(Sorry for lateness; although it seemed awfully familiar, it took my associative memory quite a while to dredge this one up.)

Revision history for this message
Micah Gersten (micahg) wrote :

Backports task is released already

Changed in precise-backports:
status: New → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

If an SRU is still required, please follow the procedure outlined here: https://wiki.ubuntu.com/StableReleaseUpdates
- update the bug description as per template in above page
- write an easy to follow test case ( something like reorder the lsb_release file, reproduce the problem, install package, check it's fixed)
- create a debdiff against precise-proposed with a correct version number and minimal changes & attach it here
- resubscribe ubuntu sponsors

Until above is done, I am unsubscribing ubuntu-sponsors.
Good luck.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in myunity (Ubuntu Precise):
status: New → Confirmed
Revision history for this message
Mattias Nilsson (mattias-o-nilsson) wrote :

Question about this:
Wouldn't the command "lsb_release --short --release" be useful to get the version (which seems to be what we're after), or can't we rely on the package lsb_release being available at all times?

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in myunity (Ubuntu Precise):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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