[PATCH] Make ccache use the same directory for repos that are clones

Lars Wirzenius lars.wirzenius at codethink.co.uk
Thu Jan 3 15:37:16 GMT 2013


On Thu, Jan 03, 2013 at 03:21:40PM +0000, Jonathan Maw wrote:
> +        ccache_url = self.artifact.source.repo.url
> +        ccache_path = urlparse(ccache_url).path
> +        ccache_repobase = os.path.basename(ccache_path)
> +        if ':' in ccache_repobase:
> +            pos = ccache_repobase.find(':')
> +            ccache_repobase = ccache_repobase[pos+1:]

Instead of parsing for colons in the URL manually, it would be best
to use the normal Morph routines for expanding an aliased URL into
its unaliased form. If, after this, the basename of the path component
of the URL still has a colon, that should be escaped (replaced with
an underscore).

I thought the CachedRepo.url field was meant to have its alias
already expanded. Am I wrong about this?

-- 
http://www.codethink.co.uk/ http://wiki.baserock.org/ http://www.baserock.com/




More information about the baserock-dev mailing list