Changeset 223536 in webkit


Ignore:
Timestamp:
Oct 17, 2017 6:54:55 AM (7 years ago)
Author:
nael.ouedraogo@crf.canon.fr
Message:

[GStreamer][GTK][WPE] update-webkit-libs-jhbuild fails to detect changes in included moduleset files
https://bugs.webkit.org/show_bug.cgi?id=178206

Reviewed by Michael Catanzaro.

The update-webkit-libs-jhbuild scripts computes MD5 sum of GTK/WPE jhbuild configuration files to check if it
needs to rebuild the dependencies libraries. This patch fixes a bug when main GTK/WPE jhbuild modules
configuration file includes additional files (for example GStreamer module). It parses jhbuild.modules file to
check if additional files are included. If any, it computes MD5 sum for each of these included files.

  • Scripts/update-webkit-libs-jhbuild:

(getJhbuildIncludedFilePaths): New function that returns included files in jhbuild.modules
(jhbuildConfigurationCheckFile): New function to check if MD5 sum file changes.
(jhbuildConfigurationChanged): Add MD5 sum check for included files.
(saveMd5File): New function to save MD5 sum of a file.
(saveJhbuildMd5): Add saving included files MD5 sum.
(deleteJhbuildMd5): Delete included files MD5 sum

  • gtk/install-dependencies: Add perl-libXML lib that is used to parse jhbuild file.
  • wpe/install-dependencies: Ditto.
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r223502 r223536  
     12017-10-17  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
     2
     3        [GStreamer][GTK][WPE] update-webkit-libs-jhbuild fails to detect changes in included moduleset files
     4        https://bugs.webkit.org/show_bug.cgi?id=178206
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        The update-webkit-libs-jhbuild scripts computes MD5 sum of GTK/WPE jhbuild configuration files to check if it
     9        needs to rebuild the dependencies libraries. This patch fixes a bug when main GTK/WPE jhbuild modules
     10        configuration file includes additional files (for example GStreamer module). It parses jhbuild.modules file to
     11        check if additional files are included. If any, it computes MD5 sum for each of these included files.
     12
     13        * Scripts/update-webkit-libs-jhbuild:
     14        (getJhbuildIncludedFilePaths): New function that returns included files in jhbuild.modules
     15        (jhbuildConfigurationCheckFile): New function to check if MD5 sum file changes.
     16        (jhbuildConfigurationChanged): Add MD5 sum check for included files.
     17        (saveMd5File): New function to save MD5 sum of a file.
     18        (saveJhbuildMd5): Add saving included files MD5 sum.
     19        (deleteJhbuildMd5): Delete included files MD5 sum
     20        * gtk/install-dependencies: Add perl-libXML lib that is used to parse jhbuild file.
     21        * wpe/install-dependencies: Ditto.
     22
    1232017-10-17  Tomas Popela  <tpopela@redhat.com>
    224
  • trunk/Tools/Scripts/update-webkit-libs-jhbuild

    r223326 r223536  
    33# Copyright (C) 2012 Intel Corporation
    44# Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
     5# Copyright (C) 2016 Canon Inc.
    56#
    67# This library is free software; you can redistribute it and/or
     
    2223use webkitdirs;
    2324use Getopt::Long qw(:config pass_through);
     25use XML::LibXML;
    2426
    2527my $platform = "";
     
    3941);
    4042
     43sub getJhbuildIncludedFilePaths
     44{
     45    my $jhbuildFile = shift;
     46    my $dom = XML::LibXML->load_xml(location => $jhbuildFile);
     47    my @includes;
     48
     49    foreach my $includeFile ($dom->findnodes('/moduleset/include/@href')) {
     50        push(@includes, $includeFile->to_literal());
     51    }
     52    return @includes;
     53}
     54
    4155sub getMD5HashForFile($)
    4256{
     
    5569}
    5670
     71sub jhbuildConfigurationCheckFile
     72{
     73    my $file = shift;
     74    my $path = join('/', getJhbuildPath(), $platform, $file . '.md5sum');
     75    if (! -e $path) {
     76        return 1;
     77    }
     78
     79    # Get the md5 sum of the file we're testing, look in the right platform directory.
     80    my $actualFile = join('/', sourceDir(), 'Tools', $platform, $file);
     81    my $currentSum = getMD5HashForFile($actualFile);
     82
     83    # Get our previous record.
     84    open(PREVIOUS_MD5, $path);
     85    chomp(my $previousSum = <PREVIOUS_MD5>);
     86    close(PREVIOUS_MD5);
     87
     88    if ($previousSum ne $currentSum) {
     89        return 1;
     90    }
     91}
     92
    5793sub jhbuildConfigurationChanged()
    5894{
    59     foreach my $file (qw(jhbuildrc jhbuild.modules)) {
    60         my $path = join('/', getJhbuildPath(), $file . '.md5sum');
    61         if (! -e $path) {
    62             return 1;
    63         }
     95    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
     96    my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
     97    push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
    6498
    65         # Get the md5 sum of the file we're testing, look in the right platform directory.
    66         my $actualFile = join('/', sourceDir(), 'Tools', $platform, $file);
    67         my $currentSum = getMD5HashForFile($actualFile);
    68 
    69         # Get our previous record.
    70         open(PREVIOUS_MD5, $path);
    71         chomp(my $previousSum = <PREVIOUS_MD5>);
    72         close(PREVIOUS_MD5);
    73 
    74         if ($previousSum ne $currentSum) {
     99    foreach my $file (@jhbuildFiles) {
     100        if (jhbuildConfigurationCheckFile($file)) {
    75101            return 1;
    76102        }
     
    78104}
    79105
     106sub saveMd5File
     107{
     108    my $file = shift;
     109    my $path = realpath(dirname(join('/', getJhbuildPath(), $platform, $file)));
     110    (-d $path) || mkpath $path;
     111
     112    $path = join('/', getJhbuildPath(), $platform);
     113    my $source = join('/', sourceDir(), "Tools", $platform, $file);
     114    my $destination = join('/', $path, $file);
     115    open(SUM, ">$destination" . ".md5sum");
     116    print SUM getMD5HashForFile($source);
     117    close(SUM);
     118}
     119
    80120sub saveJhbuildMd5() {
    81121    # Save md5sum for jhbuild-related files.saveJhbuildMd5();
    82122    my $jhbuildPath = getJhbuildPath();
     123    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
     124    my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
     125    push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
     126
    83127    (-d $jhbuildPath) || mkpath $jhbuildPath;
    84     foreach my $file (qw(jhbuildrc jhbuild.modules)) {
    85         my $source = join('/', sourceDir(), "Tools", $platform, $file);
    86         my $destination = join('/', $jhbuildPath, $file);
    87         open(SUM, ">$destination" . ".md5sum");
    88         print SUM getMD5HashForFile($source);
    89         close(SUM);
     128    foreach my $file (@jhbuildFiles) {
     129        saveMd5File($file);
    90130    }
    91131}
     
    96136        return;
    97137    }
    98     foreach my $file (qw(jhbuildrc jhbuild.modules)) {
    99         my $md5File = join('/', $jhbuildPath, $file) . ".md5sum";
     138
     139    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
     140    my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
     141    push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
     142
     143    foreach my $file (@jhbuildFiles) {
     144        my $md5File = join('/', $jhbuildPath, $platform, $file) . ".md5sum";
    100145        unlink($md5File) if -e $md5File;
    101146    }
  • trunk/Tools/gtk/install-dependencies

    r222834 r223536  
    204204        libtool-bin \
    205205        libudev-dev \
     206        libxml-libxml-perl \
    206207        python-dev \
    207208        ragel \
     
    352353        mtdev \
    353354        orc \
     355        perl-xml-libxml\
    354356        python2 \
    355357        python2-lxml \
     
    495497        mtdev-devel \
    496498        orc-devel \
     499        perl-libxml-perl \
    497500        ragel \
    498501        systemd-devel \
  • trunk/Tools/wpe/install-dependencies

    r221010 r223536  
    121121        libvpx-dev \
    122122        libxcb-xkb-dev \
     123        libxml-libxml-perl \
    123124        luajit"
    124125
     
    208209        opus \
    209210        orc \
     211        perl-xml-libxml\
    210212        v4l-utils"
    211213
     
    285287        opus-devel \
    286288        orc-devel \
     289        perl-libxml-perl \
    287290        pulseaudio-libs-devel"
    288291
Note: See TracChangeset for help on using the changeset viewer.