toolkit/components/downloads/generate_csd.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/downloads/generate_csd.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +#!/bin/bash
     1.5 +# A script to generate toolkit/components/downloads/csd.pb.{cc,h} for use in
     1.6 +# nsIApplicationReputationQuery. This script assumes you have downloaded and
     1.7 +# installed the protocol buffer compiler.
     1.8 +
     1.9 +if [ -n $PROTOC_PATH ]; then
    1.10 +  PROTOC_PATH=/usr/local/bin/protoc
    1.11 +fi
    1.12 +
    1.13 +echo "Using $PROTOC_PATH as protocol compiler"
    1.14 +
    1.15 +if [ ! -e $PROTOC_PATH ]; then
    1.16 +  echo "You must install the protocol compiler from " \
    1.17 +       "https://code.google.com/p/protobuf/downloads/list"
    1.18 +  exit 1
    1.19 +fi
    1.20 +
    1.21 +# Get the protocol buffer and compile it
    1.22 +CMD='wget http://src.chromium.org/chrome/trunk/src/chrome/common/safe_browsing/csd.proto -O csd.proto'
    1.23 +OUTPUT_PATH=toolkit/components/downloads
    1.24 +
    1.25 +$CMD
    1.26 +$PROTOC_PATH csd.proto --cpp_out=$OUTPUT_PATH

mercurial