~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/buildd/buildrecipe

Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
 
10
10
import os
11
 
import os.path
12
11
import pwd
13
12
import socket
14
13
from subprocess import call
76
75
            recipe = recipe_file.read()
77
76
        finally:
78
77
            recipe_file.close()
 
78
        # As of bzr 2.2, a defined identity is needed.  In this case, we're using
 
79
        # buildd@<hostname>.
 
80
        hostname = socket.gethostname()
 
81
        bzr_email = 'buildd@%s' % hostname
 
82
 
79
83
        print 'Building recipe:'
80
84
        print recipe
81
85
        retcode = self.chroot([
82
 
            'sudo', '-iu', self.username, 'DEBEMAIL=%s' % self.author_email,
83
 
            'DEBFULLNAME=%s' % self.author_name.encode('utf-8'), 'bzr',
 
86
            'sudo', '-i', '-u', self.username, 'DEBEMAIL=%s' % self.author_email,
 
87
            'DEBFULLNAME=%s' % self.author_name.encode('utf-8'),
 
88
            'BZR_EMAIL=%s' % bzr_email, 'bzr',
84
89
            'dailydeb', '--no-build', recipe_path_relative,
85
90
            self.tree_path_relative, '--manifest', manifest_path_relative,
86
91
            '--append-version', '~%s1' % self.distroseries_name],
127
132
        if echo:
128
133
            print "Running in chroot: %s" % ' '.join(
129
134
                "'%s'" % arg for arg in args)
 
135
            sys.stdout.flush()
130
136
        return call([
131
137
            '/usr/bin/sudo', '/usr/sbin/chroot', self.chroot_path] + args)
132
138
 
156
162
        os.environ["HOME"], "build-" + build_id, *extra)
157
163
 
158
164
if __name__ == '__main__':
159
 
    # As of bzr 2.2, a defined identity is needed.  In this case, we're using
160
 
    # buildd@<hostname>.
161
 
    hostname = socket.gethostname()
162
 
    os.environ['BZR_EMAIL'] = 'buildd@%s' % hostname
163
 
 
164
165
    builder = RecipeBuilder(*sys.argv[1:])
165
166
    if builder.install() != 0:
166
167
        sys.exit(RETCODE_FAILURE_INSTALL)