mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Create better version numbering for Windows
I don't think this will be a problem for the other OSs, but it needs a bit more testing, especially on the Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									0e0d6135af
								
							
						
					
					
						commit
						2b8043b82b
					
				
					 3 changed files with 23 additions and 7 deletions
				
			
		|  | @ -29,7 +29,7 @@ case $os in | ||||||
| 	linux) | 	linux) | ||||||
| 		v=$v0 | 		v=$v0 | ||||||
| 		;; | 		;; | ||||||
| 	darwin|win) | 	darwin) | ||||||
| 		# just the dots in the version string - this way we can | 		# just the dots in the version string - this way we can | ||||||
| 		# count them | 		# count them | ||||||
| 		IFS=. | 		IFS=. | ||||||
|  | @ -42,15 +42,30 @@ case $os in | ||||||
| 		# do we need to add another digit? | 		# do we need to add another digit? | ||||||
| 		# We know there are 1 or 2 dots in $v, so if it's just one | 		# We know there are 1 or 2 dots in $v, so if it's just one | ||||||
| 		# or we are trying to get to 4, add one digit | 		# or we are trying to get to 4, add one digit | ||||||
| 		if [ $dots -eq 1 ] || [ $os = win ]; then | 		if [ $dots -eq 1 ]; then | ||||||
| 			if [ $# -gt 1 ]; then | 			if [ $# -gt 1 ]; then | ||||||
| 				v=$v.$2 | 				v=$v.$2 | ||||||
| 			else | 			else | ||||||
| 				v=$v.0 | 				v=$v.0 | ||||||
| 			fi | 			fi | ||||||
| 		fi | 		fi | ||||||
| 		# and if it was just one dot and we want 4, at another 0 | 		;; | ||||||
| 		if [ $dots -eq 1 ] && [ $os = win ]; then | 	full|win) | ||||||
|  | 		# just the dots in the version string - this way we can | ||||||
|  | 		# count them | ||||||
|  | 		IFS=. | ||||||
|  | 		set -- $v0		# split $v0 using $IFS separator | ||||||
|  | 		dots=$(($# - 1))	# use positional argument count | ||||||
|  | 		# split version string using a '-' separator | ||||||
|  | 		IFS=- | ||||||
|  | 		set -- $v0 | ||||||
|  | 		v=$1 | ||||||
|  | 		if [ $dots -eq 1 ]; then | ||||||
|  | 			v=$v.0 | ||||||
|  | 		fi | ||||||
|  | 		if [ $# -gt 1 ]; then | ||||||
|  | 			v=$v.$2 | ||||||
|  | 		else | ||||||
| 			v=$v.0 | 			v=$v.0 | ||||||
| 		fi | 		fi | ||||||
| 		;; | 		;; | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ exists(.git/HEAD): { | ||||||
| 	VERSION_SCRIPT = $$PWD/scripts/get-version | 	VERSION_SCRIPT = $$PWD/scripts/get-version | ||||||
| 	# always use linux here -------------------vvv	so we get the true full version | 	# always use linux here -------------------vvv	so we get the true full version | ||||||
| 	FULL_VERSION = "`$$VERSION_SCRIPT linux`" | 	FULL_VERSION = "`$$VERSION_SCRIPT linux`" | ||||||
|  | 	VERSION = $$system("sh scripts/get-version full || echo $${VERSION}") | ||||||
| 	PRODVERSION_STRING = $$system("sh scripts/get-version win $$FULL_VERSION || echo $${VERSION}.0.0-git") | 	PRODVERSION_STRING = $$system("sh scripts/get-version win $$FULL_VERSION || echo $${VERSION}.0.0-git") | ||||||
| 	VERSION_STRING = $$system("sh scripts/get-version linux $$FULL_VERSION || echo $${VERSION}-git") | 	VERSION_STRING = $$system("sh scripts/get-version linux $$FULL_VERSION || echo $${VERSION}-git") | ||||||
| 	version_h.depends = $$VERSION_SCRIPT $$PWD/.git/$$system("$$SET_GIT_DIR=$$PWD/.git git rev-parse --symbolic-full-name HEAD") | 	version_h.depends = $$VERSION_SCRIPT $$PWD/.git/$$system("$$SET_GIT_DIR=$$PWD/.git git rev-parse --symbolic-full-name HEAD") | ||||||
|  |  | ||||||
|  | @ -334,9 +334,9 @@ DEPLOYMENT_PLUGIN += iconengines/qsvgicon | ||||||
| #DEPLOYMENT_PLUGIN += sqldrivers/qsqlite | #DEPLOYMENT_PLUGIN += sqldrivers/qsqlite | ||||||
| 
 | 
 | ||||||
| # This information will go into the Windows .rc file and linked into the .exe | # This information will go into the Windows .rc file and linked into the .exe | ||||||
| QMAKE_TARGET_COMPANY = subsurface team | QMAKE_TARGET_COMPANY = Subsurface Team | ||||||
| QMAKE_TARGET_DESCRIPTION = subsurface dive log | QMAKE_TARGET_DESCRIPTION = Subsurface Dive Log | ||||||
| QMAKE_TARGET_COPYRIGHT = Linus Torvalds, Dirk Hohndel and others | QMAKE_TARGET_COPYRIGHT = Linus Torvalds, Dirk Hohndel, Tomaz Canabrava and others | ||||||
| 
 | 
 | ||||||
| # And this is the Mac Info.plist file | # And this is the Mac Info.plist file | ||||||
| # qmake automatically generates sed rules to replace: | # qmake automatically generates sed rules to replace: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue