bashdb bash-completion add repo
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
from pisi.actionsapi import pisitools
|
||||
from pisi.actionsapi import autotools
|
||||
from pisi.actionsapi import get
|
||||
|
||||
import os
|
||||
|
||||
def setup():
|
||||
autotools.configure()
|
||||
|
||||
def build():
|
||||
autotools.make("bash_completion.sh")
|
||||
|
||||
def install():
|
||||
autotools.rawInstall('DESTDIR=%s' % get.installDIR())
|
||||
|
||||
# provided by util-linux , networkmanager , remove Slackware's makepkg completion
|
||||
blacklist = ["cal", "chsh", "dmesg", "eject", "hd", "hexdump", "hwclock", "ionice", "look", "ncal", "nmcli", "newgrp", "makepkg", "renice", "rtcwake", "su"]
|
||||
for comp in blacklist:
|
||||
pisitools.remove("/usr/share/bash-completion/completions/%s" % comp)
|
||||
|
||||
pisitools.dodoc("AUTHORS", "CHANGES", "COPYING", "README")
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
|
||||
def preRemove():
|
||||
os.system("complete -r")
|
||||
@@ -0,0 +1,247 @@
|
||||
_pisi()
|
||||
{
|
||||
local cur command commands options packages files
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
commands="add-repo build check clean configure-pending delete-cache delta \
|
||||
emerge graph help history index info install list-available \
|
||||
list-components list-installed list-newest list-pending list-repo \
|
||||
list-sources list-upgrades rebuild-db remove remove-repo search \
|
||||
search-file update-repo upgrade"
|
||||
|
||||
options="--destdir --yes-all --username --password --bandwidth-limit --verbose \
|
||||
--debug --no-color"
|
||||
packages=""
|
||||
files=""
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 ]] ; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=($(compgen -W "--version --help" -- $cur))
|
||||
else
|
||||
COMPREPLY=($(compgen -W "$commands --version --help" -- $cur))
|
||||
fi
|
||||
return 0;
|
||||
else
|
||||
command=${COMP_WORDS[1]}
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
case $command in
|
||||
@(add-repo|ar))
|
||||
options="${options} --at --ignore-check"
|
||||
;;
|
||||
@(blame|bl))
|
||||
options="${options} --release --all"
|
||||
;;
|
||||
@(build|bi))
|
||||
options="${options} --fetch --unpack --setup --build \
|
||||
--check --install --package --ignore-build-no \
|
||||
--quiet --ignore-dependency --output-dir \
|
||||
--ignore-action-errors --ignore-safety \
|
||||
--ignore-check --create-static --package-format \
|
||||
--use-quilt --ignore-sandbox"
|
||||
;;
|
||||
@(check))
|
||||
options="${options} --component --config"
|
||||
;;
|
||||
@(clean))
|
||||
options="${options}"
|
||||
;;
|
||||
@(configure-pending|cp))
|
||||
options="${options} --ignore-dependency --ignore-comar \
|
||||
--ignore-safety --dry-run"
|
||||
;;
|
||||
@(delete-cache|dc))
|
||||
options="${options}"
|
||||
;;
|
||||
@(delta|dt))
|
||||
options="${options} --output-dir"
|
||||
;;
|
||||
@(disable-repo|dr))
|
||||
options="${options}"
|
||||
;;
|
||||
@(emerge|em))
|
||||
options="${options} --ignore-build-no --quiet --ignore-dependency \
|
||||
--output-dir --ignore-action-errors --ignore safety \
|
||||
--ignore-check --create-static --package-format \
|
||||
--use-quilt --ignore-sandbox --component \
|
||||
--ignore-file-conflicts --ignore-package-conflicts --ignore-comar"
|
||||
;;
|
||||
@(enable-repo|er))
|
||||
options="${options}"
|
||||
;;
|
||||
@(fetch|fc))
|
||||
options="${options} --output-dir"
|
||||
;;
|
||||
@(graph))
|
||||
options="${options} --reporsitory --installed \
|
||||
--ignore-installed --output"
|
||||
;;
|
||||
@(help|--help))
|
||||
options="${commands}"
|
||||
;;
|
||||
@(history|hs))
|
||||
options="${options} --last --snapshot --takeback"
|
||||
;;
|
||||
@(index|ix))
|
||||
options="${options} --absolute-urls --output --skip-sources \
|
||||
--skip-signing"
|
||||
;;
|
||||
@(info))
|
||||
options="${options} --files --component --files-path --short --xml"
|
||||
;;
|
||||
@(install|it))
|
||||
options="${options} --ignore-dependency --ignore-comar \
|
||||
--ignore-safety --dry-run --ignore-build-no \
|
||||
--reinstall --ignore-check --ignore-file-conflicts \
|
||||
--ignore-package-conflicts --component --repository \
|
||||
--fetch-only --exclude --exclude-from"
|
||||
;;
|
||||
@(list-available|la))
|
||||
options="${options} --long --component --uninstalled"
|
||||
;;
|
||||
@(list-components|lc))
|
||||
options="${options} --long --repository"
|
||||
;;
|
||||
@(list-installed|li))
|
||||
options="${options} --without-buildno --long --component --install-info"
|
||||
;;
|
||||
@(list-newest|ln))
|
||||
options="${options} --since --last"
|
||||
;;
|
||||
@(list-pending|lp))
|
||||
options="${options}"
|
||||
;;
|
||||
@(list-repo|lr))
|
||||
options="${options}"
|
||||
;;
|
||||
@(list-sources|ls))
|
||||
options="${options} --long"
|
||||
;;
|
||||
@(list-upgrades|lu))
|
||||
options="${options} --ignore-build-no --long --component \
|
||||
--install-info"
|
||||
;;
|
||||
@(rebuild-db|rdb))
|
||||
options="${options} --files"
|
||||
;;
|
||||
@(remove|rm))
|
||||
options="${options} --ignore-dependency --ignore-comar \
|
||||
--ignore-safety --dry-run --purge --component"
|
||||
;;
|
||||
@(remove-repo|rr))
|
||||
options="${options}"
|
||||
;;
|
||||
@(search|sr))
|
||||
options="${options} --language --repository --installdb \
|
||||
--sourcedb --name --summary --description"
|
||||
;;
|
||||
@(search-file|sf))
|
||||
options="${options} --long --quiet"
|
||||
;;
|
||||
@(update-repo|ur))
|
||||
options="${options} --force"
|
||||
;;
|
||||
@(upgrade|up))
|
||||
options="${options} --ignore-dependency --ignore-comar \
|
||||
--ignore-safety --dry-run --ignore-build-no \
|
||||
--security-only --bypass-update-repo \
|
||||
--ignore-file-conflicts --ignore-package-conflicts \
|
||||
--component --repository --fetch-only --exclude --exclude-from"
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -W "$options" -- $cur))
|
||||
return 0;
|
||||
else
|
||||
case $command in
|
||||
@(install|it))
|
||||
if [ `ls *.pisi 2> /dev/null | wc -l` -gt 0 ]; then
|
||||
packages=""
|
||||
else
|
||||
if `ls /var/lib/pisi/index/* &>/dev/null`; then
|
||||
packages=`grep -P "<Name>[^\s]*</Name>" /var/lib/pisi/index/*/pisi-index.xml | gawk -F '>' '{print $2}' | gawk -F '<' '{print $1}' | sort | uniq | tr "\n" " "`
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@(info))
|
||||
if `ls /var/lib/pisi/index/* &>/dev/null`; then
|
||||
packages=`grep -P "<Name>[^\s]*</Name>" /var/lib/pisi/index/*/pisi-index.xml | gawk -F '>' '{print $2}' | gawk -F '<' '{print $1}' | sort | uniq | tr "\n" " "`
|
||||
fi
|
||||
;;
|
||||
@(upgrade|up|remove|rm))
|
||||
if `ls /var/lib/pisi/index/* &>/dev/null`; then
|
||||
packages=`grep -P "<Name>[^\s]*</Name>" /var/lib/pisi/package/*/metadata.xml | gawk -F '>' '{print $2}' | gawk -F '<' '{print $1}' | sort | uniq | tr "\n" " "`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -f -W "$packages" -- $cur))
|
||||
return 0;
|
||||
fi
|
||||
fi
|
||||
_filedir '@(pisi)'
|
||||
}
|
||||
complete -F _pisi -o filenames pisi
|
||||
|
||||
_service()
|
||||
{
|
||||
local list
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
cur_num=${#COMP_WORDS[*]}
|
||||
|
||||
if [[ ${cur_num} == 2 ]]; then
|
||||
list=`/usr/bin/hav list-apps System.Service`
|
||||
COMPREPLY=($(compgen -W "${list} dbus" -- ${cur}))
|
||||
elif [[ ${cur_num} -ge 3 ]]; then
|
||||
COMPREPLY=($(compgen -W "on off start stop restart reload" -- ${cur}))
|
||||
fi
|
||||
}
|
||||
complete -F _service service
|
||||
|
||||
_hav()
|
||||
{
|
||||
local list command app model
|
||||
|
||||
list=""
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
cur_num=${#COMP_WORDS[*]}
|
||||
|
||||
if [[ ${cur_num} == 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "call list-apps list-models list-methods register remove" -- ${cur}))
|
||||
elif [[ ${cur_num} == 3 ]]; then
|
||||
command=${COMP_WORDS[1]}
|
||||
case $command in
|
||||
@(call))
|
||||
list=`/usr/bin/hav list-apps`
|
||||
;;
|
||||
@(list-models|list-methods|register|remove))
|
||||
list=`/usr/bin/hav list-apps`
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -W "${list}" -- ${cur}))
|
||||
elif [[ ${cur_num} == 4 ]]; then
|
||||
command=${COMP_WORDS[1]}
|
||||
app=${COMP_WORDS[2]}
|
||||
case $command in
|
||||
@(call))
|
||||
list=`/usr/bin/hav list-models ${app}`
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -W "${list}" -- ${cur}))
|
||||
elif [[ ${cur_num} == 5 ]]; then
|
||||
command=${COMP_WORDS[1]}
|
||||
app=${COMP_WORDS[2]}
|
||||
model=${COMP_WORDS[3]}
|
||||
case $command in
|
||||
@(call))
|
||||
list=`/usr/bin/hav list-methods ${app} ${model}`
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -W "${list}" -- ${cur}))
|
||||
fi
|
||||
}
|
||||
complete -F _hav hav
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>bash-completion</Name>
|
||||
<Homepage>http://bash-completion.alioth.debian.org/</Homepage>
|
||||
<Packager>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>GPLv2</License>
|
||||
<IsA>app:console</IsA>
|
||||
<Summary>Programmable completion for bash</Summary>
|
||||
<Description>A relatively new feature in bash is programmable completion. Since now, users have been able to complete commands, variables and filenames; now it is also possible to complete parameters.</Description>
|
||||
<Archive sha1sum="b74bf7d83646e1412bb07dbb1de09db1c9715599" type="tarbz2">http://bash-completion.alioth.debian.org/files/bash-completion-2.1.tar.bz2</Archive>
|
||||
<Patches>
|
||||
<!-- <Patch>pisilinux.patch</Patch> -->
|
||||
<!-- <Patch level="1">libreoffice_completion.patch</Patch> -->
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>bash-completion</Name>
|
||||
<Files>
|
||||
<Path fileType="data">/etc</Path>
|
||||
<Path fileType="doc">/usr/share/doc</Path>
|
||||
<Path fileType="data">/usr/share</Path>
|
||||
<Path fileType="data">/var</Path>
|
||||
</Files>
|
||||
<AdditionalFiles>
|
||||
<AdditionalFile owner="root" permission="0644" target="/etc/bash_completion.d/pisilinux">pisilinux</AdditionalFile>
|
||||
</AdditionalFiles>
|
||||
<Provides>
|
||||
<COMAR script="package.py">System.Package</COMAR>
|
||||
</Provides>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="3">
|
||||
<Date>2014-02-23</Date>
|
||||
<Version>2.1</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Alihan Öztürk</Name>
|
||||
<Email>alihan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="2">
|
||||
<Date>2013-07-14</Date>
|
||||
<Version>2.1</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Yusuf Aydemir</Name>
|
||||
<Email>yusuf.aydemir@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="1">
|
||||
<Date>2011-06-20</Date>
|
||||
<Version>1.2</Version>
|
||||
<Comment>First release</Comment>
|
||||
<Name>Pisi Linux Admins</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" ?>
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>bash-completion</Name>
|
||||
<Summary xml:lang="tr">Bash kabuğu için otomatik tamamlama</Summary>
|
||||
<Description xml:lang="tr">Kabukta çeşitli uygulamalar için otomatik tamamlama özelliği eklenebilmesine olanak sağlayan bir programdır.</Description>
|
||||
</Source>
|
||||
</PISI>
|
||||
Reference in New Issue
Block a user