[arch-commits] Commit in android-tools/repos (10 files)

Anatol Pomozov anatolik at archlinux.org
Mon Nov 24 22:38:06 UTC 2014


    Date: Monday, November 24, 2014 @ 23:38:05
  Author: anatolik
Revision: 123100

archrelease: copy trunk to community-testing-i686, community-testing-x86_64

Added:
  android-tools/repos/community-testing-i686/
  android-tools/repos/community-testing-i686/PKGBUILD
    (from rev 123099, android-tools/trunk/PKGBUILD)
  android-tools/repos/community-testing-i686/adbMakefile
    (from rev 123099, android-tools/trunk/adbMakefile)
  android-tools/repos/community-testing-i686/bash_completion
    (from rev 123099, android-tools/trunk/bash_completion)
  android-tools/repos/community-testing-i686/fastbootMakefile
    (from rev 123099, android-tools/trunk/fastbootMakefile)
  android-tools/repos/community-testing-x86_64/
  android-tools/repos/community-testing-x86_64/PKGBUILD
    (from rev 123099, android-tools/trunk/PKGBUILD)
  android-tools/repos/community-testing-x86_64/adbMakefile
    (from rev 123099, android-tools/trunk/adbMakefile)
  android-tools/repos/community-testing-x86_64/bash_completion
    (from rev 123099, android-tools/trunk/bash_completion)
  android-tools/repos/community-testing-x86_64/fastbootMakefile
    (from rev 123099, android-tools/trunk/fastbootMakefile)

-------------------------------------------+
 community-testing-i686/PKGBUILD           |   46 ++++++
 community-testing-i686/adbMakefile        |   43 +++++
 community-testing-i686/bash_completion    |  202 ++++++++++++++++++++++++++++
 community-testing-i686/fastbootMakefile   |   67 +++++++++
 community-testing-x86_64/PKGBUILD         |   46 ++++++
 community-testing-x86_64/adbMakefile      |   43 +++++
 community-testing-x86_64/bash_completion  |  202 ++++++++++++++++++++++++++++
 community-testing-x86_64/fastbootMakefile |   67 +++++++++
 8 files changed, 716 insertions(+)

Copied: android-tools/repos/community-testing-i686/PKGBUILD (from rev 123099, android-tools/trunk/PKGBUILD)
===================================================================
--- community-testing-i686/PKGBUILD	                        (rev 0)
+++ community-testing-i686/PKGBUILD	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,46 @@
+# $Id$
+# Maintainer: Anatol Pomozov
+# Contributor: 謝致邦 <Yeking at Red54.com>
+# Contributor: Alucryd <alucryd at gmail dot com>
+
+pkgname=android-tools
+pkgver=5.0.0_r7
+pkgrel=1
+pkgdesc='Android platform tools'
+arch=(i686 x86_64)
+url='http://tools.android.com/'
+license=(Apache MIT)
+depends=(openssl)
+makedepends=(git)
+source=(git+https://android.googlesource.com/platform/system/core#tag=android-$pkgver
+        git+https://android.googlesource.com/platform/system/extras#tag=android-$pkgver
+        git+https://android.googlesource.com/platform/external/libselinux#tag=android-$pkgver
+        git+https://android.googlesource.com/platform/external/f2fs-tools#tag=android-$pkgver
+        adbMakefile
+        fastbootMakefile
+        bash_completion) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
+sha1sums=('SKIP'
+          'SKIP'
+          'SKIP'
+          'SKIP'
+          'ed3e9f6fc43ea9adb177ff1f81532a583b51e348'
+          'a61991623b3a6c21129156f36d81076e5ac1a32d'
+          'd99991b208c7c2d8d0053e9937653cca22d09b6d')
+
+
+prepare() {
+  # another way to fix the compilation error is to add #include <stddef.h>
+  sed -e 's/f2fs_sparse_file = NULL/f2fs_sparse_file = 0/g' -i extras/f2fs_utils/f2fs_utils.c 
+}
+
+build() {
+  make -C core/adb -f "$srcdir"/adbMakefile
+  make -C core/fastboot -f "$srcdir"/fastbootMakefile
+}
+
+package(){
+  install -Dm 755 core/adb/adb "$pkgdir"/usr/bin/adb
+  install -Dm 755 core/fastboot/fastboot "$pkgdir"/usr/bin/fastboot
+
+  install -Dm 644 bash_completion "$pkgdir"/etc/bash_completion.d/$pkgname
+}

