Commit 072158d8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite assure_exists with internal __epm_assure

parent 7b2a0ea3
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012 Etersoft # Copyright (C) 2012, 2014 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2014 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -267,32 +267,25 @@ set_eatmydata() ...@@ -267,32 +267,25 @@ set_eatmydata()
return 0 return 0
} }
assure_exists() #
__get_package_for_command()
{ {
PATH=$PATH:/sbin:/usr/sbin which $1 2>/dev/null >/dev/null && return case "$1" in
echo "Install appropriate package for $1 command..."
case $1 in
equery|revdep-rebuild) equery|revdep-rebuild)
epm install gentoolkit echo 'gentoolkit'
;;
apt-repo)
epm install apt-repo
;;
apt-file)
epm install apt-file
;;
erc)
epm install erc
;; ;;
update-kernel|remove-old-kernels) update-kernel|remove-old-kernels)
epm install update-kernel echo 'update-kernel'
;;
*)
fatal "Internal error: Unknown binary $1 to check if exists"
;; ;;
esac esac
} }
assure_exists()
{
load_helper epm-assure
__epm_assure "$1" $(__get_package_for_command "$1")
}
# improve # improve
get_package_type() get_package_type()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment