@@ -129,10 +129,18 @@ else
129129 if ! git diff-index --quiet HEAD; then
130130 XPI_NAME=" $XPI_NAME -dirty"
131131 fi
132- XPI_NAME=" $XPI_NAME .xpi"
133132fi
134133
134+ # Prepare packages suitable for uploading to EFF and AMO, respectively.
135135[ -d pkg ] || mkdir pkg
136+ [ -e pkg/xpi-eff ] && rm -rf pkg/xpi-eff
137+ cp -a src/ pkg/xpi-eff/
138+ rm -r pkg/xpi-eff/chrome/content/rules
139+ [ -e pkg/xpi-amo ] && rm -rf pkg/xpi-amo
140+ cp -a src/ pkg/xpi-amo/
141+ rm -r pkg/xpi-amo/chrome/content/rules
142+ # The AMO version of the package cannot contain the updateKey or updateURL tags
143+ sed -i -e ' /updateKey/d' -e ' /updateURL/d' pkg/xpi-amo/install.rdf
136144
137145# Used for figuring out which branch to pull from when viewing source for rules
138146GIT_OBJECT_FILE=" .git/refs/heads/master"
@@ -141,27 +149,19 @@ if [ -e "$GIT_OBJECT_FILE" ]; then
141149 export GIT_COMMIT_ID=$( cat " $GIT_OBJECT_FILE " )
142150fi
143151
144- cd src
145-
146-
147152# Build the XPI!
148- rm -f " ../$XPI_NAME "
149- # zip -q -X -9r "../$XPI_NAME" . "-x@../.build_exclusions"
153+ rm -f " ${XPI_NAME} .xpi"
154+ rm -f " ${XPI_NAME} -amo.xpi"
155+ python2.7 utils/create_xpi.py -n " ${XPI_NAME} .xpi" -x " .build_exclusions" " pkg/xpi-eff"
156+ python2.7 utils/create_xpi.py -n " ${XPI_NAME} -amo.xpi" -x " .build_exclusions" " pkg/xpi-amo"
150157
151- python2.7 ../utils/create_xpi.py -n " ../$XPI_NAME " -x " ../.build_exclusions" " ."
158+ echo >&2 " Total included rules: ` sqlite3 $RULESETS_SQLITE ' select count(*) from rulesets' ` "
159+ echo >&2 " Rules disabled by default: ` find src/chrome/content/rules -name " *.xml" | xargs grep -F default_off | wc -l` "
160+ echo >&2 " Created ${XPI_NAME} .xpi and ${XPI_NAME} -amo.xpi"
152161
153- ret=" $? "
154- if [ " $ret " != 0 ]; then
155- rm -f " ../$XPI_NAME "
156- exit " $? "
157- else
158- echo >&2 " Total included rules: ` sqlite3 $RULESETS_SQLITE ' select count(*) from rulesets' ` "
159- echo >&2 " Rules disabled by default: ` find chrome/content/rules -name " *.xml" | xargs grep -F default_off | wc -l` "
160- echo >&2 " Created $XPI_NAME "
161- ../utils/android-push.sh " $XPI_NAME "
162- if [ -n " $BRANCH " ]; then
163- cd ../..
164- cp $SUBDIR /$XPI_NAME pkg
165- rm -rf $SUBDIR
166- fi
162+ bash utils/android-push.sh " $XPI_NAME .xpi"
163+
164+ if [ -n " $BRANCH " ]; then
165+ cp $SUBDIR /$XPI_NAME pkg
166+ rm -rf $SUBDIR
167167fi
0 commit comments