tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: Kees Cook <keescook@chromium.org>, tools@linux.kernel.org
Subject: [PATCH 2/5] patchwork-bot: Create CACHEDIR if it is missing
Date: Tue, 30 Nov 2021 16:11:23 -0800	[thread overview]
Message-ID: <20211201001126.4106635-3-keescook@chromium.org> (raw)
In-Reply-To: <20211201001126.4106635-1-keescook@chromium.org>

Create the CACHEDIR if it is missing (e.g. the first time
git-patchwork-bot is executed).

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 git-patchwork-bot.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py
index d1eac6c0c0df..dc10fd0effa9 100755
--- a/git-patchwork-bot.py
+++ b/git-patchwork-bot.py
@@ -1375,6 +1375,9 @@ if __name__ == '__main__':
         cfgyaml = fh.read()
     CONFIG = ruamel.yaml.safe_load(cfgyaml)
 
+    if not os.path.isdir(CACHEDIR):
+        os.makedirs(CACHEDIR, exist_ok=True)
+
     if cmdargs.housekeeping:
         for _pserver, _sconfig in CONFIG['patchworks'].items():
             for _pname in _sconfig['projects']:
-- 
2.30.2


  parent reply	other threads:[~2021-12-01  0:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01  0:11 [PATCH 0/5] patchwork-bot: Use worktrees for repos Kees Cook
2021-12-01  0:11 ` [PATCH 1/5] patchwork-bot: Note which actions are part of "housekeeping" Kees Cook
2021-12-01  0:11 ` Kees Cook [this message]
2021-12-01  0:11 ` [PATCH 3/5] patchwork-bot: Allow limiting heads to single branch Kees Cook
2021-12-01  0:11 ` [PATCH 4/5] patchwork-bot: Handle repo being a worktree Kees Cook
2021-12-01  0:11 ` [PATCH 5/5] patchwork-bot: Allow initial database to skip recent commits Kees Cook
2021-12-13 22:30 ` [PATCH 0/5] patchwork-bot: Use worktrees for repos Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211201001126.4106635-3-keescook@chromium.org \
    --to=keescook@chromium.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).