summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-27 12:12:47 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-27 12:12:47 -0400
commit6521e15f95bea9d580156b52df7bb855c6765e9e (patch)
tree93745c7bce1bbffb14b6376eaef30fbf0258f153
parent088064c0b88966e5d3d7b488e27c4ea0092c9d73 (diff)
downloadb4-6521e15f95bea9d580156b52df7bb855c6765e9e.tar.gz
Disambiguate cache when useproject is specified
(Backported from master) When we are forcing a specific project, either via -p or via parsing the full lore URL, save and fetch from a distinct cache location. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/mbox.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index 7043fa1..e3bde22 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -62,7 +62,10 @@ def get_pi_thread_by_msgid(msgid, config, cmdargs):
savefile = os.path.join(outdir, savefile)
cachedir = b4.get_cache_dir()
- cachefile = os.path.join(cachedir, '%s.pi.mbx' % urllib.parse.quote_plus(msgid))
+ base = msgid
+ if cmdargs.useproject:
+ base = '%s-%s' % (cmdargs.useproject, msgid)
+ cachefile = os.path.join(cachedir, '%s.pi.mbx' % urllib.parse.quote_plus(base))
if os.path.exists(cachefile) and not cmdargs.nocache:
logger.debug('Using cached copy: %s', cachefile)
shutil.copyfile(cachefile, savefile)