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

Reported by Joel Ebel on 2012-05-15
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
MyUnity
Undecided
Unassigned
Precise Backports
Undecided
Unassigned
myunity (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
Quantal
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

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.

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?

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

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
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?

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.

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.

Michael Terry (mterry) wrote :

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

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
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.

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 ;-).

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

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.)

Micah Gersten (micahg) wrote :

Backports task is released already

Changed in precise-backports:
status: New → Fix Released
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.

Launchpad Janitor (janitor) wrote :

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

Changed in myunity (Ubuntu Precise):
status: New → Confirmed

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?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers