Use `git clone` instead of submodule to pull uAssets dependencies

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2358

We need two different branches of uAssets to properly add the
default filter lists into the packages. I couldn't figure out
how to do this with submodules, using simple `git clone` as a
dependency just work.
This commit is contained in:
Raymond Hill 2022-11-14 09:50:53 -05:00
parent 90ca2ad3cf
commit 17590c5a0c
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
7 changed files with 31 additions and 21 deletions

View File

@ -24,7 +24,7 @@ jobs:
persist-credentials: false
- name: Clone uAssets
run: |
git submodule update --depth 1 --init
tools/pull-assets.sh
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
- name: Get release information
id: release_info

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "submodules/uAssets"]
path = submodules/uAssets
url = https://github.com/uBlockOrigin/uAssets.git

View File

@ -6,10 +6,7 @@ run_options := $(filter-out $@,$(MAKECMDGOALS))
sources := $(wildcard assets/resources/* dist/version src/* src/*/* src/*/*/* src/*/*/*/*)
platform := $(wildcard platform/* platform/*/* platform/*/*/* platform/*/*/*/*)
assets := $(wildcard submodules/uAssets/* \
submodules/uAssets/*/* \
submodules/uAssets/*/*/* \
submodules/uAssets/*/*/*/*)
assets := dist/build/uAssets
all: chromium firefox npm
@ -61,9 +58,8 @@ mv3-quick: tools/make-mv3.sh $(sources) $(platform)
mv3-full: tools/make-mv3.sh $(sources) $(platform)
tools/make-mv3.sh full
# Update submodules.
update-submodules:
tools/update-submodules.sh
dist/build/uAssets:
tools/pull-assets.sh
clean:
rm -rf dist/build tmp/node_modules

View File

@ -177,6 +177,7 @@
"title": "EasyList",
"contentURL": [
"https://ublockorigin.github.io/uAssets/thirdparties/easylist.txt",
"assets/thirdparties/easylist/easylist.txt",
"assets/thirdparties/easylist-downloads.adblockplus.org/easylist.txt"
],
"cdnURLs": [
@ -227,6 +228,7 @@
"title": "EasyPrivacy",
"contentURL": [
"https://ublockorigin.github.io/uAssets/thirdparties/easyprivacy.txt",
"assets/thirdparties/easylist/easyprivacy.txt",
"assets/thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt"
],
"cdnURLs": [

@ -1 +0,0 @@
Subproject commit af7fc56287ae5b5ed467862a3aa4aac0c8ce7d5b

View File

@ -13,15 +13,20 @@ cp -R ./assets $DES/
mkdir $DES/thirdparties
git submodule update --depth 1 --init
UASSETS=submodules/uAssets
ASSETS_MAIN=dist/build/uAssets/main
ASSETS_PROD=dist/build/uAssets/prod
cp -R $UASSETS/thirdparties/easylist-downloads.adblockplus.org $DES/thirdparties/
cp -R $UASSETS/thirdparties/pgl.yoyo.org $DES/thirdparties/
cp -R $UASSETS/thirdparties/publicsuffix.org $DES/thirdparties/
cp -R $UASSETS/thirdparties/urlhaus-filter $DES/thirdparties/
cp -R $ASSETS_MAIN/thirdparties/pgl.yoyo.org $DES/thirdparties/
cp -R $ASSETS_MAIN/thirdparties/publicsuffix.org $DES/thirdparties/
cp -R $ASSETS_MAIN/thirdparties/urlhaus-filter $DES/thirdparties/
mkdir -p $DES/thirdparties/easylist
cp $ASSETS_PROD/thirdparties/easy*.txt $DES/thirdparties/easylist/
mkdir $DES/ublock
cp -R $UASSETS/filters/* $DES/ublock/
# Optional filter lists: do not include in package
rm $DES/ublock/annoyances.txt
cp $ASSETS_PROD/filters/* $DES/ublock/
# Do not include in package
rm $DES/ublock/annoyances.txt
rm $DES/ublock/lan-block.txt
rm $DES/ublock/ubol-filters.txt

11
tools/pull-assets.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# This script assumes a linux environment
set -e
DES=dist/build/uAssets
echo "*** Pull assets from remote into $DES"
git clone --depth 1 --branch master https://github.com/uBlockOrigin/uAssets $DES/main
git clone --depth 1 --branch gh-pages https://github.com/uBlockOrigin/uAssets $DES/prod