[112130] trunk/dports/devel/hub

raimue at macports.org raimue at macports.org
Sat Oct 12 05:41:28 PDT 2013


Revision: 112130
          https://trac.macports.org/changeset/112130
Author:   raimue at macports.org
Date:     2013-10-12 05:41:28 -0700 (Sat, 12 Oct 2013)
Log Message:
-----------
devel/hub:
Make the bash-completion script work with bash-completion >= 2.0

Modified Paths:
--------------
    trunk/dports/devel/hub/Portfile

Added Paths:
-----------
    trunk/dports/devel/hub/files/
    trunk/dports/devel/hub/files/patch-bash-completion.diff

Modified: trunk/dports/devel/hub/Portfile
===================================================================
--- trunk/dports/devel/hub/Portfile	2013-10-12 12:36:16 UTC (rev 112129)
+++ trunk/dports/devel/hub/Portfile	2013-10-12 12:41:28 UTC (rev 112130)
@@ -5,6 +5,7 @@
 PortGroup           github 1.0
 
 github.setup        defunkt hub 1.10.6 v
+revision            1
 description         git-wrapper for GitHub specific functionality
 long_description    hub is a command line utility which adds GitHub knowledge to git.\
                     It can be used on its own or as a git wrapper.
@@ -16,6 +17,8 @@
 
 homepage            http://defunkt.io/hub/
 
+patchfiles          patch-bash-completion.diff
+
 checksums           rmd160  3904600cb58a3d895c373b4faecd73b774f4722d \
                     sha256  096b86ed9dd83db4bab5f10679feaac017f31aad11fb081b3607405a35e93711
 
@@ -33,9 +36,9 @@
 destroot.cmd        rake
 destroot.args       prefix=${destroot}${prefix}
 post-destroot {
-    set bash-completions ${destroot}${prefix}/etc/bash_completion.d
+    set bash-completions ${destroot}${prefix}/share/bash-completion/completions
     xinstall -d ${bash-completions}
-    xinstall ${worksrcpath}/etc/hub.bash_completion.sh ${destroot}${prefix}/etc/bash_completion.d/hub
+    xinstall ${worksrcpath}/etc/hub.bash_completion.sh ${bash-completions}/hub
     set site-functions ${destroot}${prefix}/share/zsh/site-functions
     xinstall -d ${site-functions}
     xinstall ${worksrcpath}/etc/hub.zsh_completion ${site-functions}/

Added: trunk/dports/devel/hub/files/patch-bash-completion.diff
===================================================================
--- trunk/dports/devel/hub/files/patch-bash-completion.diff	                        (rev 0)
+++ trunk/dports/devel/hub/files/patch-bash-completion.diff	2013-10-12 12:41:28 UTC (rev 112130)
@@ -0,0 +1,44 @@
+--- etc/hub.bash_completion.sh.orig	2013-10-11 17:03:50.000000000 +0200
++++ etc/hub.bash_completion.sh	2013-10-12 14:24:47.000000000 +0200
+@@ -1,15 +1,16 @@
+ # hub tab-completion script for bash.
+ # This script complements the completion script that ships with git.
+ 
+-# Check that git tab completion is available
+-if declare -F _git > /dev/null; then
+-  # Duplicate and rename the 'list_all_commands' function
+-  eval "$(declare -f __git_list_all_commands | \
+-        sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
++# Ensure that git tab completion is available
++_xfunc git __git_list_all_commands
+ 
+-  # Wrap the 'list_all_commands' function with extra hub commands
+-  __git_list_all_commands() {
+-    cat <<-EOF
++# Duplicate and rename the 'list_all_commands' function
++eval "$(declare -f __git_list_all_commands | \
++    sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
++
++# Wrap the 'list_all_commands' function with extra hub commands
++__git_list_all_commands() {
++cat <<-EOF
+ alias
+ pull-request
+ fork
+@@ -17,9 +18,11 @@
+ browse
+ compare
+ EOF
+-    __git_list_all_commands_without_hub
+-  }
++__git_list_all_commands_without_hub
++}
+ 
+-  # Ensure cached commands are cleared
+-  __git_all_commands=""
+-fi
++# Ensure cached commands are cleared
++__git_all_commands=""
++
++# Register completion for the hub command
++__git_complete hub __git_main
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20131012/b4d5e26e/attachment.html>


More information about the macports-changes mailing list