From 1c8a3d87dad358848493e59dd62310646913cb44 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Fri, 30 Dec 2016 12:20:24 +0000 Subject: [PATCH] -12, fix pkgver git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3450 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- webif/lib/pkg.class | 11 ++++++++--- webif/lib/test/pkgver | 5 ++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index c022dde..83596e5 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.3.4-11 +Version: 1.3.4-12 Architecture: mipsel Maintainer: af123@hpkg.tv Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.5),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1) diff --git a/webif/lib/pkg.class b/webif/lib/pkg.class index 59dbe99..14a1ec8 100755 --- a/webif/lib/pkg.class +++ b/webif/lib/pkg.class @@ -235,8 +235,13 @@ proc {pkg upgrade} {nm} { proc {pkg vercompare} {v1 v2} { if {$v1 eq $v2} { return 0 } - lassign [split $v1 -] v1 r1 - lassign [split $v2 -] v2 r2 + if {![regexp {^(.*)-([^-]+)$} $v1 x v1 r1]} { + lassign [split $v1 -] v1 r1 + } + + if {![regexp {^(.*)-([^-]+)$} $v2 x v2 r2]} { + lassign [split $v2 -] v2 r2 + } foreach a [split $v1 .] b [split $v2 .] { if {$b eq "" || $a > $b} { return 1 } @@ -244,6 +249,6 @@ proc {pkg vercompare} {v1 v2} { } if {$r2 eq "" || $r1 > $r2} { return 1 } if {$r1 eq "" || $r2 > $r1} { return -1 } - return 0 + return [string compare $v1 $v2] } diff --git a/webif/lib/test/pkgver b/webif/lib/test/pkgver index f6fd56e..1e75996 100755 --- a/webif/lib/test/pkgver +++ b/webif/lib/test/pkgver @@ -12,6 +12,9 @@ set verlist { 1.0-1 1.0 1 1.0 1.0-1 -1 2 1.0.1 1 + 2010-365-4 2010-365-5 -1 + 2010-365-5 2010-365-4 1 + 2010-365-5 2010-365-5 0 } foreach {a b e} $verlist { @@ -19,7 +22,7 @@ foreach {a b e} $verlist { if {$ret eq $e} { puts " OK $a $b ($e)" } else { - puts "BAD $a $b ($e)" + puts "BAD $a $b ($e / $ret)" } }