mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-09 19:50:25 +03:00
sbopkg: Fix bug in updates_compare_versions()
The loop index $i was not protected with curly braces in eval statement of variable LEFT. When i=10 that statement was not evaluated as $10, but as $1 concatenated with the digit 0. Corrected description of outputs of updates_compare_versions(). Fixed #41. Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
parent
b86719b883
commit
c24c2dd5d6
@ -92,3 +92,4 @@ We moved to github, so revision number no longer used
|
|||||||
Loki Harfagr
|
Loki Harfagr
|
||||||
Alan
|
Alan
|
||||||
Erich Ritz
|
Erich Ritz
|
||||||
|
arcctgx
|
||||||
|
@ -971,14 +971,14 @@ updates_compare_versions() {
|
|||||||
# 1.2.50 build 4, the argument list is
|
# 1.2.50 build 4, the argument list is
|
||||||
# 1 2 3 7 1 2 50 4
|
# 1 2 3 7 1 2 50 4
|
||||||
# Prints -1 if the "left" package is newer (not an update), 0 if
|
# Prints -1 if the "left" package is newer (not an update), 0 if
|
||||||
# the version is unchanged, 1 if the "left" package is newer.
|
# the version is unchanged, 1 if the "left" package is older.
|
||||||
|
|
||||||
local COUNT=$(($# / 2))
|
local COUNT=$(($# / 2))
|
||||||
local i RESULT=0
|
local i RESULT=0
|
||||||
local LEFT RIGHT
|
local LEFT RIGHT
|
||||||
|
|
||||||
for ((i=1; i<=$COUNT; i++)); do
|
for ((i=1; i<=$COUNT; i++)); do
|
||||||
eval LEFT=\$$i
|
eval LEFT=\${$i}
|
||||||
eval RIGHT=\${$(($i + $COUNT))}
|
eval RIGHT=\${$(($i + $COUNT))}
|
||||||
if [[ 10#$LEFT -lt 10#$RIGHT ]]; then
|
if [[ 10#$LEFT -lt 10#$RIGHT ]]; then
|
||||||
RESULT=1
|
RESULT=1
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
SBOPKG NEWS
|
SBOPKG NEWS
|
||||||
|
|
||||||
sbopkg-dev (2018-04-25 10:27:24 UTC)
|
sbopkg-dev (2018-04-26 00:253:36 UTC)
|
||||||
FEATURES
|
FEATURES
|
||||||
* sqg: Parallelize building of single and all packages by option -j.
|
* sqg: Parallelize building of single and all packages by option -j.
|
||||||
Patch by Marcel Saegebarth.
|
Patch by Marcel Saegebarth.
|
||||||
@ -35,6 +35,8 @@ sbopkg-dev (2018-04-25 10:27:24 UTC)
|
|||||||
Patch by Alan
|
Patch by Alan
|
||||||
* Use correct SlackBuild file name to build package
|
* Use correct SlackBuild file name to build package
|
||||||
Patch by Erich Ritz
|
Patch by Erich Ritz
|
||||||
|
* Fix bug in updates_compare_versions()
|
||||||
|
Patch by arcctgx (#41)
|
||||||
|
|
||||||
sbopkg 0.38.1 (2016-09-01 13:42 UTC)
|
sbopkg 0.38.1 (2016-09-01 13:42 UTC)
|
||||||
FEATURES
|
FEATURES
|
||||||
|
Loading…
Reference in New Issue
Block a user