aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Minier <lool@dooz.org>2009-12-27 10:51:59 +0100
committerLoïc Minier <lool@dooz.org>2009-12-27 10:51:59 +0100
commit6c73bf0958124db588b14975fbef1d3ef2dae6c6 (patch)
tree0f698ec7ad4b3396d2b9429b04302564f4a4a930
parentdb5c58bc4654fe13f3a7da77d6b5fdeed70a613a (diff)
downloadpbuilder-6c73bf0958124db588b14975fbef1d3ef2dae6c6.tar
pbuilder-6c73bf0958124db588b14975fbef1d3ef2dae6c6.tar.gz
Honor PBUILDER_ROOT and PBUILDER_*DIR vars
Use GNU-style vars for system directories, allow to set them from the env, and let them be prefixed with a PBUILDER_ROOT directory to allow relocation.
-rwxr-xr-xpbuilder-checkparams6
-rw-r--r--pbuilder-loadconfig5
2 files changed, 8 insertions, 3 deletions
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 37b8f42..6debb03 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -21,8 +21,10 @@
# This code is called for pbuilder and pbuilder inside pbuilder-uml;
# pbuilder-uml calls uml-checkparams.
-. /usr/lib/pbuilder/pbuilder-loadconfig
-. /usr/lib/pbuilder/pbuilder-modules
+export PBUILDER_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-${PBUILDER_ROOT}/usr/lib/pbuilder}"
+
+. "$PBUILDER_PKGLIBDIR"/pbuilder-loadconfig
+. "$PBUILDER_PKGLIBDIR"/pbuilder-modules
#default value for this option is !empty!
INTERNAL_BUILD_UML=""
diff --git a/pbuilder-loadconfig b/pbuilder-loadconfig
index 2c00871..bd42461 100644
--- a/pbuilder-loadconfig
+++ b/pbuilder-loadconfig
@@ -17,7 +17,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-for RCFILE in /usr/share/pbuilder/pbuilderrc /etc/pbuilderrc ${HOME}/.pbuilderrc; do
+export PBUILDER_PKGDATADIR="${PBUILDER_PKGDATADIR:-$PBUILDER_ROOT/usr/share/pbuilder}"
+export PBUILDER_SYSCONFDIR="${PBUILDER_SYSCONFDIR:-$PBUILDER_ROOT/etc}"
+
+for RCFILE in "$PBUILDER_PKGDATADIR"/pbuilderrc "$PBUILDER_SYSCONFDIR"/pbuilderrc "$HOME"/.pbuilderrc; do
if [ -f "$RCFILE" ]; then
. "$RCFILE"
else