I want pbuilder on debian to create a chrooted env, install build dependencies, build a package and then launch a shell and let me analyze the build directory.For example, if I run:sudo pbuilder --build snacc_1.3.1-5.dscthere's a file:/var/cache/pbuilder/build/20352/tmp/buildd/snacc-1.3.1/compiler/back-ends/c-gen/util.cIt gets deleted after.mock for rhel has the option --no-clean-after. Can't find a similar option in pbuild.There's --preserve-buildplace, but it does something else.
pbuilder --build --no-clean-after
debian;pbuilder
I looked the /usr/lib/pbuilder/pbuilder-buildpackage which does the main part, and there seems no way to avoid cleaning up without modifying the script itself.But maybe helpful for you: The hook B is called after building as stated in man pbuilder, section --hookdir.B<digit><digit><whatever-else-you-want> is executed after build system finishes building, successfully, before copying back the build result.I use the following script in my configuration for a shell at this stage:~/.pbuilderhooks/B10shell:#!/bin/bash# invoke shell if build fails.if [ -n $PBSHELL ]; thenapt-get install -y --force-yes nano less bashcd /tmp/buildd/*/debian/..echo pbuilder-$OS-$DIST-$ARCH >/etc/debian_chrootcat <<.e----------------------------------------OS:   $OSDIST: $DISTARCH: $ARCHpbuilder-cmd: $PBCURRENTCOMMANDLINEOPERATION========================================Entering DEBUG shell:.e/bin/bash < /dev/tty > /dev/tty 2> /dev/ttyelse  echo 'I: If you want a shell, set envvar PBSHELL=1' >&2fiTo activate the shell, call pbuilder like this:PBSHELL=1 pbuilder --build ...