mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
tools/configure.sh and .c: When dumping available configurations, omit the 'config/' in the path.
This commit is contained in:
+31
-5
@@ -486,7 +486,7 @@ static void config_search(const char *boarddir)
|
|||||||
|
|
||||||
parent = strdup(g_buffer);
|
parent = strdup(g_buffer);
|
||||||
|
|
||||||
/* Vist each entry in the directory */
|
/* Visit each entry in the directory */
|
||||||
|
|
||||||
while ((dp = readdir (dir)) != NULL)
|
while ((dp = readdir (dir)) != NULL)
|
||||||
{
|
{
|
||||||
@@ -498,7 +498,8 @@ static void config_search(const char *boarddir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get a properly terminated copy of d_name (if d_name is long it may
|
/* Get a properly terminated copy of d_name (if d_name is long it may
|
||||||
* not include a NUL terminator.\ */
|
* not include a NUL terminator.
|
||||||
|
*/
|
||||||
|
|
||||||
child = strndup(dp->d_name, NAME_MAX);
|
child = strndup(dp->d_name, NAME_MAX);
|
||||||
|
|
||||||
@@ -513,7 +514,7 @@ static void config_search(const char *boarddir)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If it is a directory, the recurse */
|
/* If it is a directory, then recurse */
|
||||||
|
|
||||||
if (S_ISDIR(buf.st_mode))
|
if (S_ISDIR(buf.st_mode))
|
||||||
{
|
{
|
||||||
@@ -532,7 +533,32 @@ static void config_search(const char *boarddir)
|
|||||||
|
|
||||||
else if (S_ISREG(buf.st_mode) && strcmp("defconfig", child) == 0)
|
else if (S_ISREG(buf.st_mode) && strcmp("defconfig", child) == 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, " %s\n", boarddir);
|
char *boardname;
|
||||||
|
char *configname;
|
||||||
|
char *delim;
|
||||||
|
|
||||||
|
/* Get the board directory at the beginning of the 'boarddir' path. */
|
||||||
|
|
||||||
|
strncpy(g_buffer, boarddir, BUFFER_SIZE);
|
||||||
|
boardname = g_buffer;
|
||||||
|
delim = strchr(g_buffer, '/');
|
||||||
|
if (delim == NULL)
|
||||||
|
{
|
||||||
|
configname = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*delim = '\0';
|
||||||
|
configname = delim + 1;
|
||||||
|
|
||||||
|
delim = strrchr(configname, '/');
|
||||||
|
if (delim != NULL)
|
||||||
|
{
|
||||||
|
configname = delim + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, " %s/%s\n", boardname, configname);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(child);
|
free(child);
|
||||||
@@ -575,7 +601,7 @@ static void check_configdir(void)
|
|||||||
|
|
||||||
g_configpath = strdup(g_buffer);
|
g_configpath = strdup(g_buffer);
|
||||||
|
|
||||||
/* Get and verfy the path to the scripts directory:
|
/* Get and verify the path to the scripts directory:
|
||||||
* boards/<boarddir>/scripts
|
* boards/<boarddir>/scripts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@ if [ ! -d "${configpath}" ]; then
|
|||||||
echo "Select one of the following options for <board-name>:"
|
echo "Select one of the following options for <board-name>:"
|
||||||
configlist=`find ${TOPDIR}/boards -name defconfig`
|
configlist=`find ${TOPDIR}/boards -name defconfig`
|
||||||
for defconfig in ${configlist}; do
|
for defconfig in ${configlist}; do
|
||||||
config=`dirname ${defconfig} | sed -e "s,${TOPDIR}/boards/,,g"`
|
config=`dirname ${defconfig} | sed -e "s,${TOPDIR}/boards/,,g" | sed -e "s,configs/,,g"`
|
||||||
echo " ${config}"
|
echo " ${config}"
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user