From 64531446af6ffc51a4c5d13aa4047fad02ad090f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 2 Dec 2011 15:39:29 +0100 Subject: Start from scratch, used X2Go's buildscripts as templates... --- bin/itzks-build+upload-all-packages | 1 + bin/itzks-build+upload-package | 1 + bin/itzks-build-all-packages | 60 +++++++++ bin/itzks-build-package | 238 ++++++++++++++++++++++++++++++++++++ bin/itzks-gitcreate | 15 +++ bin/itzks-gitrevno | 28 +++++ bin/itzks-pkgneedsbuild | 47 +++++++ bin/itzks-tarballrelease | 43 +++++++ bin/itzks-updatebuildmain | 34 ++++++ bin/itzks-upload-all-packages | 1 + bin/itzks-upload-package | 1 + 11 files changed, 469 insertions(+) create mode 120000 bin/itzks-build+upload-all-packages create mode 120000 bin/itzks-build+upload-package create mode 100755 bin/itzks-build-all-packages create mode 100755 bin/itzks-build-package create mode 100755 bin/itzks-gitcreate create mode 100755 bin/itzks-gitrevno create mode 100755 bin/itzks-pkgneedsbuild create mode 100755 bin/itzks-tarballrelease create mode 100755 bin/itzks-updatebuildmain create mode 120000 bin/itzks-upload-all-packages create mode 120000 bin/itzks-upload-package (limited to 'bin') diff --git a/bin/itzks-build+upload-all-packages b/bin/itzks-build+upload-all-packages new file mode 120000 index 0000000..32133c5 --- /dev/null +++ b/bin/itzks-build+upload-all-packages @@ -0,0 +1 @@ +itzks-build-all-packages \ No newline at end of file diff --git a/bin/itzks-build+upload-package b/bin/itzks-build+upload-package new file mode 120000 index 0000000..64ea9b4 --- /dev/null +++ b/bin/itzks-build+upload-package @@ -0,0 +1 @@ +itzks-build-package \ No newline at end of file diff --git a/bin/itzks-build-all-packages b/bin/itzks-build-all-packages new file mode 100755 index 0000000..6342dce --- /dev/null +++ b/bin/itzks-build-all-packages @@ -0,0 +1,60 @@ +#!/bin/bash + +# Copyright (C) 2011 by Mike Gabriel +# +# 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. + +LIB_PACKAGES_NIGHTLY="\ +itzks-keyring nightly master\n +" +LIB_PACKAGES_MAIN="\ +itzks-keyring main build-main\n +" + +APP_PACKAGES_HEULER="\ +scratch nightly master\n +" +APP_PACKAGES_MAIN="\ +scratch main build-main\n +" + +COMPONENT=${1:-""} + +# build the newest code... (nightly-builds) +[ "x$COMPONENT" = "xnightly" ] || [ -z $COMPONENT ] && { + echo -e $LIB_PACKAGES_HEULER $APP_PACKAGES_HEULER | while read pkg comp checkout; do + if [ "x$(basename $0)" = "xitzks-build-all-packages" ]; then + itzks-build-package $pkg $comp $checkout + elif [ "x$(basename $0)" = "xitzks-upload-all-packages" ]; then + itzks-upload-package $pkg $comp $checkout + elif [ "x$(basename $0)" = "xitzks-build+upload-all-packages" ]; then + itzks-build-package $pkg $comp $checkout && itzks-upload-package $pkg $comp $checkout + fi + done +} + +# build all packages tagged as build-main +[ "x$COMPONENT" = "xmain" ] || [ -z $COMPONENT ] && { + echo -e $LIB_PACKAGES_MAIN $APP_PACKAGES_MAIN | while read pkg comp checkout; do + if [ "x$(basename $0)" = "xitzks-build-all-packages" ]; then + itzks-build-package $pkg $comp $checkout + elif [ "x$(basename $0)" = "xitzks-upload-all-packages" ]; then + itzks-upload-package $pkg $comp $checkout + elif [ "x$(basename $0)" = "xitzks-build+upload-all-packages" ]; then + itzks-build-package $pkg $comp $checkout && itzks-upload-package $pkg $comp $checkout + fi + done +} diff --git a/bin/itzks-build-package b/bin/itzks-build-package new file mode 100755 index 0000000..de429b3 --- /dev/null +++ b/bin/itzks-build-package @@ -0,0 +1,238 @@ +#!/bin/bash + +# Copyright (C) 2011 by Mike Gabriel +# +# 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: {main,main/,heuler,heuler/} []"; 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:-${CODENAMES}} + [ -n "$ARGV2_CODENAME" ] && FORCE_BUILD=0 || FORCE_BUILD=-1 + if [ "x$COMPONENT" = "xmain" ]; then + CHECKOUT=${3:-build-main} + elif [ "x$COMPONENT" = "xnightly" ]; then + CHECKOUT=${3:-master} + DATE="~${DATE:-$(date +%Y%m%d)}" + else + echo "error: no such package component area for ITZKS 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" + + # build for other architectures than amd64/i386 + EXTRA_ARCHS="${EXTRA_ARCHS:-}" + EXTRA_ARCHS_ONLY="${EXTRA_ARCHS_ONLY:-}" + + # creating paths + mkdir -p "$TEMP_BASE" + mkdir -p $PROJECT_DIR + mkdir -p $PKGDIST + + return 0 +} + +clear_pkgdist() { + + # pkgdist directory cleanup + cat 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])} + echo "$DIST_SUPPORTED" | grep $l_DIST >/dev/null && { + for l_CODENAME in $CODENAMES; do + if [ "x$EXTRA_ARCHS_ONLY" = "x" ]; then + for l_ARCH in amd64 i386; do + mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.changes + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.upload + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.build + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.dsc + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.tar.gz + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/*.deb + done + fi + for l_EXTRA_ARCH in $EXTRA_ARCHS; do + mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.changes + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.upload + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.build + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.dsc + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.tar.gz + rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/*.deb + done + done + } + done + return 0 +} + +prepare_workspace() { + # in any case remove the BUILDS_FOR file + rm -f $PROJECT_DIR/BUILDS_FOR + + # make sure our local working copy is up to date... + + if [ -d $PROJECT_DIR/.git ]; then + cd $PROJECT_DIR && git reset --hard + git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT + git pull origin $CHECKOUT + # and again, get the $CHECKOUT refspec in pure state + git reset --hard + else + cd $(dirname $PROJECT_DIR) + git clone git://code.das-netzwerkteam.de/itzks/$PROJECT.git + cd $PROJECT + git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT; + fi + cd $PROJECT_DIR + + # by default we build for all current debian versions + test -f BUILDS_FOR || cat > BUILDS_FOR </dev/null && { + for l_CODENAME in $CODENAMES; do + TEMP_DIR="$(mktemp -d --tmpdir=$TEMP_BASE)" + mkdir -p $TEMP_DIR/$PROJECT + git clone --local $PROJECT_DIR $TEMP_DIR/$PROJECT/ + cd $TEMP_DIR/$PROJECT + git checkout $CHECKOUT || git checkout master + GITREV=$(itzks-gitrevno) + # translate the version name for Debian releases + [ "x$l_CODENAME" = "xsid" ] && VERSION=unstable + [ "x$l_CODENAME" = "xwheezy" ] && VERSION=testing + [ "x$l_CODENAME" = "xsqueeze" ] && VERSION=stable + [ "x$l_CODENAME" = "xlenny" ] && VERSION=oldstable + + # modify the section for non-main package builds + [ "x$COMPONENT" = "xmain" ] || { + mv debian/control debian/control.tmp + cat debian/control.tmp | sed "s#Section:[\ ]*\(.*\)#Section: $COMPONENT/\1#g" > debian/control + } + + # modify changelog for this build + DEBEMAIL=git-admin@das-netzwerkteam.de DEBFULLNAME="NWT Git Administrator" dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for packages.it-zukunft-schule.de repository." + mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/{amd64,i386} + OTHERMIRROR="deb http://packages.it-zukunft-schule.de/debian $l_CODENAME $COMPONENT" + [ "x$USE_SUDO" != "xyes" ] && { + [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { + cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 + } + cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch + } + } + for extra_arch in $EXTRA_ARCHS; do + mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch + cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch + } + done + } + [ "x$USE_SUDO" = "xyes" ] && { + [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { + cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 + } + cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch + } + } + for extra_arch in $EXTRA_ARCHS; do + mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch + cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch + } + done + } + cd - + rm -Rf $TEMP_DIR + done + echo + } + echo + done + 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 + if [ "x$EXTRA_ARCHS_ONLY" = "x" ]; then + for l_ARCH in amd64 i386; do + cd $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH + ls $PROJECT_*.changes &>/dev/null && dupload --to itzks-$l_DIST-$l_CODENAME $PROJECT_*.changes + cd - + done + fi + for l_EXTRA_ARCH in $EXTRA_ARCHS; do + cd $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH + ls $PROJECT_*.changes &>/dev/null && dupload --to itzks-$l_DIST-$l_CODENAME $PROJECT_*.changes + cd - + done + done + done + cd - + return 0 +} + +### MAIN ### +set_vars $@ && { + if [ "x$(basename $0)" = "xitzks-build-package" ] || [ "x$(basename $0)" = "xitzks-build+upload-package" ]; then + cd $PROJECT_DIR && itzks-pkgneedsbuild $CHECKOUT || [ "$FORCE_BUILD" -eq 0 ] && { + clear_pkgdist + prepare_workspace && { + build_packages + } + } + fi + if [ "x$(basename $0)" = "xitzks-upload-package" ] || [ "x$(basename $0)" = "xitzks-build+upload-package" ]; then + upload_packages + fi +} diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate new file mode 100755 index 0000000..e64424d --- /dev/null +++ b/bin/itzks-gitcreate @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +for pkg in "$@"; do + ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./setup-repository $pkg '$pkg upstream project'" + ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./update-repository-posixacls $pkg" + cd "$pkg" + echo "$pkg: MASTER BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg master + git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg upstream + git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg pristine-tar + echo "$pkg: PUSHING TAGS" && git push --tags ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg + ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && mv $pkg.git itzks" + cd .. +done diff --git a/bin/itzks-gitrevno b/bin/itzks-gitrevno new file mode 100755 index 0000000..2f121ff --- /dev/null +++ b/bin/itzks-gitrevno @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# Copyright (C) 2010-2011 by Mike Gabriel +# +# 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 + +import subprocess +_proc = subprocess.Popen('git log --no-color --date=iso', + shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +try: + GIT_REVISION_DATE = str(len([ x for x in _proc.communicate()[0].splitlines() if x.startswith('Date:')])) +except IndexError: + GIT_REVISION_DATE = 'unknown' + +print GIT_REVISION_DATE diff --git a/bin/itzks-pkgneedsbuild b/bin/itzks-pkgneedsbuild new file mode 100755 index 0000000..2a192eb --- /dev/null +++ b/bin/itzks-pkgneedsbuild @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright (C) 2010-2011 by Mike Gabriel +# +# 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 + +set -xe + +CHECKOUT=${1:-master} + +[ -d .git ] && { + + TIMESTAMP=$(date +%s) + CURRENT_BRANCH=$(git branch | grep "*" | awk '{print $2}') + + # switch to branch given as $CHECKOUT, if it does not exist locally, create it... + git checkout $CHECKOUT &>/dev/null || git checkout -b $CHECKOUT >/dev/null + + # switch to a tmp branch... + git checkout -b tmp-$TIMESTAMP &>/dev/null + + # pull $CHECKOUT from origin into the tmp branch + LANG=en_US.UTF-8 git pull origin $CHECKOUT 2>/dev/null | egrep "^Already up-to-date.$" &>/dev/null && { + # drop the tmp branch + git checkout $CURRENT_BRANCH &>/dev/null + git branch -D tmp-$TIMESTAMP >/dev/null + exit 1 + } || { + # drop the tmp branch + git checkout $CURRENT_BRANCH &>/dev/null + git branch -D tmp-$TIMESTAMP >/dev/null + exit 0 + } +} || exit 0 diff --git a/bin/itzks-tarballrelease b/bin/itzks-tarballrelease new file mode 100755 index 0000000..1b58077 --- /dev/null +++ b/bin/itzks-tarballrelease @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2011 by Mike Gabriel +# +# This is free software; you can redistribute it and/or modify +# it under the tBerms 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. + +# Thanks to Jonas Smedegaard for inspiration... + +set -e + +RELEASE="$1" +test -n "$RELEASE" || { echo "usage: $(basename "$0") []"; exit 1; } + +CHECKOUT="${2:-master}" + +PROJECT="$(basename $PWD)" +TARGETDIR=".." + +MANIFEST="$(mktemp)" +TEMP_DIR="$(mktemp -d)" + +echo $MANIFEST + +trap "rm -f \"${MANIFEST}\"; rm -rf \"${TEMP_DIR}\"" 0 +git clone . "$TEMP_DIR/${PROJECT}_$RELEASE" +( set -e; cd "$TEMP_DIR/${PROJECT}_$RELEASE/" && git checkout ${CHECKOUT} 2>/dev/null || true ) +( set -e; cd "$TEMP_DIR" && rm -Rf "${PROJECT}_$RELEASE/.git"* ) +( set -e; cd "$TEMP_DIR" && find "${PROJECT}_$RELEASE" -type f | sed 's/^\.*\/*//' | sort > "$MANIFEST" ) +mkdir -p "$TARGETDIR/_releases_/source/${PROJECT}/" +tar c -C "$TEMP_DIR" --owner 0 --group 0 --numeric-owner --no-recursion --files-from "$MANIFEST" | gzip -n > "$TARGETDIR/_releases_/source/${PROJECT}/${PROJECT}_$RELEASE.tar.gz" diff --git a/bin/itzks-updatebuildmain b/bin/itzks-updatebuildmain new file mode 100755 index 0000000..f4f4917 --- /dev/null +++ b/bin/itzks-updatebuildmain @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright (C) 2010-2011 by Mike Gabriel +# +# 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 + +set -e + +GITPROJECT=$(basename $(pwd)) +REF=$1 + +# we need to be within a working copy (base folder) and we need a !!! +test -z $1 || test -d ./.git || { + echo "usage: $(basename $0) " + echo "Call this command from within the base folder of a Git project's working copy..." + exit -1 +} + +# update the build-main branch with our newest blessed reference +git branch build-main &>/dev/null || true +git push origin $REF:build-main diff --git a/bin/itzks-upload-all-packages b/bin/itzks-upload-all-packages new file mode 120000 index 0000000..32133c5 --- /dev/null +++ b/bin/itzks-upload-all-packages @@ -0,0 +1 @@ +itzks-build-all-packages \ No newline at end of file diff --git a/bin/itzks-upload-package b/bin/itzks-upload-package new file mode 120000 index 0000000..64ea9b4 --- /dev/null +++ b/bin/itzks-upload-package @@ -0,0 +1 @@ +itzks-build-package \ No newline at end of file -- cgit v1.2.3 From 4eeee0c7208e75eddb497d281c4bfc96c6d6b109 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 2 Dec 2011 15:51:10 +0100 Subject: allow creation of Git subfolders --- bin/itzks-gitcreate | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index e64424d..f0f7f13 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -3,13 +3,14 @@ set -e for pkg in "$@"; do - ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./setup-repository $pkg '$pkg upstream project'" - ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./update-repository-posixacls $pkg" - cd "$pkg" - echo "$pkg: MASTER BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg master - git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg upstream - git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg pristine-tar - echo "$pkg: PUSHING TAGS" && git push --tags ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$pkg - ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && mv $pkg.git itzks" + subdir=$(dirname $pkg) + pkg=$(basename $pkg) + ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./setup-repository $subdir/$pkg '$pkg upstream project'" + ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./update-repository-posixacls $subdir/$pkg" + cd "$subdir/$pkg" + echo "$pkg: MASTER BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg master + git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg upstream + git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg pristine-tar + echo "$pkg: PUSHING TAGS" && git push --tags ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg cd .. done -- cgit v1.2.3 From df01b658ff2e688a67b799df16f0a8680be874f7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 2 Dec 2011 15:53:20 +0100 Subject: fix cd statement --- bin/itzks-gitcreate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index f0f7f13..8232ae2 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -7,7 +7,7 @@ for pkg in "$@"; do pkg=$(basename $pkg) ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./setup-repository $subdir/$pkg '$pkg upstream project'" ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./update-repository-posixacls $subdir/$pkg" - cd "$subdir/$pkg" + test -d "$pkg" && cd "$pkg" echo "$pkg: MASTER BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg master git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg upstream git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg pristine-tar -- cgit v1.2.3 From 236a356924c2c6822051e6b92f9da379aad8f54b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 2 Dec 2011 16:03:14 +0100 Subject: fully rename heuler (x2go name for nightly builds) to nightly... --- bin/itzks-build-all-packages | 4 ++-- bin/itzks-build-package | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/itzks-build-all-packages b/bin/itzks-build-all-packages index 6342dce..4f93675 100755 --- a/bin/itzks-build-all-packages +++ b/bin/itzks-build-all-packages @@ -24,7 +24,7 @@ LIB_PACKAGES_MAIN="\ itzks-keyring main build-main\n " -APP_PACKAGES_HEULER="\ +APP_PACKAGES_NIGHTLY="\ scratch nightly master\n " APP_PACKAGES_MAIN="\ @@ -35,7 +35,7 @@ COMPONENT=${1:-""} # build the newest code... (nightly-builds) [ "x$COMPONENT" = "xnightly" ] || [ -z $COMPONENT ] && { - echo -e $LIB_PACKAGES_HEULER $APP_PACKAGES_HEULER | while read pkg comp checkout; do + echo -e $LIB_PACKAGES_NIGHTLY $APP_PACKAGES_NIGHTLY | while read pkg comp checkout; do if [ "x$(basename $0)" = "xitzks-build-all-packages" ]; then itzks-build-package $pkg $comp $checkout elif [ "x$(basename $0)" = "xitzks-upload-all-packages" ]; then diff --git a/bin/itzks-build-package b/bin/itzks-build-package index de429b3..72d1b17 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -17,7 +17,7 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -test -z $1 && { echo "usage: {main,main/,heuler,heuler/} []"; exit -1; } +test -z $1 && { echo "usage: {main,main/,nightly,nightly/} []"; exit -1; } set -ex @@ -32,7 +32,7 @@ set_vars() { # 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}} + COMPONENT=${ARGV2_COMPONENT:-${COMPONENT:-nightly}} CODENAMES=${ARGV2_CODENAME:-${CODENAMES}} [ -n "$ARGV2_CODENAME" ] && FORCE_BUILD=0 || FORCE_BUILD=-1 if [ "x$COMPONENT" = "xmain" ]; then -- cgit v1.2.3 From 945ccf0ab2c2f77d7a3c32f53afd655fa4e68930 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 2 Dec 2011 16:41:30 +0100 Subject: fix email address used in ITZKS packages --- bin/itzks-build-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 72d1b17..9dae301 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -152,7 +152,7 @@ build_packages() { } # modify changelog for this build - DEBEMAIL=git-admin@das-netzwerkteam.de DEBFULLNAME="NWT Git Administrator" dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for packages.it-zukunft-schule.de repository." + DEBEMAIL=itzks-packages@it-zukunft-schule.de DEBFULLNAME="NWT Git Administrator" dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for packages.it-zukunft-schule.de repository." mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/{amd64,i386} OTHERMIRROR="deb http://packages.it-zukunft-schule.de/debian $l_CODENAME $COMPONENT" [ "x$USE_SUDO" != "xyes" ] && { -- cgit v1.2.3 From 74d41ec85f4e9213e5c6c6c00457d4cac547f1c3 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 2 Dec 2011 22:40:01 +0100 Subject: change upload site in itzks-gitcreate --- bin/itzks-gitcreate | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index 8232ae2..30a7b62 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -5,12 +5,12 @@ set -e for pkg in "$@"; do subdir=$(dirname $pkg) pkg=$(basename $pkg) - ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./setup-repository $subdir/$pkg '$pkg upstream project'" - ssh -lnwt code.das-netzwerkteam.de "cd /srv/git/code.das-netzwerkteam.de && ./update-repository-posixacls $subdir/$pkg" + ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository $subdir/$pkg '$pkg upstream project'" + ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls $subdir/$pkg" test -d "$pkg" && cd "$pkg" - echo "$pkg: MASTER BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg master - git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg upstream - git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg pristine-tar - echo "$pkg: PUSHING TAGS" && git push --tags ssh://nwt@code.das-netzwerkteam.de:32032/srv/git/code.das-netzwerkteam.de/$subdir/$pkg + echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032~/git/$subdir/$pkg master + git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032~/git/code.itzks.de/$subdir/$pkg upstream + git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032~/git/$subdir/$pkg pristine-tar + echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032~/git/$subdir/$pkg cd .. done -- cgit v1.2.3 From bbc82eba9905e1d831566f6e5df9d5dc82e33d7b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 3 Dec 2011 15:57:40 +0100 Subject: fix use of ~ for home path --- bin/itzks-gitcreate | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index 30a7b62..9b7b8f6 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -8,9 +8,9 @@ for pkg in "$@"; do ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository $subdir/$pkg '$pkg upstream project'" ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls $subdir/$pkg" test -d "$pkg" && cd "$pkg" - echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032~/git/$subdir/$pkg master - git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032~/git/code.itzks.de/$subdir/$pkg upstream - git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032~/git/$subdir/$pkg pristine-tar - echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032~/git/$subdir/$pkg + echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/$subdir/$pkg master + git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/code.itzks.de/$subdir/$pkg upstream + git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/$subdir/$pkg pristine-tar + echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032/~/git/$subdir/$pkg cd .. done -- cgit v1.2.3 From 13463bb908d9bf628bb12d1aa32090a13a9626c2 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 3 Dec 2011 16:12:12 +0100 Subject: make git server configurable at beginning of script --- bin/itzks-build-package | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 9dae301..35d8b49 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -21,6 +21,8 @@ test -z $1 && { echo "usage: {main,main/,nightly,n set -ex +GIT_SERVER="code.it-zukunft-schule.de" + set_vars() { USE_SUDO="yes" PDEBUILD="pdebuild --pbuilder qemubuilder" @@ -112,7 +114,7 @@ prepare_workspace() { git reset --hard else cd $(dirname $PROJECT_DIR) - git clone git://code.das-netzwerkteam.de/itzks/$PROJECT.git + git clone git://$GIT_SERVER/$PROJECT.git cd $PROJECT git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT; fi -- cgit v1.2.3 From 420f8469c75505326a09a265e9210bf088d1246f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 3 Dec 2011 16:44:52 +0100 Subject: place DEBEMAIL and DEBFULLNAME at beginning of script --- bin/itzks-build-package | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 35d8b49..418e748 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -21,7 +21,9 @@ test -z $1 && { echo "usage: {main,main/,nightly,n set -ex -GIT_SERVER="code.it-zukunft-schule.de" +export GIT_SERVER="code.it-zukunft-schule.de" +export DEBEMAIL=itzks-packages@it-zukunft-schule.de +export DEBFULLNAME="ITZKS Packages" set_vars() { USE_SUDO="yes" @@ -154,7 +156,7 @@ build_packages() { } # modify changelog for this build - DEBEMAIL=itzks-packages@it-zukunft-schule.de DEBFULLNAME="NWT Git Administrator" dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for packages.it-zukunft-schule.de repository." + dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for packages.it-zukunft-schule.de repository." mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/{amd64,i386} OTHERMIRROR="deb http://packages.it-zukunft-schule.de/debian $l_CODENAME $COMPONENT" [ "x$USE_SUDO" != "xyes" ] && { -- cgit v1.2.3 From f226c40f955ed30174757fcbd2947e47ac6fa477 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 3 Dec 2011 17:09:27 +0100 Subject: make GPG_KEY configurable at beginning of script --- bin/itzks-build-package | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 418e748..c961525 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -24,6 +24,7 @@ set -ex export GIT_SERVER="code.it-zukunft-schule.de" export DEBEMAIL=itzks-packages@it-zukunft-schule.de export DEBFULLNAME="ITZKS Packages" +export GPG_KEY="E41B37C658842183" set_vars() { USE_SUDO="yes" @@ -162,32 +163,32 @@ build_packages() { [ "x$USE_SUDO" != "xyes" ] && { [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 } cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch } } for extra_arch in $EXTRA_ARCHS; do mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch } done } [ "x$USE_SUDO" = "xyes" ] && { [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { - sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 } cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { - sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch } } for extra_arch in $EXTRA_ARCHS; do mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { - sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k F4A7678C9C6B0B2B --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch } done } -- cgit v1.2.3 From 023fe9dd7598ccbea1160f8a782c1d89d4357060 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 7 Dec 2011 18:01:59 +0100 Subject: last package does not need a \newline... --- bin/itzks-build-all-packages | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/itzks-build-all-packages b/bin/itzks-build-all-packages index 4f93675..ffd3ab8 100755 --- a/bin/itzks-build-all-packages +++ b/bin/itzks-build-all-packages @@ -18,17 +18,17 @@ # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. LIB_PACKAGES_NIGHTLY="\ -itzks-keyring nightly master\n +itzks-keyring nightly master " LIB_PACKAGES_MAIN="\ -itzks-keyring main build-main\n +itzks-keyring main build-main " APP_PACKAGES_NIGHTLY="\ -scratch nightly master\n +scratch nightly master " APP_PACKAGES_MAIN="\ -scratch main build-main\n +scratch main build-main " COMPONENT=${1:-""} -- cgit v1.2.3 From 57db6070f0cd8e35811ba77edab3a9469e1ed34d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 11 Dec 2011 22:12:51 +0100 Subject: remove comments --- bin/itzks-gitcreate | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index 9b7b8f6..db2e111 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -3,14 +3,14 @@ set -e for pkg in "$@"; do - subdir=$(dirname $pkg) + subdir=$(dirname $pkg)/ pkg=$(basename $pkg) ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository $subdir/$pkg '$pkg upstream project'" ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls $subdir/$pkg" test -d "$pkg" && cd "$pkg" - echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/$subdir/$pkg master - git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/code.itzks.de/$subdir/$pkg upstream - git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/$subdir/$pkg pristine-tar - echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032/~/git/$subdir/$pkg + echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git master + git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git upstream + git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git pristine-tar + echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git cd .. done -- cgit v1.2.3 From 942be141462ffdb03833ee6ee733ebe18afd8d4d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 11 Dec 2011 23:10:35 +0100 Subject: fix for itzks-gitcreate --- bin/itzks-gitcreate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index db2e111..a5412bd 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -5,8 +5,8 @@ set -e for pkg in "$@"; do subdir=$(dirname $pkg)/ pkg=$(basename $pkg) - ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository $subdir/$pkg '$pkg upstream project'" - ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls $subdir/$pkg" + ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository ${subdir}${pkg} '$pkg upstream project'" + ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls ${subdir}${pkg}" test -d "$pkg" && cd "$pkg" echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git master git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git upstream -- cgit v1.2.3 From fbcdf7b29c1b17adbc3339601c14ca1307b22bcf Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 11 Dec 2011 23:30:42 +0100 Subject: another path fix for itzks-gitcreate --- bin/itzks-gitcreate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index a5412bd..3ee9dcd 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -7,7 +7,7 @@ for pkg in "$@"; do pkg=$(basename $pkg) ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository ${subdir}${pkg} '$pkg upstream project'" ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls ${subdir}${pkg}" - test -d "$pkg" && cd "$pkg" + test -d "${subdir}${pkg}" && cd "${subdir}${pkg}" echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git master git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git upstream git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git pristine-tar -- cgit v1.2.3 From 8ce52aaa4b341522ed6248664f831fb9cdcc9e80 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 13:11:05 +0100 Subject: add support for source format 3.0 (quilt) --- bin/itzks-build-package | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index c961525..5f5955b 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -123,6 +123,11 @@ prepare_workspace() { fi cd $PROJECT_DIR + test -f debian/source/format && cat debian/source/format | egrep "^3.0.*\(quilt\)" && { + UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` + ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" + git checkout --force pristine-tar && pristine-tar checkout ../${ORIG_TARBALL} + # by default we build for all current debian versions test -f BUILDS_FOR || cat > BUILDS_FOR < Date: Tue, 20 Dec 2011 13:12:47 +0100 Subject: code block fix --- bin/itzks-build-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 5f5955b..57a2b35 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -127,7 +127,7 @@ prepare_workspace() { UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" git checkout --force pristine-tar && pristine-tar checkout ../${ORIG_TARBALL} - + } # by default we build for all current debian versions test -f BUILDS_FOR || cat > BUILDS_FOR < Date: Tue, 20 Dec 2011 13:17:19 +0100 Subject: regexp modification --- bin/itzks-build-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 57a2b35..918f434 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -123,7 +123,7 @@ prepare_workspace() { fi cd $PROJECT_DIR - test -f debian/source/format && cat debian/source/format | egrep "^3.0.*\(quilt\)" && { + test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" git checkout --force pristine-tar && pristine-tar checkout ../${ORIG_TARBALL} -- cgit v1.2.3 From e113941490954ff935f24d2425d40769265b6a41 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 13:25:05 +0100 Subject: add .dfsgX versioning support --- bin/itzks-build-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 918f434..6f8cbee 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -124,7 +124,7 @@ prepare_workspace() { cd $PROJECT_DIR test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { - UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` + UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | sed 's,\(\.dfsg.*\),,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" git checkout --force pristine-tar && pristine-tar checkout ../${ORIG_TARBALL} } -- cgit v1.2.3 From 59de53e0cb82183f8f0df18cc47a3d64bb9846de Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 13:27:49 +0100 Subject: no checkout of pristine-tar branch before calling pristine-tar --- bin/itzks-build-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 6f8cbee..b0a339e 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -126,7 +126,7 @@ prepare_workspace() { test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | sed 's,\(\.dfsg.*\),,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" - git checkout --force pristine-tar && pristine-tar checkout ../${ORIG_TARBALL} + pristine-tar checkout ../${ORIG_TARBALL} } # by default we build for all current debian versions test -f BUILDS_FOR || cat > BUILDS_FOR < Date: Tue, 20 Dec 2011 13:35:55 +0100 Subject: checkout the orig tarball from the tmp git project, not from the maser copy --- bin/itzks-build-package | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index b0a339e..8ba6afb 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -121,12 +121,12 @@ prepare_workspace() { cd $PROJECT git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT; fi + cd $PROJECT_DIR test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | sed 's,\(\.dfsg.*\),,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" - pristine-tar checkout ../${ORIG_TARBALL} } # by default we build for all current debian versions test -f BUILDS_FOR || cat > BUILDS_FOR < Date: Tue, 20 Dec 2011 13:36:46 +0100 Subject: syntax fix --- bin/itzks-build-package | 1 - 1 file changed, 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 8ba6afb..1b64a53 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -150,7 +150,6 @@ build_packages() { git checkout $CHECKOUT || git checkout master GITREV=$(itzks-gitrevno) test -n ${ORIG_TARBALL} && pristine-tar checkout ../${ORIG_TARBALL} - } # translate the version name for Debian releases [ "x$l_CODENAME" = "xsid" ] && VERSION=unstable [ "x$l_CODENAME" = "xwheezy" ] && VERSION=testing -- cgit v1.2.3 From 519e9fb1f30d73e9487fc848d0465c841b1910d3 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 14:05:42 +0100 Subject: fix fetching of pristine-tar branch --- bin/itzks-build-package | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 1b64a53..4d6c0b0 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -127,6 +127,7 @@ prepare_workspace() { test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | sed 's,\(\.dfsg.*\),,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" + git fetch origin pristine-tar:pristine-tar } # by default we build for all current debian versions test -f BUILDS_FOR || cat > BUILDS_FOR < Date: Tue, 20 Dec 2011 14:15:46 +0100 Subject: more dfsg support fixes --- bin/itzks-build-package | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index 4d6c0b0..d91979d 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -125,6 +125,8 @@ prepare_workspace() { cd $PROJECT_DIR test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { + UPSTREAM_DFSG_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` + ORIG_DFSG_TARBALL="${PROJECT}_${UPSTREAM_DFSG_VERSION}.orig.tar.gz" UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | sed 's,\(\.dfsg.*\),,' | cut -d"-" -f1` ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" git fetch origin pristine-tar:pristine-tar @@ -150,7 +152,11 @@ build_packages() { cd $TEMP_DIR/$PROJECT git checkout $CHECKOUT || git checkout master GITREV=$(itzks-gitrevno) - test -n ${ORIG_TARBALL} && git fetch origin pristine-tar:pristine-tar && pristine-tar checkout ../${ORIG_TARBALL} + test -n ${ORIG_TARBALL} && { + git fetch origin pristine-tar:pristine-tar + pristine-tar checkout ../${ORIG_TARBALL} + [ "x$ORIG_TARBALL" != "x$ORIG_DFSG_TARBALL" ] && mv ../${ORIG_TARBALL} ../${ORIG_DFSG_TARBALL} + } # translate the version name for Debian releases [ "x$l_CODENAME" = "xsid" ] && VERSION=unstable [ "x$l_CODENAME" = "xwheezy" ] && VERSION=testing -- cgit v1.2.3 From d48b4bf31570862f67fff26b11ce05e6e9d1e255 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 15:26:35 +0100 Subject: revert source format 3.0 (quilt) support, does not apply to our repos --- bin/itzks-build-package | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index d91979d..e010d6a 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -124,13 +124,6 @@ prepare_workspace() { cd $PROJECT_DIR - test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { - UPSTREAM_DFSG_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` - ORIG_DFSG_TARBALL="${PROJECT}_${UPSTREAM_DFSG_VERSION}.orig.tar.gz" - UPSTREAM_VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | sed 's,\(\.dfsg.*\),,' | cut -d"-" -f1` - ORIG_TARBALL="${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" - git fetch origin pristine-tar:pristine-tar - } # by default we build for all current debian versions test -f BUILDS_FOR || cat > BUILDS_FOR </dev/null && { + echo "3.0 (native)" > debian/source/format } # translate the version name for Debian releases [ "x$l_CODENAME" = "xsid" ] && VERSION=unstable -- cgit v1.2.3 From ff305c9ba013a854730ae32f756b2946e5cd8753 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 15:34:48 +0100 Subject: permission fix for temp dirs --- bin/itzks-build-package | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index e010d6a..ba1d584 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -30,6 +30,8 @@ set_vars() { USE_SUDO="yes" PDEBUILD="pdebuild --pbuilder qemubuilder" TEMP_BASE="$HOME/tmp/" + mkdir "$TEMP_BASE" + chmod 2770 "$TEMP_BASE" # first argv is the name of the Git project PROJECT=$1 @@ -141,6 +143,7 @@ build_packages() { for l_CODENAME in $CODENAMES; do TEMP_DIR="$(mktemp -d --tmpdir=$TEMP_BASE)" mkdir -p $TEMP_DIR/$PROJECT + chmod 2770 $TEMP_DIR -Rf git clone --local $PROJECT_DIR $TEMP_DIR/$PROJECT/ cd $TEMP_DIR/$PROJECT git checkout $CHECKOUT || git checkout master -- cgit v1.2.3 From 55e112925fb4b395105da9dca9bb69e417f36012 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 15:57:10 +0100 Subject: add new origin at end of itzks-gitcreate --- bin/itzks-gitcreate | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate index 3ee9dcd..4d4f93e 100755 --- a/bin/itzks-gitcreate +++ b/bin/itzks-gitcreate @@ -12,5 +12,6 @@ for pkg in "$@"; do git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git upstream git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git pristine-tar echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git + git remote add origin ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git cd .. done -- cgit v1.2.3 From 254c45c7421caaf8987dc5af0c560f3cb24a0bec Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Dec 2011 16:58:00 +0100 Subject: fix BUILDS_FOR mechanism --- bin/itzks-build-package | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/itzks-build-package b/bin/itzks-build-package index ba1d584..2bbb3a1 100755 --- a/bin/itzks-build-package +++ b/bin/itzks-build-package @@ -74,7 +74,7 @@ set_vars() { clear_pkgdist() { # pkgdist directory cleanup - cat BUILDS_FOR | egrep -v '(^$|^#.*$)' | while read line; do + 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])} echo "$DIST_SUPPORTED" | grep $l_DIST >/dev/null && { @@ -136,7 +136,7 @@ EOF build_packages() { # use pbuilder for building all variants of this package - cat BUILDS_FOR | egrep -v '(^$|^#.*$)' | while read line; do + 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])} echo "$DIST_SUPPORTED" | grep $l_DIST >/dev/null && { -- cgit v1.2.3 From eb97641594b08b0d29dcaa486824a73fc4b823bf Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Dec 2011 01:21:48 +0100 Subject: replaced buildscripts with those form NWT build site --- bin/build+upload-all-packages | 1 + bin/build+upload-package | 1 + bin/build-all-packages | 59 ++++++++ bin/build-package | 278 ++++++++++++++++++++++++++++++++++++ bin/gitcreate | 26 ++++ bin/gitrevno | 28 ++++ bin/itzks-build+upload-all-packages | 1 - bin/itzks-build+upload-package | 1 - bin/itzks-build-all-packages | 60 -------- bin/itzks-build-package | 251 -------------------------------- bin/itzks-gitcreate | 17 --- bin/itzks-gitrevno | 28 ---- bin/itzks-pkgneedsbuild | 47 ------ bin/itzks-tarballrelease | 43 ------ bin/itzks-updatebuildmain | 34 ----- bin/itzks-upload-all-packages | 1 - bin/itzks-upload-package | 1 - bin/pkgneedsbuild | 47 ++++++ bin/tarballrelease | 43 ++++++ bin/updatebuildmain | 34 +++++ bin/upload-all-packages | 1 + bin/upload-package | 1 + 22 files changed, 519 insertions(+), 484 deletions(-) create mode 120000 bin/build+upload-all-packages create mode 120000 bin/build+upload-package create mode 100755 bin/build-all-packages create mode 100755 bin/build-package create mode 100755 bin/gitcreate create mode 100755 bin/gitrevno delete mode 120000 bin/itzks-build+upload-all-packages delete mode 120000 bin/itzks-build+upload-package delete mode 100755 bin/itzks-build-all-packages delete mode 100755 bin/itzks-build-package delete mode 100755 bin/itzks-gitcreate delete mode 100755 bin/itzks-gitrevno delete mode 100755 bin/itzks-pkgneedsbuild delete mode 100755 bin/itzks-tarballrelease delete mode 100755 bin/itzks-updatebuildmain delete mode 120000 bin/itzks-upload-all-packages delete mode 120000 bin/itzks-upload-package create mode 100755 bin/pkgneedsbuild create mode 100755 bin/tarballrelease create mode 100755 bin/updatebuildmain create mode 120000 bin/upload-all-packages create mode 120000 bin/upload-package (limited to 'bin') diff --git a/bin/build+upload-all-packages b/bin/build+upload-all-packages new file mode 120000 index 0000000..b8c12b0 --- /dev/null +++ b/bin/build+upload-all-packages @@ -0,0 +1 @@ +build-all-packages \ No newline at end of file diff --git a/bin/build+upload-package b/bin/build+upload-package new file mode 120000 index 0000000..2b48fdc --- /dev/null +++ b/bin/build+upload-package @@ -0,0 +1 @@ +build-package \ No newline at end of file diff --git a/bin/build-all-packages b/bin/build-all-packages new file mode 100755 index 0000000..b493490 --- /dev/null +++ b/bin/build-all-packages @@ -0,0 +1,59 @@ +#!/bin/bash + +# Copyright (C) 2011 by Mike Gabriel +# +# 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 `basename $0` | cut -d"-" -f1) +test -f ~/.buildscripts/$PREFIX.conf && . ~/.buildscripts/$PREFIX.conf || { echo "$0 has no valid context prefix..."; exit -1; } + +set -ex + +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 +} diff --git a/bin/build-package b/bin/build-package new file mode 100755 index 0000000..8a1f94f --- /dev/null +++ b/bin/build-package @@ -0,0 +1,278 @@ +#!/bin/bash + +# Copyright (C) 2011 by Mike Gabriel +# +# 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. + +GIT_USER="gituser" +GIT_HOSTNAME="git.mydomain.org" + +DEBEMAIL="firstname.lastname@mydomain.org" +DEBFULLNAME="Firstname Lastname" +GPG_KEY= +DISTS_SUPPORTED="debian ubuntu" +BUILDS_FOR="\ +debian: squeeze wheezy sid\n\ +ubuntu: lucid precise\n\ +" + +COMPONENT_MAIN="main" +COMPONENT_NIGHTLY="nightly" +REPOS_SERVER="packages.mydomain.org" +PACKAGES_WITHOUT_OTHERMIRROR="keyring" + +test -z $1 && { echo "usage: $(basename $0) [/] {main,main/,nightly,nightly/} []"; exit -1; } + +PREFIX=$(echo `basename $0` | cut -d"-" -f1) +test -f ~/.buildscripts/$PREFIX.conf && . ~/.buildscripts/$PREFIX.conf || { echo "$0 has no valid context prefix..."; exit -1; } + +set -ex + +set_vars() { + USE_SUDO="yes" + PDEBUILD="pdebuild --pbuilder qemubuilder" + TEMP_BASE="$HOME/tmp/" + mkdir -p "$TEMP_BASE" + chmod 2770 "$TEMP_BASE" + + # first argv is the name of the Git project + PROJECT_PATH="$1" + PROJECT_PATH=${PROJECT_PATH/%.git/} + PROJECT="$(basename $PROJECT_PATH)" + + # 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:-$COMPONENT_NIGHTLY}}" + CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" + [ -n "$ARGV2_CODENAME" ] && FORCE_BUILD=0 || FORCE_BUILD=-1 + if [ "x$COMPONENT" = "x$COMPONENT_MAIN" ]; then + CHECKOUT="${3:-build-main}" + elif [ "x$COMPONENT" = "x$COMPONENT_NIGHTLY" ]; then + CHECKOUT="${3:-master}" + DATE="~${DATE:-$(date +%Y%m%d)}" + else + echo "error: no such package component area for this Git project. 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" + PKGDIST="$HOME/pkg-dist/$COMPONENT/$PROJECT" + + # build for other architectures than amd64/i386 + EXTRA_ARCHS="${EXTRA_ARCHS:-}" + EXTRA_ARCHS_ONLY="${EXTRA_ARCHS_ONLY:-}" + + # creating paths + mkdir -p "$TEMP_BASE" + mkdir -p "$PROJECT_DIR" + mkdir -p "$PKGDIST" + + return 0 +} + +prepare_workspace() { + # in any case remove the BUILDS_FOR file + rm -f "$PROJECT_DIR/BUILDS_FOR" + + # make sure our local working copy is up to date... + + if [ -d "$PROJECT_DIR/.git" ]; then + cd "$PROJECT_DIR" && git reset --hard + git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT + git pull origin $CHECKOUT + # and again, get the $CHECKOUT refspec in pure state + git reset --hard + else + cd "$(dirname $PROJECT_DIR)" + git clone git://$GIT_HOSTNAME/$PROJECT_PATH.git + cd "$PROJECT" + git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT; + fi + cd "$PROJECT_DIR" + + # by default we build for all current debian versions + test -f BUILDS_FOR || echo -e "$BUILDS_FOR" > BUILDS_FOR + return 0 +} + +clear_pkgdist() { + # pkgdist directory cleanup + cat "$PROJECT_DIR/BUILDS_FOR" | egrep -v '(^$|^#.*$)' | while read line; do + l_DIST="$(echo ${line/: /:} | cut -d":" -f1 | tr [:upper:] [:lower:])" + l_CODENAMES="${CODENAMES:-$(echo ${line/: /:} | cut -d":" -f2- | tr [:upper:] [:lower:])}" + echo "$DISTS_SUPPORTED" | grep $l_DIST >/dev/null && { + for l_CODENAME in $l_CODENAMES; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z $CODENAMES || echo $line | grep $CODENAMES || break + + if [ "x$EXTRA_ARCHS_ONLY" = "x" ]; then + for l_ARCH in amd64 i386; do + mkdir -p "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.changes" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.upload" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.build" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.dsc" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.tar.gz" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/*.deb" + done + fi + for l_EXTRA_ARCH in $EXTRA_ARCHS; do + mkdir -p "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.changes" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.upload" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.build" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.dsc" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.tar.gz" + rm -f "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/*.deb" + done + done + } + done + return 0 +} + +build_packages() { + # use pbuilder for building all variants of this package + cat "$PROJECT_DIR/BUILDS_FOR" | egrep -v '(^$|^#.*$)' | while read line; do + l_DIST="$(echo ${line/: /:} | cut -d":" -f1 | tr [:upper:] [:lower:])" + l_CODENAMES="${CODENAMES:-$(echo ${line/: /:} | cut -d":" -f2- | tr [:upper:] [:lower:])}" + echo "$DISTS_SUPPORTED" | grep $l_DIST >/dev/null && { + for l_CODENAME in $l_CODENAMES; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z $CODENAMES || echo $line | grep $CODENAMES || break + + TEMP_DIR="$(mktemp -d --tmpdir=$TEMP_BASE)" + mkdir -p "$TEMP_DIR/$PROJECT" + chmod 2770 "$TEMP_DIR" -Rf + + cd "$PROJECT_DIR" + git clone --local "$PROJECT_DIR" "$TEMP_DIR/$PROJECT/" + cd "$TEMP_DIR/$PROJECT" + git checkout $CHECKOUT || git checkout master + GITREV=$(gitrevno) + # we always build native packages for our repos + test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { + echo "3.0 (native)" > debian/source/format + } + # translate the version name for Debian releases + [ "x$l_CODENAME" = "xsid" ] && VERSION=unstable + [ "x$l_CODENAME" = "xwheezy" ] && VERSION=testing + [ "x$l_CODENAME" = "xsqueeze" ] && VERSION=stable + [ "x$l_CODENAME" = "xlenny" ] && VERSION=oldstable + + # modify the section for non-main package builds + [ "x$COMPONENT" != "xmain" ] || { + mv debian/control debian/control.tmp + cat debian/control.tmp | sed "s#Section:[\ ]*\(.*\)#Section: $COMPONENT/\1#g" > debian/control + } + + # modify changelog for this build + dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for $REPOS_SERVER repository." + mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/{amd64,i386} + OTHERMIRROR="" + echo $PACKAGE_WITHOUT_OTHERMIRROR | grep $PROJECT >/dev/null || OTHERMIRROR="deb http://$REPOS_SERVER/$l_DIST $l_CODENAME $COMPONENT" + + [ "x$USE_SUDO" != "xyes" ] && { + [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { + cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/amd64" 0<&- + } + cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/i386" -- --binary-arch 0<&- + } + } + for extra_arch in $EXTRA_ARCHS; do + mkdir -p "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" + cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { + DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" -- --binary-arch 0<&- + } + done + } + [ "x$USE_SUDO" = "xyes" ] && { + [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { + cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 0<&- + } + cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch 0<&- + } + } + for extra_arch in $EXTRA_ARCHS; do + mkdir -p "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" + cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { + sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult "$PKGDIST/$l_DIST/$l_CODENAME/$extra_arch" -- --binary-arch 0<&- + } + done + } + rm -Rf "$TEMP_DIR" + done + } + done + 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 [:upper:] [:lower:]) + l_CODENAMES=${CODENAMES:-$(echo ${line/: /:} | cut -d":" -f2- | tr [:upper:] [:lower:])} + for l_CODENAME in $l_CODENAMES; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z $CODENAMES || echo $line | grep $CODENAMES || break + + if [ "x$EXTRA_ARCHS_ONLY" = "x" ]; then + for l_ARCH in amd64 i386; do + cd "$PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH" + ls "$PROJECT_*.changes" &>/dev/null && dupload -c ~/.dupload.conf.$PREFIX --to $PREFIX-$l_DIST-$l_CODENAME "$PROJECT_*.changes" + cd - + done + fi + for l_EXTRA_ARCH in $EXTRA_ARCHS; do + cd "$PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH" + ls "$PROJECT_*.changes" &>/dev/null && dupload -c ~/.dupload.conf.$PREFIX --to $PREFIX-$l_DIST-$l_CODENAME "$PROJECT_*.changes" + cd - + done + done + done + cd - + return 0 +} + +### MAIN ### +set_vars $@ && { + if [ "x$(basename $0)" = "x$PREFIX-build-package" ] || [ "x$(basename $0)" = "x$PREFIX-build+upload-package" ]; then + cd $PROJECT_DIR && pkgneedsbuild $CHECKOUT || [ "$FORCE_BUILD" -eq 0 ] && { + prepare_workspace && { + clear_pkgdist + build_packages + } + } + fi + if [ "x$(basename $0)" = "x$PREFIX-upload-package" ] || [ "x$(basename $0)" = "x$PREFIX-build+upload-package" ]; then + upload_packages + fi +} diff --git a/bin/gitcreate b/bin/gitcreate new file mode 100755 index 0000000..3d93faf --- /dev/null +++ b/bin/gitcreate @@ -0,0 +1,26 @@ +#!/bin/bash + +set -xe + +GIT_USER= +GIT_HOSTNAME= +GIT_SSH_PORT=22 + +PREFIX=$(echo `basename $0` | cut -d"-" -f1) +. ~/.buildscripts/$PREFIX.conf + + +for pkg in "$@"; do + subdir=$(dirname $pkg)/ + pkg=$(basename $pkg) + ssh -l$GIT_USER $GIT_HOSTNAME "cd ~/git && ./setup-repository ${subdir}${pkg} '$pkg upstream project'" + ssh -l$GIT_USER $GIT_HOSTNAME "cd ~/git && ./update-repository-posixacls ${subdir}${pkg}" + test -d "$pkg" && cd "$pkg" + echo "$pkg: MASTER BRANCH" && git push ssh://$GIT_USER@$GIT_HOSTNAME:$GIT_SSH_PORT/~/git/${subdir}${pkg} master + git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://$GIT_USER@$GIT_HOSTNAME:$GIT_SSH_PORT/~/git/${subdir}${pkg} upstream + git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://$GIT_USER@$GIT_HOSTNAME:$GIT_SSH_PORT/~/git/${subdir}${pkg} pristine-tar + echo "$pkg: PUSHING TAGS" && git push --tags ssh://$GIT_USER@$GIT_HOSTNAME:$GIT_SSH_PORT/~/git/${subdir}${pkg} + git remote | grep origin >/dev/null || git remote add origin ssh://$GIT_USER@$GIT_HOSTNAME:$GIT_SSH_PORT/~/git/${subdir}${pkg} + git remote add ${PREFIX}-public ssh://$GIT_USER@$GIT_HOSTNAME:$GIT_SSH_PORT/~/git/${subdir}${pkg} + cd .. +done diff --git a/bin/gitrevno b/bin/gitrevno new file mode 100755 index 0000000..2f121ff --- /dev/null +++ b/bin/gitrevno @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# Copyright (C) 2010-2011 by Mike Gabriel +# +# 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 + +import subprocess +_proc = subprocess.Popen('git log --no-color --date=iso', + shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +try: + GIT_REVISION_DATE = str(len([ x for x in _proc.communicate()[0].splitlines() if x.startswith('Date:')])) +except IndexError: + GIT_REVISION_DATE = 'unknown' + +print GIT_REVISION_DATE diff --git a/bin/itzks-build+upload-all-packages b/bin/itzks-build+upload-all-packages deleted file mode 120000 index 32133c5..0000000 --- a/bin/itzks-build+upload-all-packages +++ /dev/null @@ -1 +0,0 @@ -itzks-build-all-packages \ No newline at end of file diff --git a/bin/itzks-build+upload-package b/bin/itzks-build+upload-package deleted file mode 120000 index 64ea9b4..0000000 --- a/bin/itzks-build+upload-package +++ /dev/null @@ -1 +0,0 @@ -itzks-build-package \ No newline at end of file diff --git a/bin/itzks-build-all-packages b/bin/itzks-build-all-packages deleted file mode 100755 index ffd3ab8..0000000 --- a/bin/itzks-build-all-packages +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2011 by Mike Gabriel -# -# 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. - -LIB_PACKAGES_NIGHTLY="\ -itzks-keyring nightly master -" -LIB_PACKAGES_MAIN="\ -itzks-keyring main build-main -" - -APP_PACKAGES_NIGHTLY="\ -scratch nightly master -" -APP_PACKAGES_MAIN="\ -scratch main build-main -" - -COMPONENT=${1:-""} - -# build the newest code... (nightly-builds) -[ "x$COMPONENT" = "xnightly" ] || [ -z $COMPONENT ] && { - echo -e $LIB_PACKAGES_NIGHTLY $APP_PACKAGES_NIGHTLY | while read pkg comp checkout; do - if [ "x$(basename $0)" = "xitzks-build-all-packages" ]; then - itzks-build-package $pkg $comp $checkout - elif [ "x$(basename $0)" = "xitzks-upload-all-packages" ]; then - itzks-upload-package $pkg $comp $checkout - elif [ "x$(basename $0)" = "xitzks-build+upload-all-packages" ]; then - itzks-build-package $pkg $comp $checkout && itzks-upload-package $pkg $comp $checkout - fi - done -} - -# build all packages tagged as build-main -[ "x$COMPONENT" = "xmain" ] || [ -z $COMPONENT ] && { - echo -e $LIB_PACKAGES_MAIN $APP_PACKAGES_MAIN | while read pkg comp checkout; do - if [ "x$(basename $0)" = "xitzks-build-all-packages" ]; then - itzks-build-package $pkg $comp $checkout - elif [ "x$(basename $0)" = "xitzks-upload-all-packages" ]; then - itzks-upload-package $pkg $comp $checkout - elif [ "x$(basename $0)" = "xitzks-build+upload-all-packages" ]; then - itzks-build-package $pkg $comp $checkout && itzks-upload-package $pkg $comp $checkout - fi - done -} diff --git a/bin/itzks-build-package b/bin/itzks-build-package deleted file mode 100755 index 2bbb3a1..0000000 --- a/bin/itzks-build-package +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2011 by Mike Gabriel -# -# 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: {main,main/,nightly,nightly/} []"; exit -1; } - -set -ex - -export GIT_SERVER="code.it-zukunft-schule.de" -export DEBEMAIL=itzks-packages@it-zukunft-schule.de -export DEBFULLNAME="ITZKS Packages" -export GPG_KEY="E41B37C658842183" - -set_vars() { - USE_SUDO="yes" - PDEBUILD="pdebuild --pbuilder qemubuilder" - TEMP_BASE="$HOME/tmp/" - mkdir "$TEMP_BASE" - chmod 2770 "$TEMP_BASE" - - # 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:-nightly}} - CODENAMES=${ARGV2_CODENAME:-${CODENAMES}} - [ -n "$ARGV2_CODENAME" ] && FORCE_BUILD=0 || FORCE_BUILD=-1 - if [ "x$COMPONENT" = "xmain" ]; then - CHECKOUT=${3:-build-main} - elif [ "x$COMPONENT" = "xnightly" ]; then - CHECKOUT=${3:-master} - DATE="~${DATE:-$(date +%Y%m%d)}" - else - echo "error: no such package component area for ITZKS 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" - - # build for other architectures than amd64/i386 - EXTRA_ARCHS="${EXTRA_ARCHS:-}" - EXTRA_ARCHS_ONLY="${EXTRA_ARCHS_ONLY:-}" - - # creating paths - mkdir -p "$TEMP_BASE" - mkdir -p $PROJECT_DIR - mkdir -p $PKGDIST - - return 0 -} - -clear_pkgdist() { - - # pkgdist directory cleanup - 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])} - echo "$DIST_SUPPORTED" | grep $l_DIST >/dev/null && { - for l_CODENAME in $CODENAMES; do - if [ "x$EXTRA_ARCHS_ONLY" = "x" ]; then - for l_ARCH in amd64 i386; do - mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.changes - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.upload - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.build - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.dsc - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/$PROJECT_*.tar.gz - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/*.deb - done - fi - for l_EXTRA_ARCH in $EXTRA_ARCHS; do - mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.changes - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.upload - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.build - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.dsc - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/$PROJECT_*.tar.gz - rm -f $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH/*.deb - done - done - } - done - return 0 -} - -prepare_workspace() { - # in any case remove the BUILDS_FOR file - rm -f $PROJECT_DIR/BUILDS_FOR - - # make sure our local working copy is up to date... - - if [ -d $PROJECT_DIR/.git ]; then - cd $PROJECT_DIR && git reset --hard - git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT - git pull origin $CHECKOUT - # and again, get the $CHECKOUT refspec in pure state - git reset --hard - else - cd $(dirname $PROJECT_DIR) - git clone git://$GIT_SERVER/$PROJECT.git - cd $PROJECT - git checkout --force $CHECKOUT || git checkout --force -b $CHECKOUT; - fi - - cd $PROJECT_DIR - - # by default we build for all current debian versions - test -f BUILDS_FOR || cat > BUILDS_FOR </dev/null && { - for l_CODENAME in $CODENAMES; do - TEMP_DIR="$(mktemp -d --tmpdir=$TEMP_BASE)" - mkdir -p $TEMP_DIR/$PROJECT - chmod 2770 $TEMP_DIR -Rf - git clone --local $PROJECT_DIR $TEMP_DIR/$PROJECT/ - cd $TEMP_DIR/$PROJECT - git checkout $CHECKOUT || git checkout master - GITREV=$(itzks-gitrevno) - # we always build native packages for our repos - test -f debian/source/format && cat debian/source/format | egrep '^3.0.*\(quilt\)$' >/dev/null && { - echo "3.0 (native)" > debian/source/format - } - # translate the version name for Debian releases - [ "x$l_CODENAME" = "xsid" ] && VERSION=unstable - [ "x$l_CODENAME" = "xwheezy" ] && VERSION=testing - [ "x$l_CODENAME" = "xsqueeze" ] && VERSION=stable - [ "x$l_CODENAME" = "xlenny" ] && VERSION=oldstable - - # modify the section for non-main package builds - [ "x$COMPONENT" = "xmain" ] || { - mv debian/control debian/control.tmp - cat debian/control.tmp | sed "s#Section:[\ ]*\(.*\)#Section: $COMPONENT/\1#g" > debian/control - } - - # modify changelog for this build - dch --distribution $VERSION --force-distribution -l "+$l_CODENAME~$COMPONENT$DATE~$GITREV~build" "Auto-built $l_DIST $l_CODENAME package for packages.it-zukunft-schule.de repository." - mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/{amd64,i386} - OTHERMIRROR="deb http://packages.it-zukunft-schule.de/debian $l_CODENAME $COMPONENT" - [ "x$USE_SUDO" != "xyes" ] && { - [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { - cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 - } - cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch - } - } - for extra_arch in $EXTRA_ARCHS; do - mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch - cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { - DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch - } - done - } - [ "x$USE_SUDO" = "xyes" ] && { - [ "x$EXTRA_ARCHS_ONLY" = "x" ] && { - cat debian/control | egrep 'Architecture.*(all|any|amd64)' >/dev/null && { - sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=amd64 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/amd64 - } - cat debian/control | egrep 'Architecture.*(any|i386)' >/dev/null && { - sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=i386 OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/i386 -- --binary-arch - } - } - for extra_arch in $EXTRA_ARCHS; do - mkdir -p $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch - cat debian/control | egrep "Architecture.*(any|$extra_arch)" >/dev/null && { - sudo DIST=$l_DIST CODENAME=$l_CODENAME ARCH=$extra_arch OTHERMIRROR="$OTHERMIRROR" $PDEBUILD --auto-debsign --debsign-k $GPG_KEY --buildresult $PKGDIST/$l_DIST/$l_CODENAME/$extra_arch -- --binary-arch - } - done - } - cd - - rm -Rf $TEMP_DIR - done - echo - } - echo - done - 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 - if [ "x$EXTRA_ARCHS_ONLY" = "x" ]; then - for l_ARCH in amd64 i386; do - cd $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH - ls $PROJECT_*.changes &>/dev/null && dupload --to itzks-$l_DIST-$l_CODENAME $PROJECT_*.changes - cd - - done - fi - for l_EXTRA_ARCH in $EXTRA_ARCHS; do - cd $PKGDIST/$l_DIST/$l_CODENAME/$l_EXTRA_ARCH - ls $PROJECT_*.changes &>/dev/null && dupload --to itzks-$l_DIST-$l_CODENAME $PROJECT_*.changes - cd - - done - done - done - cd - - return 0 -} - -### MAIN ### -set_vars $@ && { - if [ "x$(basename $0)" = "xitzks-build-package" ] || [ "x$(basename $0)" = "xitzks-build+upload-package" ]; then - cd $PROJECT_DIR && itzks-pkgneedsbuild $CHECKOUT || [ "$FORCE_BUILD" -eq 0 ] && { - clear_pkgdist - prepare_workspace && { - build_packages - } - } - fi - if [ "x$(basename $0)" = "xitzks-upload-package" ] || [ "x$(basename $0)" = "xitzks-build+upload-package" ]; then - upload_packages - fi -} diff --git a/bin/itzks-gitcreate b/bin/itzks-gitcreate deleted file mode 100755 index 4d4f93e..0000000 --- a/bin/itzks-gitcreate +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -for pkg in "$@"; do - subdir=$(dirname $pkg)/ - pkg=$(basename $pkg) - ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./setup-repository ${subdir}${pkg} '$pkg upstream project'" - ssh -litzks code.it-zukunft-schule.de "cd ~/git && ./update-repository-posixacls ${subdir}${pkg}" - test -d "${subdir}${pkg}" && cd "${subdir}${pkg}" - echo "$pkg: MASTER BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git master - git branch | grep upstream &>/dev/null && echo "$pkg: RELEASE BRANCH" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git upstream - git branch | grep pristine-tar &>/dev/null && echo "$pkg: PRISTINE-TAR" && git push ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git pristine-tar - echo "$pkg: PUSHING TAGS" && git push --tags ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git - git remote add origin ssh://itzks@code.it-zukunft-schule.de:32032/~/git/${subdir}${pkg}.git - cd .. -done diff --git a/bin/itzks-gitrevno b/bin/itzks-gitrevno deleted file mode 100755 index 2f121ff..0000000 --- a/bin/itzks-gitrevno +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2010-2011 by Mike Gabriel -# -# 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 - -import subprocess -_proc = subprocess.Popen('git log --no-color --date=iso', - shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) -try: - GIT_REVISION_DATE = str(len([ x for x in _proc.communicate()[0].splitlines() if x.startswith('Date:')])) -except IndexError: - GIT_REVISION_DATE = 'unknown' - -print GIT_REVISION_DATE diff --git a/bin/itzks-pkgneedsbuild b/bin/itzks-pkgneedsbuild deleted file mode 100755 index 2a192eb..0000000 --- a/bin/itzks-pkgneedsbuild +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2010-2011 by Mike Gabriel -# -# 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 - -set -xe - -CHECKOUT=${1:-master} - -[ -d .git ] && { - - TIMESTAMP=$(date +%s) - CURRENT_BRANCH=$(git branch | grep "*" | awk '{print $2}') - - # switch to branch given as $CHECKOUT, if it does not exist locally, create it... - git checkout $CHECKOUT &>/dev/null || git checkout -b $CHECKOUT >/dev/null - - # switch to a tmp branch... - git checkout -b tmp-$TIMESTAMP &>/dev/null - - # pull $CHECKOUT from origin into the tmp branch - LANG=en_US.UTF-8 git pull origin $CHECKOUT 2>/dev/null | egrep "^Already up-to-date.$" &>/dev/null && { - # drop the tmp branch - git checkout $CURRENT_BRANCH &>/dev/null - git branch -D tmp-$TIMESTAMP >/dev/null - exit 1 - } || { - # drop the tmp branch - git checkout $CURRENT_BRANCH &>/dev/null - git branch -D tmp-$TIMESTAMP >/dev/null - exit 0 - } -} || exit 0 diff --git a/bin/itzks-tarballrelease b/bin/itzks-tarballrelease deleted file mode 100755 index 1b58077..0000000 --- a/bin/itzks-tarballrelease +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2011 by Mike Gabriel -# -# This is free software; you can redistribute it and/or modify -# it under the tBerms 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. - -# Thanks to Jonas Smedegaard for inspiration... - -set -e - -RELEASE="$1" -test -n "$RELEASE" || { echo "usage: $(basename "$0") []"; exit 1; } - -CHECKOUT="${2:-master}" - -PROJECT="$(basename $PWD)" -TARGETDIR=".." - -MANIFEST="$(mktemp)" -TEMP_DIR="$(mktemp -d)" - -echo $MANIFEST - -trap "rm -f \"${MANIFEST}\"; rm -rf \"${TEMP_DIR}\"" 0 -git clone . "$TEMP_DIR/${PROJECT}_$RELEASE" -( set -e; cd "$TEMP_DIR/${PROJECT}_$RELEASE/" && git checkout ${CHECKOUT} 2>/dev/null || true ) -( set -e; cd "$TEMP_DIR" && rm -Rf "${PROJECT}_$RELEASE/.git"* ) -( set -e; cd "$TEMP_DIR" && find "${PROJECT}_$RELEASE" -type f | sed 's/^\.*\/*//' | sort > "$MANIFEST" ) -mkdir -p "$TARGETDIR/_releases_/source/${PROJECT}/" -tar c -C "$TEMP_DIR" --owner 0 --group 0 --numeric-owner --no-recursion --files-from "$MANIFEST" | gzip -n > "$TARGETDIR/_releases_/source/${PROJECT}/${PROJECT}_$RELEASE.tar.gz" diff --git a/bin/itzks-updatebuildmain b/bin/itzks-updatebuildmain deleted file mode 100755 index f4f4917..0000000 --- a/bin/itzks-updatebuildmain +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2010-2011 by Mike Gabriel -# -# 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 - -set -e - -GITPROJECT=$(basename $(pwd)) -REF=$1 - -# we need to be within a working copy (base folder) and we need a !!! -test -z $1 || test -d ./.git || { - echo "usage: $(basename $0) " - echo "Call this command from within the base folder of a Git project's working copy..." - exit -1 -} - -# update the build-main branch with our newest blessed reference -git branch build-main &>/dev/null || true -git push origin $REF:build-main diff --git a/bin/itzks-upload-all-packages b/bin/itzks-upload-all-packages deleted file mode 120000 index 32133c5..0000000 --- a/bin/itzks-upload-all-packages +++ /dev/null @@ -1 +0,0 @@ -itzks-build-all-packages \ No newline at end of file diff --git a/bin/itzks-upload-package b/bin/itzks-upload-package deleted file mode 120000 index 64ea9b4..0000000 --- a/bin/itzks-upload-package +++ /dev/null @@ -1 +0,0 @@ -itzks-build-package \ No newline at end of file diff --git a/bin/pkgneedsbuild b/bin/pkgneedsbuild new file mode 100755 index 0000000..2a192eb --- /dev/null +++ b/bin/pkgneedsbuild @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright (C) 2010-2011 by Mike Gabriel +# +# 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 + +set -xe + +CHECKOUT=${1:-master} + +[ -d .git ] && { + + TIMESTAMP=$(date +%s) + CURRENT_BRANCH=$(git branch | grep "*" | awk '{print $2}') + + # switch to branch given as $CHECKOUT, if it does not exist locally, create it... + git checkout $CHECKOUT &>/dev/null || git checkout -b $CHECKOUT >/dev/null + + # switch to a tmp branch... + git checkout -b tmp-$TIMESTAMP &>/dev/null + + # pull $CHECKOUT from origin into the tmp branch + LANG=en_US.UTF-8 git pull origin $CHECKOUT 2>/dev/null | egrep "^Already up-to-date.$" &>/dev/null && { + # drop the tmp branch + git checkout $CURRENT_BRANCH &>/dev/null + git branch -D tmp-$TIMESTAMP >/dev/null + exit 1 + } || { + # drop the tmp branch + git checkout $CURRENT_BRANCH &>/dev/null + git branch -D tmp-$TIMESTAMP >/dev/null + exit 0 + } +} || exit 0 diff --git a/bin/tarballrelease b/bin/tarballrelease new file mode 100755 index 0000000..1b58077 --- /dev/null +++ b/bin/tarballrelease @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2011 by Mike Gabriel +# +# This is free software; you can redistribute it and/or modify +# it under the tBerms 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. + +# Thanks to Jonas Smedegaard for inspiration... + +set -e + +RELEASE="$1" +test -n "$RELEASE" || { echo "usage: $(basename "$0") []"; exit 1; } + +CHECKOUT="${2:-master}" + +PROJECT="$(basename $PWD)" +TARGETDIR=".." + +MANIFEST="$(mktemp)" +TEMP_DIR="$(mktemp -d)" + +echo $MANIFEST + +trap "rm -f \"${MANIFEST}\"; rm -rf \"${TEMP_DIR}\"" 0 +git clone . "$TEMP_DIR/${PROJECT}_$RELEASE" +( set -e; cd "$TEMP_DIR/${PROJECT}_$RELEASE/" && git checkout ${CHECKOUT} 2>/dev/null || true ) +( set -e; cd "$TEMP_DIR" && rm -Rf "${PROJECT}_$RELEASE/.git"* ) +( set -e; cd "$TEMP_DIR" && find "${PROJECT}_$RELEASE" -type f | sed 's/^\.*\/*//' | sort > "$MANIFEST" ) +mkdir -p "$TARGETDIR/_releases_/source/${PROJECT}/" +tar c -C "$TEMP_DIR" --owner 0 --group 0 --numeric-owner --no-recursion --files-from "$MANIFEST" | gzip -n > "$TARGETDIR/_releases_/source/${PROJECT}/${PROJECT}_$RELEASE.tar.gz" diff --git a/bin/updatebuildmain b/bin/updatebuildmain new file mode 100755 index 0000000..f4f4917 --- /dev/null +++ b/bin/updatebuildmain @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright (C) 2010-2011 by Mike Gabriel +# +# 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 + +set -e + +GITPROJECT=$(basename $(pwd)) +REF=$1 + +# we need to be within a working copy (base folder) and we need a !!! +test -z $1 || test -d ./.git || { + echo "usage: $(basename $0) " + echo "Call this command from within the base folder of a Git project's working copy..." + exit -1 +} + +# update the build-main branch with our newest blessed reference +git branch build-main &>/dev/null || true +git push origin $REF:build-main diff --git a/bin/upload-all-packages b/bin/upload-all-packages new file mode 120000 index 0000000..b8c12b0 --- /dev/null +++ b/bin/upload-all-packages @@ -0,0 +1 @@ +build-all-packages \ No newline at end of file diff --git a/bin/upload-package b/bin/upload-package new file mode 120000 index 0000000..2b48fdc --- /dev/null +++ b/bin/upload-package @@ -0,0 +1 @@ +build-package \ No newline at end of file -- cgit v1.2.3 From c6738108235cd874c48bf1e6ee7ca9d675db53ef Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Dec 2011 01:28:58 +0100 Subject: fix condition --- bin/build-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/build-package b/bin/build-package index 8a1f94f..3a891b6 100755 --- a/bin/build-package +++ b/bin/build-package @@ -182,7 +182,7 @@ build_packages() { [ "x$l_CODENAME" = "xlenny" ] && VERSION=oldstable # modify the section for non-main package builds - [ "x$COMPONENT" != "xmain" ] || { + [ "x$COMPONENT" != "xmain" ] && { mv debian/control debian/control.tmp cat debian/control.tmp | sed "s#Section:[\ ]*\(.*\)#Section: $COMPONENT/\1#g" > debian/control } -- cgit v1.2.3