Skip to content

Commit e2401df

Browse files
committed
Improve makecrx.
Create pkg dir before running make-sqlite, otherwise make-sqlite fails to write output there. Remove unused "today" build target. Only run validation if make-sqlite succeeds.
1 parent e93105c commit e2401df

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

makecrx.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,21 @@ RULESETS_UNVALIDATED="$PWD/pkg/rulesets.unvalidated.sqlite"
2424
RULESETS_SQLITE="$PWD/src/defaults/rulesets.sqlite"
2525

2626
if [ -n "$1" ]; then
27-
if [ "$1" = today ] ; then
28-
python chromium/setversion.py
29-
else
30-
BRANCH=`git branch | head -n 1 | cut -d \ -f 2-`
31-
SUBDIR=checkout
32-
[ -d $SUBDIR ] || mkdir $SUBDIR
33-
cp -r -f -a .git $SUBDIR
34-
cd $SUBDIR
35-
git reset --hard "$1"
36-
fi
27+
BRANCH=`git branch | head -n 1 | cut -d \ -f 2-`
28+
SUBDIR=checkout
29+
[ -d $SUBDIR ] || mkdir $SUBDIR
30+
cp -r -f -a .git $SUBDIR
31+
cd $SUBDIR
32+
git reset --hard "$1"
3733
fi
3834

3935
VERSION=`python -c "import json ; print(json.loads(open('chromium/manifest.json').read())['version'])"`
4036

4137
echo "Building chrome version" $VERSION
4238

39+
[ -d pkg ] || mkdir -p pkg
40+
[ -e pkg/crx ] && rm -rf pkg/crx
41+
4342
# Only generate the sqlite database if any rulesets have changed. Tried
4443
# implementing this with make, but make is very slow with 15k+ input files.
4544
needs_update() {
@@ -50,14 +49,11 @@ if [ ! -f "$RULESETS_UNVALIDATED" ] || needs_update ; then
5049
# Build the SQLite DB even though we don't yet use it in the Chrome extension,
5150
# because trivial-validate.py depends on it.
5251
echo "Generating sqlite DB"
53-
python2.7 ./utils/make-sqlite.py
54-
bash utils/validate.sh
52+
python2.7 ./utils/make-sqlite.py && bash utils/validate.sh
5553
fi
5654

5755
sed -e "s/VERSION/$VERSION/g" chromium/updates-master.xml > chromium/updates.xml
5856

59-
[ -d pkg ] || mkdir -p pkg
60-
[ -e pkg/crx ] && rm -rf pkg/crx
6157
mkdir -p pkg/crx/rules
6258
cd pkg/crx
6359
cp -a ../../chromium/* .

0 commit comments

Comments
 (0)