Changeset 171297 in webkit


Ignore:
Timestamp:
Jul 21, 2014 2:04:59 AM (10 years ago)
Author:
Carlos Garcia Campos
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):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r171249 r171297  
     12014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Simplify make-dist command line arguments
     4        https://bugs.webkit.org/show_bug.cgi?id=134832
     5
     6        Reviewed by Martin Robinson.
     7
     8        * Source/PlatformGTK.cmake: Use --version instead of
     9        --tarball-root when running make-dist.py.
     10
    1112014-07-18  Jon Honeycutt  <jhoneycutt@apple.com>
    212
  • trunk/Source/PlatformGTK.cmake

    r170965 r171297  
    5858                --source-dir=${CMAKE_SOURCE_DIR}
    5959                --build-dir=${CMAKE_BINARY_DIR}
    60                 --tarball-root=/webkitgtk-${PROJECT_VERSION}
    61                 -o ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
     60                --version=${PROJECT_VERSION}
    6261                ${TOOLS_DIR}/gtk/manifest.txt
    6362    )
     
    8281                --source-dir=${CMAKE_SOURCE_DIR}
    8382                --build-dir=${CMAKE_BINARY_DIR}
    84                 --tarball-root=/webkitgtk-${PROJECT_VERSION}
    85                 -o ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
     83                --version=/webkitgtk-${PROJECT_VERSION}
    8684                ${TOOLS_DIR}/gtk/manifest.txt
    8785        COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
  • trunk/Tools/ChangeLog

    r171296 r171297  
     12014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Simplify make-dist command line arguments
     4        https://bugs.webkit.org/show_bug.cgi?id=134832
     5
     6        Reviewed by Martin Robinson.
     7
     8        Remove --tarball-root and -o command line options and add
     9        --version, since the version can be used to build both, the
     10        tarball root and the output filename. When the version it's not
     11        provided, the pkg-config file is used to get the version. Also
     12        change the default value of build-dir to the current directory,
     13        since it's very common to call make-dist.py from the build dir.
     14
     15        * gtk/make-dist.py:
     16        (get_tarball_root_and_output_filename_from_arguments):
     17
    1182014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Tools/gtk/make-dist.py

    r170965 r171297  
    265265            setattr(namespace, self.dest, os.path.abspath(values))
    266266
     267    def ensure_version_if_possible(arguments):
     268        if arguments.version is not None:
     269            return
     270
     271        pkgconfig_file = os.path.join(arguments.build_dir, "Source/WebKit2/webkit2gtk-3.0.pc")
     272        if os.path.isfile(pkgconfig_file):
     273            p = subprocess.Popen(['pkg-config', '--modversion', pkgconfig_file], stdout=subprocess.PIPE)
     274            version = p.communicate()[0]
     275            if version:
     276                arguments.version = version.rstrip('\n')
     277
     278
     279    def get_tarball_root_and_output_filename_from_arguments(arguments):
     280        tarball_root = "webkitgtk"
     281        if arguments.version is not None:
     282            tarball_root += '-' + arguments.version
     283
     284        output_filename = os.path.join(arguments.build_dir, tarball_root + ".tar")
     285        return tarball_root, output_filename
     286
    267287    parser = argparse.ArgumentParser(description='Build a distribution bundle.')
    268288    parser.add_argument('-c', '--check', action='store_true',
     
    271291                        help='The top-level directory of the source distribution. ' + \
    272292                              'Directory for relative paths. Defaults to current directory.')
    273     parser.add_argument('--tarball-root', type=str, default='/',
    274                         help='The top-level path of the tarball. By default files are added to the root of the tarball.')
    275     parser.add_argument('-b', '--build-dir', type=str, action=FilePathAction, default=None,
     293    parser.add_argument('--version', type=str, default=None,
     294                        help='The version of the tarball to generate')
     295    parser.add_argument('-b', '--build-dir', type=str, action=FilePathAction, default=os.getcwd(),
    276296                        help='The top-level path of directory of the build root. ' + \
    277                               'By default there is no build root.')
    278     parser.add_argument('-o', type=str, action=FilePathAction, default='out.tar', dest="output_filename",
    279                         help='The tarfile to produce. By default this is "out.tar"')
     297                              'By default is the current directory.')
    280298    parser.add_argument('manifest_filename', metavar="manifest", type=str, action=FilePathAction, help='The path to the manifest file.')
    281299
     
    287305    os.chdir(arguments.source_dir)
    288306
    289     manifest = Manifest(arguments.manifest_filename, arguments.source_dir, arguments.build_dir, arguments.tarball_root)
    290     manifest.create_tarfile(arguments.output_filename)
     307    ensure_version_if_possible(arguments)
     308    tarball_root, output_filename = get_tarball_root_and_output_filename_from_arguments(arguments)
     309
     310    manifest = Manifest(arguments.manifest_filename, arguments.source_dir, arguments.build_dir, tarball_root)
     311    manifest.create_tarfile(output_filename)
    291312
    292313    if arguments.check:
    293         Distcheck(arguments.source_dir, arguments.build_dir).check(arguments.output_filename)
     314        Distcheck(arguments.source_dir, arguments.build_dir).check(output_filename)
Note: See TracChangeset for help on using the changeset viewer.