summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/x2go-buildpackage32
-rwxr-xr-xbin/x2go-packageupload81
l---------bin/x2go-uploadpackage1
3 files changed, 28 insertions, 86 deletions
diff --git a/bin/x2go-buildpackage b/bin/x2go-buildpackage
index 613cce2..23cf0e8 100755
--- a/bin/x2go-buildpackage
+++ b/bin/x2go-buildpackage
@@ -162,12 +162,34 @@ 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
+ if ["x$(basename $0)" = "xx2go-buildpackage" ]; then
+ cd $PROJECT_DIR && x2go-pkgneedsbuild $CHECKOUT && {
+ clear_pkgdist
+ prepare_workspace && {
+ build_packages
+ }
}
- }
+ elif ["x$(basename $0)" = "xx2go-uploadpackage" ]; then
+ upload_packages
+ fi
}
diff --git a/bin/x2go-packageupload b/bin/x2go-packageupload
deleted file mode 100755
index fc6b1ca..0000000
--- a/bin/x2go-packageupload
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/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
diff --git a/bin/x2go-uploadpackage b/bin/x2go-uploadpackage
new file mode 120000
index 0000000..18eb486
--- /dev/null
+++ b/bin/x2go-uploadpackage
@@ -0,0 +1 @@
+x2go-buildpackage \ No newline at end of file