CPackRPM: remove unneeded string length calculation
This wants just the rest of the string, which can be achieved by passing -1 as remainder length.
This commit is contained in:
parent
0b3b54e21f
commit
5cc8169bf9
|
@ -683,9 +683,7 @@ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC
|
||||||
# Transform NAME --> Name e.g. PROVIDES --> Provides
|
# Transform NAME --> Name e.g. PROVIDES --> Provides
|
||||||
# The Upper-case first letter and lowercase tail is the
|
# The Upper-case first letter and lowercase tail is the
|
||||||
# appropriate value required in the final RPM spec file.
|
# appropriate value required in the final RPM spec file.
|
||||||
string(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
|
string(SUBSTRING ${_RPM_SPEC_HEADER} 1 -1 _PACKAGE_HEADER_TAIL)
|
||||||
math(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
|
|
||||||
string(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
|
|
||||||
string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
|
string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
|
||||||
string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
|
string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
|
||||||
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
|
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
|
||||||
|
|
Loading…
Reference in New Issue