except subprocess.CalledProcessError, e:
if not force:
raise
- package = deb822.Changes(open(changes).read())['Binary']
- logAndRun(['reprepro-env', 'remove', apt, package])
+ changelog = deb822.Changes(open(changes).read())
+ packages = set(changelog['Binary'].split())
+ packages.add(changelog['Source'])
+ for package in packages:
+ logAndRun(['reprepro-env', 'remove', apt, package])
logAndRun(upload)
pushes to the superproject.
"""
superproject = os.path.join(b._REPO_DIR, 'invirt/packages.git')
+
branch = b.pocketToGit(pocket)
+
+ if not b.pocketExists(pocket, superproject):
+ gitmodules = "\n"
+ gitmodules_hash = logAndRun(['git', 'hash-object', '-w', '--stdin'],
+ cwd=superproject,
+ stdin_str=gitmodules).strip()
+ tree_items = {'.gitmodules': "100644 blob "+gitmodules_hash}
+ new_tree = "\n".join("%s\t%s" % (v, k) for (k, v) in tree_items.iteritems())
+ new_tree_id = logAndRun(['git', 'mktree', '--missing'],
+ cwd=superproject,
+ stdin_str=new_tree).strip()
+ env2 = dict(os.environ)
+ env2['GIT_AUTHOR_NAME'] = config.build.tagger.name
+ env2['GIT_AUTHOR_EMAIL'] = config.build.tagger.email
+ env2['GIT_COMMITTER_NAME'] = config.build.tagger.name
+ env2['GIT_COMMITTER_EMAIL'] = config.build.tagger.email
+ new_commit = logAndRun(['git', 'commit-tree', new_tree_id],
+ cwd=superproject,
+ env=env2,
+ stdin_str="Create new pocket").strip()
+ logAndRun(['git', 'update-ref', 'refs/heads/%s' % branch, new_commit],
+ cwd=superproject)
+
tree = logAndRun(['git', 'ls-tree', branch],
cwd=superproject).strip()
gitmodules_hash = logAndRun(['git', 'hash-object', '-w', '--stdin'],
cwd=superproject,
stdin_str=gitmodules).strip()
- tree_items[package] = "100644 blob "+gitmodules_hash
+ tree_items['.gitmodules'] = "100644 blob "+gitmodules_hash
new_tree = "\n".join("%s\t%s" % (v, k) for (k, v) in tree_items.iteritems())
workdir = tempfile.mkdtemp(prefix=("b%d-" % build_id))
try:
p_archive = subprocess.Popen(
- ['git', 'archive',
- '--remote=file://%s' % b.getRepo(package),
+ ['git', '--git-dir=%s' % (b.getRepo(package),),
+ 'archive',
'--prefix=%s/' % package,
commit,
],
env = dict(os.environ)
env['GIT_COMMITTER_NAME'] = config.build.tagger.name
env['GIT_COMMITTER_EMAIL'] = config.build.tagger.email
+ env['GIT_AUTHOR_NAME'] = principal.split('@')[0]
+ env['GIT_AUTHOR_EMAIL'] = principal
# If validateBuild returns something other than True, then
# it means we should copy from that pocket to our pocket.
# If we were, we could use debuild and get nice
# environment scrubbing. Since we're not, debuild
# complains about not having an orig.tar.gz
- logAndRun(['dpkg-buildpackage', '-us', '-uc', '-S'],
+ logAndRun(['schroot', '-c',
+ '%s-amd64-sbuild' % (b.pocketToDistro(pocket),),
+ '--', 'dpkg-buildpackage', '-us', '-uc', '-S'],
cwd=packagedir)
db.failed_stage = 'building binary packages'