summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/anchor_plugin.py3
-rw-r--r--morphlib/plugins/artifact_inspection_plugin.py8
-rw-r--r--morphlib/plugins/certify_plugin.py8
-rw-r--r--morphlib/plugins/system_manifests_plugin.py12
4 files changed, 8 insertions, 23 deletions
diff --git a/morphlib/plugins/anchor_plugin.py b/morphlib/plugins/anchor_plugin.py
index 40cd4c48..62c66c15 100644
--- a/morphlib/plugins/anchor_plugin.py
+++ b/morphlib/plugins/anchor_plugin.py
@@ -137,9 +137,6 @@ class AnchorPlugin(cliapp.Plugin):
for reponame, sources in sources_by_reponame.iteritems():
# UGLY HACK we need to push *FROM* our local repo cache to
# avoid cloning everything multiple times.
- # This uses get_updated_repo rather than get_repo because the
- # BuildCommand.create_source_pool won't cache the repositories
- # locally if it can use a remote cache instead.
repo = bc.lrc.get_updated_repo(reponame,
refs=(s.original_ref
for s in sources))
diff --git a/morphlib/plugins/artifact_inspection_plugin.py b/morphlib/plugins/artifact_inspection_plugin.py
index fc433a01..413a0072 100644
--- a/morphlib/plugins/artifact_inspection_plugin.py
+++ b/morphlib/plugins/artifact_inspection_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2015 Codethink Limited
+# Copyright (C) 2012-2016 Codethink Limited
#
# 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
@@ -46,7 +46,7 @@ class ProjectVersionGuesser(object):
filenames = [x for x in self.interesting_files if x in tree]
if filenames:
if self.lrc.has_repo(repo):
- repository = self.lrc.get_repo(repo)
+ repository = self.lrc.get_updated_repo(repo, ref)
for filename in filenames:
yield filename, repository.read_file(filename, ref)
elif self.rrc:
@@ -147,9 +147,7 @@ class VersionGuesser(object):
version = None
try:
if self.lrc.has_repo(repo):
- repository = self.lrc.get_repo(repo)
- if not self.app.settings['no-git-update']:
- repository.update()
+ repository = self.lrc.get_updated_repo(repo, ref)
tree = repository.list_files(ref=ref, recurse=False)
elif self.rrc:
repository = None
diff --git a/morphlib/plugins/certify_plugin.py b/morphlib/plugins/certify_plugin.py
index 8228be4d..735d0332 100644
--- a/morphlib/plugins/certify_plugin.py
+++ b/morphlib/plugins/certify_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2015 Codethink Limited
+# Copyright (C) 2014-2016 Codethink Limited
#
# 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
@@ -115,11 +115,7 @@ class CertifyPlugin(cliapp.Plugin):
.format(name, ref))
certified = False
- # Ensure we have a cache of the repo
- if not self.lrc.has_repo(source.repo_name):
- self.lrc.cache_repo(source.repo_name)
-
- cached = self.lrc.get_repo(source.repo_name)
+ cached = self.lrc.get_updated_repo(source.repo_name, ref)
# Test that sha1 ref is anchored in a tag or branch,
# and thus not a candidate for removal on `git gc`.
diff --git a/morphlib/plugins/system_manifests_plugin.py b/morphlib/plugins/system_manifests_plugin.py
index 8e14d2eb..4444ecb3 100644
--- a/morphlib/plugins/system_manifests_plugin.py
+++ b/morphlib/plugins/system_manifests_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2015 Codethink Limited
+# Copyright (C) 2015-2016 Codethink Limited
#
# 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
@@ -150,11 +150,7 @@ class SystemManifestsPlugin(cliapp.Plugin):
name = source.morphology['name']
ref = source.original_ref
- # Ensure we have a cache of the repo
- if not self.lrc.has_repo(source.repo_name):
- self.lrc.cache_repo(source.repo_name)
-
- cached = self.lrc.get_repo(source.repo_name)
+ cached = self.lrc.get_updated_repo(source.repo_name, ref)
new_prefix = '[%d/%d][%s] ' % (i, len(sources), name)
self.app.status_prefix = old_prefix + new_prefix
@@ -174,9 +170,7 @@ def run_licensecheck(filename):
return output[len(filename) + 2:].strip()
def checkout_repo(lrc, repo, dest, ref='master'):
- if not lrc.has_repo(repo):
- lrc.cache_repo(repo)
- cached = lrc.get_repo(repo)
+ cached = lrc.get_updated_repo(repo, ref)
if not os.path.exists(dest):
cached.checkout(ref, dest)