| 136 | # convert a floating point version to an rpm-style one |
| 137 | proc convert_version {vers} { |
| 138 | set index [string first . $vers] |
| 139 | if {$index == -1} { |
| 140 | return $vers |
| 141 | } |
| 142 | set ret [string range $vers 0 [expr $index - 1]] |
| 143 | incr index |
| 144 | set fractional [string range $vers $index end] |
| 145 | set index 0 |
| 146 | while {$index < [string length $fractional] || $index < 6} { |
| 147 | set sub [string range $fractional $index [expr $index + 2]] |
| 148 | if {[string length $sub] < 3} { |
| 149 | append sub [string repeat "0" [expr 3 - [string length $sub]]] |
| 150 | } |
| 151 | append ret ".[scan $sub %u]" |
| 152 | incr index 3 |
| 153 | } |
| 154 | return $ret |
| 155 | } |