summaryrefslogtreecommitdiff
path: root/bin/build-all-packages
diff options
context:
space:
mode:
Diffstat (limited to 'bin/build-all-packages')
-rwxr-xr-xbin/build-all-packages59
1 files changed, 59 insertions, 0 deletions
diff --git a/bin/build-all-packages b/bin/build-all-packages
new file mode 100755
index 0000000..3757c4b
--- /dev/null
+++ b/bin/build-all-packages
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# Copyright (C) 2011 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+COMPONENT_MAIN="main"
+COMPONENT_NIGHTLY="nightly"
+
+LIB_PACKAGES_NIGHTLY=
+LIB_PACKAGES_MAIN=
+APP_PACKAGES_NIGHTLY=
+APP_PACKAGES_MAIN=
+
+PREFIX=$(echo $0 | cut -d"-" -f1)
+test -f ~/.buildscripts/$PREFIX.conf && . ~/.buildscripts/$PREFIX.conf || { echo "$0 has no valid context prefix..."; exit -1; }
+
+test -z $1 && { echo "usage: $(basename $0) [{$COMPONENT_MAIN,$COMPONENT_NIGHTLY}]"; exit -1; }
+
+COMPONENT=${1:-""}
+
+# build the newest code... (nightly-builds)
+[ "x$COMPONENT" = "x$COMPONENT_NIGHTLY" ] || [ -z $COMPONENT ] && {
+ echo -e $LIB_PACKAGES_NIGHTLY $APP_PACKAGES_NIGHTLY | while read pkg comp checkout; do
+ if [ "x$(basename $0)" = "x$PREFIX-build-all-packages" ]; then
+ $PREFIX-build-package $pkg $comp $checkout
+ elif [ "x$(basename $0)" = "x$PREFIX-upload-all-packages" ]; then
+ $PREFIX-upload-package $pkg $comp $checkout
+ elif [ "x$(basename $0)" = "x$PREFIX-build+upload-all-packages" ]; then
+ $PREFIX-build-package $pkg $comp $checkout && $PREFIX-upload-package $pkg $comp $checkout
+ fi
+ done
+}
+
+# build all packages tagged as build-main
+[ "x$COMPONENT" = "x$COMPONENT_MAIN" ] || [ -z $COMPONENT ] && {
+ echo -e $LIB_PACKAGES_MAIN $APP_PACKAGES_MAIN | while read pkg comp checkout; do
+ if [ "x$(basename $0)" = "x$PREFIX-build-all-packages" ]; then
+ $PREFIX-build-package $pkg $comp $checkout
+ elif [ "x$(basename $0)" = "x$PREFIX-upload-all-packages" ]; then
+ $PREFIX-upload-package $pkg $comp $checkout
+ elif [ "x$(basename $0)" = "x$PREFIX-build+upload-all-packages" ]; then
+ $PREFIX-build-package $pkg $comp $checkout && $PREFIX-upload-package $pkg $comp $checkout
+ fi
+ done
+}