diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/.gitignore | 2 | ||||
-rw-r--r-- | data/Makefile.am | 11 | ||||
-rw-r--r-- | data/bash-completion.sh | 47 | ||||
-rw-r--r-- | data/razor.pc.in | 12 |
4 files changed, 72 insertions, 0 deletions
diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..16bc098 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,2 @@ +razor.pc + diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..9405c68 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,11 @@ +## Process this file with automake to produce Makefile.in + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = razor.pc + +bashcompletiondir = ${SYSCONFDIR}/bash_completion.d +dist_bashcompletion_DATA = bash-completion.sh + +clean-local : + rm -f *~ + diff --git a/data/bash-completion.sh b/data/bash-completion.sh new file mode 100644 index 0000000..a9c4221 --- /dev/null +++ b/data/bash-completion.sh @@ -0,0 +1,47 @@ +__razor_commands () { + local IFS=$'\n' + COMPREPLY=($(IFS=: compgen -S' ' -W "info:list-requires:list-provides:list-files:list-file-packages:list-package-files:what-requires:what-provides:import-yum:import-rpmdb:validate:update:diff:install:init:download" -- $1)) +} + +__razor_packages () { + local IFS=$'\n' + + COMPREPLY=($(./razor list --only-names "$1*" | while read p; do echo "$p "; done)) +} + +__razor_upstream_packages () { + local IFS=$'\n' + + COMPREPLY=($(RAZOR_REPO=rawhide.repo ./razor list --only-names "$1*" | while read p; do echo "$p "; done)) +} + +__razor_files() { + COMPREPLY=($(./razor list-files "$1*")) +} + +__razor_requires() { + COMPREPLY=($(compgen -W "$(./razor list-requires)" -- $1)) +} + +__razor_provides() { + COMPREPLY=($(compgen -W "$(./razor list-provides)" -- $1)) +} + +__razor() { + local cur="${COMP_WORDS[COMP_CWORD]}" + + if [ $COMP_CWORD = 1 ]; then + __razor_commands $cur + else + case "${COMP_WORDS[1]}" in + info|list-requires|list-provides|list-package-files) + __razor_packages $cur ;; + list-files|list-file-packages) __razor_files $cur ;; + what-requires) __razor_requires $cur ;; + what-provides) __razor_provides $cur ;; + install|download) __razor_upstream_packages $cur ;; + esac + fi +} + +complete -o nospace -F __razor razor diff --git a/data/razor.pc.in b/data/razor.pc.in new file mode 100644 index 0000000..ddf0ba0 --- /dev/null +++ b/data/razor.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: razor +Description: library for depsolving, installing and removing packages +Version: @VERSION@ +Requires: expat curl +Libs: -L${libdir} -lexpat -lz -lcurl +Cflags: -I${includedir}/razor + |