Skip to content

Commit

Permalink
Added a error when attempt to create a distribution on a sub directory
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Oct 14, 2014
1 parent 494f9a4 commit 504f81a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ install: installdirs
$(POST_INSTALL) # Post-install commands follow.

dist: FORCE
$(fn_remove_dist_archive)
$(fn_pre_dist)
dir='$(srcdir)' && $(fn_append_files_to_dist_archive) \
$(notdir $(INSTALL_DOCS))
$(fn_finalize_dist_archive)
$(fn_post_dist)

installdirs:
$(INSTALL) -d '$(DESTDIR)$(docdir)'
15 changes: 13 additions & 2 deletions bootstrap.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,21 @@ maintainer-clean-generic:
@echo 'deletes files that may need special tools to rebuild.'


fn_remove_dist_archive = rm -f '$(DIST_ARCHIVE)'
fn_top_pre_dist = \
test x"$(builddir)" = x"$(top_builddir)" || { \
echo "ERROR: cannot create a distribution on a sub directory"; \
echo ' $$ cd $(top_builddir) && make dist'; \
exit 1; \
} >&2

fn_pre_dist = \
@$(fn_top_pre_dist); \
echo 'rm -f $(DIST_ARCHIVE)'; \
rm -f '$(DIST_ARCHIVE)'

fn_append_files_to_dist_archive = tar -C $$dir -rf '$(DIST_ARCHIVE)' --transform s,'^','$(distdir)/',

fn_finalize_dist_archive = \
fn_post_dist = \
@echo 'dir="$(srcdir)" && $(fn_append_files_to_dist_archive)'; \
echo ' Makefile.in'; \
dir='$(srcdir)' && $(fn_append_files_to_dist_archive) \
Expand Down Expand Up @@ -258,6 +268,7 @@ fn_titlelize = { sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'; }
distdir="$(distdir)/$$subdir" \
fn_finalize_top_dist_archive=':' \
TOP_DISTCLEAN_FILES='' \
fn_top_pre_dist=':' \
; \
done;

Expand Down
4 changes: 2 additions & 2 deletions doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ install: all installdirs
$(POST_INSTALL) # Post-install commands follow.

dist: FORCE
$(fn_remove_dist_archive)
$(fn_pre_dist)
dir='$(srcdir)' && $(fn_append_files_to_dist_archive) \
man.1
$(fn_finalize_dist_archive)
$(fn_post_dist)

$(builddir)/$(PACKAGE)$(man1ext).gz: $(srcdir)/man.1
gzip -c $^ > $@
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ installcheck: install
cd '$(DESTDIR)$(pkglibdir)' && $(PYTHON) $(PYTHONFLAGS) $(TEST_SCRIPT) $(ARGUMENTS)

dist: $(srcdir)/setup.py FORCE
$(fn_remove_dist_archive)
$(fn_pre_dist)
rm -rf $(srcdir)/build
$(PYTHON) $(PYTHONFLAGS) $(srcdir)/setup.py build
dir='$(srcdir)/build/lib' && $(fn_append_files_to_dist_archive) \
Expand All @@ -65,7 +65,7 @@ dist: $(srcdir)/setup.py FORCE
main.in \
postinstall.sh.in \
setup.py.in
$(fn_finalize_dist_archive)
$(fn_post_dist)

$(builddir)/$(PACKAGE): $(srcdir)/main.in
cat $^ \
Expand Down
4 changes: 2 additions & 2 deletions tools/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ install: all installdirs
$(POST_INSTALL) # Post-install commands follow.

dist: FORCE
$(fn_remove_dist_archive)
$(fn_pre_dist)
dir='$(srcdir)' && $(fn_append_files_to_dist_archive) \
completion.bash
$(fn_finalize_dist_archive)
$(fn_post_dist)

$(builddir)/$(PACKAGE): $(srcdir)/completion.bash
cp $^ $@

0 comments on commit 504f81a

Please sign in to comment.