]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools-Source: Update displayed version information
authoredk2 dev <edk2.dev@edk2.org>
Tue, 16 Feb 2016 02:47:30 +0000 (10:47 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 16 Feb 2016 02:58:40 +0000 (10:58 +0800)
Standardize the --version and --help text command-line options

Updated tools to correctly display the Build number when using command-line
option --version and exit successfully after termination.
Ecc was also updated to print informational messages after the options are
parsed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Larry Hauch <larry.hauch@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
BaseTools/Source/C/BootSectImage/bootsectimage.c
BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
BaseTools/Source/C/Split/Split.c
BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
BaseTools/Source/C/VfrCompile/VfrCompiler.h
BaseTools/Source/C/VolInfo/VolInfo.c
BaseTools/Source/Python/BPDG/BPDG.py
BaseTools/Source/Python/BPDG/StringTable.py
BaseTools/Source/Python/Ecc/Ecc.py
BaseTools/Source/Python/UPT/Logger/StringTable.py
BaseTools/Source/Python/UPT/UPT.py

index b4fb340c2bb70decbb3db53e28a3d86906e857b9..453a463f26d4698ab19d09885b38273480b7c013 100644 (file)
@@ -4,7 +4,7 @@ Abstract:
   Patch the BPB information in boot sector image file.\r
   Patch the MBR code in MBR image file.\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -33,8 +33,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Utility version information\r
 //\r
-#define UTILITY_MAJOR_VERSION 0\r
-#define UTILITY_MINOR_VERSION 1\r
+#define UTILITY_MAJOR_VERSION 1
+#define UTILITY_MINOR_VERSION 0
 \r
 void\r
 Version (\r
@@ -56,10 +56,7 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights reserved.\n");\r
-  printf ("\n  The BootSectImage tool prints information or patch destination file by source\n");\r
-  printf ("  file for BIOS Parameter Block (BPB) or Master Boot Record (MBR).\n");\r
+  printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
 }\r
 \r
 void\r
@@ -82,6 +79,9 @@ Returns:
 --*/\r
 {\r
   Version();\r
+  printf ("Copyright (c) 1999-2016 Intel Corporation. All rights reserved.\n");
+  printf ("\n  The BootSectImage tool prints information or patch destination file by source\n");
+  printf ("  file for BIOS Parameter Block (BPB) or Master Boot Record (MBR).\n");
   printf ("\nUsage: \n\\r
    BootSectImage\n\\r
      [-f, --force force patch even if the FAT type of SrcImage and DstImage mismatch]\n\\r
index 31d697ec515243dac12145d8d773882de3547c10..79618677f6569842d23bc4f1a18e5cfc7a601b5a 100644 (file)
@@ -6,7 +6,7 @@ FILE := EFILDR_HEADER
         <PeImageFileContent> +\r
 The order of EFILDR_IMAGE is same as the order of placing PeImageFileContent.\r
   \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -51,8 +51,8 @@ typedef struct {
 //\r
 // Utility version information\r
 //\r
-#define UTILITY_MAJOR_VERSION 0\r
-#define UTILITY_MINOR_VERSION 1\r
+#define UTILITY_MAJOR_VERSION 1
+#define UTILITY_MINOR_VERSION 0
 \r
 void\r
 Version (\r
@@ -74,9 +74,8 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights reserved.\n");\r
-  printf ("\n  The EfiLdrImage tool is used to combine PE files into EFILDR image with Efi loader header.\n");\r
+  printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
+  exit (0);
 }\r
 \r
 VOID\r
@@ -85,7 +84,9 @@ Usage (
   )\r
 {\r
   printf ("Usage: EfiLdrImage -o OutImage LoaderImage PeImage1 PeImage2 ... PeImageN\n");\r
-  exit (1);\r
+  printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
+  printf ("Copyright (c) 1999-2016 Intel Corporation. All rights reserved.\n");
+  printf ("\n  The EfiLdrImage tool is used to combine PE files into EFILDR image with Efi loader header.\n");
 }\r
 \r
 EFI_STATUS\r
@@ -180,7 +181,7 @@ Returns:
   SetUtilityName (UTILITY_NAME);\r
 \r
   if (argc == 1) {\r
-    Usage();\r
+    printf ("Usage: EfiLdrImage -o OutImage LoaderImage PeImage1 PeImage2 ... PeImageN\n");
     return STATUS_ERROR;\r
   }\r
   \r
index 44a09681d36a9ebaebe9659faa3a4e66b59fb22c..953f5df94fdd32f9296717f2a02fd11e99bc67a8 100644 (file)
@@ -2,7 +2,7 @@
 \r
   Split a file into two pieces at the request offset.\r
 \r
-Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
 distribution.  The full text of the license may be found at\r
@@ -34,8 +34,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Utility version information\r
 //\r
-#define UTILITY_MAJOR_VERSION 0\r
-#define UTILITY_MINOR_VERSION 1\r
+#define UTILITY_MAJOR_VERSION 1
+#define UTILITY_MINOR_VERSION 0
 \r
 void\r
 Version (\r
@@ -57,10 +57,7 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 1999-2015 Intel Corporation. All rights reserved.\n");\r
-  printf ("\n  SplitFile creates two Binary files either in the same directory as the current working\n");\r
-  printf ("  directory or in the specified directory.\n");\r
+  printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
 }\r
 \r
 void\r
@@ -83,6 +80,9 @@ Returns:
 --*/\r
 {\r
   Version();\r
+  printf ("Copyright (c) 1999-2016 Intel Corporation. All rights reserved.\n");
+  printf ("\n  SplitFile creates two Binary files either in the same directory as the current working\n");
+  printf ("  directory or in the specified directory.\n");
   printf ("\nUsage: \n\\r
    Split\n\\r
      -f, --filename inputFile to split\n\\r
index 063266a91fa5f85146ab72a4339b387beb9f323a..c4d77ad15fdf18cf0eda9df5beb5fdba1a4b473b 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler main class and main function.\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -412,8 +412,8 @@ CVfrCompiler::Usage (
   UINT32 Index;\r
   CONST  CHAR8 *Help[] = {\r
     " ", \r
-    "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION,\r
-    "Copyright (c) 2004-2014 Intel Corporation. All rights reserved.",\r
+    "VfrCompile version " VFR_COMPILER_VERSION "Build " __BUILD_VERSION,
+    "Copyright (c) 2004-2016 Intel Corporation. All rights reserved.",
     " ",\r
     "Usage: VfrCompile [options] VfrFile",\r
     " ",\r
@@ -451,7 +451,7 @@ CVfrCompiler::Version (
 {\r
   UINT32 Index;\r
   CONST  CHAR8 *Help[] = {\r
-    "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION,\r
+    "VfrCompile version " VFR_COMPILER_VERSION "Build " __BUILD_VERSION,
     NULL\r
     };\r
   for (Index = 0; Help[Index] != NULL; Index++) {\r
index 6a6779c0ca478997961af69b96fd5e0b38e720ba..f61c4836b6bf7e0c924f52eb036cefd6cac62f9b 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler internal defintions.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "ParseInf.h"\r
 \r
 #define PROGRAM_NAME                       "VfrCompile"\r
-#define VFR_COMPILER_VERSION               " 2.00 (UEFI 2.4) "\r
+#define VFR_COMPILER_VERSION               " 2.01 (UEFI 2.4) "
 //\r
 // This is how we invoke the C preprocessor on the VFR source file\r
 // to resolve #defines, #includes, etc. To make C source files\r
index 87e78d48a872ebbefe090967c822c10e5718637d..4fa87d41eea0e0b64ee2df141cffd199c010ff9b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 The tool dumps the contents of a firmware volume\r
 \r
-Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -46,8 +46,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 EFI_GUID  gEfiCrc32GuidedSectionExtractionProtocolGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;\r
 \r
-#define UTILITY_MAJOR_VERSION      0\r
-#define UTILITY_MINOR_VERSION      83\r
+#define UTILITY_MAJOR_VERSION      1
+#define UTILITY_MINOR_VERSION      0
 \r
 #define UTILITY_NAME         "VolInfo"\r
 \r
@@ -168,12 +168,11 @@ Returns:
   //\r
   // Print utility header\r
   //\r
-  printf ("%s Version %d.%d %s, %s\n",\r
+  printf ("%s Version %d.%d Build %s\n",
     UTILITY_NAME,\r
     UTILITY_MAJOR_VERSION,\r
     UTILITY_MINOR_VERSION,\r
-    __BUILD_VERSION,\r
-    __DATE__\r
+    __BUILD_VERSION
     );\r
 \r
   //\r
@@ -231,7 +230,7 @@ Returns:
   //\r
   if (argc != 1) {\r
     Usage ();\r
-    return -1;\r
+    return STATUS_ERROR;
   }\r
   //\r
   // Look for help options\r
@@ -239,9 +238,14 @@ Returns:
   if ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0) || \r
       (strcmp(argv[0], "-?") == 0) || (strcmp(argv[0], "/?") == 0)) {\r
     Usage();\r
-    return STATUS_ERROR;\r
+    return STATUS_SUCCESS;
+  }
+  //
+  // Version has already been printed, return success.
+  //
+  if (strcmp(argv[0], "--version") == 0) {
+    return STATUS_SUCCESS;
   }\r
-\r
   //\r
   // Open the file containing the FV\r
   //\r
@@ -1846,7 +1850,7 @@ Returns:
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.\n\n");
   fprintf (stdout, "  Display Tiano Firmware Volume FFS image information\n\n");\r
 \r
   //\r
@@ -1857,6 +1861,8 @@ Returns:
             Parse basename to file-guid cross reference file(s).\n");\r
   fprintf (stdout, "  --offset offset\n\\r
             Offset of file to start processing FV at.\n");\r
+  fprintf (stdout, "  --version\n\
+            Display version of this tool and exit.\n");
   fprintf (stdout, "  -h, --help\n\\r
             Show this help message and exit.\n");\r
 \r
index b12403139df0589b8929cd5d3ca41883b6c3c707..08e29f055a407ed937fe8d7e74bfb24d04bd256c 100644 (file)
@@ -6,7 +6,7 @@
 #  file of PCD layout for use during the build when the platform integrator selects to use \r
 #  automatic offset calculation.\r
 #\r
-#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -33,7 +33,7 @@ import StringTable as st
 import GenVpd\r
 \r
 PROJECT_NAME       = st.LBL_BPDG_LONG_UNI\r
-VERSION            = (st.LBL_BPDG_VERSION + " " + gBUILD_VERSION)\r
+VERSION            = (st.LBL_BPDG_VERSION + " Build " + gBUILD_VERSION)
 \r
 ## Tool entrance method\r
 #\r
@@ -91,7 +91,7 @@ def MyOptionParser():
     #\r
     # Process command line firstly.\r
     #\r
-    parser = OptionParser(version="%s - Version %s\n" % (PROJECT_NAME, VERSION),\r
+    parser = OptionParser(version="%s - Version %s" % (PROJECT_NAME, VERSION),
                           description='',\r
                           prog='BPDG',\r
                           usage=st.LBL_BPDG_USAGE\r
index a661da0f9476fbddef0453ca5fbd81a29670994e..56b64b60ff7b7c13700db646b1e392548c6ed981 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define strings used in the BPDG tool\r
 #\r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -32,7 +32,7 @@ MAP_FILE_COMMENT_TEMPLATE = \
 #\r
 #  This file lists all VPD informations for a platform fixed/adjusted by BPDG tool.\r
 # \r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 -2016, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -46,14 +46,14 @@ MAP_FILE_COMMENT_TEMPLATE = \
 \r
 \r
 LBL_BPDG_LONG_UNI           = (u"Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)")\r
-LBL_BPDG_VERSION            = (u"0.1")\r
+LBL_BPDG_VERSION            = (u"1.0")
 LBL_BPDG_USAGE              = \\r
 (\r
-"""\r
-BPDG options -o Filename.bin -m Filename.map Filename.txt\r
-Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)\r
-Copyright (c) 2010 Intel Corporation All Rights Reserved.\r
+"""BPDG options -o Filename.bin -m Filename.map Filename.txt
+Copyright (c) 2010 - 2016, Intel Corporation All Rights Reserved.
 \r
+  Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)
+  
 Required Flags:\r
   -o BIN_FILENAME, --vpd-filename=BIN_FILENAME\r
             Specify the file name for the VPD binary file\r
index c2ad4faff4466b82b08c279a9858ef5c4ac870c7..3fd4f2043bee6ea0b0d609832ae57699537cda08 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to be the main entrance of ECC tool\r
 #\r
-# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -49,9 +49,9 @@ from Common.MultipleWorkspace import MultipleWorkspace as mws
 class Ecc(object):\r
     def __init__(self):\r
         # Version and Copyright\r
-        self.VersionNumber = ("0.01" + " " + gBUILD_VERSION)\r
+        self.VersionNumber = ("1.0" + " Build " + gBUILD_VERSION)
         self.Version = "%prog Version " + self.VersionNumber\r
-        self.Copyright = "Copyright (c) 2009 - 2010, Intel Corporation  All rights reserved."\r
+        self.Copyright = "Copyright (c) 2009 - 2016, Intel Corporation  All rights reserved."
 \r
         self.InitDefaultConfigIni()\r
         self.OutputFile = 'output.txt'\r
@@ -65,6 +65,7 @@ class Ecc(object):
 \r
         # Parse the options and args\r
         self.ParseOption()\r
+        EdkLogger.info(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[00:00]" + "\n")
         \r
         #\r
         # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP\r
@@ -104,7 +105,7 @@ class Ecc(object):
         GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir\r
         GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir\r
         \r
-        \r
+        EdkLogger.info("Loading ECC configuration ... done")
         # Generate checkpoints list\r
         EccGlobalData.gConfig = Configuration(self.ConfigFile)\r
 \r
@@ -327,7 +328,6 @@ class Ecc(object):
     # Parse options\r
     #\r
     def ParseOption(self):\r
-        EdkLogger.quiet("Loading ECC configuration ... done")\r
         (Options, Target) = self.EccOptionParser()\r
 \r
         if Options.Workspace:\r
@@ -437,7 +437,6 @@ if __name__ == '__main__':
     # Initialize log system\r
     EdkLogger.Initialize()\r
     EdkLogger.IsRaiseError = False\r
-    EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[00:00]" + "\n")\r
 \r
     StartTime = time.clock()\r
     Ecc = Ecc()\r
index 69e36f3b85c55ec6fd442b021144ae33cc694ff2..c5430735b9648553573136edb4d6688633e09c0e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define strings used in the UPT tool\r
 #\r
-# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -39,10 +39,10 @@ MSG_USAGE_STRING = _("\n"
 ##\r
 # Version and Copyright\r
 #\r
-MSG_VERSION_NUMBER = _("1.0")\r
+MSG_VERSION_NUMBER = _("1.1")
 MSG_VERSION = _("UEFI Packaging Tool (UEFIPT) - Revision " + \\r
                 MSG_VERSION_NUMBER)\r
-MSG_COPYRIGHT = _("Copyright (c) 2011 - 2015 Intel Corporation All Rights Reserved.")\r
+MSG_COPYRIGHT = _("Copyright (c) 2011 - 2016 Intel Corporation All Rights Reserved.")
 MSG_VERSION_COPYRIGHT = _("\n  %s\n  %s" % (MSG_VERSION, MSG_COPYRIGHT))\r
 MSG_USAGE = _("%s [options]\n%s" % ("UPT", MSG_VERSION_COPYRIGHT))\r
 MSG_DESCRIPTION = _("The UEFIPT is used to create, " + \\r
index 17decda5c3e6d11377be54fc1d4df734acaf3c1a..b64cc2cf3b32550271efe7c7c14c8f413c8297f9 100644 (file)
@@ -2,7 +2,7 @@
 #\r
 # This file is the main entry for UPT \r
 #\r
-# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -99,7 +99,7 @@ def SetLogLevel(Opt):
 def Main():\r
     Logger.Initialize()\r
 \r
-    Parser = OptionParser(version=(MSG_VERSION + ' ' + gBUILD_VERSION), description=MSG_DESCRIPTION,\r
+    Parser = OptionParser(version=(MSG_VERSION + ' Build ' + gBUILD_VERSION), description=MSG_DESCRIPTION,
                           prog="UPT.exe", usage=MSG_USAGE)\r
 \r
     Parser.add_option("-d", "--debug", action="store", type="int", dest="debug_level", help=ST.HLP_PRINT_DEBUG_INFO)\r