Copied: android-tools/repos/community-testing-i686/adbMakefile (from rev 123099, android-tools/trunk/adbMakefile)
===================================================================
--- community-testing-i686/adbMakefile	                        (rev 0)
+++ community-testing-i686/adbMakefile	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,43 @@
+SRCS+= adb.c
+SRCS+= adb_auth_host.c
+SRCS+= adb_client.c
+SRCS+= commandline.c
+SRCS+= console.c
+SRCS+= fdevent.c
+SRCS+= file_sync_client.c
+SRCS+= get_my_path_linux.c
+SRCS+= services.c
+SRCS+= sockets.c
+SRCS+= transport.c
+SRCS+= transport_local.c
+SRCS+= transport_usb.c
+SRCS+= usb_linux.c
+SRCS+= usb_vendors.c
+
+VPATH+= ../libcutils
+SRCS+= load_file.c
+SRCS+= socket_inaddr_any_server.c
+SRCS+= socket_local_client.c
+SRCS+= socket_local_server.c
+SRCS+= socket_loopback_client.c
+SRCS+= socket_loopback_server.c
+SRCS+= socket_network_client.c
+
+VPATH+= ../libzipfile
+SRCS+= centraldir.c
+SRCS+= zipfile.c
+
+CPPFLAGS+= -DADB_HOST=1
+CPPFLAGS+= -DHAVE_FORKEXEC=1
+CPPFLAGS+= -DHAVE_OFF64_T=1
+CPPFLAGS+= -I.
+CPPFLAGS+= -I../include
+
+LIBS+= -lcrypto -lpthread -lz
+
+OBJS= $(SRCS:.c=.o)
+
+all: adb
+
+adb: $(OBJS)
+	cc -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)

Copied: android-tools/repos/community-testing-i686/bash_completion (from rev 123099, android-tools/trunk/bash_completion)
===================================================================
--- community-testing-i686/bash_completion	                        (rev 0)
+++ community-testing-i686/bash_completion	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,202 @@
+## 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|grep 'device$'|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=$(( $(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/repos/community-testing-i686/fastbootMakefile (from rev 123099, android-tools/trunk/fastbootMakefile)
===================================================================
--- community-testing-i686/fastbootMakefile	                        (rev 0)
+++ community-testing-i686/fastbootMakefile	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,67 @@
+SRCS+=bootimg.c
+SRCS+=engine.c
+SRCS+=fastboot.c
+SRCS+=protocol.c
+SRCS+=usb_linux.c
+SRCS+=util_linux.c
+SRCS+=util.c
+SRCS+=fs.c
+
+VPATH+= ../libsparse
+SRCS+= backed_block.c
+SRCS+= output_file.c
+SRCS+= sparse.c
+SRCS+= sparse_crc32.c
+SRCS+= sparse_err.c
+SRCS+= sparse_read.c
+
+VPATH+= ../libzipfile
+SRCS+= centraldir.c
+SRCS+= zipfile.c
+
+VPATH+= ../../extras/ext4_utils
+SRCS+= allocate.c
+SRCS+= contents.c
+SRCS+= crc16.c
+SRCS+= ext4_utils.c
+SRCS+= ext4_sb.c
+SRCS+= extent.c
+SRCS+= indirect.c
+SRCS+= make_ext4fs.c
+SRCS+= sha1.c
+SRCS+= uuid.c
+SRCS+= wipe.c
+
+VPATH+= ../../extras/f2fs_utils
+SRCS+= f2fs_utils.c
+SRCS+= f2fs_dlutils.c
+SRCS+= f2fs_ioutils.c
+
+VPATH+= ../../libselinux/src
+SRCS+= callbacks.c
+SRCS+= check_context.c
+SRCS+= freecon.c
+SRCS+= init.c
+SRCS+= label.c
+SRCS+= label_android_property.c
+SRCS+= label_file.c
+
+CPPFLAGS+= -I../include
+CPPFLAGS+= -I../libsparse/include
+CPPFLAGS+= -I../mkbootimg
+CPPFLAGS+= -I../../extras/ext4_utils
+CPPFLAGS+= -I../../extras/f2fs_utils/
+CPPFLAGS+= -I../../libselinux/include
+CPPFLAGS+= -I../../f2fs-tools/include
+CPPFLAGS+= -I../../f2fs-tools/mkfs
+CPPFLAGS+= -DHAVE_OFF64_T=1
+CPPFLAGS+= -std=gnu99
+
+LIBS+= -lz -ldl
+
+OBJS= $(SRCS:.c=.o)
+
+all: fastboot
+
+fastboot: $(OBJS)
+	cc -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)

