[arch-commits] Commit in android-tools/trunk (4 files)
Anatol Pomozov
anatolik at archlinux.org
Wed Jan 13 17:44:56 UTC 2016
Date: Wednesday, January 13, 2016 @ 18:44:55
Author: anatolik
Revision: 156313
upgpkg: android-tools 6.0.1_r10-2
Bash completion loader is looking for files named as the executable name.
For android-tool we provide completions for 'adb' and 'fastboot', we need to call
completions the same way.
Added:
android-tools/trunk/bash_completion.adb
(from rev 156263, android-tools/trunk/bash_completion)
android-tools/trunk/bash_completion.fastboot
(from rev 156312, android-tools/trunk/bash_completion)
Modified:
android-tools/trunk/PKGBUILD
Deleted:
android-tools/trunk/bash_completion
--------------------------+
PKGBUILD | 11 +-
bash_completion | 203 ---------------------------------------------
bash_completion.adb | 135 +++++++++++++++++++++++++++++
bash_completion.fastboot | 90 +++++++++++++++++++
4 files changed, 232 insertions(+), 207 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-01-13 17:22:37 UTC (rev 156312)
+++ PKGBUILD 2016-01-13 17:44:55 UTC (rev 156313)
@@ -5,7 +5,7 @@
pkgname=android-tools
pkgver=6.0.1_r10
-pkgrel=1
+pkgrel=2
pkgdesc='Android platform tools'
arch=(i686 x86_64)
url='http://tools.android.com/'
@@ -18,7 +18,8 @@
git+https://android.googlesource.com/platform/external/f2fs-tools#tag=android-$pkgver
build.sh # regenerate this file with generate_build.rb tool
fix_build.patch
- bash_completion) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
+ bash_completion.fastboot
+ bash_completion.adb) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
sha1sums=('SKIP'
'SKIP'
'SKIP'
@@ -25,7 +26,8 @@
'SKIP'
'd47604b60cc123641d52eed8f6495265725bf9d3'
'40a978209b6d1bbf99e04b8bd5fca6429b97f1b1'
- 'e1bd94fd4dd260af3c068496071d67738d431aec')
+ '7004dbd0c193668827174880de6f8434de8ceaee'
+ '2e69152091bb9642be058e49ec6cb720a2fd91dc')
prepare() {
patch -p1 < fix_build.patch
@@ -38,5 +40,6 @@
package(){
install -m755 -d "$pkgdir"/usr/bin
install -m755 -t "$pkgdir"/usr/bin mkbootimg fastboot adb
- install -Dm 644 bash_completion "$pkgdir"/usr/share/bash-completion/completions/$pkgname
+ install -Dm 644 bash_completion.fastboot "$pkgdir"/usr/share/bash-completion/completions/fastboot
+ install -Dm 644 bash_completion.adb "$pkgdir"/usr/share/bash-completion/completions/adb
}
Deleted: bash_completion
===================================================================
--- bash_completion 2016-01-13 17:22:37 UTC (rev 156312)
+++ bash_completion 2016-01-13 17:44:55 UTC (rev 156313)
@@ -1,203 +0,0 @@
-## Bash completion for the Android SDK tools.
-##
-## Copyright (c) 2009 Matt Brubeck
-##
-## Permission is hereby granted, free of charge, to any person obtaining a copy
-## of this software and associated documentation files (the "Software"), to deal
-## in the Software without restriction, including without limitation the rights
-## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-## copies of the Software, and to permit persons to whom the Software is
-## furnished to do so, subject to the following conditions:
-##
-## The above copyright notice and this permission notice shall be included in
-## all copies or substantial portions of the Software.
-##
-## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-## THE SOFTWARE.
-
-
-function _adb()
-{
- local cur prev opts cmds c subcommand device_selected
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- opts="-d -e -s -p"
- cmds="devices push pull sync shell emu logcat forward jdwp install sideload \
- uninstall bugreport help version wait-for-device start-server \
- reboot reboot-bootloader \
- connect disconnect \
- kill-server get-state get-serialno status-window remount root ppp backup restore"
- cmds_not_need_device="devices help version start-server kill-server connect disconnect"
- subcommand=""
- device_selected=""
-
- # Look for the subcommand.
- c=1
- while [ $c -lt $COMP_CWORD ]; do
- word="${COMP_WORDS[c]}"
- if [ "$word" = "-d" -o "$word" = "-e" -o "$word" = "-s" ]; then
- device_selected=true
- opts="-p"
- fi
- for cmd in $cmds; do
- if [ "$cmd" = "$word" ]; then
- subcommand="$word"
- fi
- done
- c=$((++c))
- done
-
- case "${subcommand}" in
- '')
- case "${prev}" in
- -p)
- return 0;
- ;;
- -s)
- # Use 'adb devices' to list serial numbers.
- COMPREPLY=( $(compgen -W "$(adb devices |
- awk '/(device|recovery|sideload)$/{print $1}')" -- ${cur} ) )
- return 0
- ;;
- esac
- case "${cur}" in
- -*)
- COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
- return 0
- ;;
- esac
- if [ -z "$device_selected" ]; then
- local num_devices=$(( $(adb devices 2>/dev/null|wc -l) - 2 ))
- if [ "$num_devices" -gt "1" ]; then
- # With multiple devices, you must choose a device first.
- COMPREPLY=( $(compgen -W "${opts} ${cmds_not_need_device}" -- ${cur}) )
- return 0
- fi
- fi
- COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
- return 0
- ;;
- install)
- case "${cur}" in
- -*)
- COMPREPLY=( $(compgen -W "-l -r -s" -- ${cur}) )
- return 0
- ;;
- esac
- ;;
- forward)
- # Filename or installation option.
- COMPREPLY=( $(compgen -W "tcp: localabstract: localreserved: localfilesystem: dev: jdwp:" -- ${cur}) )
- return 0
- ;;
- uninstall)
- case "${cur}" in
- -*)
- COMPREPLY=( $(compgen -W "-k" -- ${cur}) )
- return 0
- ;;
- esac
- ;;
- logcat)
- case "${cur}" in
- -*)
- COMPREPLY=( $(compgen -W "-v -b -c -d -f -g -n -r -s" -- ${cur}) )
- return 0
- ;;
- esac
- case "${prev}" in
- -v)
- COMPREPLY=( $(compgen -W "brief process tag thread raw time long" -- ${cur}) )
- return 0
- ;;
- -b)
- COMPREPLY=( $(compgen -W "radio events main" -- ${cur}) )
- return 0
- ;;
- esac
- ;;
- backup)
- case "${cur}" in
- -*)
- COMPREPLY=( $(compgen -W "-f -apk -noapk -obb -noobb -shared -noshared -all -system -nosystem" -- ${cur}) )
- return 0
- ;;
- esac
- ;;
- esac
-}
-complete -o default -F _adb adb
-
-function _fastboot()
-{
- local cur prev opts cmds c subcommand device_selected
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- opts="-w -s -p -c -i -b -n"
- cmds="update flashall flash erase getvar boot devices \
- reboot reboot-bootloader oem continue"
- subcommand=""
- partition_list="boot recovery system userdata bootloader radio"
- device_selected=""
-
- # Look for the subcommand.
- c=1
- while [ $c -lt $COMP_CWORD ]; do
- word="${COMP_WORDS[c]}"
- if [ "$word" = "-s" ]; then
- device_selected=true
- fi
- for cmd in $cmds; do
- if [ "$cmd" = "$word" ]; then
- subcommand="$word"
- fi
- done
- c=$((++c))
- done
-
- case "${subcommand}" in
- '')
- case "${prev}" in
- -s)
- # Use 'fastboot devices' to list serial numbers.
- COMPREPLY=( $(compgen -W "$(fastboot devices|cut -f1)" -- ${cur} ) )
- return 0
- ;;
- esac
- case "${cur}" in
- -*)
- COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
- return 0
- ;;
- esac
- if [ -z "$device_selected" ]; then
- local num_devices=$(( $(fastboot devices 2>/dev/null|wc -l) ))
- if [ "$num_devices" -gt "1" ]; then
- # With multiple devices, you must choose a device first.
- COMPREPLY=( $(compgen -W "-s" -- ${cur}) )
- return 0
- fi
- fi
- COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
- return 0
- ;;
- flash)
- # partition name
- COMPREPLY=( $(compgen -W "${partition_list}" -- ${cur}) )
- return 0
- ;;
- erase)
- # partition name
- COMPREPLY=( $(compgen -W "${partition_list}" -- ${cur}) )
- return 0
- ;;
- esac
-}
-complete -o default -F _fastboot fastboot
Copied: android-tools/trunk/bash_completion.adb (from rev 156263, android-tools/trunk/bash_completion)
===================================================================
--- bash_completion.adb (rev 0)
+++ bash_completion.adb 2016-01-13 17:44:55 UTC (rev 156313)
@@ -0,0 +1,135 @@
+## Bash completion for the Android SDK tools.
+##
+## Copyright (c) 2009 Matt Brubeck
+##
+## Permission is hereby granted, free of charge, to any person obtaining a copy
+## of this software and associated documentation files (the "Software"), to deal
+## in the Software without restriction, including without limitation the rights
+## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+## copies of the Software, and to permit persons to whom the Software is
+## furnished to do so, subject to the following conditions:
+##
+## The above copyright notice and this permission notice shall be included in
+## all copies or substantial portions of the Software.
+##
+## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+## THE SOFTWARE.
+
+
+function _adb()
+{
+ local cur prev opts cmds c subcommand device_selected
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ opts="-d -e -s -p"
+ cmds="devices push pull sync shell emu logcat forward jdwp install sideload \
+ uninstall bugreport help version wait-for-device start-server \
+ reboot reboot-bootloader \
+ connect disconnect \
+ kill-server get-state get-serialno status-window remount root ppp backup restore"
+ cmds_not_need_device="devices help version start-server kill-server connect disconnect"
+ subcommand=""
+ device_selected=""
+
+ # Look for the subcommand.
+ c=1
+ while [ $c -lt $COMP_CWORD ]; do
+ word="${COMP_WORDS[c]}"
+ if [ "$word" = "-d" -o "$word" = "-e" -o "$word" = "-s" ]; then
+ device_selected=true
+ opts="-p"
+ fi
+ for cmd in $cmds; do
+ if [ "$cmd" = "$word" ]; then
+ subcommand="$word"
+ fi
+ done
+ c=$((++c))
+ done
+
+ case "${subcommand}" in
+ '')
+ case "${prev}" in
+ -p)
+ return 0;
+ ;;
+ -s)
+ # Use 'adb devices' to list serial numbers.
+ COMPREPLY=( $(compgen -W "$(adb devices |
+ awk '/(device|recovery|sideload)$/{print $1}')" -- ${cur} ) )
+ return 0
+ ;;
+ esac
+ case "${cur}" in
+ -*)
+ COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ if [ -z "$device_selected" ]; then
+ local num_devices=$(( $(adb devices 2>/dev/null|wc -l) - 2 ))
+ if [ "$num_devices" -gt "1" ]; then
+ # With multiple devices, you must choose a device first.
+ COMPREPLY=( $(compgen -W "${opts} ${cmds_not_need_device}" -- ${cur}) )
+ return 0
+ fi
+ fi
+ COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
+ return 0
+ ;;
+ install)
+ case "${cur}" in
+ -*)
+ COMPREPLY=( $(compgen -W "-l -r -s" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+ forward)
+ # Filename or installation option.
+ COMPREPLY=( $(compgen -W "tcp: localabstract: localreserved: localfilesystem: dev: jdwp:" -- ${cur}) )
+ return 0
+ ;;
+ uninstall)
+ case "${cur}" in
+ -*)
+ COMPREPLY=( $(compgen -W "-k" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+ logcat)
+ case "${cur}" in
+ -*)
+ COMPREPLY=( $(compgen -W "-v -b -c -d -f -g -n -r -s" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ case "${prev}" in
+ -v)
+ COMPREPLY=( $(compgen -W "brief process tag thread raw time long" -- ${cur}) )
+ return 0
+ ;;
+ -b)
+ COMPREPLY=( $(compgen -W "radio events main" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+ backup)
+ case "${cur}" in
+ -*)
+ COMPREPLY=( $(compgen -W "-f -apk -noapk -obb -noobb -shared -noshared -all -system -nosystem" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+ esac
+}
+complete -o default -F _adb adb
Copied: android-tools/trunk/bash_completion.fastboot (from rev 156312, android-tools/trunk/bash_completion)
===================================================================
--- bash_completion.fastboot (rev 0)
+++ bash_completion.fastboot 2016-01-13 17:44:55 UTC (rev 156313)
@@ -0,0 +1,90 @@
+## Bash completion for the Android SDK tools.
+##
+## Copyright (c) 2009 Matt Brubeck
+##
+## Permission is hereby granted, free of charge, to any person obtaining a copy
+## of this software and associated documentation files (the "Software"), to deal
+## in the Software without restriction, including without limitation the rights
+## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+## copies of the Software, and to permit persons to whom the Software is
+## furnished to do so, subject to the following conditions:
+##
+## The above copyright notice and this permission notice shall be included in
+## all copies or substantial portions of the Software.
+##
+## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+## THE SOFTWARE.
+
+
+function _fastboot()
+{
+ local cur prev opts cmds c subcommand device_selected
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ opts="-w -s -p -c -i -b -n"
+ cmds="update flashall flash erase getvar boot devices \
+ reboot reboot-bootloader oem continue"
+ subcommand=""
+ partition_list="boot recovery system userdata bootloader radio"
+ device_selected=""
+
+ # Look for the subcommand.
+ c=1
+ while [ $c -lt $COMP_CWORD ]; do
+ word="${COMP_WORDS[c]}"
+ if [ "$word" = "-s" ]; then
+ device_selected=true
+ fi
+ for cmd in $cmds; do
+ if [ "$cmd" = "$word" ]; then
+ subcommand="$word"
+ fi
+ done
+ c=$((++c))
+ done
+
+ case "${subcommand}" in
+ '')
+ case "${prev}" in
+ -s)
+ # Use 'fastboot devices' to list serial numbers.
+ COMPREPLY=( $(compgen -W "$(fastboot devices|cut -f1)" -- ${cur} ) )
+ return 0
+ ;;
+ esac
+ case "${cur}" in
+ -*)
+ COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ if [ -z "$device_selected" ]; then
+ local num_devices=$(( $(fastboot devices 2>/dev/null|wc -l) ))
+ if [ "$num_devices" -gt "1" ]; then
+ # With multiple devices, you must choose a device first.
+ COMPREPLY=( $(compgen -W "-s" -- ${cur}) )
+ return 0
+ fi
+ fi
+ COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
+ return 0
+ ;;
+ flash)
+ # partition name
+ COMPREPLY=( $(compgen -W "${partition_list}" -- ${cur}) )
+ return 0
+ ;;
+ erase)
+ # partition name
+ COMPREPLY=( $(compgen -W "${partition_list}" -- ${cur}) )
+ return 0
+ ;;
+ esac
+}
+complete -o default -F _fastboot fastboot
More information about the arch-commits
mailing list