Skip to content

Commit

Permalink
build: avoid problems with autogen.sh runs from tarball
Browse files Browse the repository at this point in the history
Introduced by commit fac97c6 distributing cfg.mk, which
previously could blindly assume it was in a git checkout.

* cfg.mk (_update_required): Also check for .git.
* autogen.sh: Don't run bootstrap from a tarball.
Reported by Daniel Veillard.
  • Loading branch information
ebblake committed Feb 12, 2011
1 parent 117b2a6 commit 3a97fa2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
27 changes: 15 additions & 12 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ THEDIR=`pwd`
cd "$srcdir"

test -f src/libvirt.c || {
echo "You must run this script in the top-level libvirt directory"
exit 1
echo "You must run this script in the top-level libvirt directory"
exit 1
}


Expand Down Expand Up @@ -52,16 +52,19 @@ bootstrap_hash()
# Also, running 'make rpm' tends to litter the po/ directory, and some people
# like to run 'git clean -x -f po' to fix it; but only ./bootstrap regenerates
# the required file po/Makevars.
curr_status=.git-module-status
t=$(bootstrap_hash; git diff .gnulib)
if test "$t" = "$(cat $curr_status 2>/dev/null)" \
&& test -f "po/Makevars"; then
# good, it's up to date, all we need is autoreconf
autoreconf -if
else
echo running bootstrap$no_git...
./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \
|| { echo "Failed to bootstrap, please investigate."; exit 1; }
# Only run bootstrap from a git checkout, never from a tarball.
if test -d .git; then
curr_status=.git-module-status
t=$(bootstrap_hash; git diff .gnulib)
if test "$t" = "$(cat $curr_status 2>/dev/null)" \
&& test -f "po/Makevars"; then
# good, it's up to date, all we need is autoreconf
autoreconf -if
else
echo running bootstrap$no_git...
./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \
|| { echo "Failed to bootstrap, please investigate."; exit 1; }
fi
fi

cd "$THEDIR"
Expand Down
1 change: 1 addition & 0 deletions cfg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ ifeq (0,$(MAKELEVEL))
_submodule_hash = sed 's/^[ +-]//;s/ .*//'
_update_required := $(shell \
cd '$(srcdir)'; \
test -d .git || { echo 0; exit; }; \
test -f po/Makevars || { echo 1; exit; }; \
actual=$$(git submodule status | $(_submodule_hash); \
git hash-object bootstrap.conf; \
Expand Down

0 comments on commit 3a97fa2

Please sign in to comment.