Blob Blame History Raw
diff -up noscript-11.4.28/build.sh.f noscript-11.4.28/build.sh
--- noscript-11.4.28/build.sh.f	2023-10-08 22:29:24.000000000 +0200
+++ noscript-11.4.28/build.sh	2023-11-21 11:34:58.294714452 +0100
@@ -70,13 +70,6 @@ LIB="$SRC/lib"
 
 NSCL="$SRC/nscl"
 
-# install html5_events.pl dependencies if needed
-cpan Regexp::List List::MoreUtils
-if ./html5_events/html5_events.pl; then
-  # update full event list as an array in src/lib/DocumentFreezer.js
-  EVENTS=$(grep '^on[a-z]\+$' html5_events/html5_events_archive.txt | sed "s/^on//;s/.*/'&'/;H;1h;"'$!d;x;s/\n/, /g');
-  perl -pi -e 's/(\bconst eventTypes\s*=\s*)\[.*?\]/$1\['"$EVENTS"'\]/' src/lib/DocumentFreezer.js
-fi
 
 rm -rf "$BUILD" "$XPI"
 cp -pR "$SRC" "$BUILD"
@@ -86,8 +79,8 @@ cp -pR "$SRC" "$BUILD"
 
 cp -p LICENSE "$BUILD"/
 
-BUILD_CMD="web-ext"
-BUILD_OPTS="build --overwrite-dest"
+BUILD_CMD="zip"
+BUILD_OPTS="-r"
 CHROMIUM_BUILD_CMD="$BUILD_CMD"
 CHROMIUM_BUILD_OPTS="$BUILD_OPTS"
 
@@ -131,10 +124,42 @@ else
   WEBEXT_OUT="$XPI_DIR"
 fi
 
-COMMON_BUILD_OPTS="--ignore-files=test/XSS_test.js --ignore-files=content/experiments.js"
+grep -E -h -v '^(#|$)' .gitignore src/nscl/.gitignore > exclude.lst
+cat >> exclude.lst << __EOF__
+.gitignore
+content/experiments.js
+nscl/boot.js
+nscl/common/Entities.js
+nscl/content/DocumentFreezer.js
+nscl/content/ftp.js
+nscl/content/patchWorkers.js
+nscl/content.js
+nscl/COPYING
+nscl/lib/browser-polyfill.js.license
+nscl/lib/punycode.js.license
+nscl/LICENSE.md
+nscl/LICENSES/*
+nscl/main.js
+nscl/.reuse/*
+nscl/.gitignore
+nscl/include.sh
+nscl/manifest.json
+nscl/nscl-logo.png
+nscl/reuse.sh
+nscl/ReadMe.md
+nscl/service/patchWorkers.js
+nscl/service/PolicyEnforcer.js
+nscl/service/WebRequestCSP.js
+nscl/test/run.js
+nscl/TLD/*
+test/XSS_test.js
+__EOF__
+COMMON_BUILD_OPTS="--exclude @$BASE/exclude.lst"
 
 build() {
-  "$BUILD_CMD" $BUILD_OPTS --source-dir="$WEBEXT_IN" --artifacts-dir="$WEBEXT_OUT" $COMMON_BUILD_OPTS
+  pushd "$WEBEXT_IN"
+  "$BUILD_CMD" $BUILD_OPTS "$WEBEXT_OUT/noscript-$VER.zip" . $COMMON_BUILD_OPTS
+  popd
 }
 
 build
@@ -156,6 +181,7 @@ elif ! [ -f "$XPI.xpi" ]; then
   exit 3
 fi
 ln -fs "$XPI.xpi" "$BASE/latest.xpi"
+exit 0
 
 # create Chromium pre-release