From 78011666f8c604b24b673ef94d0c31bc6778ce91 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Thu, 24 Nov 2011 21:27:47 -0500 Subject: [PATCH 01/16] Remove the source package when the binary package name is not the same as the source package name --- debian/changelog | 7 +++++++ invirtibuilder | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc34a10..0a99b19 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-dev (0.1.18) unstable; urgency=low + + * Remove the source package when the binary package name is not the same + as the source package name + + -- Quentin Smith Thu, 24 Nov 2011 21:26:29 -0500 + invirt-dev (0.1.17) unstable; urgency=low * Remove all binary packages built from a source package when rebuilding diff --git a/invirtibuilder b/invirtibuilder index 8a6b077..bf3b499 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -202,8 +202,10 @@ def uploadBuild(pocket, workdir): except subprocess.CalledProcessError, e: if not force: raise - packages = deb822.Changes(open(changes).read())['Binary'] - for package in packages.split(): + 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) -- 1.7.9.5 From e1f7b2844093a084076a7e173b410a5d31ff6674 Mon Sep 17 00:00:00 2001 From: Mitchell E Berger Date: Tue, 20 Dec 2011 13:41:10 -0500 Subject: [PATCH 02/16] Add a repo_access configuration hook to grant VCS access to developers not trusted to build into any package pockets --- debian/changelog | 7 +++++++ invirt-build-conf | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0a99b19..b7add8e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-dev (0.1.19) unstable; urgency=low + + * Add a repo_access configuration hook to grant VCS access to + developers not trusted to build into any package pockets + + -- Mitchell Berger Tue, 20 Dec 2011 13:40:00 -0500 + invirt-dev (0.1.18) unstable; urgency=low * Remove the source package when the binary package name is not the same diff --git a/invirt-build-conf b/invirt-build-conf index cd0a750..8df29d2 100755 --- a/invirt-build-conf +++ b/invirt-build-conf @@ -61,6 +61,10 @@ def main(): print >>f, 'create repo /usr/bin/invirt-add-repo /etc/remctl/acl/repo_admin' with atomic_write(os.path.join(builder._REPO_DIR, '.k5login')) as f: + if 'repo_access' in config.build: + acl = authz.expandAdmin(config.build.repo_access) + princs = [userToPrinc(a) for a in acl] + all_devs.update(set(princs)) print >>f, '\n'.join(all_devs) -- 1.7.9.5 From e84d19305a4744c77198d718c5cb49338a51ae16 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 9 Mar 2013 16:16:15 -0500 Subject: [PATCH 03/16] Support getting Git commits from elsewhere, for xvm-dev Requires manually setting up the clones in /srv/git/invirt/packages/, with --mirror=fetch remotes. Currently expecting this to be a temporary setup anyway. --- debian/changelog | 9 +++++++++ invirt-submit-build | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index b7add8e..e931861 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +invirt-dev (0.1.20) unstable; urgency=low + + * Support getting Git commits from elsewhere, for xvm-dev + (Requires manually setting up the clones in /srv/git/invirt/packages/, + with --mirror=fetch remotes. Currently expecting this to be a + temporary setup anyway.) + + -- Greg Price Sat, 09 Mar 2013 16:11:23 -0500 + invirt-dev (0.1.19) unstable; urgency=low * Add a repo_access configuration hook to grant VCS access to diff --git a/invirt-submit-build b/invirt-submit-build index 4bed2ee..f202c3d 100755 --- a/invirt-submit-build +++ b/invirt-submit-build @@ -24,6 +24,8 @@ import sys import tempfile import uuid +from invirt.config import structs as config +import invirt.common as c import invirt.builder as b @@ -43,6 +45,8 @@ def main(): try: # TODO: clean up this interface. b.ensureValidPackage(package) + if config.build.get('mirror'): + c.captureOutput(['git', 'fetch'], cwd=b.getRepo(package)) commit = b.canonicalize_commit(package, commit) b.validateBuild(pocket, package, commit) except b.InvalidBuild, e: -- 1.7.9.5 From 50d6954a47fdce977bc0853e53a2bb14ff04ca90 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 9 Mar 2013 17:07:49 -0500 Subject: [PATCH 04/16] Fix "git archive" command in invirtibuilder --- debian/changelog | 7 +++++++ invirtibuilder | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e931861..c98533e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-dev (0.1.21) unstable; urgency=low + + * The "git archive" command broke on recent Git. Replace + --remote=file: with the standard --git-dir, which works. + + -- Greg Price Sat, 09 Mar 2013 17:06:42 -0500 + invirt-dev (0.1.20) unstable; urgency=low * Support getting Git commits from elsewhere, for xvm-dev diff --git a/invirtibuilder b/invirtibuilder index bf3b499..fd1417f 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -287,8 +287,8 @@ def packageWorkdir(package, commit, build_id): 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, ], -- 1.7.9.5 From abe003c68224fa27b9a3cc6a9188a220cc4a13a7 Mon Sep 17 00:00:00 2001 From: Steven Valdez Date: Wed, 20 Mar 2013 02:24:53 -0400 Subject: [PATCH 05/16] Fixed formatting in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 3978406..1cc98c9 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ Installation: - The secret of the gpg key identified in invirt.config.apt.keyid must be in the keyring of the repository user. - The public key should then be in the apt keyring of systems using + - The public key should then be in the apt keyring of systems using the packages. - Packages should be located at -- 1.7.9.5 From 97dfc56429b6cb2fec836c9051b1d0aa3078065c Mon Sep 17 00:00:00 2001 From: Steven Valdez Date: Wed, 20 Mar 2013 02:37:56 -0400 Subject: [PATCH 06/16] Fixed version --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index b7add8e..d23c8f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-dev (0.1.20) precise; urgency=low + + * Fixed formatting in the README + + -- Steven Valdez Wed, 20 Mar 2013 02:37:34 -0400 + invirt-dev (0.1.19) unstable; urgency=low * Add a repo_access configuration hook to grant VCS access to -- 1.7.9.5 From 10bc540738db1d1416a65a9aa8687ed3011b18f9 Mon Sep 17 00:00:00 2001 From: Steven Valdez Date: Wed, 20 Mar 2013 02:24:53 -0400 Subject: [PATCH 07/16] Fixed formatting in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 3978406..1cc98c9 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ Installation: - The secret of the gpg key identified in invirt.config.apt.keyid must be in the keyring of the repository user. - The public key should then be in the apt keyring of systems using + - The public key should then be in the apt keyring of systems using the packages. - Packages should be located at -- 1.7.9.5 From c270399470fc2b3cda1d5380f1e641f156db8224 Mon Sep 17 00:00:00 2001 From: Steven Valdez Date: Wed, 20 Mar 2013 02:37:56 -0400 Subject: [PATCH 08/16] Fixed version --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c98533e..1508207 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-dev (0.1.22) precise; urgency=low + + * Fixed formatting in the README + + -- Steven Valdez Wed, 20 Mar 2013 02:37:34 -0400 + invirt-dev (0.1.21) unstable; urgency=low * The "git archive" command broke on recent Git. Replace -- 1.7.9.5 From e491a46de27679430d1ee21fd2516451254d7984 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Sun, 10 Mar 2013 21:04:18 -0400 Subject: [PATCH 09/16] Fix grammar error --- README.invirtibuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.invirtibuilder b/README.invirtibuilder index a60c2e9..72215e2 100644 --- a/README.invirtibuilder +++ b/README.invirtibuilder @@ -268,7 +268,7 @@ Once the build has been successfully completed, the APT and Git repositories are updated to match the new state. First, a new tag is added to the package's Git repository for the current version [#]_. Next, the pocket tracking branch in the submodule is also -updated with the new version of the package. Then the a new commit is +updated with the new version of the package. Then a new commit is created on the superproject which updates the package's submodule to point to the new version of the package. Finally, the new version of the package is included in the appropriate component of the APT -- 1.7.9.5 From 7ab21029484efeb1abd46d1cdd635a055cb46882 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Mon, 25 Mar 2013 23:10:49 -0400 Subject: [PATCH 10/16] Add package to build submission zephyrs --- build-hooks/post-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-hooks/post-build b/build-hooks/post-build index 3b9d3f4..2e5aa7d 100755 --- a/build-hooks/post-build +++ b/build-hooks/post-build @@ -102,7 +102,7 @@ def submit_completion_msg(succeeded, values, verbose=True, success=lambda x: x, values['_extra'] = '\nError: %s' % escape(sys.stdin.read()) for key in ['commit', 'pocket', 'principal']: values[key] = escape(values[key]) - msg = """Submission of %(commit)s to be built in %(pocket)s %(result)s. + msg = """Submission of %(commit)s (%(package)s) to be built in %(pocket)s %(result)s. Build submitted by %(principal)s.%(_extra)s""" % values return msg -- 1.7.9.5 From e18b24c5a3314a430c66eae6f2c47e52ba1ab66f Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Mon, 25 Mar 2013 23:58:01 -0400 Subject: [PATCH 11/16] Resync zephyr-post-receive with upstream This incorporates the changes in snippets from 7f3e83eb49926fd6bf2d60ee2a9642640e5b8b0b ("zephyr-post-receive: Detect renames." by Anders) to 0a6422ec6a30429215c4a93dd5a40799712c09b0 ("zephyr-post-receive: fix quoting and tabs" by me). --- git-hooks/sub/zephyr-post-receive | 45 ++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/git-hooks/sub/zephyr-post-receive b/git-hooks/sub/zephyr-post-receive index 3cb2086..293cae6 100755 --- a/git-hooks/sub/zephyr-post-receive +++ b/git-hooks/sub/zephyr-post-receive @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # This script is run after receive-pack has accepted a pack and the # repository has been updated. It is passed arguments in through stdin @@ -13,6 +13,7 @@ class=$(invirt-getconf "$base.class" 2>/dev/null) instance=$(invirt-getconf "$base.instance" 2>/dev/null) zsig=$(invirt-getconf "$base.zsig" 2>/dev/null) color=$(invirt-getconf "$base.color" 2>/dev/null) +maxlines=`git config --int zephyr.maxlines 2>/dev/null || echo 50` # Git hooks are always called with PWD == GIT_DIR. repo=${PWD#/srv/git/} @@ -24,30 +25,64 @@ else usecolor="" fi +if [ -z "$zsig" ]; then + if [ -e "$GIT_DIR/description" ]; then + zsig=`cat "$GIT_DIR/description"` + fi + if [ -z "$zsig" ] || \ + [ "$zsig" = "Unnamed repository; edit this file to name it for gitweb." ] || \ + [ "$zsig" = "Unnamed repository; edit this file 'description' to name the repository." ]; then + zsig=$(basename "$(cd "$GIT_DIR" && pwd)") + if [ "$zsig" = ".git" ]; then + zsig=$(basename "$(cd "$GIT_DIR/.." && pwd)") + fi + fi +fi + if [ -z "$class" ]; then echo "I don't know where to send a commit zephyr!" >&2 echo "Please provide a value for $base.class in" >&2 echo "your invirt config file." >&2 exit 1 fi + +let max=10 +check_max () { + if ! let --max; then + zwrite -c "$class" -i "${instance:-git}" -s "Aperture Science Emergency Intelligence Incinerator" -d \ + -m 'Aborting zephyr hook to prevent zwrite flood.' + exit 0 + fi +} + while read oldrev newrev refname; do if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then + check_max # dammit git zwrite -c "$class" -i "$repo" -s "${zsig:-Git}: $refname" -d \ - -m "New branch ${refname#refs/heads/} created." + -m "New branch ${refname#refs/heads/} created, currently at $newrev." continue fi - git rev-list --first-parent --reverse "$oldrev..$newrev" | while read rev; do + while read rev; do + check_max shortrev=`git log -1 --pretty=format:%h "$rev"` - (git show --stat -M $usecolor "$rev" | + lines=`git show -M "$rev" | wc -l` + if [ $lines -lt $maxlines ]; then + stat="" + else + stat="--stat" + fi + (git show -M $stat $usecolor "$rev" | sed -e 's/@/@@/g' \ -e 's/}/@(})/g' \ -e 's/\[m/}@{/g' \ + -e 's/\[1m/}@b{/g' \ -e 's/\[33m/@color(yellow)/g' \ -e 's/\[31m/@color(red)/g' \ -e 's/\[32m/@color(green)/g' \ + -e 's/\[36m/@color(cyan)/g' \ -e '1s/^/@{/' \ -e '$s/$/}/') | zwrite -c "$class" -i "${instance:-$repo/$shortrev}" -s "${zsig:-Git}: $refname" -d - done + done < <(git rev-list --first-parent --reverse "$oldrev..$newrev") done -- 1.7.9.5 From 7826e4072b7421fcef68be846e5feec6649aa72f Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Tue, 26 Mar 2013 00:03:03 -0400 Subject: [PATCH 12/16] Add changelog entry with my recent changes --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1508207..6ac3140 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +invirt-dev (0.1.23) unstable; urgency=low + + * Include the package name when zephyring about build submissions + * Resync zephyr-post-receive with the version in upstream + /mit/snippets/git-hooks/ + * Fix grammar in the README + + -- Alex Dehnert Tue, 26 Mar 2013 00:01:02 -0400 + invirt-dev (0.1.22) precise; urgency=low * Fixed formatting in the README -- 1.7.9.5 From 281e0d0a1d636078a9a48395c753d5a10d78b63a Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Tue, 26 Mar 2013 00:13:59 -0400 Subject: [PATCH 13/16] Correct typo in changelog --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6ac3140..490a6ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ invirt-dev (0.1.23) unstable; urgency=low * Include the package name when zephyring about build submissions * Resync zephyr-post-receive with the version in upstream /mit/snippets/git-hooks/ - * Fix grammar in the README + * Fix grammar in the README.invirtibuilder -- Alex Dehnert Tue, 26 Mar 2013 00:01:02 -0400 -- 1.7.9.5 From f7001f4aedf6cefad5ae3ca820bf685e5862ad86 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Wed, 24 Apr 2013 23:05:55 -0400 Subject: [PATCH 14/16] Use opcode "auto" for build zephyrs --- build-hooks/post-build | 4 ++-- debian/changelog | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build-hooks/post-build b/build-hooks/post-build index 2e5aa7d..0acaefb 100755 --- a/build-hooks/post-build +++ b/build-hooks/post-build @@ -262,8 +262,8 @@ def main(): escape=zephyr_escape) instance = zephyr_config.get('instance', values['default_instance']) % values zsig = zephyr_config.get('zsig', 'XVM Buildbot') % values - common.captureOutput(['zwrite', '-c', klass, '-i', instance, '-s', - zsig, '-d', '-m', msg], + common.captureOutput(['zwrite', '-c', klass, '-i', instance, '-s', zsig, + '-O', 'auto', '-d', '-m', msg], stdout=None, stderr=None) try: diff --git a/debian/changelog b/debian/changelog index 490a6ef..bcb180f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-dev (0.1.24) unstable; urgency=low + + * Use opcode "auto" for build zephyrs + + -- Alex Dehnert Wed, 24 Apr 2013 23:05:15 -0400 + invirt-dev (0.1.23) unstable; urgency=low * Include the package name when zephyring about build submissions -- 1.7.9.5 From a99f0f2e083cdd32a49cfb7b80ced878813909cd Mon Sep 17 00:00:00 2001 From: Adam Glasgall Date: Fri, 12 Jul 2013 23:49:54 -0400 Subject: [PATCH 15/16] build source packages in a chroot too --- debian/changelog | 7 +++++++ invirtibuilder | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bcb180f..05878d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-dev (0.1.25~glasgall1) unstable; urgency=low + + * Build source packages in a chroot as well so that they can take + advantage of newer debhelper et al versions. + + -- Adam Glasgall Fri, 12 Jul 2013 23:48:06 -0400 + invirt-dev (0.1.24) unstable; urgency=low * Use opcode "auto" for build zephyrs diff --git a/invirtibuilder b/invirtibuilder index fd1417f..4e73484 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -389,7 +389,9 @@ def build(): # 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' -- 1.7.9.5 From ddfae2e7744dde1196eeeebf0746397e8bfb3cf8 Mon Sep 17 00:00:00 2001 From: Peter Iannucci Date: Mon, 15 Jul 2013 14:56:26 -0400 Subject: [PATCH 16/16] Better new-pocket affordances in invirtibuilder and build submission script --- debian/changelog | 8 ++++++++ invirtibuilder | 3 +++ python/invirt/builder.py | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/debian/changelog b/debian/changelog index 05878d4..ac05680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +invirt-dev (0.1.25) unstable; urgency=low + + * invirt-submit-build allows builds in new pockets + * invirtibuilder warns if super-repository does not contain the pocket + branch + + -- Peter Iannucci Mon, 15 Jul 2013 14:46:00 -0400 + invirt-dev (0.1.25~glasgall1) unstable; urgency=low * Build source packages in a chroot as well so that they can take diff --git a/invirtibuilder b/invirtibuilder index 4e73484..699ce07 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -220,6 +220,9 @@ def updateSuperproject(pocket, package, commit, principal, version, env): pushes to the superproject. """ superproject = os.path.join(b._REPO_DIR, 'invirt/packages.git') + if not b.pocketExists(pocket, superproject): + raise Exception("Super-repository does not contain pocket branch '%s'. Create it first." % pocket) + branch = b.pocketToGit(pocket) tree = logAndRun(['git', 'ls-tree', branch], cwd=superproject).strip() diff --git a/python/invirt/builder.py b/python/invirt/builder.py index f864feb..8e24faf 100644 --- a/python/invirt/builder.py +++ b/python/invirt/builder.py @@ -106,6 +106,13 @@ def getVersion(package, ref): """Get the version of a given package at a particular ref.""" return getChangelog(package, ref).get_version() +def pocketExists(pocket, repo): + branch = pocketToGit(pocket) + try: + c.captureOutput(['git', 'rev-parse', branch], cwd=repo) + except subprocess.CalledProcessError: + return False + return True def validateBuild(pocket, package, commit): """Given the parameters of a new build, validate that build. @@ -167,6 +174,9 @@ def validateBuild(pocket, package, commit): (new_version, package, p, current_commit)) if not config.build.pockets[pocket].get('allow_backtracking', False): + if not pocketExists(pocket, package_repo): + return True + branch = pocketToGit(pocket) current_version = getVersion(package, branch) if new_version <= current_version: -- 1.7.9.5