Otherwise we end up printing two `--- srcpath = ...' lines in the common
`checkout' case, which is just silly.
Instead:
* set `$srcpath' in the `checkout' stanza, either pointing the new
tree or back at the original one; and
* use `$topath' for the original source tree until we've established
`$srcpath'.
cd ..
done
assign toppath $(pwd)
cd ..
done
assign toppath $(pwd)
## Build any necessary qualifiers.
qual= sep=.
## Build any necessary qualifiers.
qual= sep=.
esac
## Construct the output directory.
esac
## Construct the output directory.
-assign releasepath $srcpath/dist-$build$qual
+assign releasepath $toppath/dist-$build$qual
chmod -R +w $releasepath 2>/dev/null || :
rm -rf $releasepath 2>/dev/null || :
mkdir $releasepath
chmod -R +w $releasepath 2>/dev/null || :
rm -rf $releasepath 2>/dev/null || :
mkdir $releasepath
esac
## Do we have a Git repository?
esac
## Do we have a Git repository?
-case "$checkout,$setup,$(yesno [ -d $srcpath/.git ])" in
+case "$checkout,$setup,$(yesno [ -d $toppath/.git ])" in
yes,no,*)
fail "Inconsistent options: can't check out without setup."
;;
yes,no,*)
fail "Inconsistent options: can't check out without setup."
;;
checkout=no gitver=none
;;
yes,yes,yes)
checkout=no gitver=none
;;
yes,yes,yes)
[ "$(git ls-files -m)" = "" ] ||
warn "working tree has uncommitted changes"
;;
esac
## Is there Debian build equipment?
[ "$(git ls-files -m)" = "" ] ||
warn "working tree has uncommitted changes"
;;
esac
## Is there Debian build equipment?
-case "$debian,$(yesno [ -d $srcpath/debian ])" in
+case "$debian,$(yesno [ -d $toppath/debian ])" in
yes,no)
info "No debian directory found."
debian=no debver=none
yes,no)
info "No debian directory found."
debian=no debver=none
case "$checkout" in
yes)
cd $releasepath
case "$checkout" in
yes)
cd $releasepath
- run git clone -sn $srcpath/.git _source
+ run git clone -sn $toppath/.git _source
assign srcpath $releasepath/_source
cd $srcpath
run git update-ref refs/heads/mdw-build $checkoutrev ""
assign srcpath $releasepath/_source
cd $srcpath
run git update-ref refs/heads/mdw-build $checkoutrev ""
run git checkout-index -afu
assign gitversion "$(git describe --abbrev=4)"
;;
run git checkout-index -afu
assign gitversion "$(git describe --abbrev=4)"
;;
+ no)
+ assign srcpath $toppath
+ ;;
esac
## Check the version number.
esac
## Check the version number.