Bug 135048

Summary: Add --dry-run option to sort-export-file
Product: WebKit Reporter: Nagy Renátó <rnagy>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, ossy, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch
none
Proposed patch
none
Proposed patch
none
Proposed patch
none
Patch
none
Proposed patch
none
Proposed patch none

Description Nagy Renátó 2014-07-18 06:18:24 PDT
Adding dry-run option to sort-export-file script to simulate run without any file modification.
Comment 1 Nagy Renátó 2014-07-18 06:46:06 PDT
Created attachment 235125 [details]
Proposed patch

The check-webkit-style script is going to need this feature later.
Comment 2 Tim Horton 2014-07-18 06:51:03 PDT
Comment on attachment 235125 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235125&action=review

> Tools/Scripts/sort-export-file:149
> +            print STDERR "$exportFile should be sorted \n" if $shouldBeVerbose;

I think the return code of the script should indicate whether it was already sorted or not, for ease of use from other scripts.
Comment 3 Nagy Renátó 2014-07-21 03:54:48 PDT
Adding new return code to sort-export-file.
Comment 4 Nagy Renátó 2014-07-21 03:56:27 PDT
Created attachment 235215 [details]
Proposed patch
Comment 5 Nagy Renátó 2014-07-22 01:59:12 PDT
Created attachment 235277 [details]
Proposed patch
Comment 6 Nagy Renátó 2014-07-22 02:01:36 PDT
Created attachment 235278 [details]
Proposed patch
Comment 7 Csaba Osztrogonác 2014-07-24 07:56:19 PDT
Comment on attachment 235278 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235278&action=review

> Tools/Scripts/sort-export-file:157
>          open OUT, ">", $exportFile or die "Could not overwrite $exportFile: $!";
>          print OUT $after;
>          close OUT;

You shouldn't update the export files here.
Comment 8 Nagy Renátó 2014-07-25 07:19:08 PDT
Created attachment 235509 [details]
Patch
Comment 9 Nagy Renátó 2014-07-25 07:38:37 PDT
Created attachment 235510 [details]
Proposed patch
Comment 10 Nagy Renátó 2014-07-25 07:50:55 PDT
Created attachment 235515 [details]
Proposed patch
Comment 11 WebKit Commit Bot 2014-07-25 08:08:59 PDT
Comment on attachment 235515 [details]
Proposed patch

Clearing flags on attachment: 235515

Committed r171594: <http://trac.webkit.org/changeset/171594>
Comment 12 WebKit Commit Bot 2014-07-25 08:10:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Darin Adler 2014-07-27 23:34:38 PDT
Comment on attachment 235515 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235515&action=review

> Tools/Scripts/sort-export-file:63
> +       0      if OK
> +
> +       1      if parse error
> +
> +       2      if file(s) should be sorted (only with --dry-run)
> +
> +       3      if parse error and file(s) should be sorted (only with --dry-run)

Too many blank lines!
Comment 14 Csaba Osztrogonác 2014-07-28 01:43:14 PDT
(In reply to comment #13)
> (From update of attachment 235515 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=235515&action=review
> 
> > Tools/Scripts/sort-export-file:63
> > +       0      if OK
> > +
> > +       1      if parse error
> > +
> > +       2      if file(s) should be sorted (only with --dry-run)
> > +
> > +       3      if parse error and file(s) should be sorted (only with --dry-run)
> 
> Too many blank lines!

Followup fix landed in https://trac.webkit.org/changeset/171674