summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-11-20 12:31:13 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-11-20 12:49:33 +0000
commit3dc746bee5664fbd3fe111a4c28243bce4b5ad49 (patch)
treedb20b94cce6d8f1fcb14b80e575e27fefea8f163
parentaa5c9cfde38f19ae8795ec3b9ef6c64510fc0212 (diff)
downloadimport-3dc746bee5664fbd3fe111a4c28243bce4b5ad49.tar.gz
Print out what requires a package when we can't find its ref
Sometimes this is due to weird version requirements caused by some other package which isn't actually needed.
-rw-r--r--baserockimport/mainloop.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/baserockimport/mainloop.py b/baserockimport/mainloop.py
index 9c6e08b..99391af 100644
--- a/baserockimport/mainloop.py
+++ b/baserockimport/mainloop.py
@@ -203,8 +203,8 @@ class ImportLoop(object):
lorry = self._find_or_create_lorry_file(kind, name)
source_repo, url = self._fetch_or_update_source(lorry)
- checked_out_version, ref = self._checkout_source_version(
- source_repo, name, version)
+ checked_out_version, ref = self._checkout_source_version_for_package(
+ source_repo, package)
package.set_version_in_use(checked_out_version)
# 2. Create a chunk morphology with build instructions.
@@ -366,9 +366,11 @@ class ImportLoop(object):
return repo, url
- def _checkout_source_version(self, source_repo, name, version):
+ def _checkout_source_version_for_package(self, source_repo, package):
# FIXME: we need to be a bit smarter than this. Right now we assume
# that 'version' is a valid Git ref.
+ name = package.name
+ version = package.version
possible_names = [
version,
@@ -390,7 +392,7 @@ class ImportLoop(object):
ref = version = 'master'
else:
raise BaserockImportException(
- 'Could not find ref for %s version %s.' % (name, version))
+ 'Could not find ref for %s.' % package)
return version, ref