File tree Expand file tree Collapse file tree 6 files changed +40
-9
lines changed Expand file tree Collapse file tree 6 files changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,12 @@ TAG:=$(shell git --git-dir=$(SRC_PATH)/.git describe --tags --abbrev=0 --match "
2727VERSION: =$(shell echo `git --git-dir=$(SRC_PATH ) /.git describe --tags --long --match "v* " || echo "UNKNOWN"` | sed "s/^$(TAG ) -//")
2828BRANCH: =$(shell git --git-dir=$(SRC_PATH ) /.git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "UNKNOWN")
2929
30+ # strip illegal debian version string characters + illegal filename charachers
31+ DHBRANCH: =$(shell echo "$(BRANCH ) " | sed 's/[^-+.0-9a-zA-Z~]/-/g' )
32+
3033version :
3134 @if [ -d $( SRC_PATH) /" .git" ]; then \
32- echo " #define GPAC_GIT_REVISION \" $( VERSION) -$( BRANCH ) \" " > $(GITREV_PATH ) .new; \
35+ echo " #define GPAC_GIT_REVISION \" $( VERSION) -$( DHBRANCH ) \" " > $(GITREV_PATH ) .new; \
3336 if ! diff -q $( GITREV_PATH) $( GITREV_PATH) .new > /dev/null ; then \
3437 mv $(GITREV_PATH ) .new $(GITREV_PATH ) ; \
3538 fi ; \
@@ -349,9 +352,6 @@ endif
349352
350353ifeq ($(CONFIG_LINUX ) ,yes)
351354
352- # strip illegal debian version string characters
353- DHBRANCH: =$(shell echo "$(BRANCH ) " | sed 's/[^-+:.0-9a-zA-Z~]/-/g' )
354-
355355deb :
356356 git checkout -- debian/changelog
357357 fakeroot debian/rules clean
Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ version=`grep '#define GPAC_VERSION ' ../../include/gpac/version.h | cut -d '"'
77TAG=$( git describe --tags --abbrev=0 --match " v*" 2> /dev/null)
88REVISION=$( echo ` git describe --tags --long --match " v*" 2> /dev/null || echo " UNKNOWN" ` | sed " s/^$TAG -//" )
99BRANCH=$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo " UNKNOWN" )
10- rev=" $REVISION -$BRANCH "
10+
11+ # sanitize branch name for filenames
12+ DHBRANCH=$( echo " $BRANCH " | sed ' s/[^-+.0-9a-zA-Z~]/-/g' )
13+
14+ rev=" $REVISION -$DHBRANCH "
1115if [ " $rev " != " " ]
1216then
1317 sed ' s/<string>.*<\/string><!-- VERSION_REV_REPLACE -->/<string>' " $version " ' <\/string>/' ../../applications/gpac/ios-Info.plist > ../../applications/gpac/ios-Info.plist.new
Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ if [ -d ".git" ]; then
77TAG=$( git describe --tags --abbrev=0 --match " v*" 2>> gtmp)
88VERSION=$( echo ` git describe --tags --long --match " v*" 2>> gtmp || echo " UNKNOWN" ` | sed " s/^$TAG -//" )
99BRANCH=$( git rev-parse --abbrev-ref HEAD 2>> gtmp || echo " UNKNOWN" )
10- revision=" $VERSION -$BRANCH "
10+
11+ # sanitize branch name for filenames
12+ DHBRANCH=$( echo " $BRANCH " | sed ' s/[^-+.0-9a-zA-Z~]/-/g' )
13+
14+ revision=" $VERSION -$DHBRANCH "
1115
1216rm gtmp
1317
Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ REM execute git and check if the result if found within revision.h
5252for /f " delims=" %%a in ('git describe --tags --long --match " v*" ') do @ set VERSION = %%a
5353for /f " delims=" %%a in ('git describe --tags --abbrev^ =0 --match " v*" ') do @ set TAG = %%a -
5454for /f " delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @ set BRANCH = %%a
55+
56+ REM sanitize BRANCH for filename
57+ set " BRANCH = %BRANCH:/ =- % "
58+ set " BRANCH = %BRANCH:" =- % "
59+ set " BRANCH = %BRANCH:< =- % "
60+ set " BRANCH = %BRANCH:> =- % "
61+ set " BRANCH = %BRANCH:| =- % "
62+ set " BRANCH = %BRANCH:@ =- % "
63+
64+
5565REM remove anotated tag from VERSION
5666setlocal enabledelayedexpansion
5767call set VERSION = %% VERSION:!TAG! =%%
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ cp $source_path/COPYING ./tmpdmg
4040mkdir -p tmpdmg/GPAC.app/Contents/MacOS/modules
4141mkdir -p tmpdmg/GPAC.app/Contents/MacOS/lib
4242
43- cp bin/gcc/gm* tmpdmg/GPAC.app/Contents/MacOS/modules
44- cp bin/gcc/gf_* tmpdmg/GPAC.app/Contents/MacOS/modules
43+ cp bin/gcc/gm* tmpdmg/GPAC.app/Contents/MacOS/modules || true
44+ cp bin/gcc/gf_* tmpdmg/GPAC.app/Contents/MacOS/modules || true
4545cp bin/gcc/libgpac.dylib tmpdmg/GPAC.app/Contents/MacOS/lib
4646if [ -f bin/gcc/libopenhevc.1.dylib ]; then
4747 cp bin/gcc/libopenhevc.1.dylib tmpdmg/GPAC.app/Contents/MacOS/lib
@@ -83,7 +83,11 @@ cd $source_path
8383TAG=$( git describe --tags --abbrev=0 --match " v*" 2> /dev/null)
8484REVISION=$( echo ` git describe --tags --long --match " v*" 2> /dev/null || echo " UNKNOWN" ` | sed " s/^$TAG -//" )
8585BRANCH=$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo " UNKNOWN" )
86- rev=" $REVISION -$BRANCH "
86+
87+ # sanitize branch name for filenames
88+ DHBRANCH=$( echo " $BRANCH " | sed ' s/[^-+.0-9a-zA-Z~]/-/g' )
89+
90+ rev=" $REVISION -$DHBRANCH "
8791cd $cur_dir
8892
8993full_version=$version
Original file line number Diff line number Diff line change @@ -7,6 +7,15 @@ IF NOT EXIST .\.git\NUL GOTO not_git
77for /f " delims=" %%a in ('git describe --tags --long --match " v*" ') do @ set VERSION = %%a
88for /f " delims=" %%a in ('git describe --tags --abbrev^ =0 --match " v*" ') do @ set TAG = %%a -
99for /f " delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @ set BRANCH = %%a
10+
11+ REM sanitize BRANCH for filename
12+ set " BRANCH = %BRANCH:/ =- % "
13+ set " BRANCH = %BRANCH:" =- % "
14+ set " BRANCH = %BRANCH:< =- % "
15+ set " BRANCH = %BRANCH:> =- % "
16+ set " BRANCH = %BRANCH:| =- % "
17+ set " BRANCH = %BRANCH:@ =- % "
18+
1019REM remove anotated tag from VERSION
1120setlocal enabledelayedexpansion
1221call set VERSION = %% VERSION:!TAG! =%%
You can’t perform that action at this time.
0 commit comments