[ubuntu-application] not all syntax for dependencies supported

Bug #587520 reported by Frederik Elwert
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Quickly
Fix Released
Medium
Unassigned
quickly (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Fix Released
Medium
Unassigned

Bug Description

It took me a while to figure out how additional dependencies can be specified. Now it turned out that there are some limitations regarding the syntax to specify dependencies:

The debian dependency format allows for thinks like »libc6 (>= 2.2.1), exim | mail-transport-agent« (taken from [1]). Since configure.py space-splits the dependency list, version information or alternatives is split from the corresponding entry. Maybe packages should rather be comma-split and remaining trailing or leading spaces be stripped?

Additionally, version information leads to more severe problems since the list of dependencies seems not to be read at all. E.g., when calling »quickly configure dependencies« again after setting a dependency with version information, the temp file is empty and a second dependency entry is created in .quickly. I guess this is a general problem in the config parser that the = in the config value breaks parsing (but I haven’t investigated further).

[1] http://www.debian.org/doc/debian-policy/ch-relationships.html

$ quickly --version
Quickly 0.4.2

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

This is a proposed patch that comma-separates dependency entries rather than space-separates them since this is the defined debian syntax. It has the drawback of not being backwards compatible.

I also replaced os.system with subprocess.call, since the latter is recommended generally. Or is there a specific reason for using os.system? (Found it used in edit.py as well, maybe it could be replaced there, too.)

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

This patch limits configuration file key-value splitting to the first equal sign. This should allow for configuration values to hold equal signs, as is the case for debian dependencies.

I wonder if that minimal parser could be replaced by an existing one like ConfigParser (standard library) or configobj (more powerful)?

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

That seems safe.

TBH, I didn't think that Quicky user will use versionned dependency or something more complicated like alternatives or stuff like that (it wasn't in the Quickly scope).

Maybe what you do is to add in data/templates/ubuntu-application/upgrade.py a <if version < 0.4.3>, migrate the content of the dependency file in .quickly with the new convert.

Can you ensure too that python-distutils-extra still work with this kind of dependency? (I've done a rough patch to it, didn't think about advance cases).
Thanks a lot for your help there!

Changed in quickly:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Ok, I’ll add code for this to upgrade.py, do some testing and propose an updated patch.

Regarding scope: Yes, probably the main audience of Quickly will not need this. But I personally like quickly because it makes packaging and releasing versions so much easier. So I even migrated two projects to quickly, and for one of these I need (or rather: would like to have) this kind of functionality.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Sweet, thanks for upgrade.py (upgrade.py is launched the first time the revision is != from the revision given, you can bump it in quicklyconfig.py to make your test in trunk) ;)

Sure, I agree with you, I was just explaining you why I didn't implement this at first in a naive way and I'm more than happy if we can support it :)

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Phew, this was harder than I thought. But now it should work as intended.

I was just a bit confused, because calling 'quickly upgrade' explicitly did change the dependencies entry in .quickly, but did not bump the project version number. Triggering the implicit upgrade by calling 'quickly edit' did change the version number. I didn’t investigate further, but maybe upgrade should also change the version number? Otherwise, the upgrade code is executed twice.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

No, that's clearly on purpose. People may want to run quickly upgrade themselve and even specify the version of upgrade they want.

The consequence is that the upgrade script should be idempotent (as debian maintainer script), which means that you can launch it twice, and the result is the same than the first one. I'm not sure it's the case with your upgrade command as you split on space the first time.

It seems your script doesn't follow that, because I will have first time:
foo bar baz
then:
foo, bar, baz
and if I relaunch the script:
foo,, bar,, baz
(just reading the code, not actually trying).

I guess you can fix this in making something like this:
"if not ',' in configurationhandler.project_config['dependencies']"

Also, what happen if the project doesn't have the dependencies key in .quickly file (can happen too). Should be checked :)

Thanks again for your work there. I guess just 5% of the work remain!

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Ah, ok, now I understand! Thanks for the explanation!

You are right, I’m not currently checking this, I’ll prepare an updated patch.

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Updated patch, should handle subsequent upgrades correctly.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Just merged your patch intro trunk. Thanks a lot for your work there!

I reverted:
- os.system("%s %s" % (editor, depfile_name))
+ subprocess.call([editor, depfile_name])
Indeed subprocess doesn't work with inline editor (like vim, for instance).

This update will be part of Quickly 0.4.3

Changed in quickly:
status: Triaged → Fix Committed
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

 quickly (0.4.3-0ubuntu1) lucid-proposed; urgency=low
 .
   * New bugfix release:
     quickly core:
     - fix wrong template proposal for commands not followed by template
     ubuntu-application template:
     - change label caption from glade to design (LP: #571409)
     - fix dialog when having - in title name (LP: #578710)
     - fix unicode problems in About dialog (LP: #582584) (Petar Vasić)
     - fix the boiler plate for faulty preferences dialog code (LP: #587090)
       (Nick Veitch)
     ubuntu-application and inherited:
     - fix configure stripping team name for ppa (LP: #587314) (Frederik Elwert)
     - fix not all syntax for dependencies supported (LP: #587520) (Frederik
       Elwert)
     - fix issue and description of release: quickly release <number>
     updated translations

TestCase:
- install the new version
- check that the bugs listed in the changelog are fixed
- check that it doesn't break the normal Quicklly workflow

Changed in quickly (Ubuntu Lucid):
status: New → Triaged
Changed in quickly (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in quickly (Ubuntu Lucid):
importance: Undecided → Medium
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
Changed in quickly:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted quickly into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in quickly (Ubuntu Lucid):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Ryan Macnish (nisshh) wrote :

I have tested 0.4.3 and this bug is fixed.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package quickly - 0.4.3-0ubuntu1

---------------
quickly (0.4.3-0ubuntu1) lucid-proposed; urgency=low

  * New bugfix release:
    quickly core:
    - fix wrong template proposal for commands not followed by template
    ubuntu-application template:
    - change label caption from glade to design (LP: #571409)
    - fix dialog when having - in title name (LP: #578710)
    - fix unicode problems in About dialog (LP: #582584) (Petar Vasić)
    - fix the boiler plate for faulty preferences dialog code (LP: #587090)
      (Nick Veitch)
    ubuntu-application and inherited:
    - fix configure stripping team name for ppa (LP: #587314) (Frederik Elwert)
    - fix not all syntax for dependencies supported (LP: #587520) (Frederik
      Elwert)
    - fix issue and description of release: quickly release <number>
    updated translations
 -- Didier Roche <email address hidden> Fri, 11 Jun 2010 13:18:01 +0200

Changed in quickly (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Copied to maverick as well.

Changed in quickly (Ubuntu):
status: Triaged → 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.