Revert "add bash completion for the "apt" command"
authorMichael Vogt <mvo@debian.org>
Mon, 5 May 2014 14:24:52 +0000 (16:24 +0200)
committerMichael Vogt <mvo@debian.org>
Mon, 5 May 2014 14:24:52 +0000 (16:24 +0200)
This reverts commit 697c9314c8ba24f3e393b5de11a3fad7adae4bfc.

Conflicts:
debian/rules

debian/apt.dirs
debian/rules
share/bash-completions/apt [deleted file]

index e4bb2c8..6d492a3 100644 (file)
@@ -15,4 +15,3 @@ var/lib/apt/mirrors/partial
 var/lib/apt/periodic
 var/log/apt
 usr/share/bug/apt
-usr/share/bash-completion/completions/
\ No newline at end of file
index fc0e9e8..f8b3929 100755 (executable)
@@ -189,8 +189,6 @@ apt: build-binary build-manpages debian/apt.install
        cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
        cp debian/apt.auto-removal.sh debian/$@/etc/kernel/postinst.d/apt-auto-removal
        chmod 755 debian/$@/etc/kernel/postinst.d/apt-auto-removal
-       # install bash completion
-       cp share/bash-completions/* debian/$@/usr/share/bash-completion/completions/
        # install vendor specific apt confs
        find -L vendor/current -name 'apt.conf-*' | while read conf; do cp "$${conf}" "debian/$@/etc/apt/apt.conf.d/$${conf#*-}"; done
 
diff --git a/share/bash-completions/apt b/share/bash-completions/apt
deleted file mode 100644 (file)
index 9929bf7..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-# Debian apt(8) completion                             -*- shell-script -*-
-
-_apt()
-{
-    local sourcesdir="/etc/apt/sources.list.d"
-    local cur prev words cword
-    _init_completion || return
-
-    # see if the user selected a command already
-    local COMMANDS=("install" "remove" "purge" "show" "list"
-                    "update" "upgrade" "full-upgrade" "dist-upgrade"
-                    "edit-sources" "help")
-
-    local command i
-    for (( i=0; i < ${#words[@]}-1; i++ )); do
-        if [[ ${COMMANDS[@]} =~ ${words[i]} ]]; then
-            command=${words[i]}
-            break
-        fi
-    done
-
-    # supported options per command
-    if [[ "$cur" == -* ]]; then
-        case $command in
-            install|remove|purge|upgrade|full-upgrade)
-                COMPREPLY=( $( compgen -W '--show-progress
-                  --fix-broken --purge --verbose-versions --auto-remove
-                  --simulate --dry-run
-                  --download
-                  --fix-missing
-                  --fix-policy
-                  --ignore-hold
-                  --force-yes
-                  --trivial-only
-                  --reinstall --solver' -- "$cur" ) )
-                return 0
-                ;;
-            update)
-                COMPREPLY=( $( compgen -W '--list-cleanup 
-                  ' -- "$cur" ) )
-                return 0
-                ;;
-            list)
-                COMPREPLY=( $( compgen -W '--installed --upgradable 
-                  --manual-installed
-                  -v --verbose
-                  -a --all-versions
-                  ' -- "$cur" ) )
-                return 0
-                ;;
-            show)
-                COMPREPLY=( $( compgen -W '-a --all-versions
-                  ' -- "$cur" ) )
-                return 0
-                ;;
-        esac
-    fi
-
-    # specific command arguments
-    if [[ -n $command ]]; then
-        case $command in
-            remove|purge)
-                if [[ -f /etc/debian_version ]]; then
-                    # Debian system
-                    COMPREPLY=( $( \
-                        _xfunc dpkg _comp_dpkg_installed_packages $cur ) )
-                else
-                    # assume RPM based
-                    _xfunc rpm _rpm_installed_packages
-                fi
-                return 0
-                ;;
-            install|show|list)
-                COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
-                    2> /dev/null ) )
-                return 0
-                ;;
-            edit-sources)
-                COMPREPLY=( $( compgen -W '$( command ls $sourcesdir )' \
-                    -- "$cur" ) )
-                return 0
-                ;;
-        esac
-    fi
-
-    # no command yet, show what commands we have
-    if [ "$command" = "" ]; then
-        COMPREPLY=( $( compgen -W '${COMMANDS[@]}' -- "$cur" ) )
-    fi
-
-    return 0
-} &&
-complete -F _apt apt
-
-# ex: ts=4 sw=4 et filetype=sh