Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (298a53df5e22d764bd0ca8d8ce84a052ff5ac9d7)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Ismael Luceno (298a53df5e22d764bd0ca8d8ce84a052ff5ac9d7)
  • Date: Mon, 5 Jan 2015 12:25:16 -0600

GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:

ChangeLog | 1 +
var/lib/sorcery/modules/libqueue | 18 +++++++++---------
2 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 298a53df5e22d764bd0ca8d8ce84a052ff5ac9d7
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

Update ChangeLog about libqueue version-comparison changes

commit de21a1b6ad60b683fd95a7303561307ee371ec32
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libqueue: Give more descriptive names to version comparison functions

diff --git a/ChangeLog b/ChangeLog
index 2205d2a..54436c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
2015-01-04 Ismael Luceno <ismael AT sourcemage.org>
* dl_axel: Added alternative http/https/ftp download handler
+ * libqueue: Improved version comparison, no automatic downgrades

2014-12-26 Ismael Luceno <ismael AT sourcemage.org>
* excluded: Ignore site-lisp's loaddefs.el
diff --git a/var/lib/sorcery/modules/libqueue
b/var/lib/sorcery/modules/libqueue
index 4a0ad40..f86dfb2 100755
--- a/var/lib/sorcery/modules/libqueue
+++ b/var/lib/sorcery/modules/libqueue
@@ -145,9 +145,9 @@ function find_security_updates() {
} ' > $tmp_queue 2> $recheck_queue
}

-awk_vercmp='
+awk_version_compare='
function max(a, b) { return a > b ? a : b }
- function vercmp(v1, v2, i, a, b) {
+ function version_cmp(v1, v2, i, a, b) {
v1 = max(split(v1, a, /[-_.:]/), split(v2, b, /[-_.:]/))
for (i = 1; i <= v1; i++)
if (v2 = a[i] - b[i])
@@ -155,10 +155,10 @@ awk_vercmp='
return v2
}
'
-function vercmpgt() {
- awk "$awk_vercmp"'
+function version_compare_gt() {
+ awk "$awk_version_compare"'
BEGIN {
- exit !(vercmp(ARGV[1], ARGV[2]) > 0)
+ exit !(version_cmp(ARGV[1], ARGV[2]) > 0)
}
' "$@"
}
@@ -171,7 +171,7 @@ function find_updates() {
local tmp_queue=$1
local recheck_queue=$2

- awk -v i=$VERSION_STATUS -v verbose=$VERBOSE_QUEUING "$awk_vercmp"'
+ awk -v i=$VERSION_STATUS -v verbose=$VERBOSE_QUEUING
"$awk_version_compare"'
# decide what to print - just the spell or also the reason
function needs_update( reasons, diff) {
if (verbose == "on") {
@@ -184,7 +184,7 @@ function find_updates() {
reasons = reasons " Security update."
}
}
- if (vercmp($2, factor[2]) < 0) {
+ if (version_cmp($2, factor[2]) < 0) {
reasons = reasons " New version (" factor[2] ")."
}
if ($3 < factor[3] ) {
@@ -197,7 +197,7 @@ function find_updates() {
print $1, reasons
}
} else {
- if (vercmp($2, factor[2]) < 0 || $3 < factor[3] || $4 < factor[4] ||
$5 < factor[5]) {
+ if (version_cmp($2, factor[2]) < 0 || $3 < factor[3] || $4 <
factor[4] || $5 < factor[5]) {
print $1
}
}
@@ -268,7 +268,7 @@ function does_spell_need_update_slow() {
message="$message Security update."
fi
fi
- if vercmpgt $VERSION $curr_version; then
+ if version_compare_gt $VERSION $curr_version; then
message="$message New version ($VERSION)."
fi
if (( "${PATCHLEVEL:-0}" > "$curr_patchlevel" )); then



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (298a53df5e22d764bd0ca8d8ce84a052ff5ac9d7), Ismael Luceno, 01/05/2015

Archive powered by MHonArc 2.6.24.

Top of Page