Browse Source

PA_GIT_REVISION: new scripts to replace SVN revision

update_gitrevision.sh should be run before building on Mac or Linux.
tags/pa_stable_v190600_20161030
Phil Burk 2 years ago
parent
commit
a553478d71

+ 12
- 0
clear_gitrevision.sh View File

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+#
3
+# Clear the Git commit SHA in the include file.
4
+# This should be run before checking in code to Git.
5
+#
6
+revision_filename=src/common/pa_gitrevision.h
7
+
8
+# Update the include file with the current GIT revision.
9
+echo "#define PA_GIT_REVISION unknown" > ${revision_filename}
10
+
11
+echo ${revision_filename} now contains
12
+cat ${revision_filename}

+ 0
- 12
clear_svnrevision.sh View File

@@ -1,12 +0,0 @@
1
-#!/bin/bash
2
-#
3
-# Clear the SVN revision in the include file.
4
-# This should be run before checking in code to SVN.
5
-#
6
-revision_filename=src/common/pa_svnrevision.h
7
-
8
-# Update the include file with the current SVN revision.
9
-echo "#define PA_SVN_REVISION unknown" > ${revision_filename}
10
-
11
-echo ${revision_filename} now contains
12
-cat ${revision_filename}

+ 2
- 1
examples/paex_sine.c View File

@@ -113,8 +113,9 @@ int main(void)
113 113
     paTestData data;
114 114
     int i;
115 115
 
116
-    
116
+
117 117
     printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER);
118
+    printf("%s\n", Pa_GetVersionText());
118 119
     
119 120
     /* initialise sinusoidal wavetable */
120 121
     for( i=0; i<TABLE_SIZE; i++ )

+ 4
- 4
src/common/pa_front.c View File

@@ -77,8 +77,8 @@
77 77
 #include "pa_trace.h" /* still usefull?*/
78 78
 #include "pa_debugprint.h"
79 79
 
80
-#ifndef PA_SVN_REVISION
81
-#include "pa_svnrevision.h"
80
+#ifndef PA_GIT_REVISION
81
+#include "pa_gitrevision.h"
82 82
 #endif
83 83
 
84 84
 /**
@@ -110,7 +110,7 @@
110 110
 #define TOSTRING(x) STRINGIFY(x)
111 111
 
112 112
 #define PA_VERSION_STRING_ TOSTRING(paVersionMajor) "." TOSTRING(paVersionMinor) "." TOSTRING(paVersionSubMinor)
113
-#define PA_VERSION_TEXT_   "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_SVN_REVISION)
113
+#define PA_VERSION_TEXT_   "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_GIT_REVISION)
114 114
 
115 115
 int Pa_GetVersion( void )
116 116
 {
@@ -126,7 +126,7 @@ static PaVersionInfo versionInfo_ = {
126 126
     /*.versionMajor =*/ paVersionMajor,
127 127
     /*.versionMinor =*/ paVersionMinor,
128 128
     /*.versionSubMinor =*/ paVersionSubMinor,
129
-    /*.versionControlRevision =*/ TOSTRING(PA_SVN_REVISION),
129
+    /*.versionControlRevision =*/ TOSTRING(PA_GIT_REVISION),
130 130
     /*.versionText =*/ PA_VERSION_TEXT_
131 131
 };
132 132
 

+ 1
- 0
src/common/pa_gitrevision.h View File

@@ -0,0 +1 @@
1
+#define PA_GIT_REVISION unknown

+ 0
- 1
src/common/pa_svnrevision.h View File

@@ -1 +0,0 @@
1
-#define PA_SVN_REVISION unknown

+ 17
- 0
update_gitrevision.sh View File

@@ -0,0 +1,17 @@
1
+#!/bin/bash
2
+#
3
+# Write the Git commit SHA to an include file.
4
+# This should be run before compiling code on Linux or Macintosh.
5
+#
6
+revision_filename=src/common/pa_gitrevision.h
7
+
8
+# Run git first to make sure it is installed before corrupting the
9
+# include file.
10
+git rev-parse HEAD
11
+
12
+# Update the include file with the current Git revision.
13
+echo -n "#define PA_GIT_REVISION " > ${revision_filename}
14
+git rev-parse HEAD >> ${revision_filename}
15
+
16
+echo ${revision_filename} now contains
17
+cat ${revision_filename}

+ 0
- 17
update_svnrevision.sh View File

@@ -1,17 +0,0 @@
1
-#!/bin/bash
2
-#
3
-# Write the SVN revision to an include file.
4
-# This should be run before compiling code on Linux or Macintosh.
5
-#
6
-revision_filename=src/common/pa_svnrevision.h
7
-
8
-# Run svnversion first to make sure it is installed before corrupting the
9
-# include file.
10
-svnversion .
11
-
12
-# Update the include file with the current SVN revision.
13
-echo -n "#define PA_SVN_REVISION " > ${revision_filename}
14
-svnversion . >> ${revision_filename}
15
-
16
-echo ${revision_filename} now contains
17
-cat ${revision_filename}

Loading…
Cancel
Save