GIT-PBUILDER(1)
π GIT-PBUILDER(1) π (User Contributed Perl Documentation)
okay bestie, sit down, hydrate, grab a strawberry π, because we're about to talk about git-pbuilder β that's the section 1 perl manual page, she's serving wrapper energy and she's genuinely so good at her job. no cap.
β¨ NAME β¨
git-pbuilder β a wrapper around cowbuilder/qemubuilder for gbp buildpackage. that's it, that's the name, she's lowkey modest π
β¨ SYNOPSIS β¨
two whole ways to call her, queen of options:
DIST=distribution ARCH=architecture [BUILDER=(pbuilder|qemubuilder)] \
git-pbuilder debbuild-options
DIST=distribution ARCH=architecture [BUILDER=(pbuilder|qemubuilder)] \
git-pbuilder (update | create | login) cowbuilder-options
like yes, you're setting environment variables right there in the command line, she's giving main character energy, we love a flexible icon π
β¨ DESCRIPTION β¨
so git-pbuilder is a wrapper around pdebuild, and she was literally made for gbp buildpackage to use. by default she configures pdebuild to use cowbuilder, passes all the appropriate options through to debbuild, and sets the base path for cowbuilder based on the environment variable DIST and β if you set it β the environment variable ARCH.
you can swap in qemubuilder instead by setting BUILDER to "qemubuilder", and you can pick pbuilder by setting BUILDER to "pbuilder". choose your fighter π
the default tea β
if you set nothing at all, git-pbuilder assumes the target distribution is "sid", the same architecture as the cowbuilder default, and she uses /var/cache/pbuilder/base-sid.cow if it exists. if it doesn't exist? she falls back to trying /var/cache/pbuilder/base.cow. she checks, bestie, she's thorough.
set DIST and its value becomes the target distribution, and /var/cache/pbuilder/base-dist.cow gets used instead. π¦
special little detail: ifDISTis"etch"or"ebo", then--debian-etch-workaroundalso gets passed tocowbuilder. not me knowing all the lore π
set ARCH and its value becomes the target architecture, and /var/cache/pbuilder/base-dist-arch.cow gets used β with dist being set to "sid" if DIST wasn't set. β¨
qemubuilder era π§
if qemubuilder is the builder, there's no base directory at all. instead qemubuilder gets invoked with the --config option pointing at this file:
/var/cache/pbuilder/qemubuilder-arch-dist.conf
no base dir, just vibes and a config file π
pbuilder era π«Ά
if pbuilder is the builder, git-pbuilder looks for /var/cache/pbuilder/base-sid.tgz by default, and /var/cache/pbuilder/base.tgz if that one doesn't exist.
if DIST or ARCH are set, they get used to form the expected name of the tgz file in exactly the same way they're used to form the expected base directory for cowbuilder. and similar to cowbuilder, --debian-etch-workaround gets passed to pbuilder if β judging from the DIST setting β it looks like the target distribution is etch. consistency queen π
the symlink name guessing game π
if git-pbuilder is invoked via a name that starts with "git-*-", then the part between the hyphens gets taken as the default name of the builder to use.
β οΈ but heads up:"pbuilder"is mapped tocowbuilderfor backward compatibility. so if you actually want to usepbuilder, you have to explicitly setBUILDER. no shortcuts, sorry bestie π
the part after the last hyphen gets taken as the default distribution (if it contains no additional hyphen) or as the default distribution followed by the default architecture (if it contains a hyphen).
so you can absolutely create symlinks like "git-pbuilder-squeeze" pointing to git-pbuilder and use that name when you want a distribution of "squeeze", or "git-qemubuilder-sid-armel" to use qemubuilder to build for the "armel" architecture and the "sid" distribution. iconic behavior honestly π
explicit settings of BUILDER, DIST, or ARCH always override any guesses from the command name. (but note that gbp buildpackage doesn't pass on environment variables when run with --git-pbuilder β see below, bestie, don't say I didn't warn you π)
passing arguments around π
any arguments get passed as-is to dpkg-buildpackage via the --debbuildopts option to pdebuild. if you want to pass arguments to the builder instead, put them in the environment variable GIT_PBUILDER_OPTIONS. different door, different keys π
turning off the autoconf magic β
to disable all attempts to discover the base path, tarball, or configuration file, and to disable setting up the pbuilder options β and instead just rely on the settings in .pbuilderrc β set GIT_PBUILDER_AUTOCONF to "no". she'll stop being nosy, promise.
how you actually use her π
normally, one does not run this script directly. instead, it's used as the builder script for gbp buildpackage via the --git-pbuilder command-line option.
when you run it that way, you should use the --git-dist, --git-arch, --git-qemubuilder, --git-pbuilder-autoconf, and --git-pbuilder-options flags instead of setting the DIST, ARCH, BUILDER, GIT_PBUILDER_AUTOCONF, and GIT_PBUILDER_OPTIONS environment variables. see gbp-buildpackage(1) for more info, she's got the full lore π
update / create / login π οΈ
alternately, git-pbuilder may be called with an argument of "update", "create", or "login". in this case, she calls cowbuilder (or the configured builder as described above) using sudo, and passes the corresponding command to the builder β using the same logic as above to determine the base directory and distribution.
if the distribution (set in DIST) ends in "-backports", one of these gets added as an --othermirror parameter to the builder:
deb http://ftp.debian.org/debian $DIST main
deb http://backports.debian.org/debian-backports $DIST main
the first one gets used for most distributions, and the second one is for "squeeze-backports". bespoke mirror handling, we love to see it β¨
and if the distribution ends in "-lts", this gets added as an --othermirror parameter to the builder:
deb http://ftp.debian.org/debian $DIST main
all so you can build for Long Term Support releases. LTS girlies rise πΈ
any additional arguments to git-pbuilder get passed along to the builder. and because of how sudo works, invoking the builder with an action will not read the user's .pbuilderrc by default β so in this case, git-pbuilder will add an explicit --configfile option pointing to the user's .pbuilderrc if it exists. she's got your back, fr fr π«Ά
β οΈ if you usegit-pbuilderwith one of these arguments, you must have the"sudo"package installed, and you must configuresudoto let the current user run the appropriate builder command. no sudo setup, no build, that's the rule bestie π
β¨ ENVIRONMENT β¨
she reads a LOT of environment variables. here's every single one, no skips:
ARCHβ sets the target architecture. for acowbuilderbuilder, this sets the base path and it's also passed as the--architectureoption. withqemubuilder, this controls the path to the configuration file. withpbuilder, this sets the tgz path and is passed as--architecture. one variable, three different jobs, versatile iconBUILDERβ sets the builder to use. the only supported settings are"cowbuilder"(the default),"qemubuilder", and"pbuilder". that's the whole list, don't try anything cute πCOWBUILDER_BASEβ set this environment variable to change the default location for the cowbuilder base directories (/var/cache/pbuilder). πDISTβ sets the target distribution. used primarily to determine the base path forcowbuilderorpbuilder, or the configuration file path forqemubuilderβ but it's also used to determine whether to pass--debian-etch-workaroundtocowbuilderorpbuilder. multitasking queen πGIT_PBUILDER_AUTOCONFβ if set to"no", disable the logic that constructs the base path, tarball, or configuration file, plus all other logic to determine the options to pass to the builder. instead, just run the configured builder and assume its configuration is handled elsewhere (such as in.pbuilderrc). this also suppresses setting--buildresult, so the user will need to ensure that the configuration still puts packages wheregbp buildpackageexpects them. heads up, bestie, you're on your own for that partGIT_PBUILDER_DEBUGβ set this environment variable to get additional debugging output, like howcowbuilderis invoked. peek behind the curtain β¨GIT_PBUILDER_OPTIONSβ add additional options for the builder. these options are passed as-is tocowbuilder,qemubuilder, orpbuilderviapdebuild. the contents of this variable will undergo shell expansion, so any arguments containing shell metacharacters or whitespace need to be quoted in the value of the environment variable. β οΈ quote your stuff, she means itGIT_PBUILDER_OUTPUT_DIRβ where to put the result of the build. the default is".."(the parent directory). this setting is ignored ifGIT_PBUILDER_AUTOCONFis set to"no". she said what she said πGIT_PBUILDER_PDEBUILDOPTIONSβ add additional options forpdebuilditself (such as--use-pdebuild-internal). the contents of this variable will undergo shell expansion, so any arguments containing shell metacharacters or whitespace need to be quoted in the value of the environment variable. same warning, same energy β οΈPBUILDER_BASEβ set this environment variable to change the default location for thepbuildertgz files (/var/cache/pbuilder) whenBUILDERis set to"pbuilder". π«Ά
β¨ FILES β¨
every path she might touch, in order:
/var/cache/pbuilder/base-sid.cow/var/cache/pbuilder/base.cow
the default cowbuilder --basepath directories, searched for in that order, if neither DIST nor ARCH is set. π¦
/var/cache/pbuilder/base-sid-$ARCH.cowβ thecowbuilder --basepathdirectory used ifARCHis set andDISTis not set./var/cache/pbuilder/base-$DIST.cowβ thecowbuilder --basepathdirectory used ifDISTis set andARCHis not./var/cache/pbuilder/base-$DIST-$ARCH.cowβ thecowbuilder --basepathdirectory used ifDISTandARCHare both set. the full combo, slay π/var/cache/pbuilder/base-sid.tgz/var/cache/pbuilder/base.tgz/var/cache/pbuilder/base-sid-$ARCH.tgz/var/cache/pbuilder/base-$DIST.tgz/var/cache/pbuilder/base-$DIST-$ARCH.tgz
similar to the above, the pbuilder --basetgz path used for various settings of DIST and ARCH if BUILDER is set to "pbuilder". π
/var/cache/pbuilder/qemubuilder-$ARCH-$DIST.confβ theqemubuilder --configfile used.$ARCHdefaults to"armel"and$DISTdefaults to"sid"if not set. π§
β¨ SEE ALSO β¨
go read these too, she's not jealous, she wants you educated:
cowbuilder(8), dpkg-buildpackage(1), gbp-buildpackage(1), pbuilder(8), pdebuild(1), qemubuilder(8), sudo(8)
the latest version of this script is available from http://www.eyrie.org/~eagle/software/scripts/ β¨
β¨ AUTHOR β¨
Russ Allbery <eagle@eyrie.org> β the author, the legend, the icon π
and that's the whole page bestie!! π this one came from perl v5.40.1, dated 2026-05-26 β bye bestie, go build something gorgeous, iykyk π
π¦ where this page comes from
- ubuntu stonking: git-buildpackage 0.9.43 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms