git-pbuilder 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. #!/bin/bash
  2. # $Id: git-pbuilder,v 1.43 2016/12/10 18:54:05 eagle Exp $
  3. #
  4. # Wrapper around pbuilder for gbp buildpackage
  5. #
  6. # Note that this script requires bash, not a POSIX shell, because it uses bash
  7. # arrays to handle GIT_PBUILDER_OPTIONS and GIT_PBUILDER_PDEBUILDOPTIONS.
  8. # It's otherwise quite difficult to get the contents of that environment
  9. # variable to undergo the correct amount of shell expansion.
  10. #
  11. # Written by Russ Allbery <eagle@eyrie.org>
  12. # Based on the example in the git-buildpackage documentation
  13. # Copyright 2014, 2015, 2016 Russ Allbery <eagle@eyrie.org>
  14. # Copyright 2008, 2009, 2010, 2011, 2012, 2013
  15. # The Board of Trustees of the Leland Stanford Junior University
  16. #
  17. # Permission to use, copy, modify, and distribute this software and its
  18. # documentation for any purpose and without fee is hereby granted, provided
  19. # that the above copyright notice appear in all copies and that both that
  20. # copyright notice and this permission notice appear in supporting
  21. # documentation, and that the name of Stanford University not be used in
  22. # advertising or publicity pertaining to distribution of the software without
  23. # specific, written prior permission. Stanford University makes no
  24. # representations about the suitability of this software for any purpose. It
  25. # is provided "as is" without express or implied warranty.
  26. #
  27. # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
  28. # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  29. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  30. set -e
  31. # Helper function to quote an argument so that it's protected from the shell.
  32. # This is used when passing arguments through in --debbuildopts, since they'll
  33. # undergo another round of shell expansion.
  34. shell_quote () {
  35. echo "$1" | sed -e "s/'/'\"'\"'/g" -e "1 s/^/'/" -e "\$ s/\$/'/"
  36. }
  37. # Set default BUILDER, DIST, and ARCH based on the name we were invoked as.
  38. # This allows people to create symlinks like git-pbuilder-squeeze and
  39. # git-qemubuilder-squeeze-amd64 pointing to git-pbuilder and auto-detecting
  40. # the builder, distribution, and architecture from that.
  41. default_BUILDER=${0#*git-}
  42. default_DIST=${default_BUILDER#*-}
  43. default_BUILDER=${default_BUILDER%%-*}
  44. case $default_BUILDER in
  45. pbuilder|cowbuilder) default_BUILDER=cowbuilder ;;
  46. /*) default_BUILDER=cowbuilder ;;
  47. esac
  48. case $default_BUILDER in
  49. *builder) ;;
  50. *) default_BUILDER=cowbuilder ;;
  51. esac
  52. case $default_DIST in
  53. *builder)
  54. default_DIST=
  55. ;;
  56. *-*)
  57. default_ARCH=${default_DIST#*-}
  58. default_DIST=${default_DIST%%-*}
  59. ;;
  60. esac
  61. : ${default_BUILDER:=cowbuilder}
  62. # Set BUILDER, DIST, and ARCH, allowing existing settings to override.
  63. : ${BUILDER:=$default_BUILDER}
  64. : ${DIST:=$default_DIST}
  65. : ${ARCH:=$default_ARCH}
  66. # If DIST ends in -backports, strip that out of DIST and add it to EXT.
  67. if expr "$DIST" : '.*-backports$' >/dev/null; then
  68. DIST=${DIST%-backports}
  69. EXT="-backports"
  70. # The URL to the Debian backports repository to add to the chroot
  71. # configuration when created via this script for a distribution ending in
  72. # -backports. Backports was incorporated into the main mirrors as of
  73. # wheezy.
  74. case $DIST in
  75. squeeze)
  76. BACKPORTS='http://backports.debian.org/debian-backports'
  77. ;;
  78. *)
  79. BACKPORTS='http://ftp.debian.org/debian'
  80. ;;
  81. esac
  82. elif expr "$DIST" : '.*-lts$' >/dev/null; then
  83. DIST=${DIST%-lts}
  84. EXT="-lts"
  85. # The URL to the Debian LTS repository to add to the chroot
  86. # configuration when created via this script for a distribution ending in
  87. # -lts.
  88. LTS='http://ftp.debian.org/debian'
  89. else
  90. EXT=
  91. fi
  92. # Make sure we have the necessary tools.
  93. if [ ! -x /usr/sbin/"$BUILDER" ]; then
  94. echo "$BUILDER not found; you need to install the $BUILDER package" >&2
  95. exit 1
  96. fi
  97. # Default options come from the environment. Use eval to parse
  98. # GIT_PBUILDER_OPTIONS and GIT_PBUILDER_PDEBUILDOPTIONS into arrays, since
  99. # some arguments may have quoting.
  100. eval "OPTIONS=( $GIT_PBUILDER_OPTIONS )"
  101. eval "PDEBUILDOPTS=( $GIT_PBUILDER_PDEBUILDOPTIONS )"
  102. OUTPUT_DIR="${GIT_PBUILDER_OUTPUT_DIR:-../}"
  103. # How we handle options depends on what type of builder we're using. Ignore
  104. # options if $GIT_PBUILDER_AUTOCONF is set to no.
  105. if [ no != "$GIT_PBUILDER_AUTOCONF" ]; then
  106. case $BUILDER in
  107. pbuilder)
  108. # The root directory where different pbuilder --basetgz files are
  109. # found. git-pbuilder expects them to be named base-<dist>.tgz.
  110. : ${PBUILDER_BASE:=/var/cache/pbuilder}
  111. # If DIST is set, use base-$DIST.tgz. If DIST is not set, the sid
  112. # chroot may be either base.tgz or base-sid.tgz. Try both. If
  113. # ARCH is set, use base-$DIST-$ARCH.tgz.
  114. : ${DIST:=sid}
  115. if [ -n "$ARCH" ] ; then
  116. BASE="$PBUILDER_BASE/base-$DIST$EXT-$ARCH.tgz"
  117. OPTIONS+=( --architecture "$ARCH" )
  118. elif [ "$DIST" = 'sid' ] ; then
  119. if [ -f "$PBUILDER_BASE/base-sid.tgz" ]; then
  120. BASE="$PBUILDER_BASE/base-sid.tgz"
  121. else
  122. BASE="$PBUILDER_BASE/base.tgz"
  123. fi
  124. else
  125. BASE="$PBUILDER_BASE/base-$DIST$EXT.tgz"
  126. fi
  127. OPTIONS+=( --basetgz "$BASE" )
  128. # Make sure the base tarball exists.
  129. if [ ! -f "$BASE" ] && [ "$1" != "create" ]; then
  130. echo "Base tarball $BASE does not exist" >&2
  131. exit 1
  132. fi
  133. # Set --debian-etch-workaround if DIST is etch. Assume that
  134. # everything else is new enough that it will be fine.
  135. if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ]; then
  136. OPTIONS+=( --debian-etch-workaround )
  137. fi
  138. ;;
  139. cowbuilder)
  140. # The root directory where different cowbuilder --basepath
  141. # directories are found. git-pbuilder expects them to be named
  142. # base-<dist>.cow.
  143. : ${COWBUILDER_BASE:=/var/cache/pbuilder}
  144. # If --basepath is specified on the command line we need to use
  145. # that and that alone, since if it's specified more than once,
  146. # cowbuilder will fail.
  147. bp_found=""
  148. for opt in $@; do
  149. case $opt in
  150. --basepath|--basepath=*) bp_found="yes" ;;
  151. esac
  152. done
  153. # If --basepath wasn't already provided, we need to set it. If
  154. # DIST is set, use base-$DIST.cow. If DIST is not set, the sid
  155. # chroot may be either base.cow or base-sid.cow. Try both. If
  156. # ARCH is set, use base-$DIST-$ARCH.cow.
  157. if [ -z "$bp_found" ]; then
  158. : ${DIST:=sid}
  159. if [ -n "$ARCH" ]; then
  160. BASE="$COWBUILDER_BASE/base-$DIST$EXT-$ARCH.cow"
  161. OPTIONS+=( --architecture "$ARCH" )
  162. elif [ "$DIST" = 'sid' ]; then
  163. if [ -d "$COWBUILDER_BASE/base-sid.cow" ] ; then
  164. BASE="$COWBUILDER_BASE/base-sid.cow"
  165. else
  166. BASE="$COWBUILDER_BASE/base.cow"
  167. fi
  168. else
  169. BASE="$COWBUILDER_BASE/base-$DIST$EXT.cow"
  170. fi
  171. OPTIONS+=( --basepath "$BASE" )
  172. # Make sure the base directory exists.
  173. if [ ! -d "$BASE" ] && [ "$1" != "create" ]; then
  174. echo "Base directory $BASE does not exist" >&2
  175. exit 1
  176. fi
  177. fi
  178. # Set --debian-etch-workaround if DIST is etch. Assume that
  179. # everything else is new enough that it will be fine.
  180. if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ]; then
  181. OPTIONS+=( --debian-etch-workaround )
  182. fi
  183. ;;
  184. qemubuilder)
  185. # There always has to be an architecture for qemubuilder, and it
  186. # doesn't make much sense to default to the current architecture.
  187. # There's probably no good default, but this one at least makes
  188. # some sense.
  189. : ${DIST:=sid}
  190. : ${ARCH:=armel}
  191. # There has to be a configuration file matching our distribution
  192. # and architecture.
  193. QEMUCONFIG="/var/cache/pbuilder/$BUILDER-$ARCH-$DIST$EXT.conf"
  194. if [ ! -r "$QEMUCONFIG" ]; then
  195. echo "Cannot read configuration file $QEMUCONFIG" >&2
  196. exit 1
  197. fi
  198. OPTIONS+=( --config "$QEMUCONFIG" )
  199. ;;
  200. *)
  201. echo "Unknown builder $BUILDER" >&2
  202. exit 1
  203. ;;
  204. esac
  205. fi
  206. # If the first argument to the script is update, create, or login (or
  207. # --update, --create, or --login), set the $action.
  208. case $1 in
  209. update|create|login)
  210. action="--$1"
  211. shift
  212. ;;
  213. --update|--create|--login)
  214. action="$1"
  215. shift
  216. ;;
  217. *)
  218. action=""
  219. ;;
  220. esac
  221. # If $action is set, run the builder for $action under sudo rather than
  222. # proceeding.
  223. if [ -n "$action" ]; then
  224. # Since we're running the builder under sudo, $HOME will change to root's
  225. # home directory and the user's .pbuilderrc won't be run. sudo -E would
  226. # fix this, but that requires special configuration in sudoers to allow
  227. # it. Instead, check if the user has a .pbuilderrc and, if so, explicitly
  228. # add it as a configuration file.
  229. if [ -f "$HOME/.pbuilderrc" ] ; then
  230. OPTIONS+=( --configfile "$HOME/.pbuilderrc" )
  231. fi
  232. # Check that sudo is installed and try to provide a useful error if it
  233. # is not.
  234. if ! which sudo >/dev/null 2>&1; then
  235. cat >&2 <<EOE
  236. git-pbuilder: sudo not found in $PATH
  237. sudo was not found in your path. You need to install the sudo package and
  238. allow the current user to invoke the builder via sudo.
  239. EOE
  240. exit 1
  241. fi
  242. # Run the builder.
  243. if [ no = "$GIT_PBUILDER_AUTOCONF" ] ; then
  244. set -x
  245. sudo "$BUILDER" "$action" "${OPTIONS[@]}" "$@"
  246. else
  247. if [ "$EXT" = '-backports' ] ; then
  248. OTHERMIRROR="deb $BACKPORTS $DIST$EXT main"
  249. set -x
  250. sudo "$BUILDER" "$action" --distribution "$DIST" \
  251. --othermirror "$OTHERMIRROR" "${OPTIONS[@]}" "$@"
  252. elif [ "$EXT" = '-lts' ] ; then
  253. OTHERMIRROR="deb $LTS $DIST$EXT main"
  254. set -x
  255. sudo "$BUILDER" "$action" --distribution "$DIST" \
  256. --othermirror "$OTHERMIRROR" "${OPTIONS[@]}" "$@"
  257. else
  258. set -x
  259. sudo "$BUILDER" "$action" --distribution "$DIST" \
  260. "${OPTIONS[@]}" "$@"
  261. fi
  262. fi
  263. { set +x; } 2>/dev/null
  264. exit 0
  265. fi
  266. # Build package: not (update | create | login)
  267. if [ -z "$GBP_BUILD_DIR" ]; then
  268. echo "Warning: git-pbuilder should be run via 'gbp buildpackage'" >&2
  269. fi
  270. # Print out some information about what we're doing.
  271. building="Building with $BUILDER"
  272. if [ no = "$GIT_PBUILDER_AUTOCONF" ] ; then
  273. echo "$building"
  274. elif [ -n "$ARCH" ] ; then
  275. echo "$building for distribution $DIST$EXT, architecture $ARCH"
  276. else
  277. echo "$building for distribution $DIST$EXT"
  278. fi
  279. # Source package format 1.0 doesn't automatically exclude Git files, so we
  280. # want to add the appropriate flags to do that. But source package format 3.0
  281. # does exclude by default and has many other ways of controlling those
  282. # exclusions that we don't want to tromp on. So we don't want to give any -i
  283. # or -I flags unless we're using source format 1.0.
  284. if [ ! -f debian/source/format ] || grep -qs '^1.0' debian/source/format ; then
  285. echo 'Source format 1.0 detected, adding exclude flags'
  286. DEBBUILDOPTS="-i'(?:^|/)\\.git(attributes)?(?:\$|/.*\$)' -I.git"
  287. else
  288. DEBBUILDOPTS=''
  289. fi
  290. # Add all of the additional arguments we got on the command line, but quote
  291. # them from the shell since they'll undergo another round of shell expansion
  292. # when the pbuilder runs debbuild.
  293. for arg in "$@" ; do
  294. DEBBUILDOPTS+=" $(shell_quote "$arg")"
  295. done
  296. # Now we can finally run pdebuild. The quoting here is tricky, but this
  297. # seems to pass everything through properly.
  298. if [ no = "$GIT_PBUILDER_AUTOCONF" ] ; then
  299. pdebuild --pbuilder "$BUILDER" --debbuildopts "$DEBBUILDOPTS" \
  300. "${PDEBUILDOPTS[@]}" -- "${OPTIONS[@]}"
  301. else
  302. pdebuild --buildresult "$OUTPUT_DIR" --pbuilder "$BUILDER" \
  303. --debbuildopts "$DEBBUILDOPTS" "${PDEBUILDOPTS[@]}" -- "${OPTIONS[@]}"
  304. fi
  305. exit "$?"
  306. # Documentation. Use a hack to hide this from the shell. Because of the
  307. # above exit line, this should never be executed.
  308. DOCS=<<__END_OF_DOCS__
  309. =head1 NAME
  310. git-pbuilder - Wrapper around cowbuilder/qemubuilder for gbp buildpackage
  311. =head1 SYNOPSIS
  312. DIST=I<distribution> ARCH=I<architecture> [BUILDER=(pbuilder|qemubuilder)] \
  313. B<git-pbuilder> I<debbuild-options>
  314. DIST=I<distribution> ARCH=I<architecture> [BUILDER=(pbuilder|qemubuilder)] \
  315. B<git-pbuilder> (update | create | login) I<cowbuilder-options>
  316. =head1 DESCRIPTION
  317. B<git-pbuilder> is a wrapper around B<pdebuild> intended for use by
  318. B<gbp buildpackage>. It configures B<pdebuild> to use B<cowbuilder> by
  319. default, passes appropriate options to B<debbuild>, and sets the base path
  320. for B<cowbuilder> based on the environment variable DIST and, if set, the
  321. environment variable ARCH. B<qemubuilder> can be selected instead by
  322. setting the environment variable BUILDER to C<qemubuilder>, and
  323. B<pbuilder> can be selected by setting BUILDER to C<pbuilder>.
  324. By default, B<git-pbuilder> assumes the target distribution is C<sid>, the
  325. same architecture as the B<cowbuilder> default, and uses
  326. F</var/cache/pbuilder/base-sid.cow> if it exists. If it doesn't,
  327. F</var/cache/pbuilder/base.cow> is tried. If DIST is set, its value is
  328. the target distribution and F</var/cache/pbuilder/base-I<dist>.cow> is
  329. used instead. If DIST is C<etch> or C<ebo>, B<--debian-etch-workaround>
  330. is also passed to B<cowbuilder>. If ARCH is set, its value is the target
  331. architecture and F</var/cache/pbuilder/base-I<dist>-I<arch>.cow> is used,
  332. with I<dist> being set to C<sid> if DIST was not set.
  333. If B<qemubuilder> is used as the builder, no base directory is used.
  334. Instead, B<qemubuilder> is invoked with the B<--config> option pointing to
  335. the file F</var/cache/pbuilder/qemubuilder-I<arch>-I<dist>.conf>
  336. If B<pbuilder> is used as the builder, B<git-pbuilder> instead looks for
  337. F</var/cache/pbuilder/base-sid.tgz> by default and
  338. F</var/cache/pbuilder/base.tgz> if it doesn't exist. If DIST or ARCH are
  339. set, they are used to form the expected name of the tgz file in the same
  340. way as they're used to form the expected base directory for B<cowbuilder>.
  341. Similar to B<cowbuilder>, B<--debian-etch-workaround> is passed to
  342. B<pbuilder> if from the DIST setting it looks like the target distribution
  343. is etch.
  344. If B<git-pbuilder> is invoked via a name that starts with C<git-*->, the
  345. part between the hyphens is taken to be the default name of the builder to
  346. use. However, C<pbuilder> is mapped to B<cowbuilder> for backward
  347. compatibility; if you want to use B<pbuilder>, you have to explicitly set
  348. BUILDER. The part after the last hyphen is taken to be the default
  349. distribution (if it contains no additional hyphen) or the default
  350. distribution followed by the default architecture (if it contains a
  351. hyphen). One can therefore create symlinks like C<git-pbuilder-squeeze>
  352. pointing to B<git-pbuilder> and use that name when wanting to use a
  353. distribution of C<squeeze>, or C<git-qemubuilder-sid-armel> to use
  354. B<qemubuilder> to build for the C<armel> architecture and the C<sid>
  355. distribution. Explicit settings of BUILDER, DIST, or ARCH always override
  356. any guesses from the command name. (But note that B<gbp buildpackage>
  357. does not pass on environment variables when run with B<--git-pbuilder>;
  358. see below.)
  359. Any arguments are passed as-is to B<dpkg-buildpackage> via the
  360. B<--debbuildopts> option to B<pdebuild>. To pass arguments to the builder
  361. instead, put them in the environment variable GIT_PBUILDER_OPTIONS.
  362. To disable all attempts to discover the base path, tarball, or
  363. configuration file and set up the pbuilder options and instead rely on the
  364. settings in .pbuilderrc, set GIT_PBUILDER_AUTOCONF to C<no>.
  365. Normally, one does not run this script directly. Instead, it's used as
  366. the builder script for B<gbp buildpackage> via the B<--git-pbuilder>
  367. command-line option. When run this way, you should use the B<--git-dist>,
  368. B<--git-arch>, B<--git-qemubuilder>, B<--git-pbuilder-autoconf>, and
  369. B<--git-pbuilder-options> flags instead of setting the DIST, ARCH, BUILDER,
  370. GIT_PBUILDER_AUTOCONF, and GIT_PBUILDER_OPTIONS environment variables. See
  371. L<gbp-buildpackage(1)> for more information.
  372. Alternately, B<git-pbuilder> may be called with an argument of C<update>,
  373. C<create>, or C<login>. In this case, it calls B<cowbuilder> (or the
  374. configured builder as described above) using B<sudo> and passes the
  375. corresponding command to the builder, using the same logic as above to
  376. determine the base directory and distribution. If the distribution (set
  377. in DIST) ends in C<-backports>, one of the following will be added as an
  378. B<--othermirror> parameter to the builder:
  379. deb http://ftp.debian.org/debian $DIST main
  380. deb http://backports.debian.org/debian-backports $DIST main
  381. The first will be used for most distributions, and the second for
  382. C<squeeze-backports>. If the distribution ends in C<-lts>, the following will
  383. be added as an B<--othermirror> parameter to the builder:
  384. deb http://ftp.debian.org/debian $DIST main
  385. to support building for Long Term Support releases.
  386. Any additional arguments to B<git-pbuilder> are passed along to the
  387. builder. Due to how B<sudo> works, invoking the builder with an action
  388. will not read the user's F<.pbuilderrc> by default, so in this case
  389. B<git-pbuilder> will add an explicit B<--configfile> option pointing to
  390. the user's F<.pbuilderrc> if it exists.
  391. If you use B<git-pbuilder> with one of these arguments, you must have
  392. the C<sudo> package installed, and you must configure B<sudo> to let the
  393. current user run the appropriate builder command.
  394. =head1 ENVIRONMENT
  395. =over 4
  396. =item ARCH
  397. Sets the target architecture. For a B<cowbuilder> builder, this sets both
  398. the base path and is passed as the B<--architecture> option. With
  399. B<qemubuilder>, this controls the path to the configuration file. With
  400. B<pbuilder>, this sets the tgz path and is passed as B<--architecture>.
  401. =item BUILDER
  402. Sets the builder to use. The only supported settings are C<cowbuilder>
  403. (the default), C<qemubuilder>, and C<pbuilder>.
  404. =item COWBUILDER_BASE
  405. Set this environment variable to change the default location for the
  406. cowbuilder base directories (F</var/cache/pbuilder>).
  407. =item DIST
  408. Sets the target distribution. This is used primarily to determine the
  409. base path for B<cowbuilder> or B<pbuilder> or the configuration file path
  410. for B<qemubuilder>, but it's also used to determine whether to pass
  411. B<--debian-etch-workaround> to B<cowbuilder> or B<pbuilder>.
  412. =item GIT_PBUILDER_AUTOCONF
  413. If set to C<no>, disable the logic that constructs the base path, tarball,
  414. or configuration file and all other logic to determine the options to pass
  415. to the builder. Instead, just run the configured builder and assume its
  416. configuration is handled elsewhere (such as in F<.pbuilderrc>). This also
  417. suppresses setting B<--buildresult>, so the user will need to ensure that
  418. the configuration still puts packages where B<gbp buildpackage> expects
  419. them.
  420. =item GIT_PBUILDER_OPTIONS
  421. Add additional options for the builder. These options are passed as-is to
  422. B<cowbuilder>, B<qemubuilder>, or B<pbuilder> via B<pdebuild>. The
  423. contents of this variable will undergo shell expansion, so any arguments
  424. containing shell metacharacters or whitespace need to be quoted in the
  425. value of the environment variable.
  426. =item GIT_PBUILDER_OUTPUT_DIR
  427. Where to put the result of the build. The default is C<..> (the parent
  428. directory). This setting is ignored if GIT_PBUILDER_AUTOCONF is set to
  429. C<no>.
  430. =item GIT_PBUILDER_PDEBUILDOPTIONS
  431. Add additional options for B<pdebuild> itself (such as
  432. B<--use-pdebuild-internal>). The contents of this variable will undergo
  433. shell expansion, so any arguments containing shell metacharacters or
  434. whitespace need to be quoted in the value of the environment variable.
  435. =item PBUILDER_BASE
  436. Set this environment variable to change the default location for the
  437. pbuilder tgz files (F</var/cache/pbuilder>) when BUILDER is set to
  438. C<pbuilder>.
  439. =back
  440. =head1 FILES
  441. =over 4
  442. =item /var/cache/pbuilder/base-sid.cow
  443. =item /var/cache/pbuilder/base.cow
  444. The default C<cowbuilder --basepath> directories, searched for in that
  445. order, if neither DIST nor ARCH is set.
  446. =item /var/cache/pbuilder/base-sid-$ARCH.cow
  447. The C<cowbuilder --basepath> directory used if ARCH is set and DIST is not
  448. set.
  449. =item /var/cache/pbuilder/base-$DIST.cow
  450. The C<cowbuilder --basepath> directory used if DIST is set and ARCH is
  451. not.
  452. =item /var/cache/pbuilder/base-$DIST-$ARCH.cow
  453. The C<cowbuilder --basepath> directory used if DIST and ARCH are both set.
  454. =item /var/cache/pbuilder/base-sid.tgz
  455. =item /var/cache/pbuilder/base.tgz
  456. =item /var/cache/pbuilder/base-sid-$ARCH.tgz
  457. =item /var/cache/pbuilder/base-$DIST.tgz
  458. =item /var/cache/pbuilder/base-$DIST-$ARCH.tgz
  459. Similar to the above, the C<pbuilder --basetgz> path used for various
  460. settings of DIST and ARCH if BUILDER is set to C<pbuilder>.
  461. =item /var/cache/pbuilder/qemubuilder-$ARCH-$DIST.conf
  462. The C<qemubuilder --config> file used. $ARCH defaults to C<armel> and
  463. $DIST defaults to C<sid> if not set.
  464. =back
  465. =head1 SEE ALSO
  466. cowbuilder(8), dpkg-buildpackage(1), gbp-buildpackage(1), pbuilder(8),
  467. pdebuild(1), qemubuilder(8), sudo(8)
  468. The latest version of this script is available from
  469. L<http://www.eyrie.org/~eagle/software/scripts/>.
  470. =head1 AUTHOR
  471. Russ Allbery <eagle@eyrie.org>
  472. =cut
  473. __END_OF_DOCS__