From 45d0df026e01b4245b3fe8ff2a0190ace8d1ccc0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 23 May 2013 21:56:03 +0100 Subject: Remove trailing whitespace --- jenkinstool | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'jenkinstool') diff --git a/jenkinstool b/jenkinstool index bf45b6c..21197d5 100755 --- a/jenkinstool +++ b/jenkinstool @@ -3,17 +3,17 @@ # jenkinstool -- manipulate jobs in a running Jenkins instance # # Copyright 2012 Lars Wirzenius -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -76,7 +76,7 @@ commit_date() { if [ -e .bzr ] then - commit_timestamp="$(bzr log -l1 --timezone=utc | + commit_timestamp="$(bzr log -l1 --timezone=utc | sed -n '/^timestamp: /s///p')" elif [ -e .git ] then @@ -93,7 +93,7 @@ is_release() { local project="$1" local version="$2" - + if [ -d .bzr ] then if bzr log -l1 | @@ -108,7 +108,7 @@ is_release() fi elif [ -d .git ] then - tag=$(git show-ref --tags "${project}-${version}" | + tag=$(git show-ref --tags "${project}-${version}" | awk '{ print $1 }') commit=$(git log -1 | awk '/^commit / { print $2 }') if [ -n "$tag" ] && [ "$tag" = "$commit" ] @@ -160,7 +160,7 @@ then "debian/changelog version $debianversion" \ "match, good" ;; - *) + *) echo "Upstream version $version and " \ "debian/changelog version $debianversion" \ "do NOT match, bad" 1>&2 @@ -206,7 +206,7 @@ fi class JobGenerator(object): '''Generate Jenkins jobs from a JSON specification file.''' - + def __init__(self, pretend, pbuilder_max_age, artifacts_url, jenkins_host): self.pretend = pretend self.pbuilder_max_age = pbuilder_max_age @@ -215,13 +215,13 @@ class JobGenerator(object): def generate_setup_jobs(self, config): '''Generate all the shared jobs to setup Jenkins. - + Return list of (job_id, config_xml) pairs. - + ''' jobs = [] - + # Setup reprepro on Jenkins host. reprepro = self.reprepro_setup_job(config) jobs.append(reprepro) @@ -343,7 +343,7 @@ setup_pbuilder() else opts="--create" fi - + if %(global.pretend)s then echo "PRETEND: pbuilder create/update $basetgz" @@ -370,7 +370,7 @@ setup_pbuilder "$pbuilder_release_tgz" yes ''') return jc - + def generate_project(self, config, project): '''Generate all the jobs for a given project.''' @@ -380,7 +380,7 @@ setup_pbuilder "$pbuilder_release_tgz" yes } main_host = config['hosts'][0] jobs = [] - + jobs.append(self.vcs_watch_job(localhost, project)) for host in config['hosts']: @@ -425,11 +425,11 @@ setup_pbuilder "$pbuilder_release_tgz" yes def prepare_worker_job(self, host, project): '''Create job to prepare worker for build. - + Upgrades build environment, and configures dput. - + ''' - + jc = self.create_job_config(host, project, 'prepare-worker') jc.set_description('Upgrade build environment on %(host.ssh-target)s ' 'for %(project.name)s from %(project.vcs)s') @@ -472,8 +472,8 @@ EOF self.add_rsync_workspace_to_target(jc) if not self.pretend: jc.add_ssh_command(have_vcs_copy + prelude + ''' -missing="$(dpkg-checkbuilddeps 2>&1 | - sed -n '/^.*: Unmet build dependencies: /s///p' | +missing="$(dpkg-checkbuilddeps 2>&1 | + sed -n '/^.*: Unmet build dependencies: /s///p' | sed 's/([^)]*)//g' | tr -s ' ' '\n')" case "$missing" in @@ -576,7 +576,7 @@ else esac fi -# Should we modify debian/changelog? We do not do that if it is a +# Should we modify debian/changelog? We do not do that if it is a # release build, going to Debian unstable. if ! is_release "$project" "$version" then @@ -593,7 +593,7 @@ debuild -S $srcopt -us -uc -i dput -f jenkins "../$changes" ''') self.add_rsync_workspace_from_target(jc) - + return jc def process_incoming_job(self, config, localhost, project, suffix): @@ -619,7 +619,7 @@ dput -f jenkins "../$changes" self.add_get_source_from_vcs(jc) self.add_rsync_workspace_to_target(jc) - + script = have_vcs_copy + prelude if build_all: script += ''' @@ -715,7 +715,7 @@ rm -rf "$temp" class JenkinsTool(cliapp.Application): '''Manipulate jobs in running Jenkins CI server.''' - + def add_settings(self): self.settings.boolean( ['pretend-jobs'], @@ -777,13 +777,13 @@ class JenkinsTool(cliapp.Application): def cmd_graph_projects(self, args): '''Output a graphviz file showing project dependencies.''' - + def find(config, name): for project in config['projects']: if project['name'] == name: return project return None - + def write_graphviz(f, config, project_names): done = set() f.write('strict digraph foo {\n') @@ -796,9 +796,9 @@ class JenkinsTool(cliapp.Application): for dep in project.get('build-depends', []): f.write('"%s" -> "%s";\n' % (name, dep)) project_names.append(dep) - + f.write('}\n') - + if len(args) == 0: return @@ -817,7 +817,7 @@ class JenkinsTool(cliapp.Application): '''Update Jenkmins with jobs based specification, then run them.''' self.settings.require('jenkins-host') - + if len(args) == 0: return filename = args[0] @@ -872,7 +872,7 @@ class JenkinsTool(cliapp.Application): ts = ttystatus.TerminalStatus(period=0) ts.format('Running job %Index(job,jobs) %String(job)') ts['jobs'] = job_ids - + for job_id in job_ids: logging.info('Starting job %s' % job_id) ts['job'] = job_id @@ -894,7 +894,7 @@ class JenkinsTool(cliapp.Application): (self.settings['jenkins-host'], job_id, latest) raise cliapp.AppException('Job %s failed: %s' % (job_id, url)) - ts.finish() + ts.finish() JenkinsTool(version=simplejenkinsapi.__version__).run() -- cgit v1.2.1