~pkgme-committers/pkgme/trunk

« back to all changes in this revision

Viewing changes to pkgme/run_script.py

  • Committer: Jonathan Lange
  • Date: 2011-07-29 16:42:33 UTC
  • mfrom: (70.1.13 debug-logging)
  • Revision ID: jml@canonical.com-20110729164233-sokxhclqz8fjjk3k
Debug log system and many debug statements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import os
3
3
import subprocess
4
4
 
 
5
from pkgme import trace
 
6
 
5
7
 
6
8
class ScriptProblem(Exception):
7
9
 
38
40
    env = os.environ.copy()
39
41
    if os.path.isdir(helperpath):
40
42
        if 'PATH' in env:
41
 
            env['PATH'] = env['PATH'] + ':' + helperpath
 
43
            env['PATH'] = os.pathsep.join([env['PATH'], helperpath])
42
44
        else:
43
45
            env['PATH'] = helperpath
44
46
    try:
 
47
        trace.debug("Running script %s..." % (script_path,))
45
48
        proc = subprocess.Popen(
46
49
            [script_path], stdout=subprocess.PIPE,
47
50
            stderr=subprocess.STDOUT, stdin=subprocess.PIPE,