Copied: android-tools/repos/community-testing-x86_64/PKGBUILD (from rev 123099, android-tools/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,46 @@
+# $Id$
+# Maintainer: Anatol Pomozov
+# Contributor: 謝致邦 <Yeking at Red54.com>
+# Contributor: Alucryd <alucryd at gmail dot com>
+
+pkgname=android-tools
+pkgver=5.0.0_r7
+pkgrel=1
+pkgdesc='Android platform tools'
+arch=(i686 x86_64)
+url='http://tools.android.com/'
+license=(Apache MIT)
+depends=(openssl)
+makedepends=(git)
+source=(git+https://android.googlesource.com/platform/system/core#tag=android-$pkgver
+        git+https://android.googlesource.com/platform/system/extras#tag=android-$pkgver
+        git+https://android.googlesource.com/platform/external/libselinux#tag=android-$pkgver
+        git+https://android.googlesource.com/platform/external/f2fs-tools#tag=android-$pkgver
+        adbMakefile
+        fastbootMakefile
+        bash_completion) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
+sha1sums=('SKIP'
+          'SKIP'
+          'SKIP'
+          'SKIP'
+          'ed3e9f6fc43ea9adb177ff1f81532a583b51e348'
+          'a61991623b3a6c21129156f36d81076e5ac1a32d'
+          'd99991b208c7c2d8d0053e9937653cca22d09b6d')
+
+
+prepare() {
+  # another way to fix the compilation error is to add #include <stddef.h>
+  sed -e 's/f2fs_sparse_file = NULL/f2fs_sparse_file = 0/g' -i extras/f2fs_utils/f2fs_utils.c 
+}
+
+build() {
+  make -C core/adb -f "$srcdir"/adbMakefile
+  make -C core/fastboot -f "$srcdir"/fastbootMakefile
+}
+
+package(){
+  install -Dm 755 core/adb/adb "$pkgdir"/usr/bin/adb
+  install -Dm 755 core/fastboot/fastboot "$pkgdir"/usr/bin/fastboot
+
+  install -Dm 644 bash_completion "$pkgdir"/etc/bash_completion.d/$pkgname
+}

Copied: android-tools/repos/community-testing-x86_64/adbMakefile (from rev 123099, android-tools/trunk/adbMakefile)
===================================================================
--- community-testing-x86_64/adbMakefile	                        (rev 0)
+++ community-testing-x86_64/adbMakefile	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,43 @@
+SRCS+= adb.c
+SRCS+= adb_auth_host.c
+SRCS+= adb_client.c
+SRCS+= commandline.c
+SRCS+= console.c
+SRCS+= fdevent.c
+SRCS+= file_sync_client.c
+SRCS+= get_my_path_linux.c
+SRCS+= services.c
+SRCS+= sockets.c
+SRCS+= transport.c
+SRCS+= transport_local.c
+SRCS+= transport_usb.c
+SRCS+= usb_linux.c
+SRCS+= usb_vendors.c
+
+VPATH+= ../libcutils
+SRCS+= load_file.c
+SRCS+= socket_inaddr_any_server.c
+SRCS+= socket_local_client.c
+SRCS+= socket_local_server.c
+SRCS+= socket_loopback_client.c
+SRCS+= socket_loopback_server.c
+SRCS+= socket_network_client.c
+
+VPATH+= ../libzipfile
+SRCS+= centraldir.c
+SRCS+= zipfile.c
+
+CPPFLAGS+= -DADB_HOST=1
+CPPFLAGS+= -DHAVE_FORKEXEC=1
+CPPFLAGS+= -DHAVE_OFF64_T=1
+CPPFLAGS+= -I.
+CPPFLAGS+= -I../include
+
+LIBS+= -lcrypto -lpthread -lz
+
+OBJS= $(SRCS:.c=.o)
+
+all: adb
+
+adb: $(OBJS)
+	cc -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)

