]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- changed method of removing leading 0s after .
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 6 May 2003 13:03:53 +0000 (13:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  (previous caused conversion to string type and broke comparisons)

Changed files:
    pldnotify.awk -> 1.32

pldnotify.awk

index c58a0f7184537a338acda50892c47d7296df64ee..f6fbd5bd7b90a2d9e5366c86587a622cc336887f 100644 (file)
@@ -16,6 +16,8 @@ function compare_ver(v1,v2) {
                v2=(substr(v2,1,RSTART) "." substr(v2,RSTART+RLENGTH-1))
        sub("^0*","",v1)
        sub("^0*","",v2)
+       gsub("\.0*",".",v1)
+       gsub("\.0*",".",v2)
        if (DEBUG) print "v1 == " v1
        if (DEBUG) print "v2 == " v2
        count=split(v1,v1a,"\.")
@@ -25,8 +27,6 @@ function compare_ver(v1,v2) {
        else mincount=count2
        
        for (i=1; i<=mincount; i++) {
-               sub("^0*","",v1a[i])
-               sub("^0*","",v2a[i])
                if (v1a[i]=="") v1a[i]=0
                if (v2a[i]=="") v2a[i]=0
                if (DEBUG) print "i == " i
This page took 0.029666 seconds and 4 git commands to generate.