[HTTPS-Everywhere] Implement build of specific branch in makexpi.sh
Alex Xu
alex_y_xu at yahoo.ca
Sat Oct 1 20:07:01 PDT 2011
Pushed to GitHub. https://github.com/Hello71/HTTPS-Everywhere
Attached new diff combining both patches.
A side note: Fun how the patch size is larger than the actual script.
On 11-10-01 02:42 PM, Peter Eckersley wrote:
> For some reason the patch isn't applying, and "git apply" isn't giving me any
> meaningful feedback. Can you apply this and push it to your remote?
>
> On Sat, Oct 01, 2011 at 01:32:49PM -0400, Alex Xu wrote:
>> Increased portability and efficiency. Also removed "multi-line comment"
>> on trivial-validate included for testing; forgot to remove in last diff.
>>
>> On 11-09-30 11:45 PM, Eitan Adler wrote:
>>> On Fri, Sep 30, 2011 at 10:50 PM, Alex Xu <alex_y_xu at yahoo.ca> wrote:
>>>> Also cleaned up inaccurate documentation in makexpi.sh.
>>>>
>>>> Did basic testing and it appears to work.. decently.
>>>>
>>>> Probably needs some code cleanup before merge, though.
>>>
>>> Some portability notes:
>>>
>>> + cp --recursive --archive .git $SUBDIR
>>>
>>> Please use cp -r -a
>>>
>>> + mkdir --parents $XPI_NAME
>>>
>>> Please use mkdir -p
>>>
>>> + printf >&2 "Total included rules: $(ls chrome/content/rules/*.xml
>>> | wc -l)\n"
>>>
>>> Don't script on ls: use find instead.
>>>
>>> While here can you please fix the sed lines? it appears that they are
>>> using some non-standard extensions (although this was not introduced
>>> by your patch).
>>>
>>>
>>>>
>>>> _______________________________________________
>>>> HTTPS-everywhere mailing list
>>>> HTTPS-everywhere at mail1.eff.org
>>>> https://mail1.eff.org/mailman/listinfo/https-everywhere
>>>>
>>>>
>>>
>>>
>>>
>
>> diff --git a/makexpi.sh b/makexpi.sh
>> index 8d87ab9..52cf9a6 100755
>> --- a/makexpi.sh
>> +++ b/makexpi.sh
>> @@ -20,12 +20,11 @@ if [ -n "$1" ]; then
>> BRANCH=$(git branch | head -n 1 | cut -d \ -f 2-)
>> SUBDIR=checkout
>> [ -d $SUBDIR ] || mkdir $SUBDIR
>> - cp --recursive --archive .git $SUBDIR
>> + cp -r -a .git $SUBDIR
>> cd $SUBDIR
>> git reset --hard "$1"
>> fi
>>
>> -if false; then
>> if ./trivial-validate src/chrome/content/rules >&2
>> then
>> echo Validation of included rulesets completed. >&2
>> @@ -34,7 +33,6 @@ else
>> echo ERROR: Validation of rulesets failed. >&2
>> exit 1
>> fi
>> -fi
>>
>> if [ -n "$1" ]; then
>> VERSION="$1"
>> @@ -43,7 +41,7 @@ else
>> fi
>>
>> XPI_NAME="pkg/$APP_NAME-$VERSION.xpi"
>> -mkdir --parents $XPI_NAME
>> +mkdir -p $XPI_NAME
>> rmdir $XPI_NAME
>>
>> cd "src"
>> @@ -53,9 +51,9 @@ echo "</rulesetlibrary>" >> chrome/content/rules/default.rulesets
>> echo "Removing whitespaces and comments..."
>> sed -i -e :a -re 's/<!--.*?-->//g;/<!--/N;//ba' chrome/content/rules/default.rulesets
>> sed -i ':a;N;$!ba;s/\n//g' chrome/content/rules/default.rulesets
>> -sed -i 's/>[[:blank:]]*</></g' chrome/content/rules/default.rulesets
>> -sed -i 's/[[:blank:]]*to=/ to=/g' chrome/content/rules/default.rulesets
>> -sed -i 's/[[:blank:]]*from=/ from=/g' chrome/content/rules/default.rulesets
>> +sed -i 's/>[ ]*</></g' chrome/content/rules/default.rulesets
>> +sed -i 's/[ ]*to=/ to=/g' chrome/content/rules/default.rulesets
>> +sed -i 's/[ ]*from=/ from=/g' chrome/content/rules/default.rulesets
>> sed -i 's/ \/>/\/>/g' chrome/content/rules/default.rulesets
>> touch -r chrome/content/rules chrome/content/rules/default.rulesets
>> rm -f "../$XPI_NAME"
>> @@ -66,8 +64,8 @@ if [ "$ret" != 0 ]; then
>> rm -f "../$XPI_NAME"
>> exit "$?"
>> else
>> - printf >&2 "Total included rules: $(ls chrome/content/rules/*.xml | wc -l)\n"
>> - printf >&2 "Rules disabled by default: $(grep -lr default_off chrome/content/rules | wc -l)\n"
>> + printf >&2 "Total included rules: $(find -name "chrome/content/rules/*.xml" | wc -l)\n"
>> + printf >&2 "Rules disabled by default: $(grep -lrc default_off chrome/content/rules)\n"
>> printf >&2 "Created %s\n" "$XPI_NAME"
>> if [ -n "$BRANCH" ]; then
>> cd ../..
>
>> _______________________________________________
>> HTTPS-everywhere mailing list
>> HTTPS-everywhere at mail1.eff.org
>> https://mail1.eff.org/mailman/listinfo/https-everywhere
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: makexpi.diff.merged
URL: <http://lists.eff.org/pipermail/https-everywhere/attachments/20111001/c7f308b5/attachment.ksh>
More information about the HTTPS-everywhere
mailing list