Skip to content

Commit 284026c

Browse files
marcowssravnborg
authored andcommitted
kconfig: do not hardcode ".config" filename
Rather than hardcoding ".config" use conf_get_configname(), which also respects the environment variable KCONFIG_CONFIG. This fixes "make silentoldconfig" when KCONFIG_CONFIG is used and also suggests the given filename for "Load" and "Save as" in qconf. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 8d90c97 commit 284026c

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎scripts/kconfig/conf.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,15 @@ int main(int ac, char **av)
498498
conf_parse(name);
499499
//zconfdump(stdout);
500500
if (sync_kconfig) {
501-
if (stat(".config", &tmpstat)) {
501+
name = conf_get_configname();
502+
if (stat(name, &tmpstat)) {
502503
fprintf(stderr, _("***\n"
503504
"*** You have not yet configured your kernel!\n"
504-
"*** (missing kernel .config file)\n"
505+
"*** (missing kernel config file \"%s\")\n"
505506
"***\n"
506507
"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
507508
"*** \"make menuconfig\" or \"make xconfig\").\n"
508-
"***\n"));
509+
"***\n"), name);
509510
exit(1);
510511
}
511512
}

‎scripts/kconfig/qconf.cc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void)
14481448

14491449
void ConfigMainWindow::loadConfig(void)
14501450
{
1451-
QString s = QFileDialog::getOpenFileName(".config", NULL, this);
1451+
QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this);
14521452
if (s.isNull())
14531453
return;
14541454
if (conf_read(QFile::encodeName(s)))
@@ -1464,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void)
14641464

14651465
void ConfigMainWindow::saveConfigAs(void)
14661466
{
1467-
QString s = QFileDialog::getSaveFileName(".config", NULL, this);
1467+
QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this);
14681468
if (s.isNull())
14691469
return;
14701470
if (conf_write(QFile::encodeName(s)))

0 commit comments

Comments
 (0)