Title: [171297] trunk
Revision
171297
Author
[email protected]
Date
2014-07-21 02:04:59 -0700 (Mon, 21 Jul 2014)

Log Message

[GTK] Simplify make-dist command line arguments
https://bugs.webkit.org/show_bug.cgi?id=134832

Reviewed by Martin Robinson.

.:
* Source/PlatformGTK.cmake: Use --version instead of
--tarball-root when running make-dist.py.

Tools:
Remove --tarball-root and -o command line options and add
--version, since the version can be used to build both, the
tarball root and the output filename. When the version it's not
provided, the pkg-config file is used to get the version. Also
change the default value of build-dir to the current directory,
since it's very common to call make-dist.py from the build dir.

* gtk/make-dist.py:
(get_tarball_root_and_output_filename_from_arguments):

Modified Paths

Diff

Modified: trunk/ChangeLog (171296 => 171297)


--- trunk/ChangeLog	2014-07-21 08:30:12 UTC (rev 171296)
+++ trunk/ChangeLog	2014-07-21 09:04:59 UTC (rev 171297)
@@ -1,3 +1,13 @@
+2014-07-21  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Simplify make-dist command line arguments
+        https://bugs.webkit.org/show_bug.cgi?id=134832
+
+        Reviewed by Martin Robinson.
+
+        * Source/PlatformGTK.cmake: Use --version instead of
+        --tarball-root when running make-dist.py.
+
 2014-07-18  Jon Honeycutt  <[email protected]>
 
         Add a manual test for r135044

Modified: trunk/Source/PlatformGTK.cmake (171296 => 171297)


--- trunk/Source/PlatformGTK.cmake	2014-07-21 08:30:12 UTC (rev 171296)
+++ trunk/Source/PlatformGTK.cmake	2014-07-21 09:04:59 UTC (rev 171297)
@@ -57,8 +57,7 @@
         COMMAND ${TOOLS_DIR}/gtk/make-dist.py
                 --source-dir=${CMAKE_SOURCE_DIR}
                 --build-dir=${CMAKE_BINARY_DIR}
-                --tarball-root=/webkitgtk-${PROJECT_VERSION}
-                -o ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+                --version=${PROJECT_VERSION}
                 ${TOOLS_DIR}/gtk/manifest.txt
     )
 
@@ -81,8 +80,7 @@
                 --check
                 --source-dir=${CMAKE_SOURCE_DIR}
                 --build-dir=${CMAKE_BINARY_DIR}
-                --tarball-root=/webkitgtk-${PROJECT_VERSION}
-                -o ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+                --version=/webkitgtk-${PROJECT_VERSION}
                 ${TOOLS_DIR}/gtk/manifest.txt
         COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
     )

Modified: trunk/Tools/ChangeLog (171296 => 171297)


--- trunk/Tools/ChangeLog	2014-07-21 08:30:12 UTC (rev 171296)
+++ trunk/Tools/ChangeLog	2014-07-21 09:04:59 UTC (rev 171297)
@@ -1,5 +1,22 @@
 2014-07-21  Carlos Garcia Campos  <[email protected]>
 
+        [GTK] Simplify make-dist command line arguments
+        https://bugs.webkit.org/show_bug.cgi?id=134832
+
+        Reviewed by Martin Robinson.
+
+        Remove --tarball-root and -o command line options and add
+        --version, since the version can be used to build both, the
+        tarball root and the output filename. When the version it's not
+        provided, the pkg-config file is used to get the version. Also
+        change the default value of build-dir to the current directory,
+        since it's very common to call make-dist.py from the build dir.
+
+        * gtk/make-dist.py:
+        (get_tarball_root_and_output_filename_from_arguments):
+
+2014-07-21  Carlos Garcia Campos  <[email protected]>
+
         [GTK] Reduce the size of the tarball generated by distcheck
         https://bugs.webkit.org/show_bug.cgi?id=134802
 

Modified: trunk/Tools/gtk/make-dist.py (171296 => 171297)


--- trunk/Tools/gtk/make-dist.py	2014-07-21 08:30:12 UTC (rev 171296)
+++ trunk/Tools/gtk/make-dist.py	2014-07-21 09:04:59 UTC (rev 171297)
@@ -264,19 +264,37 @@
         def __call__(self, parser, namespace, values, option_string=None):
             setattr(namespace, self.dest, os.path.abspath(values))
 
+    def ensure_version_if_possible(arguments):
+        if arguments.version is not None:
+            return
+
+        pkgconfig_file = os.path.join(arguments.build_dir, "Source/WebKit2/webkit2gtk-3.0.pc")
+        if os.path.isfile(pkgconfig_file):
+            p = subprocess.Popen(['pkg-config', '--modversion', pkgconfig_file], stdout=subprocess.PIPE)
+            version = p.communicate()[0]
+            if version:
+                arguments.version = version.rstrip('\n')
+
+
+    def get_tarball_root_and_output_filename_from_arguments(arguments):
+        tarball_root = "webkitgtk"
+        if arguments.version is not None:
+            tarball_root += '-' + arguments.version
+
+        output_filename = os.path.join(arguments.build_dir, tarball_root + ".tar")
+        return tarball_root, output_filename
+
     parser = argparse.ArgumentParser(description='Build a distribution bundle.')
     parser.add_argument('-c', '--check', action='',
                         help='Check the tarball')
     parser.add_argument('-s', '--source-dir', type=str, action="" default=os.getcwd(),
                         help='The top-level directory of the source distribution. ' + \
                               'Directory for relative paths. Defaults to current directory.')
-    parser.add_argument('--tarball-root', type=str, default='/',
-                        help='The top-level path of the tarball. By default files are added to the root of the tarball.')
-    parser.add_argument('-b', '--build-dir', type=str, action="" default=None,
+    parser.add_argument('--version', type=str, default=None,
+                        help='The version of the tarball to generate')
+    parser.add_argument('-b', '--build-dir', type=str, action="" default=os.getcwd(),
                         help='The top-level path of directory of the build root. ' + \
-                              'By default there is no build root.')
-    parser.add_argument('-o', type=str, action="" default='out.tar', dest="output_filename",
-                        help='The tarfile to produce. By default this is "out.tar"')
+                              'By default is the current directory.')
     parser.add_argument('manifest_filename', metavar="manifest", type=str, action="" help='The path to the manifest file.')
 
     arguments = parser.parse_args()
@@ -286,8 +304,11 @@
     # to be the source directory.
     os.chdir(arguments.source_dir)
 
-    manifest = Manifest(arguments.manifest_filename, arguments.source_dir, arguments.build_dir, arguments.tarball_root)
-    manifest.create_tarfile(arguments.output_filename)
+    ensure_version_if_possible(arguments)
+    tarball_root, output_filename = get_tarball_root_and_output_filename_from_arguments(arguments)
 
+    manifest = Manifest(arguments.manifest_filename, arguments.source_dir, arguments.build_dir, tarball_root)
+    manifest.create_tarfile(output_filename)
+
     if arguments.check:
-        Distcheck(arguments.source_dir, arguments.build_dir).check(arguments.output_filename)
+        Distcheck(arguments.source_dir, arguments.build_dir).check(output_filename)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to