summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-26 11:08:45 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-26 13:00:46 +0100
commitdbee6afd429a8cf4136a040d95ea10fe3a38520e (patch)
treea92cf86619ebe523a632d0071a6e7b06a8b80bc2 /tests
parent42d2e3ec03b634c5719700c5bcfb27f0f652d74c (diff)
dgit: build_source mostly uses a playtree, not $maindir
In particular, it uses a playtree unless we are trying to include uncommitted changes in the source package (which is not supported in split brain mode). This change allows build_source to respect $buildproductsdir. It will also enable, later, building a source package from HEAD, or arbitrary git ref, when the working tree is dirty. This change also requires modifying build_prep to only conditionally clean $maindir. It should clean $maindir only when it's $maindir that we're packing into a source package, or when we are running any builder in $maindir. When we are using a playtree we must build the changes file there too, because dpkg-genchanges cannot be persuaded to look for the .dsc anywhere but ../. Right now build-source still cleans the tree needlessly. We need to change the test suite to not expect a clean unless running a builder: dgit now cleans the tree only when including uncommitted changes in a source package, and when running a builder in $maindir. The code in lib-build-modes does not test the including of uncommitted changes in a source package. Thus, it should expect the tree to be cleaned only when running a builder. Also, we need to not expect a clean with sbuild, for the same reason. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib-build-modes26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/lib-build-modes b/tests/lib-build-modes
index cf9f6cd..6465b61 100644
--- a/tests/lib-build-modes
+++ b/tests/lib-build-modes
@@ -120,7 +120,31 @@ bm-compute-expected () {
exec 4>$bmexp
echo >&4 "$heading"
- case $cleanmode in
+ local eff_cleanmode=$cleanmode
+
+ case "$e_targets" in
+ *[^\ ]*)
+ ;;
+ *)
+ # dgit won't bother cleaning the tree
+ # if no build is going to be run
+ eff_cleanmode=none
+ ;;
+ esac
+
+ case "$act" in
+ sbuild*)
+ # dgit sbuild won't bother cleaning the tree
+ # because it doesn't need to to make a .dsc for sbuild
+ eff_cleanmode=none
+ ;;
+ esac
+
+ # we are running the builder in-tree ?
+ # when we have --include-dirty, we will want to check
+ # that too and reset eff_cleanmode to $cleanmode
+
+ case $eff_cleanmode in
git) echo >&4 'BUILD-MODES PROGRAM git clean -xdf' ;;
git-ff) echo >&4 'BUILD-MODES PROGRAM git clean -xdff' ;;
check) echo >&4 'BUILD-MODES PROGRAM git clean -xdn' ;;