diff --git a/source/tools/acpisrc/acpisrc.h b/source/tools/acpisrc/acpisrc.h index d1843d9bb..3fe826932 100644 --- a/source/tools/acpisrc/acpisrc.h +++ b/source/tools/acpisrc/acpisrc.h @@ -167,6 +167,7 @@ extern struct stat Gbl_StatBuf; extern char *Gbl_FileBuffer; extern UINT32 Gbl_FileSize; extern BOOLEAN Gbl_VerboseMode; +extern BOOLEAN Gbl_BatchMode; extern int optind; diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c index d0402ceb4..ce0e70288 100644 --- a/source/tools/acpisrc/asmain.c +++ b/source/tools/acpisrc/asmain.c @@ -131,6 +131,7 @@ struct stat Gbl_StatBuf; char *Gbl_FileBuffer; UINT32 Gbl_FileSize; BOOLEAN Gbl_VerboseMode = FALSE; +BOOLEAN Gbl_BatchMode = FALSE; /****************************************************************************** @@ -286,7 +287,8 @@ AsExaminePaths ( /* Check if source is a file or a directory */ - if (ConversionTable->Flags & FLG_NO_FILE_OUTPUT) + if ((ConversionTable->Flags & FLG_NO_FILE_OUTPUT) || + (Gbl_BatchMode)) { return 0; } @@ -297,6 +299,11 @@ AsExaminePaths ( scanf ("%c", &Response); /* Check response */ + + if ((char) Response != 'y') + { + return -1; + } } else @@ -308,6 +315,11 @@ AsExaminePaths ( scanf ("%c", &Response); /* Check response */ + + if ((char) Response != 'y') + { + return -1; + } } } @@ -355,11 +367,12 @@ AsDisplayUsage (void) { printf ("\n"); - printf ("Usage: acpisrc [-cl] \n\n"); - printf ("Where: -c Generate cleaned version of the source\n"); - printf (" -l Generate Linux version of the source\n"); - printf (" -s Generate source statistics only\n"); - printf (" -v Verbose mode\n"); + printf ("Usage: acpisrc [-clsvy] \n\n"); + printf ("Where: -c Generate cleaned version of the source\n"); + printf (" -l Generate Linux version of the source\n"); + printf (" -s Generate source statistics only\n"); + printf (" -v Verbose mode\n"); + printf (" -y Suppress file overwrite prompts\n"); printf ("\n"); return; } @@ -395,7 +408,7 @@ main ( /* Command line options */ - while ((j = getopt (argc, argv, "lcsv")) != EOF) switch(j) + while ((j = getopt (argc, argv, "lcsvy")) != EOF) switch(j) { case 'l': printf ("Creating Linux source code\n"); @@ -414,6 +427,10 @@ main ( Gbl_VerboseMode = TRUE; break; + case 'y': + Gbl_BatchMode = TRUE; + break; + default: AsDisplayUsage (); return -1;