mirror of
https://github.com/xiph/opus.git
synced 2025-06-01 16:17:42 +00:00
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 <giles@thaumas.net>
This commit is contained in:
parent
bd54e279d5
commit
8fe210f14b
4 changed files with 8 additions and 21 deletions
|
@ -2,13 +2,13 @@
|
|||
|
||||
setlocal enableextensions enabledelayedexpansion
|
||||
|
||||
for /f %%v in ('git --git-dir="%~dp0..\.git" describe --tags --match "v*"') do set version=%%v
|
||||
for /f %%v in ('cd "%~dp0.." ^&^& git status ^>NUL 2^>NUL ^&^& git describe --tags --match "v*" --dirty 2^>NUL') do set version=%%v
|
||||
|
||||
if not "%version%"=="" goto :gotversion
|
||||
if not "%version%"=="" set version=!version:~1! && goto :gotversion
|
||||
|
||||
if exist "%~dp0..\version.mk" goto :getversion
|
||||
if exist "%~dp0..\package_version" goto :getversion
|
||||
|
||||
echo Git cannot be found, nor can version.mk. Generating unknown version.
|
||||
echo Git cannot be found, nor can package_version. Generating unknown version.
|
||||
|
||||
set version=unknown
|
||||
|
||||
|
@ -16,25 +16,16 @@ goto :gotversion
|
|||
|
||||
:getversion
|
||||
|
||||
for /f "delims== tokens=2" %%v in (%~dps0..\version.mk) do set version=%%v
|
||||
|
||||
set version=!version:^"=!
|
||||
set version=!version: =!
|
||||
for /f "delims== tokens=2" %%v in (%~dps0..\package_version) do set version=%%v
|
||||
set version=!version:"=!
|
||||
|
||||
:gotversion
|
||||
|
||||
set version=!version: =!
|
||||
set version_out=#define %~2 "%version%"
|
||||
set version_mk=%~2 = "%version%"
|
||||
|
||||
echo %version_out%> "%~1_temp"
|
||||
|
||||
if %version%==unknown goto :skipgenerate
|
||||
|
||||
echo # static version string; update manually every release.> "%~dp0..\version.mk"
|
||||
echo %version_mk%>> "%~dp0..\version.mk"
|
||||
|
||||
:skipgenerate
|
||||
|
||||
echo n | comp "%~1_temp" "%~1" > NUL 2> NUL
|
||||
|
||||
if not errorlevel 1 goto exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue