summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-01-03 17:47:34 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-01-03 17:47:34 +0000
commit7172dca14d7306d79e93b97dcef3a006309f2e03 (patch)
tree08678cc13b518a0a3cbdc4e059c52e1de0a9757a
parent530ffb7125f87e528dcf6338b637ef71a7930b8c (diff)
parentee1cb9b7e6366568a29016f09adbdb327073e470 (diff)
downloadmorph-7172dca14d7306d79e93b97dcef3a006309f2e03.tar.gz
Merge remote-tracking branch 'origin/jonathanmaw/ccache-local-fix'
Fixed a copyright year to make ./check happy.
-rw-r--r--morphlib/builder2.py19
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py2
2 files changed, 16 insertions, 5 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 0c1acfde..a60c4a47 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012-2013 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
@@ -27,6 +27,7 @@ import traceback
import subprocess
import tempfile
import gzip
+from urlparse import urlparse
import cliapp
@@ -294,9 +295,19 @@ class ChunkBuilder(BuilderBase):
if not os.path.isdir(ccache_dir):
os.makedirs(ccache_dir)
# Get a path for the repo's ccache
- ccache_repobase = os.path.basename(self.artifact.source.repo.path)
- ccache_repodir = os.path.join(ccache_dir,
- ccache_repobase)
+ ccache_url = self.artifact.source.repo.url
+ ccache_path = urlparse(ccache_url).path
+ ccache_repobase = os.path.basename(ccache_path)
+ if ':' in ccache_repobase: # the basename is a repo-alias
+ resolver = morphlib.repoaliasresolver.RepoAliasResolver(
+ self.app.settings['repo-alias'])
+ ccache_url = resolver.pull_url(ccache_repobase)
+ ccache_path = urlparse(ccache_url).path
+ ccache_repobase = os.path.basename(ccache_path)
+ if ccache_repobase.endswith('.git'):
+ ccache_repobase = ccache_repobase[:-len('.git')]
+
+ ccache_repodir = os.path.join(ccache_dir, ccache_repobase)
# Make sure that directory exists
if not os.path.isdir(ccache_repodir):
os.mkdir(ccache_repodir)
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index 30f66ff1..88c017c8 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012,2013 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