From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kconfig: make parent directories for the saved .config as needed
Date: Mon, 13 May 2019 11:31:21 +0900 [thread overview]
Message-ID: <CAK7LNATXs4Cr_2zwX08dd7xE84JaG6K6LF3YXA1=aFNVYji2Ew@mail.gmail.com> (raw)
In-Reply-To: <1557507361-7418-1-git-send-email-yamada.masahiro@socionext.com>
On Sat, May 11, 2019 at 1:56 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> With menuconfig / nconfig, users can input any file path from the
> "Save" menu, but it fails if the parent directory does not exist.
>
> Why not create the parent directory automatically. I think this is
> a user-friendly behavior.
>
> I changed the error messages in menuconfig / nconfig.
>
> "Nonexistent directory" is no longer the most likely reason of the
> failure. Perhaps, the user specified the existing directory, or
> attempted to write to the location without write permission.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
Applied to linux-kbuild.
> scripts/kconfig/confdata.c | 3 +++
> scripts/kconfig/mconf.c | 2 +-
> scripts/kconfig/nconf.c | 3 +--
> 3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 431b805..b7bdd96 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -881,6 +881,9 @@ int conf_write(const char *name)
> return -1;
> }
>
> + if (make_parent_dir(name))
> + return -1;
> +
> env = getenv("KCONFIG_OVERWRITECONFIG");
> if (env && *env) {
> *tmpname = 0;
> diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
> index 5f8c82a..694091f 100644
> --- a/scripts/kconfig/mconf.c
> +++ b/scripts/kconfig/mconf.c
> @@ -936,7 +936,7 @@ static void conf_save(void)
> set_config_filename(dialog_input_result);
> return;
> }
> - show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60);
> + show_textbox(NULL, "Can't create file!", 5, 60);
> break;
> case 1:
> show_helptext("Save Alternate Configuration", save_config_help);
> diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
> index ac92c0d..cbafe3b 100644
> --- a/scripts/kconfig/nconf.c
> +++ b/scripts/kconfig/nconf.c
> @@ -1438,8 +1438,7 @@ static void conf_save(void)
> set_config_filename(dialog_input_result);
> return;
> }
> - btn_dialog(main_window, "Can't create file! "
> - "Probably a nonexistent directory.",
> + btn_dialog(main_window, "Can't create file!",
> 1, "<OK>");
> break;
> case 1:
> --
> 2.7.4
>
--
Best Regards
Masahiro Yamada
prev parent reply other threads:[~2019-05-13 2:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 16:56 [PATCH] kconfig: make parent directories for the saved .config as needed Masahiro Yamada
2019-05-13 2:31 ` Masahiro Yamada [this message]
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='CAK7LNATXs4Cr_2zwX08dd7xE84JaG6K6LF3YXA1=aFNVYji2Ew@mail.gmail.com' \
--to=yamada.masahiro@socionext.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.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).