Quantcast

[PATCH] Protect vgversion.h in a tarball from getting deleted by make clean

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] Protect vgversion.h in a tarball from getting deleted by make clean

Matthias Schwarzott
Create a file vgversion_dist.h in the tarball.
This file is not deleted by make clean
Change auxprogs/make_or_upd_vgversion_h to use vgversion_dist.h if it is
available.
Add some missing quotes to auxprogs/make_or_upd_vgversion_h
---
 Makefile.am                      |  2 +-
 auxprogs/make_or_upd_vgversion_h | 13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ea87cc187..fdce3cf9f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,7 +117,7 @@ EXTRA_DIST = \
  autogen.sh
 
 dist-hook: include/vgversion.h
- cp -p include/vgversion.h $(distdir)/include/vgversion.h
+ cp -p include/vgversion.h $(distdir)/include/vgversion_dist.h
 
 dist_noinst_SCRIPTS = \
  vg-in-place
diff --git a/auxprogs/make_or_upd_vgversion_h b/auxprogs/make_or_upd_vgversion_h
index 6bfe6799d..cacbce314 100755
--- a/auxprogs/make_or_upd_vgversion_h
+++ b/auxprogs/make_or_upd_vgversion_h
@@ -14,16 +14,21 @@ extract_svn_version()
     fi    
 }
 
-srcdir=${1:-.}
+srcdir="${1:-.}"
 
-cat > include/vgversion.h.tmp <<EOF
+if [ -e "$srcdir"/include/vgversion_dist.h ]
+then
+    cp "$srcdir"/include/vgversion_dist.h include/vgversion.h.tmp
+else
+    cat > include/vgversion.h.tmp <<EOF
 /* Do not edit: file generated by auxprogs/make_or_upd_vgversion_h.
    This file defines VGSVN and VEXSVN, used to report SVN revision
    when using command line options:  -v --version
 */
-#define VGSVN "$(extract_svn_version $srcdir/.)"
-#define VEXSVN "$(extract_svn_version $srcdir/VEX)"
+#define VGSVN "$(extract_svn_version "$srcdir/.")"
+#define VEXSVN "$(extract_svn_version "$srcdir/VEX")"
 EOF
+fi
 
 if [ -f include/vgversion.h ]
 then
--
2.13.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Protect vgversion.h in a tarball from getting deleted by make clean

Mark Wielaard-3
On Thu, 2017-05-18 at 07:12 +0200, Matthias Schwarzott wrote:
> Create a file vgversion_dist.h in the tarball.
> This file is not deleted by make clean
> Change auxprogs/make_or_upd_vgversion_h to use vgversion_dist.h if it is
> available.
> Add some missing quotes to auxprogs/make_or_upd_vgversion_h

Thanks that looks good and should make sure the vgversion is always
there in a dist tar ball. And it survived a make distcheck.

Committed as valgrind svn r16398

Cheers,

Mark

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers
Loading...