MozillaFirefox/create-tar.sh
branchfirefox69
changeset 1111 97a6da6d7e29
parent 1098 538cbf0bbdca
child 1113 8e9195853a32
equal deleted inserted replaced
1110:9e4b30f05706 1111:97a6da6d7e29
     1 #!/bin/bash
     1 #!/bin/bash
     2 
     2 
     3 function print_usage_and_exit() {
     3 function print_usage_and_exit() {
     4   echo "Usage: create-tar.sh tar_stamp"
     4   echo "Usage: create-tar.sh tar_stamps"
     5   echo ""
     5   echo ""
     6   echo "Where tar_stamp should look like this:"
     6   echo "Where tar_stamps should look like this:"
     7   echo ""
     7   echo ""
     8   cat << EOF
     8   cat << EOF
     9 # Node ID: 64ee63facd4ff96b3e8590cff559d7e97ac6b061
     9 # Node ID: 64ee63facd4ff96b3e8590cff559d7e97ac6b061
    10 PRODUCT="firefox" # "firefox" or "thunderbird"
    10 PRODUCT="firefox" # "firefox" or "thunderbird"
    11 CHANNEL="esr60"
    11 CHANNEL="esr60"
    12 VERSION="60.7.0"
    12 VERSION="60.7.0"
    13 VERSION_SUFFIX="esr"
    13 VERSION_SUFFIX="esr"
    14 FF_RELEASE_TAG="" # Needs only to be set if no tar-ball can be downloaded
    14 RELEASE_TAG="" # Needs only to be set if no tar-ball can be downloaded
    15 TB_RELEASE_TAG="" # Only relevant for Thunderbird
       
    16 PREV_VERSION="60.6.3" # Prev. version only needed for locales (leave empty to force l10n-generation)
    15 PREV_VERSION="60.6.3" # Prev. version only needed for locales (leave empty to force l10n-generation)
    17 PREV_VERSION_SUFFIX="esr"
    16 PREV_VERSION_SUFFIX="esr"
    18 #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation
    17 #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation
    19 EOF
    18 EOF
    20 
    19 
    23 
    22 
    24 if [ $# -ne 1 ]; then
    23 if [ $# -ne 1 ]; then
    25   print_usage_and_exit
    24   print_usage_and_exit
    26 fi
    25 fi
    27 
    26 
    28 # Sourcing the given tar_stamp-file to have the variables available
    27 # Sourcing the given tar_stamps-file to have the variables available
    29 source "$1" || print_usage_and_exit
    28 source "$1" || print_usage_and_exit
    30 
    29 
    31 # Internal variables
    30 # Internal variables
    32 BRANCH="releases/mozilla-$CHANNEL"
    31 BRANCH="releases/mozilla-$CHANNEL"
    33 if [ "$PRODUCT" = "firefox" ]; then
    32 if [ "$PRODUCT" = "firefox" ]; then
   191   fi
   190   fi
   192   if [ ! -d $PRODUCT-$VERSION ]; then
   191   if [ ! -d $PRODUCT-$VERSION ]; then
   193     echo "cloning new $BRANCH..."
   192     echo "cloning new $BRANCH..."
   194     hg clone http://hg.mozilla.org/$BRANCH $PRODUCT-$VERSION
   193     hg clone http://hg.mozilla.org/$BRANCH $PRODUCT-$VERSION
   195     if [ "$PRODUCT" = "thunderbird" ]; then
   194     if [ "$PRODUCT" = "thunderbird" ]; then
   196       hg clone http://hg.mozilla.org/releases/comm-$CHANNEL thunderbird-$VERSION/comm
   195       hg clone http://hg.mozilla.org/releases/comm-$CHANNEL $PRODUCT-$VERSION/comm
   197     fi
   196     fi
   198   fi
   197   fi
   199   pushd $PRODUCT-$VERSION || exit 1
   198   pushd $PRODUCT-$VERSION || exit 1
       
   199 
       
   200   # parse out the Firefox-release tag for this Thunderbird-checkout
       
   201   if [ "$PRODUCT" = "thunderbird" ]; then
       
   202     FF_RELEASE_TAG=$(grep ^GECKO_HEAD_REV ./comm/.gecko_rev.yml | awk -F ' ' '{print $2}') || exit 1
       
   203     echo "Parsed Firefox base ID from .gecko_rev.yml: $FF_RELEASE_TAG"
       
   204   else
       
   205     FF_RELEASE_TAG="$RELEASE_TAG"
       
   206   fi
       
   207 
   200   hg update --check $FF_RELEASE_TAG
   208   hg update --check $FF_RELEASE_TAG
   201   [ "$FF_RELEASE_TAG" == "default" ] || hg update -r $FF_RELEASE_TAG
   209   [ "$FF_RELEASE_TAG" == "default" ] || hg update -r $FF_RELEASE_TAG
   202   # get repo and source stamp
   210   # get repo and source stamp
   203   echo -n "REV=" > ../source-stamp.txt
   211   echo -n "REV=" > ../source-stamp.txt
   204   hg -R . parent --template="{node|short}\n" >> ../source-stamp.txt
   212   hg -R . parent --template="{node|short}\n" >> ../source-stamp.txt
   205   echo -n "REPO=" >> ../source-stamp.txt
   213   echo -n "REPO=" >> ../source-stamp.txt
   206   hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" >> ../source-stamp.txt
   214   hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" >> ../source-stamp.txt
   207 
   215 
   208   if [ "$PRODUCT" = "thunderbird" ]; then
   216   if [ "$PRODUCT" = "thunderbird" ]; then
   209     pushd comm || exit 1
   217     pushd comm || exit 1
   210     hg update --check $TB_RELEASE_TAG
   218     hg update --check $RELEASE_TAG
   211     popd || exit 1
   219     popd || exit 1
   212     rm -rf thunderbird-${VERSION}/{,comm/}other-licenses/7zstub
   220     rm -rf thunderbird-${VERSION}/{,comm/}other-licenses/7zstub
   213   fi
   221   fi
   214   popd || exit 1
   222   popd || exit 1
   215 
   223 
   239             hg pull
   247             hg pull
   240             popd || exit 1
   248             popd || exit 1
   241           else
   249           else
   242             hg clone "http://hg.mozilla.org/l10n-central/$locale" "l10n/$locale"
   250             hg clone "http://hg.mozilla.org/l10n-central/$locale" "l10n/$locale"
   243           fi
   251           fi
   244           [ "$FF_RELEASE_TAG" == "default" ] || hg -R "l10n/$locale" up -C -r "$changeset"
   252           [ "$RELEASE_TAG" == "default" ] || hg -R "l10n/$locale" up -C -r "$changeset"
   245           ;;
   253           ;;
   246       esac
   254       esac
   247     done
   255     done
   248   echo "creating l10n archive..."
   256   echo "creating l10n archive..."
   249   if [ "$PRODUCT" = "thunderbird" ]; then
   257   if [ "$PRODUCT" = "thunderbird" ]; then