summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-01-22 14:04:23 -0300
committerTomás Touceda <chiiph@leap.se>2014-01-22 14:04:23 -0300
commitf5a5a7e3a8adfbc1f7bf450cb72cc50901dfade4 (patch)
tree5e2eb1813799744bac7c8031f21d1f774d7a1b67
parent1388f5bc6563f3b8ca5d3c70ef22a9b6966cff04 (diff)
parentd834422a48fda0ad1a5b1bd1db5edd0a4a35c823 (diff)
Merge remote-tracking branch 'refs/remotes/drebs/add-debian-package-build-script' into develop
-rw-r--r--scripts/README.rst13
-rwxr-xr-xscripts/build_debian_package.sh32
-rw-r--r--scripts/client_side_db.py (renamed from scripts/client-side-db.py)6
-rw-r--r--scripts/server_side_db.py (renamed from scripts/server-side-db.py)4
4 files changed, 41 insertions, 14 deletions
diff --git a/scripts/README.rst b/scripts/README.rst
index fdd1d642..37cf2c0e 100644
--- a/scripts/README.rst
+++ b/scripts/README.rst
@@ -2,16 +2,3 @@ Soledad Scripts
===============
The scripts in this directory are meant to be used for development purposes.
-
-Currently, the scripts are:
-
- * server-side-db.py: Gives access to server-side soledad user database,
- based on the configuration in /etc/leap/soledad-server.conf. One should
- use it as:
-
- python -i server-side-db.py <uuid>
-
- * client-side-db.py: Gives access to client-side soledad user database,
- based on data stored in ~/.config/leap/soledad. One should use it as:
-
- python -i client-side-db.py <uuid> <passphrase>
diff --git a/scripts/build_debian_package.sh b/scripts/build_debian_package.sh
new file mode 100755
index 00000000..cc62c3ac
--- /dev/null
+++ b/scripts/build_debian_package.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# This script generates Soledad Debian packages.
+#
+# When invoking this script, you should pass a git repository URL and the name
+# of the branch that contains the code you wish to build the packages from.
+#
+# The script will clone the given branch from the given repo, as well as the
+# main Soledad repo in github which contains the most up-to-date debian
+# branch. It will then merge the desired branch into the debian branch and
+# build the packages.
+
+if [ $# -ne 2 ]; then
+ echo "Usage: ${0} <url> <branch>"
+ exit 1
+fi
+
+SOLEDAD_MAIN_REPO=git://github.com/leapcode/soledad.git
+
+url=$1
+branch=$2
+workdir=`mktemp -d`
+
+git clone -b ${branch} ${url} ${workdir}/soledad
+export GIT_DIR=${workdir}/soledad/.git
+export GIT_WORK_TREE=${workdir}/soledad
+git remote add leapcode ${SOLEDAD_MAIN_REPO}
+git fetch leapcode
+git checkout debian
+git merge --no-edit ${branch}
+(cd ${workdir}/soledad && debuild -uc -us)
+echo "Packages generated in ${workdir}"
diff --git a/scripts/client-side-db.py b/scripts/client_side_db.py
index 0c3df7a4..6d1843ac 100644
--- a/scripts/client-side-db.py
+++ b/scripts/client_side_db.py
@@ -1,7 +1,11 @@
#!/usr/bin/python
# This script gives client-side access to one Soledad user database by using
-# the data stored in ~/.config/leap/soledad/
+# the data stored in the appropriate config dir given by get_path_prefix().
+#
+# Use it like this:
+#
+# python -i client-side-db.py <uuid> <passphrase>
import sys
import os
diff --git a/scripts/server-side-db.py b/scripts/server_side_db.py
index 01a9aaac..18641a0f 100644
--- a/scripts/server-side-db.py
+++ b/scripts/server_side_db.py
@@ -2,6 +2,10 @@
# This script gives server-side access to one Soledad user database by using
# the configuration stored in /etc/leap/soledad-server.conf.
+#
+# Use it like this:
+#
+# python -i server-side-db.py <uuid>
import sys
from ConfigParser import ConfigParser