From a5fab3c6c4067e99510ed68e0c7959f60f74345d Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 27 Mar 2020 12:06:24 -0400 Subject: Make cache locations project-specific When we use a specific project either via -p or via parsing the full lore URL, don't use the generic lookup cache location. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/b4/__init__.py b/b4/__init__.py index 8a7cf8b..af8b23c 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1462,7 +1462,10 @@ def get_pi_thread_by_url(t_mbx_url, savefile): def get_pi_thread_by_msgid(msgid, savefile, useproject=None, nocache=False): config = get_main_config() cachedir = get_cache_dir() - cachefile = os.path.join(cachedir, '%s.pi.mbx' % urllib.parse.quote_plus(msgid)) + base = msgid + if useproject: + base = '%s-%s' % (useproject, msgid) + cachefile = os.path.join(cachedir, '%s.pi.mbx' % urllib.parse.quote_plus(base)) if os.path.exists(cachefile) and not nocache: logger.debug('Using cached copy: %s', cachefile) shutil.copyfile(cachefile, savefile) -- cgit v1.2.3