Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 8fe210f

Browse files
wiiaboorillian
authored andcommitted
genversion.bat: generate same version as update_version
Remove version.mk and references to it in the repo. genversion.bat will now generate the same version strings as update_version script, i.e. without 'v' prefix and without a fallback if git archive is used. If run from a release tarball it'll use package_version, like configure. If run from a git repo, it will use the same 'git describe' with '-dirty' as update_version. Signed-off-by: Ralph Giles <[email protected]>
1 parent bd54e27 commit 8fe210f

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ opus_custom_demo_LDADD = libopus.la $(LIBM)
157157
endif
158158
endif
159159

160-
EXTRA_DIST = version.mk \
161-
opus.pc.in \
160+
EXTRA_DIST = opus.pc.in \
162161
opus-uninstalled.pc.in \
163162
opus.m4 \
164163
Makefile.mips \

doc/release.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
- Check for uncommitted changes to master.
66
- Update OPUS_LT_* API versioning in configure.ac.
7-
- Update the version in version.mk
87
- Tag the release commit with 'git tag -s vN.M'.
98
- Include release notes in the tag annotation.
109
- Verify 'make distcheck' produces a tarball with

version.mk

Lines changed: 0 additions & 2 deletions
This file was deleted.

win32/genversion.bat

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,30 @@
22

33
setlocal enableextensions enabledelayedexpansion
44

5-
for /f %%v in ('git --git-dir="%~dp0..\.git" describe --tags --match "v*"') do set version=%%v
5+
for /f %%v in ('cd "%~dp0.." ^&^& git status ^>NUL 2^>NUL ^&^& git describe --tags --match "v*" --dirty 2^>NUL') do set version=%%v
66

7-
if not "%version%"=="" goto :gotversion
7+
if not "%version%"=="" set version=!version:~1! && goto :gotversion
88

9-
if exist "%~dp0..\version.mk" goto :getversion
9+
if exist "%~dp0..\package_version" goto :getversion
1010

11-
echo Git cannot be found, nor can version.mk. Generating unknown version.
11+
echo Git cannot be found, nor can package_version. Generating unknown version.
1212

1313
set version=unknown
1414

1515
goto :gotversion
1616

1717
:getversion
1818

19-
for /f "delims== tokens=2" %%v in (%~dps0..\version.mk) do set version=%%v
20-
21-
set version=!version:^"=!
22-
set version=!version: =!
19+
for /f "delims== tokens=2" %%v in (%~dps0..\package_version) do set version=%%v
20+
set version=!version:"=!
2321

2422
:gotversion
2523

24+
set version=!version: =!
2625
set version_out=#define %~2 "%version%"
27-
set version_mk=%~2 = "%version%"
2826

2927
echo %version_out%> "%~1_temp"
3028

31-
if %version%==unknown goto :skipgenerate
32-
33-
echo # static version string; update manually every release.> "%~dp0..\version.mk"
34-
echo %version_mk%>> "%~dp0..\version.mk"
35-
36-
:skipgenerate
37-
3829
echo n | comp "%~1_temp" "%~1" > NUL 2> NUL
3930

4031
if not errorlevel 1 goto exit

0 commit comments

Comments
 (0)