summaryrefslogtreecommitdiff
path: root/download
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2009-06-25 23:48:40 +0200
committerJan Holesovsky <kendy@suse.cz>2009-06-25 23:48:40 +0200
commite1c272704de130e8397a17fae6712247123cf248 (patch)
treeb43f0bcae0b44e7383bd47c306313acf52cd34fa /download
parent8519384bbaddb6b052d95977b65833e73f9e5ba6 (diff)
Split build: Script to clone the rest of the repositories.
* download:
Diffstat (limited to 'download')
-rwxr-xr-xdownload64
1 files changed, 64 insertions, 0 deletions
diff --git a/download b/download
new file mode 100755
index 000000000000..c68ba5d89193
--- /dev/null
+++ b/download
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Clone the rest of the remote repositories to have the complete ooo-build
+# sources
+
+usage() {
+ cat 1>&2 <<EOF
+
+./download [--help] [--list] [--skip=val[,val2]] [--repo=git://XYZ]
+
+ -h,--help This text
+ -l,--list Return all the available components
+ --repo The repository location; if not specified, it is guessed
+ from the current one
+ Anon repo: git://anongit.freedesktop.org/git/ooo-build
+ --skip Don't download the selected components, eg. filters,l10n
+EOF
+ exit 1
+}
+
+COMPONENTS="artwork base bootstrap calc components extensions extras filters
+help impress l10n libs-core libs-extern libs-extern-sys libs-gui ooo-build
+postprocess sdk testing ure writer"
+
+ORIGIN=`git remote show -n origin | grep URL: | sed 's#^[[:space:]]*URL: ##'`
+
+SKIP=
+REPO=`echo "$ORIGIN" | sed 's#/[^/]\+/\?$##'`
+
+# get the params
+while [ -n "$1" ]
+do
+ case "$1" in
+ --list|-l) echo $COMPONENTS ; exit 0 ;;
+ --skip=*) SKIP=${1#--skip=} ;;
+ --repo=*) REPO=${1#--repo=} ;;
+ --help|-h) usage ;;
+ esac
+ shift
+done
+
+# check that everything's OK
+if [ -z "$REPO" ]
+then
+ echo "Couldn't guess the repository location, please provide that with --repo" 1>&2
+ echo 1>&2
+ usage
+fi
+
+# skip the repo where we are
+SKIP="$SKIP,`echo $ORIGIN | sed 's#.*/\([^/]\+\)/\?$#\1#'`"
+
+# do the work
+for DIR in $COMPONENTS
+do
+ # skip?
+ ( echo "$SKIP" | grep "\<$DIR\>" > /dev/null 2>&1 ) && continue
+ # already cloned?
+ [ -d ../$DIR ] && { echo "* Not clonnig $DIR, already exists" ; continue ; }
+
+ # clone!
+ echo "* Cloning $DIR..."
+ ( cd .. ; git clone "$REPO/$DIR" )
+done