summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJames Bowes <jbowes@redhat.com>2008-06-20 19:04:06 -0400
committerJames Bowes <jbowes@redhat.com>2008-06-20 19:04:47 -0400
commitc778afefaa189c6aa8437fc00512f140a6a68efe (patch)
tree2b62b297754d70db03ff990c5d196f696aa34976 /data
parent08973b4c9c22a4dcbed220daa38fcf510ba9146d (diff)
parente557f97da15b1682b2e9854672b019485bc48362 (diff)
Merge branch 'krh/master'
Conflicts: librazor/razor.h librazor/rpm.c razor.c src/main.c
Diffstat (limited to 'data')
-rw-r--r--data/.gitignore2
-rw-r--r--data/Makefile.am11
-rw-r--r--data/bash-completion.sh47
-rw-r--r--data/razor.pc.in12
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
+