Changeset 27014 in webkit


Ignore:
Timestamp:
Oct 24, 2007 8:51:10 PM (16 years ago)
Author:
ddkilzer
Message:

Refurbish update-webkit script.

Reviewed by Adam.

Scripts/update-webkit: Add -hhelp switch and usage statement. Check result of
GetOptions() call. Fix -qquiet switch to be passed to svn command properly. Use

multi-argument version of system() for flexibility and security. Check for existence
of Internal directory using -d test instead of -x.

Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r27013 r27014  
     12007-10-24  David Kilzer  <ddkilzer@webkit.org>
     2
     3        Refurbish update-webkit script.
     4
     5        Reviewed by Adam.
     6
     7        * Scripts/update-webkit: Add -h|--help switch and usage statement.  Check result of
     8        GetOptions() call.  Fix -q|--quiet switch to be passed to svn command properly.  Use
     9        multi-argument version of system() for flexibility and security.  Check for existence
     10        of Internal directory using -d test instead of -x.
     11
    1122007-10-24  David Kilzer  <ddkilzer@webkit.org>
    213
  • trunk/WebKitTools/Scripts/update-webkit

    r23463 r27014  
    11#!/usr/bin/perl -w
    22
    3 # Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
     3# Copyright (C) 2005, 2006, 2007 Apple Inc.  All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    3232use FindBin;
    3333use lib $FindBin::Bin;
     34use File::Basename;
    3435use Getopt::Long;
    3536use webkitdirs;
    3637
    3738# Handle options
    38 my $quiet ='';
    39 my $svnoptions = '';
    40 GetOptions('quiet|q' => \$quiet);
    41 $svnoptions = '-q' if $quiet;
     39my $quiet = '';
     40my $showHelp;
     41
     42my $getOptionsResult = GetOptions(
     43    'h|help'  => \$showHelp,
     44    'q|quiet' => \$quiet,
     45);
     46
     47if (!$getOptionsResult || $showHelp) {
     48    print STDERR <<__END__;
     49Usage: @{[ basename($0) ]} [options]
     50  -h|--help   show the help message
     51  -q|--quiet  pass -q to svn update for quiet updates
     52__END__
     53    exit 1;
     54}
     55
     56my @svnOptions = ();
     57push @svnOptions, '-q' if $quiet;
    4258
    4359chdirWebKit();
    4460print "Updating OpenSource\n" unless $quiet;
    45 (system("svn $svnoptions up") == 0) or die;
     61(system("svn", "update", @svnOptions) == 0) or die;
    4662if (isCygwin()) {
    47     (system("perl WebKitTools/Scripts/update-webkit-auxiliary-libs") == 0) or die;
     63    (system("perl", "WebKitTools/Scripts/update-webkit-auxiliary-libs") == 0) or die;
    4864}
    4965
    50 if (-x "../Internal") {
     66if (-d "../Internal") {
    5167    chdir("../Internal");
    5268    print "Updating Internal\n" unless $quiet;
    53     (system("svn $svnoptions up") == 0) or die;
     69    (system("svn", "update", @svnOptions) == 0) or die;
    5470}
Note: See TracChangeset for help on using the changeset viewer.