Patchwork build: don't clean __version__.py on 'make clean' in release tarballs

login
register
mail settings
Submitter Thomas De Schampheleire
Date Sept. 2, 2014, 11:34 a.m.
Message ID <0ac369b4cf23edb414a3.1409657673@localhost>
Download mbox | patch
Permalink /patch/5680/
State Accepted
Headers show

Comments

Thomas De Schampheleire - Sept. 2, 2014, 11:34 a.m.
# HG changeset patch
# User J. Lewis Muir <jlmuir@anl.gov>
# Date 1409650124 -7200
#      Tue Sep 02 11:28:44 2014 +0200
# Node ID 0ac369b4cf23edb414a362df3a44d957a08ebd56
# Parent  90cf454edd709c616d1e5ea4f30fb4d02f0c01a4
build: don't clean __version__.py on 'make clean' in release tarballs

When running 'make clean' in an extracted release tarball, file
mercurial/__version__.py is removed, causing a subsequent install to
indicate 'version unknown'.

This problem was reported in the past [1] and a patch proposed in that mail,
but was never properly sent nor applied.

[1] http://selenic.com/pipermail/mercurial/2010-December/036249.html
Augie Fackler - Sept. 9, 2014, 4:30 p.m.
On Tue, Sep 02, 2014 at 01:34:33PM +0200, Thomas De Schampheleire wrote:
> # HG changeset patch
> # User J. Lewis Muir <jlmuir@anl.gov>
> # Date 1409650124 -7200
> #      Tue Sep 02 11:28:44 2014 +0200
> # Node ID 0ac369b4cf23edb414a362df3a44d957a08ebd56
> # Parent  90cf454edd709c616d1e5ea4f30fb4d02f0c01a4
> build: don't clean __version__.py on 'make clean' in release tarballs

Patch looks good, queued, thanks.

>
> When running 'make clean' in an extracted release tarball, file
> mercurial/__version__.py is removed, causing a subsequent install to
> indicate 'version unknown'.
>
> This problem was reported in the past [1] and a patch proposed in that mail,
> but was never properly sent nor applied.
>
> [1] http://selenic.com/pipermail/mercurial/2010-December/036249.html
>
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -56,7 +56,8 @@
>       find contrib doc hgext i18n mercurial tests \
>               \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
>       rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py)))
> -	rm -f MANIFEST MANIFEST.in mercurial/__version__.py hgext/__index__.py tests/*.err
> +	rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
> +	if test -d .hg; then rm -f mercurial/__version__.py; fi
>       rm -rf build mercurial/locale
>       $(MAKE) -C doc clean
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,8 @@ 
 	find contrib doc hgext i18n mercurial tests \
 		\( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
 	rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py)))
-	rm -f MANIFEST MANIFEST.in mercurial/__version__.py hgext/__index__.py tests/*.err
+	rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
+	if test -d .hg; then rm -f mercurial/__version__.py; fi
 	rm -rf build mercurial/locale
 	$(MAKE) -C doc clean