definition of env varible in run command wrongly depends on existence of glib2 schema path file

Bug #936379 reported by Paolo Sammicheli
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Quickly
Fix Released
Undecided
Unassigned
quickly (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I'm testing the qtquick-application template with the Precise Quickly. Creating a new the project with this template doesn't works anymore providing this error:

Traceback (most recent call last):
  File "/usr/share/quickly/templates/ubuntu-application/create.py", line 126, in <module>
    subprocess.call(['./' + project_name], cwd='bin/', env=env)
NameError: name 'env' is not defined

Inspecting the code in ubuntu-application/create.py I've found at line 112 the env definition:

schemapath = os.path.abspath("data/glib-2.0/schemas")

if os.path.exists(schemapath):
    subprocess.call(["glib-compile-schemas", schemapath])

    env = os.environ.copy()
    datadir = os.path.abspath("data")
    if 'XDG_DATA_DIRS' in env:
        env['XDG_DATA_DIRS'] = "%s:%s" % (datadir, env['XDG_DATA_DIRS'])
    else:
        env['XDG_DATA_DIRS'] = datadir

So if a template derivated from quickly-application doesn't uses glib and doesn't provide the data/glib-2.0/schemas file the variable env is not defined.

The problem is that few lines after in the code we have the env variable used in the subprocess.call

subprocess.call(['./' + project_name], cwd='bin/', env=env)

This would be fixed just putting the env = os.environ.copy() before the if clause.

I'll provide a patch later, thanks in advance

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: quickly 11.12-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-17.26-generic-pae 3.2.6
Uname: Linux 3.2.0-17-generic-pae i686
ApportVersion: 1.91-0ubuntu1
Architecture: i386
Date: Sun Feb 19 18:21:16 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha i386 (20120201.1)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=it_IT.UTF-8
 SHELL=/bin/bash
QuicklyDataPath: /usr/share/quickly
QuicklyTemplatesDirectories:
 /home/x/quickly-templates
 /usr/share/quickly/templates/
SourcePackage: quickly
UpgradeStatus: Upgraded to precise on 2012-02-19 (0 days ago)

Revision history for this message
Paolo Sammicheli (xdatap1) wrote :
summary: - definition of env varible in create commands wrongly depends on
- existance of glib2 schema path
+ definition of env varible in create command wrongly depends on existence
+ of glib2 schema path file
Changed in quickly (Ubuntu):
assignee: nobody → Paolo Sammicheli (xdatap1)
Revision history for this message
Paolo Sammicheli (xdatap1) wrote : Re: definition of env varible in create command wrongly depends on existence of glib2 schema path file

I just find that Dider fixed it in trunk few days ago:

http://bazaar.launchpad.net/~quickly-committers/quickly/trunk/revision/652

You can't beat that guy :)

Changed in quickly (Ubuntu):
status: New → Fix Released
Revision history for this message
Paolo Sammicheli (xdatap1) wrote :

If just found that the same exact code is also in the run command so the same fix is needed also there

Changed in quickly (Ubuntu):
status: Fix Released → Confirmed
summary: - definition of env varible in create command wrongly depends on existence
- of glib2 schema path file
+ definition of env varible in run command wrongly depends on existence of
+ glib2 schema path file
Revision history for this message
Paolo Sammicheli (xdatap1) wrote :

Attaching the patch, if a merge proposal is needed just let me know

Changed in quickly (Ubuntu):
assignee: Paolo Sammicheli (xdatap1) → nobody
Changed in quickly (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "env-not-defined.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. 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-reviewers 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
Michael Terry (mterry)
Changed in quickly:
status: New → Fix Committed
Michael Terry (mterry)
Changed in quickly:
milestone: none → 12.03
Michael Terry (mterry)
Changed in quickly:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
quickly (12.03-0ubuntu1) precise; urgency=low

  * New upstream release
    - Tutorial update (LP: #929417, LP: #929420, LP: #929572)
    - Fix crash when creating derived-template projects (LP: #936379)
    - Don't strip comments from glade files (LP: #945808)
  * debian/rules:
    - Move project_root schema file to template directory after
      python-distutils-extra zealously places it in system schema folder.
 -- Michael Terry <email address hidden> Wed, 14 Mar 2012 20:30:12 -0400

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