summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2017-01-19 19:30:10 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-01-27 12:13:26 +1000
commitb5cffea256d8e2832c683a7231b92de126e99158 (patch)
treeb36c036e1d79088f153b42b57e7a0363375c394e
parentf16477858bce32449f462bf38226923cc711d82b (diff)
release.sh: implement around git worktree
Months ago, before my work in here there the script had a number of assumptions: - autoreconf or alike is ran by the user - slight nuisance esp. when releasing multiple packages. - the generated files were compatible with the ones on the server - rarely and issue, but still - config.status means 'all the autotools bits were generated correctly' - failed to consider if user has multiple config.status - using ./build-64bit/ and ./build-32bit/ anyone ? - ... With 663364cda5e316a0509ff5869293e3a815b9945f we mitigated a lot of that but did not consider - forcing people to `git clean' is annoying and if not careful one can purge local files that they want to keep - the files generated by autotools were left behind In order to mitigate those use git worktree. This is more efficient [both bandwidth and storage wise] than pulling/generating git tarballs, git clone and friends. Cc: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rwxr-xr-xrelease.sh34
1 files changed, 19 insertions, 15 deletions
diff --git a/release.sh b/release.sh
index fcf2a82..e0209bc 100755
--- a/release.sh
+++ b/release.sh
@@ -357,25 +357,24 @@ process_module() {
return 1
fi
- if [ -e configure ]; then
- echo "Error: the git repository contains configure"
- echo "Did you forget to run git clean -fXd (and git clean -fxd) ?"
- return 1
- fi
-
- # Create tmpdir for the build
+ # Create tmpdir for the release
build_dir=`mktemp -d -p . build.XXXXXXXXXX`
if [ $? -ne 0 ]; then
- echo "Error: could not create a temporary directory for the build."
+ echo "Error: could not create a temporary directory for the release"
echo "Do you have coreutils' mktemp ?"
return 1
fi
- echo "Info: generating configure."
- autoreconf --force --install >/dev/null
+ # Worktree removal is intentionally left to the user, due to:
+ # - currently we cannot select only one worktree to prune
+ # - requires to removal of $build_dir which might contradict with the
+ # user decision to keep some artefacts like tarballs or other
+ echo "Info: creating new git worktree."
+ git worktree add $build_dir
if [ $? -ne 0 ]; then
- echo "Error: failed to generate configure."
- return 1
+ echo "Error: failed to create a git worktree."
+ cd $top_src
+ return 1
fi
cd $build_dir
@@ -385,9 +384,14 @@ process_module() {
return 1
fi
- # Using ../ here feels a bit nasty, yet $top_src is an absolute path. Thus
- # it will get propagated in the generated sources, which we do not want.
- ../configure >/dev/null
+ echo "Info: generating configure."
+ autoreconf --force --install >/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error: failed to generate configure."
+ return 1
+ fi
+
+ ./configure >/dev/null
if [ $? -ne 0 ]; then
echo "Error: failed to configure module."
cd $top_src