fix script
This commit is contained in:
parent
1556d489f1
commit
fb6a7e0e3b
10
whatprovides
10
whatprovides
|
@ -41,7 +41,11 @@ update_database() {
|
||||||
|
|
||||||
while getopts :hp:u option; do
|
while getopts :hp:u option; do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
p) cat "${DB_PATH}/${OPTARG}"; exit 0;;
|
p)
|
||||||
|
echo "SELECT owned_file FROM 'whatprovides' WHERE package_name == '${OPTARG}' ORDER BY owned_file;" | \
|
||||||
|
sqlite3 "${DB_PATH}" | awk "{ print \"${OPTARG}: \"\$0 }"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
u) update_database; exit 0;;
|
u) update_database; exit 0;;
|
||||||
h) show_usage; exit 0;;
|
h) show_usage; exit 0;;
|
||||||
*) show_usage; exit 1;;
|
*) show_usage; exit 1;;
|
||||||
|
@ -49,8 +53,8 @@ while getopts :hp:u option; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $# -ge 1 ]; then
|
if [ $# -ge 1 ]; then
|
||||||
echo "SELECT owned_file FROM 'whatprovides' WHERE package_name == '${1}' ORDER BY owned_file;" | \
|
echo "SELECT package_name FROM 'whatprovides' WHERE owned_file == '${1}' ORDER BY package_name;" | \
|
||||||
sqlite3 "${DB_PATH}" | awk "{ print \"${1}: \"\$0 }"
|
sqlite3 "${DB_PATH}" | awk "{ print \$0\": ${1}\" }"
|
||||||
else
|
else
|
||||||
show_usage
|
show_usage
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue