Skip to content

Commit 816d8ae

Browse files
committed
[Build] Fixes for cygwin-related cross-platform compatibility quirks.
1 parent 808fd65 commit 816d8ae

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,15 @@ done
8888
echo "Creating $XPI.xpi..."
8989
mkdir -p "$XPI_DIR"
9090

91-
"$BUILD_CMD" $BUILD_OPTS --source-dir=$(cygpath -w "$BUILD") --artifacts-dir=$(cygpath -w "$XPI_DIR") --ignore-files=test/XSS_test.js
91+
if which cygpath; then
92+
WEBEXT_IN="$(cygpath -w "$BUILD")"
93+
WEBEXT_OUT="$(cygpath -w "$XPI_DIR")"
94+
else
95+
WEBEXT_IN="$BUILD"
96+
WEBEXT_OUT="$XPI_DIR"
97+
fi
98+
99+
"$BUILD_CMD" $BUILD_OPTS --source-dir="$WEBEXT_IN" --artifacts-dir="$WEBEXT_OUT" --ignore-files=test/XSS_test.js
92100
SIGNED="$XPI_DIR/noscript_security_suite-$VER-an+fx.xpi"
93101
if [ -f "$SIGNED" ]; then
94102
mv "$SIGNED" "$XPI.xpi"

html5_events/html5_events.pl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
require LWP::UserAgent;
55
use LWP::Simple;
6-
use RegExp::List;
6+
use Regexp::List;
77
use File::stat;
88
use File::Basename;
99
use List::MoreUtils qw(uniq);
@@ -17,7 +17,7 @@ sub create_re
1717
{
1818
my $cache = "$HERE/html5_events.re";
1919
my $archive = "$HERE/html5_events_archive.txt";
20-
20+
2121
my $sb = stat($cache);
2222

2323
if ($sb && time() - $sb->mtime < 86400)
@@ -27,7 +27,7 @@ sub create_re
2727
close IN;
2828
return $content[0];
2929
}
30-
30+
3131
sub fetch_url
3232
{
3333
my $url = shift(@_);
@@ -53,30 +53,30 @@ sub create_re
5353
$content = join("\n", grep(/^\s*Atom\("on\w+"/, split(/[\n\r]/, $content)));
5454

5555
$content =~ s/.*"(on\w+)".*/$1 /g;
56-
56+
5757
open IN, "<$archive";
5858
my @archived = <IN>;
5959
close IN;
6060

6161
$content .= join("\n", @archived);
62-
62+
6363
$content =~ s/\s+/\n/g;
6464
$content =~ s/^\s+|\s+$//g;
65-
65+
6666
my @all_events = grep(!/^only$/, uniq(split("\n", $content)));
67-
67+
6868
open (OUT, ">$archive");
6969
print OUT join("\n", @all_events);
7070
close OUT;
71-
71+
7272
my $l = Regexp::List->new;
7373
my $re = $l->list2re(@all_events);
7474
$re =~ s/\(\?[-^]\w+:(.*)\)/$1/;
75-
75+
7676
open (OUT, ">$cache");
7777
print OUT $re;
7878
close OUT;
79-
79+
8080
$re;
8181
}
8282

0 commit comments

Comments
 (0)