summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/x2go-buildpackage20
-rwxr-xr-xbin/x2go-packageupload81
2 files changed, 82 insertions, 19 deletions
diff --git a/bin/x2go-buildpackage b/bin/x2go-buildpackage
index abe5d7a..613cce2 100755
--- a/bin/x2go-buildpackage
+++ b/bin/x2go-buildpackage
@@ -162,30 +162,12 @@ build_packages() {
return 0
}
-upload_packages() {
- # dupload the new packages to the reprepro repository
- cd $PKGDIST
- cat $PROJECT_DIR/BUILDS_FOR | egrep -v '(^$|^#.*$)' | while read line; do
- l_DIST=$(echo $line | cut -d":" -f1 | tr [A-Z] [a-z])
- CODENAMES=${CODENAMES:-$(echo $line | cut -d":" -f2- | tr [A-Z] [a#-z])}
- for l_CODENAME in $CODENAMES; do
- for l_ARCH in amd64 i386; do
- cd $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH
- ls $PROJECT_*.changes &>/dev/null && dupload --to x2go-$l_DIST-$l_CODENAME $PROJECT_*.changes
- cd -
- done
- done
- done
- cd -
- return 0
-}
-
### MAIN ###
set_vars $@ && {
cd $PROJECT_DIR && x2go-pkgneedsbuild $CHECKOUT && {
clear_pkgdist
prepare_workspace && {
- build_packages && upload_packages
+ build_packages
}
}
}
diff --git a/bin/x2go-packageupload b/bin/x2go-packageupload
new file mode 100755
index 0000000..fc6b1ca
--- /dev/null
+++ b/bin/x2go-packageupload
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+# Copyright (C) 2011 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+#
+# This programme 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 programme 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.
+
+test -z $1 && { echo "usage: <x2go-git-project> {main,main/<codename>,heuler,heuler/<codename>} [<git-checkout>]"; exit -1; }
+
+set -ex
+
+set_vars() {
+ USE_SUDO="yes"
+ PDEBUILD="pdebuild --pbuilder qemubuilder"
+ TEMP_BASE="$HOME/tmp/"
+
+ # first argv is the name of the Git project
+ PROJECT=$1
+
+ # grab repository component area from command line (2nd argv) or guess it
+ ARGV2_COMPONENT=$(echo $2 | cut -d"/" -f1)
+ ARGV2_CODENAME=$(echo $2 | cut -d"/" -f2)
+ COMPONENT=${ARGV2_COMPONENT:-${COMPONENT:-heuler}}
+ CODENAMES=${ARGV2_CODENAME:-${CODENAME_ONLY:-sid}}
+ if [ "x$COMPONENT" = "xmain" ]; then
+ CHECKOUT=${3:-build-main}
+ elif [ "x$COMPONENT" = "xheuler" ]; then
+ CHECKOUT=${3:-master}
+ DATE="~${DATE:-$(date +%Y%m%d)}"
+ else
+ echo "error: no such package component area for X2go packages. Aborting..."
+ exit -1
+ fi
+ # the DATE might be given as ,,today'' from the command line
+ [ "x$DATE" = "xtoday" ] && DATE="~$(date +%Y%m%d)"
+
+ # setting paths
+ PROJECT_DIR=$HOME/build/$COMPONENT/$PROJECT
+ DIST_SUPPORTED="debian ubuntu"
+ PKGDIST="$HOME/pkg-dist/$COMPONENT/$PROJECT"
+
+ # creating paths
+ mkdir -p "$TEMP_BASE"
+ mkdir -p $PROJECT_DIR
+ mkdir -p $PKGDIST
+
+ return 0
+}
+
+upload_packages() {
+ # dupload the new packages to the reprepro repository
+ cd $PKGDIST
+ cat $PROJECT_DIR/BUILDS_FOR | egrep -v '(^$|^#.*$)' | while read line; do
+ l_DIST=$(echo $line | cut -d":" -f1 | tr [A-Z] [a-z])
+ CODENAMES=${CODENAMES:-$(echo $line | cut -d":" -f2- | tr [A-Z] [a#-z])}
+ for l_CODENAME in $CODENAMES; do
+ for l_ARCH in amd64 i386; do
+ cd $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH
+ ls $PROJECT_*.changes &>/dev/null && dupload --to x2go-$l_DIST-$l_CODENAME $PROJECT_*.changes
+ cd -
+ done
+ done
+ done
+ cd -
+ return 0
+}
+
+### MAIN ###
+set_vars $@ && upload_packages