[PATCH v2 util-modular] release.sh: create a worktree structure that's out of reach of libtool
Peter Hutterer
peter.hutterer at who-t.net
Thu Mar 9 10:49:47 UTC 2017
On Thu, Mar 09, 2017 at 09:37:52AM +0000, Eric Engestrom wrote:
> On Thursday, 2017-03-09 08:23:24 +1000, Peter Hutterer wrote:
> > The comment in the diff says it all, we need to put our worktree root at least
> > two directories away from our normal checkout because most repos don't have
> > AC_CONFIG_AUX_DIR() set.
> >
> > This fixes the issue of release.sh failing in git trees that haven't been git
> > cleaned:
> >
> > ERROR: files left in build directory after distclean:
> > ./config.sub
> > ./test-driver
> > ./ltmain.sh
> > ./config.guess
> > ./install-sh
> > ./missing
> > ./depcomp
> > ./compile
> > make[1]: *** [distcleancheck] Error 1
> > make: *** [distcheck] Error 1
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> > Changes to v1:
> > - now with new and improved typos :)
> > - add note about AC_CONFIG_AUX_DIR
> > - change path to release/$section/, section is the only thing we have
> > available this early
> >
> > release.sh | 15 ++++++++++++++-
> > 1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/release.sh b/release.sh
> > index c824dea..0e9261b 100755
> > --- a/release.sh
> > +++ b/release.sh
> > @@ -357,13 +357,26 @@ process_module() {
> > return 1
> > fi
> >
> > + # If AC_CONFIG_AUX_DIR isn't set, libtool will search down to ../.. for
> > + # install-sh and then just guess that's the aux dir, dumping config.sub
> > + # and other files into that directory. make distclean then complains
> > + # about leftover files. So let's put our real module dir out of reach of
> > + # libtool.
> > + #
> > + # We use release/$section/$build_dir because git worktree will pick the
> > + # last part as branch identifier, so it needs to be random to avoid
> > + # conflicts.
> > + build_dir="release/$section"
> > + mkdir -p "$build_dir"
> > +
> > # Create tmpdir for the release
> > - build_dir=`mktemp -d -p . build.XXXXXXXXXX`
> > + tmpdir=`mktemp -d -p . build.XXXXXXXXXX`
>
> I'm pretty sure that should be `-p "$build_dir"` :P
>
> And the output already contains `-p`, so this line should read:
> build_dir=`mktemp -d -p "$build_dir" build.XXXXXXXXXX`
>
> > if [ $? -ne 0 ]; then
> > echo "Error: could not create a temporary directory for the release"
> > echo "Do you have coreutils' mktemp ?"
> > return 1
> > fi
> > + build_dir="$build_dir/$tmpdir"
>
> And this line should be dropped.
oops. my tests didn't notice this because it worked anyway :)
diff squashed in is:
diff --git a/release.sh b/release.sh
index 256f669..2eae4a5 100755
--- a/release.sh
+++ b/release.sh
@@ -370,13 +370,12 @@ process_module() {
mkdir -p "$build_dir"
# Create tmpdir for the release
- tmpdir=`mktemp -d -p . build.XXXXXXXXXX`
+ builddir=`mktemp -d -p "$build_dir" build.XXXXXXXXXX`
if [ $? -ne 0 ]; then
echo "Error: could not create a temporary directory for the release"
echo "Do you have coreutils' mktemp ?"
return 1
fi
- build_dir="$build_dir/$tmpdir"
# Worktree removal is intentionally left to the user, due to:
# - currently we cannot select only one worktree to prune
> With that, the patch is:
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
thanks!
Cheers,
Peter
More information about the xorg-devel
mailing list