Skip to content

Commit

Permalink
use consistent expression delimitters, fix target directory detection
Browse files Browse the repository at this point in the history
Ensure that the target directory formatting is only used when the
virtual path exactly match .../targets/$target/$subtarget. Do not
match on any of the parent directories or in any of the subdirs.

Also change all regular expressions to use "!" as delimitter and
properly escape dots.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Apr 15, 2017
1 parent 772e004 commit 29040cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dir-index.cgi
Expand Up @@ -330,8 +330,8 @@ my @hidden = ( # hide these files - never consider th
qr!^/releases/\d\d\.\d\d-SNAPSHOT/?$!,
qr!^/releases/faillogs/?$!,
qr!^/packages-\d\d\.\d\d/?$!,
qr/.DS_Store/, # ignore OSX .DS_Store file
qr/index.html/ # test script generates index.html in the SampleData directory
qr!\.DS_Store!, # ignore OSX .DS_Store file
qr!index\.html! # test script generates index.html in the SampleData directory
);

my $hidden_re = join '|', @hidden; # build the master regex for hidden files
Expand All @@ -356,7 +356,7 @@ if (opendir(D, $phys)) { # read all the files from the director

# @entries contains list of files from the directory that should be processed

if ($virt =~ /\/targets\//) { # special handling for 'targets' - LEDE image file directories
if ($virt =~ m!/targets/[^/]+/[^/]+/?$!) { # special handling for 'targets' - LEDE image file directories
printtargets(\@entries, $phys, $virt)
}
else { # otherwise use standard directory display format
Expand Down

0 comments on commit 29040cb

Please sign in to comment.