Commit 54639842 authored by bgm's avatar bgm

Initial support for the new git repositories (4.3 will be in git, <=4.2 in svn).

parent 45b02855
#!/bin/bash
#
# build-unified-pots.sh - builds a set of .pot files for the last 3 versions
# of CiviCRM.
#
# Usage:
#
# - Prepare a directory that has all of the CiviCRM git repositories, ex:
# /path/to/repositories/civicrm-{core,drupal,joomla,wordpress,packages}
#
# In other words:
# $ mkdir -p ~/repositories/civicrm
# $ cd ~/repositories/civicrm
# $ git clone https://github.com/civicrm/civicrm-core.git
# $ git clone https://github.com/civicrm/civicrm-drupal.git
# $ git clone https://github.com/civicrm/civicrm-joomla.git
# $ git clone https://github.com/civicrm/civicrm-wordpress.git
# $ git clone https://github.com/civicrm/civicrm-packages.git
#
# WARNING: the script assumes you are tracking "origin",
# the script will "git pull origin $release" for each repo.
#
# - Run this script:
# $ ./bin/build-unified-pots.sh ~/repositories/civicrm po/pot 'v4.1 v4.2 v4.3'
# $ ./bin/build-unified-pots.sh ~/repositories/civicrm po/pot 'v4.1 v4.2 master'
#
# - Push the new strings to Transifex.
#
# NB: since the migration to git, as of 4.3, we hardcode for now that v4.1 and v4.2
# are fetched from SVN, and v4.3 from git.
SVNROOT="http://svn.civicrm.org/civicrm/branches"
[ -z "$1" ] || [ -z "$1" ] || [ -z "$2" ] || [ ! -d "$2" ] || [ -z "$3" ] && echo "usage: $0 source-dir-or-repo POT-dir releases" && exit 1
[ -n "$4" ] && echo 'provide releases as one, space-separated string' && exit 1
root="$1"
potdir="$2"
rels=`echo "$3" | tr ' ' '\n'`
releases=`echo "$3" | tr ' ' '\n'`
temp=`mktemp -d`
for rel in $rels; do
for rel in $releases; do
## This can be useful to debug the build process or to test on a trunk checkout
## (if you use this, comment out the 'get fresh codebase' block below)
# cp -r /path/to/civicrm $temp/v4.1
......@@ -20,12 +50,42 @@ for rel in $rels; do
pushd .
# get fresh codebase from either Git or Subversion
if [[ $root == http* ]]; then
svn export --force "$root/$rel" "$temp/$rel"
# Get fresh codebase
# starting 4.3, civicrm is using git
# assuming that before that, we are fetching from SVN
# when we drop support for 4.2, we can cleanup this code.
if [ "$rel" = "v4.2" -o "$rel" = "v4.1" ]; then
svn export --force "$SVNROOT/$rel" "$temp/$rel"
else
cd $root
cd $root/civicrm-core
git pull
git archive $rel | tar -xC $temp/$rel
## FIXME: will change to 7.x-${rel}
## we use ${rel:2} so that v4.3 => 4.3
mkdir -p $temp/$rel/drupal
cd $root/civicrm-drupal
git checkout ${rel:1}-7.x
git pull
git archive ${rel:1}-7.x | tar -xC $temp/$rel/drupal
mkdir -p $temp/$rel/joomla
cd $root/civicrm-joomla
git checkout $rel
git pull
git archive $rel | tar -xC $temp/$rel/joomla
mkdir -p $temp/$rel/wordpress
cd $root/civicrm-wordpress
git checkout $rel
git pull
git archive $rel | tar -xC $temp/$rel/wordpress
mkdir -p $temp/$rel/packages
cd $root/civicrm-packages
git checkout $rel
git pull
git archive $rel | tar -xC $temp/$rel/packages
fi
mkdir $temp/$rel/xml/default
......@@ -38,7 +98,6 @@ for rel in $rels; do
popd
bin/create-pot-files.sh $temp/$rel $temp/pot/$rel
done
pots=`for pot in $temp/pot/*/*.pot; do basename $pot .pot; done | sort -u | grep -v ^drupal-civicrm$`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment