+#!/bin/bash
+#
# See https://wiki.debian.org/BuildingFormalBackports
# https://wiki.debian.org/PbuilderTricks#How_to_include_local_packages_in_the_build
+
+set -e
+
+if [ ! -z "$LOCALDEBS" ]; then
+ ( cd $LOCALDEBS; apt-ftparchive packages . > Packages )
+fi
+
/usr/bin/apt-get update
# See /usr/share/pbuilder/pbuilderrc for defaults
-# Source custom configuration
-if [ -e "$HOME/.custom/pbuilderrc" ]; then
- source $HOME/.custom/pbuilderrc
-fi
-
# Basic configuration
ARCH=${ARCH:=amd64}
DIST=${DIST:=sid}
COMPONENTS=${COMPONENTS:=main contrib non-free}
HOOKDIR=${HOOKDIR:=$HOME/.config/pbuilder/hooks/}
+# Source custom configuration
+if [ -e "$HOME/.custom/pbuilderrc" ]; then
+ source $HOME/.custom/pbuilderrc
+fi
+
# Map distribution option to our env variable
DISTRIBUTION="$DIST"
+# Bindmounts
+if [ ! -z "$BINDMOUNTS" ]; then
+ mkdir -p $BINDMOUNTS
+fi
+
# Backports
# https://wiki.ubuntu.com/PbuilderHowto#Using_backport_repositories_in_pbuilder
# https://wiki.debian.org/BuildingFormalBackports#Building_multi-dependencies_packages
# https://wiki.debian.org/AutomateBackports
# https://wiki.debian.org/PbuilderTricks#How_to_include_local_packages_in_the_build
if [ ! -z "$LOCALDEBS" ]; then
+ # Ensure it exists
+ mkdir -p $LOCALDEBS
+
if [ ! -z "$OTHERMIRROR" ]; then
OTHERMIRROR="$OTHERMIRROR | deb file://${LOCALDEBS} ./"
else