Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=641d6c1590e7fddf008a3128585a9bd15418050b

commit 641d6c1590e7fddf008a3128585a9bd15418050b
Author: Michel Hermier <[EMAIL PROTECTED]>
Date:   Tue Nov 13 17:51:55 2007 +0100

utils.sh
* Fsort now use versort when available.

diff --git a/source/include/util.sh b/source/include/util.sh
index 73f2220..b05e3c8 100644
--- a/source/include/util.sh
+++ b/source/include/util.sh
@@ -676,9 +676,15 @@ Facu() {

###
# * Fsort(): Similar to sort, but handles versions (i.e. 1.9 vs 1.10 vs 2.0)
-# correctly. Uses vercmp from pacman. Reads the version list from stdin.
+# correctly. Uses versort from pacman. Reads the version list from stdin.
+# Uses vercmp from pacman when versort is not found.
###
Fsort() {
+       if [ -x /usr/bin/versort ]; then
+               /usr/bin/versort
+       else
+
+       # Deprecated method of sorting, it's too much slow
local i= items= left=0
items=( `cat|tr '\n' ' '` )
while [[ ${left} -lt [EMAIL PROTECTED] ]] ; do
@@ -695,6 +701,8 @@ Fsort() {
left=$(( ${left} + 1 ))
done
echo [EMAIL PROTECTED]|sed 's/ /\n/g'
+
+       fi
}

###
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to