]> Repos - portaudio/commitdiff
PA_GIT_REVISION: new scripts to replace SVN revision
authorPhil Burk <philburk@mobileer.com>
Tue, 6 Sep 2016 00:03:27 +0000 (17:03 -0700)
committerPhil Burk <philburk@mobileer.com>
Tue, 6 Sep 2016 00:03:27 +0000 (17:03 -0700)
update_gitrevision.sh should be run before building on Mac or Linux.

clear_gitrevision.sh [new file with mode: 0755]
clear_svnrevision.sh [deleted file]
examples/paex_sine.c
src/common/pa_front.c
src/common/pa_gitrevision.h [new file with mode: 0644]
src/common/pa_svnrevision.h [deleted file]
update_gitrevision.sh [new file with mode: 0755]
update_svnrevision.sh [deleted file]

diff --git a/clear_gitrevision.sh b/clear_gitrevision.sh
new file mode 100755 (executable)
index 0000000..b1b087c
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# Clear the Git commit SHA in the include file.
+# This should be run before checking in code to Git.
+#
+revision_filename=src/common/pa_gitrevision.h
+
+# Update the include file with the current GIT revision.
+echo "#define PA_GIT_REVISION unknown" > ${revision_filename}
+
+echo ${revision_filename} now contains
+cat ${revision_filename}
diff --git a/clear_svnrevision.sh b/clear_svnrevision.sh
deleted file mode 100755 (executable)
index 2501630..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-#
-# Clear the SVN revision in the include file.
-# This should be run before checking in code to SVN.
-#
-revision_filename=src/common/pa_svnrevision.h
-
-# Update the include file with the current SVN revision.
-echo "#define PA_SVN_REVISION unknown" > ${revision_filename}
-
-echo ${revision_filename} now contains
-cat ${revision_filename}
index ed4cb52156a07294d26efcd53ccbd503aa8dfb3b..86bf31bdc396eb06f145345e4e2a170a576c73a5 100644 (file)
@@ -113,8 +113,9 @@ int main(void)
     paTestData data;
     int i;
 
-    
+
     printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER);
+    printf("%s\n", Pa_GetVersionText());
     
     /* initialise sinusoidal wavetable */
     for( i=0; i<TABLE_SIZE; i++ )
index 2cd9c54dbe983a3ed4575388ff3a770d8d8d3742..4ebf5d7922bf52c7368d1c6e6ef453d94dd7b29a 100644 (file)
@@ -77,8 +77,8 @@
 #include "pa_trace.h" /* still usefull?*/
 #include "pa_debugprint.h"
 
-#ifndef PA_SVN_REVISION
-#include "pa_svnrevision.h"
+#ifndef PA_GIT_REVISION
+#include "pa_gitrevision.h"
 #endif
 
 /**
 #define TOSTRING(x) STRINGIFY(x)
 
 #define PA_VERSION_STRING_ TOSTRING(paVersionMajor) "." TOSTRING(paVersionMinor) "." TOSTRING(paVersionSubMinor)
-#define PA_VERSION_TEXT_   "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_SVN_REVISION)
+#define PA_VERSION_TEXT_   "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_GIT_REVISION)
 
 int Pa_GetVersion( void )
 {
@@ -126,7 +126,7 @@ static PaVersionInfo versionInfo_ = {
     /*.versionMajor =*/ paVersionMajor,
     /*.versionMinor =*/ paVersionMinor,
     /*.versionSubMinor =*/ paVersionSubMinor,
-    /*.versionControlRevision =*/ TOSTRING(PA_SVN_REVISION),
+    /*.versionControlRevision =*/ TOSTRING(PA_GIT_REVISION),
     /*.versionText =*/ PA_VERSION_TEXT_
 };
 
diff --git a/src/common/pa_gitrevision.h b/src/common/pa_gitrevision.h
new file mode 100644 (file)
index 0000000..7d47425
--- /dev/null
@@ -0,0 +1 @@
+#define PA_GIT_REVISION unknown
diff --git a/src/common/pa_svnrevision.h b/src/common/pa_svnrevision.h
deleted file mode 100644 (file)
index c3a1313..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define PA_SVN_REVISION unknown
diff --git a/update_gitrevision.sh b/update_gitrevision.sh
new file mode 100755 (executable)
index 0000000..80d4f3b
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Write the Git commit SHA to an include file.
+# This should be run before compiling code on Linux or Macintosh.
+#
+revision_filename=src/common/pa_gitrevision.h
+
+# Run git first to make sure it is installed before corrupting the
+# include file.
+git rev-parse HEAD
+
+# Update the include file with the current Git revision.
+echo -n "#define PA_GIT_REVISION " > ${revision_filename}
+git rev-parse HEAD >> ${revision_filename}
+
+echo ${revision_filename} now contains
+cat ${revision_filename}
diff --git a/update_svnrevision.sh b/update_svnrevision.sh
deleted file mode 100755 (executable)
index 7a4631a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-#
-# Write the SVN revision to an include file.
-# This should be run before compiling code on Linux or Macintosh.
-#
-revision_filename=src/common/pa_svnrevision.h
-
-# Run svnversion first to make sure it is installed before corrupting the
-# include file.
-svnversion .
-
-# Update the include file with the current SVN revision.
-echo -n "#define PA_SVN_REVISION " > ${revision_filename}
-svnversion . >> ${revision_filename}
-
-echo ${revision_filename} now contains
-cat ${revision_filename}