Copied: android-tools/repos/community-testing-x86_64/bash_completion (from rev 123099, android-tools/trunk/bash_completion)
===================================================================
--- community-testing-x86_64/bash_completion	                        (rev 0)
+++ community-testing-x86_64/bash_completion	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,202 @@
+## 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|grep 'device$'|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=$(( $(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/repos/community-testing-x86_64/fastbootMakefile (from rev 123099, android-tools/trunk/fastbootMakefile)
===================================================================
--- community-testing-x86_64/fastbootMakefile	                        (rev 0)
+++ community-testing-x86_64/fastbootMakefile	2014-11-24 22:38:05 UTC (rev 123100)
@@ -0,0 +1,67 @@
+SRCS+=bootimg.c
+SRCS+=engine.c
+SRCS+=fastboot.c
+SRCS+=protocol.c
+SRCS+=usb_linux.c
+SRCS+=util_linux.c
+SRCS+=util.c
+SRCS+=fs.c
+
+VPATH+= ../libsparse
+SRCS+= backed_block.c
+SRCS+= output_file.c
+SRCS+= sparse.c
+SRCS+= sparse_crc32.c
+SRCS+= sparse_err.c
+SRCS+= sparse_read.c
+
+VPATH+= ../libzipfile
+SRCS+= centraldir.c
+SRCS+= zipfile.c
+
+VPATH+= ../../extras/ext4_utils
+SRCS+= allocate.c
+SRCS+= contents.c
+SRCS+= crc16.c
+SRCS+= ext4_utils.c
+SRCS+= ext4_sb.c
+SRCS+= extent.c
+SRCS+= indirect.c
+SRCS+= make_ext4fs.c
+SRCS+= sha1.c
+SRCS+= uuid.c
+SRCS+= wipe.c
+
+VPATH+= ../../extras/f2fs_utils
+SRCS+= f2fs_utils.c
+SRCS+= f2fs_dlutils.c
+SRCS+= f2fs_ioutils.c
+
+VPATH+= ../../libselinux/src
+SRCS+= callbacks.c
+SRCS+= check_context.c
+SRCS+= freecon.c
+SRCS+= init.c
+SRCS+= label.c
+SRCS+= label_android_property.c
+SRCS+= label_file.c
+
+CPPFLAGS+= -I../include
+CPPFLAGS+= -I../libsparse/include
+CPPFLAGS+= -I../mkbootimg
+CPPFLAGS+= -I../../extras/ext4_utils
+CPPFLAGS+= -I../../extras/f2fs_utils/
+CPPFLAGS+= -I../../libselinux/include
+CPPFLAGS+= -I../../f2fs-tools/include
+CPPFLAGS+= -I../../f2fs-tools/mkfs
+CPPFLAGS+= -DHAVE_OFF64_T=1
+CPPFLAGS+= -std=gnu99
+
+LIBS+= -lz -ldl
+
+OBJS= $(SRCS:.c=.o)
+
+all: fastboot
+
+fastboot: $(OBJS)
+	cc -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)



More information about the arch-commits mailing list