[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-167-g32f2239

Ville Skyttä ville.skytta at iki.fi
Wed May 30 20:59:04 UTC 2012


The following commit has been merged in the master branch:
commit 32f223963a013e4875c999109c0a2fa8f9a0ecdf
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed May 30 23:56:58 2012 +0300

    _realcommand: Try greadlink before readlink (Alioth: #313659).
    
    Some systems' readlink does not have -f, but may have the GNU readlink
    which does installed as greadlink.

diff --git a/bash_completion b/bash_completion
index e26df45..dea0fd4 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1274,6 +1274,8 @@ _realcommand()
     type -P "$1" > /dev/null && {
         if type -p realpath > /dev/null; then
             realpath "$(type -P "$1")"
+        elif type -p greadlink > /dev/null; then
+            greadlink -f "$(type -P "$1")"
         elif type -p readlink > /dev/null; then
             readlink -f "$(type -P "$1")"
         else
diff --git a/test/lib/library.exp b/test/lib/library.exp
index b223325..75bf921 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -799,6 +799,8 @@ proc realcommand {cmd} {
     if [string length [set path [auto_execok $cmd]]] {
         if {[string length [auto_execok realpath]]} {
             set result [exec realpath $path]
+        } elseif {[string length [auto_execok greadlink]]} {
+            set result [exec greadlink -f $path]
         } elseif {[string length [auto_execok readlink]]} {
             set result [exec readlink -f $path]
         } else {

-- 
bash-completion



More information about the Bash-completion-commits mailing list