Replace the superrepo hooks with an update hook that rejects all
[invirt/scripts/git-hooks.git] / super / build-pre-receive
diff --git a/super/build-pre-receive b/super/build-pre-receive
deleted file mode 100755 (executable)
index d6f84cb..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/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