Commit 1b6ae644 authored by Vitaly Lipatov's avatar Vitaly Lipatov

search_file: realize search_file on ALT Linux via grep local contents_index

parent 4b552598
......@@ -18,12 +18,36 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
local_content_search()
{
local SYSARCH
SYSARCH=$(uname -m)
[ "$SYSARCH" = "x86_64" ] || SYSARCH=i586
local REPODIR=/var/ftp/pub/ALTLinux/Sisyphus
local CI=$REPODIR/$SYSARCH/base/contents_index
local CINOA=$REPODIR/noarch/base/contents_index
local OUTCMD="less"
[ -n "$USETTY" ] || OUTCMD="cat"
test -r $CI && test -r $CINOA || fatal "Can't locate $CI or $CINOA"
{
[ -n "$USETTY" ] && echo "Search in $CI and $CINOA for $1..."
grep -h ".*$1.*\t" $CI $CINOA | sed -e "s|\(.*\)\t\(.*\)|\2: \1|g"
} | $OUTCMD
}
epm_search_file()
{
[ -n "$pkg_filenames" ] || fatal "Run search without names"
case $PMTYPE in
apt-rpm|apt-dpkg)
apt-rpm)
local_content_search $pkg_filenames
return ;;
apt-dpkg)
docmd $SUDO apt-file update
docmd apt-file search $pkg_filenames
return ;;
......
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