From 59b2e608a6edb349a07f0f6c52695ee6f0afc8d8 Mon Sep 17 00:00:00 2001 From: burakerturk Date: Sat, 18 Jul 2015 01:47:47 +0300 Subject: [PATCH] bashdb bash-completion add repo --- util/shell/bash-completion/actions.py | 27 +++ util/shell/bash-completion/comar/package.py | 6 + util/shell/bash-completion/files/pisilinux | 247 ++++++++++++++++++++ util/shell/bash-completion/pspec.xml | 61 +++++ util/shell/bash-completion/translations.xml | 8 + util/shell/bashdb/actions.py | 22 ++ util/shell/bashdb/pspec.xml | 52 +++++ util/shell/bashdb/translations.xml | 8 + util/shell/component.xml | 3 + 9 files changed, 434 insertions(+) create mode 100644 util/shell/bash-completion/actions.py create mode 100644 util/shell/bash-completion/comar/package.py create mode 100644 util/shell/bash-completion/files/pisilinux create mode 100644 util/shell/bash-completion/pspec.xml create mode 100644 util/shell/bash-completion/translations.xml create mode 100644 util/shell/bashdb/actions.py create mode 100644 util/shell/bashdb/pspec.xml create mode 100644 util/shell/bashdb/translations.xml create mode 100644 util/shell/component.xml diff --git a/util/shell/bash-completion/actions.py b/util/shell/bash-completion/actions.py new file mode 100644 index 0000000000..a86b60daca --- /dev/null +++ b/util/shell/bash-completion/actions.py @@ -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") diff --git a/util/shell/bash-completion/comar/package.py b/util/shell/bash-completion/comar/package.py new file mode 100644 index 0000000000..fe85182b15 --- /dev/null +++ b/util/shell/bash-completion/comar/package.py @@ -0,0 +1,6 @@ +#!/usr/bin/python + +import os + +def preRemove(): + os.system("complete -r") diff --git a/util/shell/bash-completion/files/pisilinux b/util/shell/bash-completion/files/pisilinux new file mode 100644 index 0000000000..a6dccb9ccb --- /dev/null +++ b/util/shell/bash-completion/files/pisilinux @@ -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 "[^\s]*" /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 "[^\s]*" /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 "[^\s]*" /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 diff --git a/util/shell/bash-completion/pspec.xml b/util/shell/bash-completion/pspec.xml new file mode 100644 index 0000000000..b3563a9620 --- /dev/null +++ b/util/shell/bash-completion/pspec.xml @@ -0,0 +1,61 @@ + + + + + bash-completion + http://bash-completion.alioth.debian.org/ + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + app:console + Programmable completion for bash + 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. + http://bash-completion.alioth.debian.org/files/bash-completion-2.1.tar.bz2 + + + + + + + + bash-completion + + /etc + /usr/share/doc + /usr/share + /var + + + pisilinux + + + System.Package + + + + + + 2014-02-23 + 2.1 + Rebuild + Alihan Öztürk + alihan@pisilinux.org + + + 2013-07-14 + 2.1 + Version bump. + Yusuf Aydemir + yusuf.aydemir@pisilinux.org + + + 2011-06-20 + 1.2 + First release + Pisi Linux Admins + admins@pisilinux.org + + + diff --git a/util/shell/bash-completion/translations.xml b/util/shell/bash-completion/translations.xml new file mode 100644 index 0000000000..c27ec6bc7d --- /dev/null +++ b/util/shell/bash-completion/translations.xml @@ -0,0 +1,8 @@ + + + + bash-completion + Bash kabuğu için otomatik tamamlama + Kabukta çeşitli uygulamalar için otomatik tamamlama özelliği eklenebilmesine olanak sağlayan bir programdır. + + diff --git a/util/shell/bashdb/actions.py b/util/shell/bashdb/actions.py new file mode 100644 index 0000000000..60413bbab0 --- /dev/null +++ b/util/shell/bashdb/actions.py @@ -0,0 +1,22 @@ +#!/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 autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import get + +WorkDir = "%s-4.3-0.91" % get.srcNAME() + +def setup(): + autotools.configure() + +def build(): + autotools.make() + +def install(): + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) + + pisitools.dodoc("AUTHORS", "ChangeLog*", "COPYING", "NEWS", "README", "THANKS", "TODO") diff --git a/util/shell/bashdb/pspec.xml b/util/shell/bashdb/pspec.xml new file mode 100644 index 0000000000..c1baf89087 --- /dev/null +++ b/util/shell/bashdb/pspec.xml @@ -0,0 +1,52 @@ + + + + + bashdb + http://bashdb.sourceforge.net + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + app:console + A Debugger for Bash + bashdb is a comprehensive source-code debugger for bash. + mirrors://sourceforge/bashdb/bashdb-4.3-0.91.tar.gz + + + + bashdb + + /usr/bin + /usr/share/doc + /usr/share/bashdb + /usr/share/info + /usr/share/man + + + + + + 2015-01-22 + 0.91 + Version bump. + Stefan Gronewold(groni) + groni@pisilinux.org + + + 2014-01-19 + 4.2.0.8 + Rebuild + Stefan Gronewold(groni) + groni@pisilinux.org + + + 2011-05-27 + 4.2.0.8 + First release + Pisi Linux Admins + admins@pisilinux.org + + + diff --git a/util/shell/bashdb/translations.xml b/util/shell/bashdb/translations.xml new file mode 100644 index 0000000000..208b4898dd --- /dev/null +++ b/util/shell/bashdb/translations.xml @@ -0,0 +1,8 @@ + + + + bashdb + Bash Kabuğu için bir hata ayıklayıcısı + bashdb, bash için kapsamlı bir kaynak kodu hata ayıklayıcısıdır. + + diff --git a/util/shell/component.xml b/util/shell/component.xml new file mode 100644 index 0000000000..178adb08bc --- /dev/null +++ b/util/shell/component.xml @@ -0,0 +1,3 @@ + + util.shell +