mirror of
git://code.qt.io/qt/qt5.git
synced 2026-01-11 01:16:41 +08:00
37 lines
1.1 KiB
Perl
37 lines
1.1 KiB
Perl
#!/usr/bin/perl
|
|
|
|
use Cwd;
|
|
use Cwd 'abs_path';
|
|
use File::Basename;
|
|
use File::Path;
|
|
|
|
|
|
# Find SHA1 of commit before $subject, else empty string
|
|
sub findWebKitSHA1
|
|
{
|
|
my ($subject) = @_;
|
|
my @commits = `git rev-list --grep="$subject" HEAD~300..HEAD`;
|
|
if (@commits) {
|
|
my $commit = $commits[0];
|
|
chomp $commit;
|
|
$commit = `git rev-parse $commit~`;
|
|
chomp $commit;
|
|
return $commit;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
my $current = dirname(abs_path($0));
|
|
$current =~ s,\\,/,g;
|
|
chdir("$current/qtwebkit");
|
|
|
|
if (!findWebKitSHA1("Removed modular references after support for the flag was removed")) {
|
|
if (system("git am --ignore-whitespace $current/patches/qtwebkit/*.patch")) {
|
|
print("Applying webkit patches failed, retrying...\n");
|
|
system("git am --abort");
|
|
system("git am --ignore-whitespace $current/patches/qtwebkit/*.patch") and die("Could not apply patches");
|
|
}
|
|
chdir("..");
|
|
system("git commit -a -m \"Committed Qt Modularization patches to QtWebKit.\" --author \"axis <qt-info\@nokia.com>\"") and die("Could not commit to qt5 repository");
|
|
}
|