Don't delete *_source.changes on source only builds
authorGuido Günther <agx@sigxcpu.org>
Tue, 26 Aug 2014 09:08:27 +0000 (11:08 +0200)
committerGuido Günther <agx@sigxcpu.org>
Tue, 26 Aug 2014 09:08:27 +0000 (11:08 +0200)
Closes: #758726
bin/git-pbuilder

index 4024d124b604eb8fe78ea8cf3cbfdb091ffbd912..37ffe67b79cda49c51e132b0f0f13bc521f1fcc9 100644 (file)
@@ -265,6 +265,7 @@ fi
 # them from the shell since they'll undergo another round of shell expansion
 # when the pbuilder runs debbuild.
 for arg in "$@" ; do
+    [ "$arg" != "-S" ] || source_only=true
     DEBBUILDOPTS+=" $(shell_quote "$arg")"
 done
 
@@ -278,7 +279,7 @@ else
         --debbuildopts "$DEBBUILDOPTS" -- "${OPTIONS[@]}"
 fi
 status="$?"
-if [ -n "`ls ../*_source.changes`" ] ; then
+if [ -n "`ls ../*_source.changes`" -a $source_only != 'true' ] ; then
     rm ../*_source.changes
 fi
 exit "$status"