+++ /dev/null
-#!/bin/bash
-set -e
-
-read oldrev newrev head
-if [ $head != 'refs/heads/dev' ]; then
- echo "error: head not recognized: $head" >&2
- exit 1
-fi
-if read; then
- echo "error: one update at a time, please" >&2
- exit 1
-fi
-
-tmpdir=$(mktemp -d /tmp/xvm-git-XXXXXX)
-echo "build directory $tmpdir"
-
-# XXX fixme
-sbuild () { echo " SBUILD" "$@"; }
-
-build_package () {
- packagepath=$1
- rev=$2
-
- package=${packagepath#packages/}
- url=$(git config -f $tmpdir/git/.gitmodules submodule.$packagepath.url)
- echo "building $package at new version $rev"
-
- srcdir=$tmpdir/$package
- mkdir $srcdir
- # XXX remove that .git -- be sure to include it in `git submodule add`
- git --git-dir=$url.git archive $rev | tar -xf - -C $srcdir
- pushd $srcdir >/dev/null
-
- eval $(perl -ne 'print if s/^(Version|Source|Distribution): /\1=/' \
- <(dpkg-parsechangelog))
- dpkg-buildpackage -us -uc -rfakeroot -S
- cd ..
-
- eval $(perl -ne 'print if s/^(Architecture): /\1=/' ${Source}_${Version}.dsc)
- case $Architecture in
- all)
- sbuild -d $distribution --arch-all ${Source}_${Version}.dsc;;
- any)
- sbuild -d $distribution --arch amd64 --arch-all ${Source}_${Version}.dsc
- sbuild -d $distribution --arch i386 ${Source}_${Version}.dsc;;
- *)
- echo "build-pre-receive: arch '$Architecture' unimplemented" >&2
- exit 1
- esac
-
- echo "XXX tag submodule as $Version"
-
- [ $Distribution = 'unstable' ] \
- || echo "$(basename $0): warning: Distribution is $Distribution, script expects unstable"
-
- echo "built $package version $Version from commit $rev"
- popd >/dev/null
-}
-
-git clone . $tmpdir/git
-
-git ls-tree $newrev packages/ \
- | grep ^160000\ commit \
- | while read x y newsubrev packagepath; do
- # XXX deal with new packages
- # XX deal with removed packages
- oldsubrev=$(git ls-tree $oldrev $packagepath | perl -lane 'print $F[2]')
- if [ $newsubrev == $oldsubrev ]; then
- continue
- fi
-
- build_package $packagepath $newsubrev
- done
-
-
-exit 0
-
-for package; do
- changesfile=`pwd`/${Source}_*${Version}*.changes
- for i in $changesfile; do
- reprepro-env include unstable $i
- reprepro-env copy stable unstable $(sed -ne 's/^Binary: //p' $i)
- done
- reprepro-env copy stable unstable $Source
-
- cd ..
- rm -rf build-release/$package
-done
--- /dev/null
+#!/bin/sh
+
+ref="$1"
+oldrev="$2"
+newrev="$3"
+
+# --- Safety check
+
+if [ -z "$GIT_DIR" ]; then
+ echo "Don't run this script from the command line." >&2
+ echo " (if you want, you could supply GIT_DIR then run" >&2
+ echo " $0 <ref> <oldrev> <newrev>)" >&2
+ exit 1
+fi
+
+if [ -z "$ref" -o -z "$oldrev" -o -z "$newrev" ]; then
+ echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
+ exit 1
+fi
+
+# --- Disallow all pushes
+
+echo "*** Pushing to the superrepo is not allowed" >&2
+echo "***" >&2
+echo "*** If you would like to update the superrepo, use remctl" >&2
+exit 1