Bug 17665 - determineSourceDir() dies if $sourceDir has a trailing backslash
Summary: determineSourceDir() dies if $sourceDir has a trailing backslash
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P4 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-03 23:31 PST by Dmitriy Kazachkov
Modified: 2008-03-31 13:19 PDT (History)
1 user (show)

See Also:


Attachments
trivial fix (1.24 KB, patch)
2008-03-30 16:24 PDT, Julien Chaffraix
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitriy Kazachkov 2008-03-03 23:31:24 PST
Linux: version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 5 19:30:39 EST 2005

Compiler: gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)

Product: WebKit nightly build (03.03.2008)

Command: WebKit/WebKitTools/Scripts/build-webkit --qt

What I got: "Could not find top level webkit directory above source directory using FindBin."

Comment:
The root cause is extra slash at the end of the path returned by FindBin.

How to avoid:
1)open webkitdirs.pm (in the Scripts folder)
2) in the function determineSourceDir
after line
  $sourceDir = $FindBin::Bin;
insert 
  $sourceDir=s|/$||;
Comment 1 Julien Chaffraix 2008-03-30 15:34:55 PDT
Confirming bug as it seems a pretty common issue with $FindBin.
Switching it to "Tools / Tests".
Comment 2 Julien Chaffraix 2008-03-30 15:46:13 PDT
I should add that our code checks just after for s|/[^/]+$|| which will fail if $FindBin::Bin ends with a '/' (and this is the common issue I was mentioning).
Comment 3 Julien Chaffraix 2008-03-30 16:24:03 PDT
Created attachment 20225 [details]
trivial fix
Comment 4 Darin Adler 2008-03-30 16:39:51 PDT
Comment on attachment 20225 [details]
trivial fix

Seems like we should remove any number of trailing / characters, not just one, but the change seems fine.

r=me
Comment 5 Julien Chaffraix 2008-03-31 13:19:19 PDT
Committed in r31469 with Darin's comment.