Skip to content

Instantly share code, notes, and snippets.

@fpytloun
Created August 4, 2016 15:02
Show Gist options
  • Save fpytloun/f640e18258af39192ca0853c30a4f31f to your computer and use it in GitHub Desktop.
Save fpytloun/f640e18258af39192ca0853c30a4f31f to your computer and use it in GitHub Desktop.
pbuilder hook to access shell on FTBFS
#!/bin/bash
# example file to be used with --hookdir
#
# invoke shell if build fails.
echo "=== BUILD FAILED"
read -r -p "=== Do you want to enter shell and investigate situation? (Y/n) " res < /dev/tty > /dev/tty 2> /dev/tty
if [[ ${res,,} =~ ^(yes|y|)$ ]]; then
BUILDDIR="${BUILDDIR:-/tmp/buildd}"
apt-get install -y "${APTGETOPT[@]}" vim-nox less
cd "$BUILDDIR"/*/debian/..
/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment