From cad3c5f5cbc039fec49e9df31a9ebd186b0bb802 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 3 Apr 2016 13:07:46 -0400 Subject: [PATCH] update packaging scripts for https://github.com/uBlockOrigin/uAssets repo --- src/js/assets.js | 7 +++++++ tools/make-assets.sh | 25 +++++++++++++++++++++++++ tools/make-chromium.sh | 22 +++++++++++----------- tools/make-firefox.sh | 4 ++-- tools/make-opera.sh | 4 ++-- 5 files changed, 47 insertions(+), 15 deletions(-) create mode 100755 tools/make-assets.sh diff --git a/src/js/assets.js b/src/js/assets.js index b2cd3a790..db5414630 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -295,6 +295,13 @@ var toRepoURL = function(path) { return projectRepositoryRoot + path; } + if ( path.startsWith('assets/checksums.txt') ) { + return path.replace( + /^assets\/checksums.txt/, + assetsRepositoryRoot + 'checksums/ublock0.txt' + ); + } + if ( path.startsWith('assets/thirdparties/') ) { return path.replace( /^assets\/thirdparties\//, diff --git a/tools/make-assets.sh b/tools/make-assets.sh new file mode 100755 index 000000000..68e2d3984 --- /dev/null +++ b/tools/make-assets.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# This script assumes a linux environment + +DES=$1/assets + +echo "*** uBlock0.chromium: packaging assets in $DES" + +rm -rf $DES +mkdir $DES + +mkdir $DES/thirdparties +cp -R ../uAssets/thirdparties/easylist-downloads.adblockplus.org $DES/thirdparties/ +cp -R ../uAssets/thirdparties/mirror1.malwaredomains.com $DES/thirdparties/ +cp -R ../uAssets/thirdparties/pgl.yoyo.org $DES/thirdparties/ +cp -R ../uAssets/thirdparties/publicsuffix.org $DES/thirdparties/ +cp -R ../uAssets/thirdparties/www.malwaredomainlist.com $DES/thirdparties/ + +mkdir $DES/ublock +cp -R ../uAssets/filters/* $DES/ublock/ +cp -R ./assets/ublock/filter-lists.json $DES/ublock/ + +cp ../uAssets/checksums/ublock0.txt $DES/checksums.txt + +echo "*** uBlock0.chromium: packaging assets: done." diff --git a/tools/make-chromium.sh b/tools/make-chromium.sh index 0cd4474ad..57b61d1ff 100755 --- a/tools/make-chromium.sh +++ b/tools/make-chromium.sh @@ -9,20 +9,20 @@ DES=dist/build/uBlock0.chromium rm -rf $DES mkdir -p $DES -cp -R assets $DES/ -rm $DES/assets/*.sh -cp -R src/css $DES/ -cp -R src/img $DES/ -cp -R src/js $DES/ -cp -R src/lib $DES/ -cp -R src/_locales $DES/ -cp -R $DES/_locales/nb $DES/_locales/no -cp src/*.html $DES/ -cp platform/chromium/*.js $DES/js/ +./tools/make-assets.sh $DES + +cp -R src/css $DES/ +cp -R src/img $DES/ +cp -R src/js $DES/ +cp -R src/lib $DES/ +cp -R src/_locales $DES/ +cp -R $DES/_locales/nb $DES/_locales/no +cp src/*.html $DES/ +cp platform/chromium/*.js $DES/js/ cp -R platform/chromium/img $DES/ cp platform/chromium/*.html $DES/ cp platform/chromium/*.json $DES/ -cp LICENSE.txt $DES/ +cp LICENSE.txt $DES/ if [ "$1" = all ]; then echo "*** uBlock0.chromium: Creating package..." diff --git a/tools/make-firefox.sh b/tools/make-firefox.sh index ad03b2994..e1b4626c7 100755 --- a/tools/make-firefox.sh +++ b/tools/make-firefox.sh @@ -8,8 +8,8 @@ DES=dist/build/uBlock0.firefox rm -rf $DES mkdir -p $DES -cp -R assets $DES/ -rm $DES/assets/*.sh +./tools/make-assets.sh $DES + cp -R src/css $DES/ cp -R src/img $DES/ cp -R src/js $DES/ diff --git a/tools/make-opera.sh b/tools/make-opera.sh index 66bb197e3..82a78c834 100755 --- a/tools/make-opera.sh +++ b/tools/make-opera.sh @@ -9,8 +9,8 @@ DES=dist/build/uBlock0.opera rm -r $DES mkdir -p $DES -cp -R assets $DES/ -rm $DES/assets/*.sh +./tools/make-assets.sh $DES + cp -R src/css $DES/ cp -R src/img $DES/ cp -R src/js $DES/