]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
debian: add option to create pbuilder debug hook
authorTravis Cross <tc@traviscross.com>
Mon, 28 May 2012 13:37:34 +0000 (13:37 +0000)
committerTravis Cross <tc@traviscross.com>
Mon, 28 May 2012 18:21:30 +0000 (18:21 +0000)
debian/util.sh

index 326e8f6156bcb9cf96b4208dad8b04b0dbeb73d9..08827f3e07e53aa30e7b4b3fcdfd5c8153698ab6 100755 (executable)
@@ -192,7 +192,23 @@ create_dsc () {
   echo $dsc
 }
 
+fmt_debug_hook () {
+    cat <<'EOF'
+#!/bin/bash
+export debian_chroot="cow"
+cd /tmp/buildd/*/debian/..
+/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
+EOF
+}
+
 build_debs () {
+  local OPTIND OPTARG debug_hook=false hookdir=""
+  while getopts 'd' o "$@"; do
+    case "$o" in
+      d) debug_hook=true;;
+    esac
+  done
+  shift $(($OPTIND-1))
   local distro="$(find_distro $1)" dsc="$2" arch="$3"
   if [ -z "$distro" ] || [ "$distro" = "auto" ]; then
     if ! (echo "$dsc" | grep -e '-[0-9]*~[a-z]*+[0-9]*'); then
@@ -218,7 +234,13 @@ build_debs () {
   announce "Updating base $distro-$arch image..."
   cow --update
   announce "Building $distro-$arch DEBs from $dsc..."
-  cow --build $dsc
+  if $debug_hook; then
+    mkdir -p .hooks
+    fmt_debug_hook > .hooks/C10shell
+    chmod +x .hooks/C10shell
+    hookdir=$(pwd)/.hooks
+  fi
+  cow --build $dsc --hookdir "$hookdir"
   echo ${dsc}_${arch}.changes
 }