epm-query_package 1.23 KB
Newer Older
1 2 3 4 5
#!/bin/sh
#
# Copyright (C) 2012  Etersoft
# Copyright (C) 2012  Vitaly Lipatov <lav@etersoft.ru>
#
6 7 8
# 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
# the Free Software Foundation, either version 3 of the License, or
9 10 11 12 13
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
15
#
16 17
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18 19 20
#

load_helper epm-packages
21
load_helper epm-search
22

23 24
__epm_query_package()
{
25
	(pkg_filenames="$*" quoted_args="$*" quiet=1 epm_query_package)
26 27
}

28 29
epm_query_package()
{
Vitaly Lipatov's avatar
Vitaly Lipatov committed
30
	[ -n "$pkg_filenames" ] || fatal "Please, use search with some argument or run epmqa for get all packages."
31
	# FIXME: do it better
Vitaly Lipatov's avatar
Vitaly Lipatov committed
32 33
	local MGS
	MGS=$(eval __epm_search_make_grep $quoted_args)
34
	EXTRA_SHOWDOCMD=$MGS
Vitaly Lipatov's avatar
Vitaly Lipatov committed
35
	# Note: get all packages list and do grep
36
	(eval "pkg_filenames='' epm_packages \"$(eval get_firstarg $quoted_args)\" $MGS")
37
}