Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nurlan
eepm
Commits
58842d6a
Commit
58842d6a
authored
Mar 10, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
colorify search_file
parent
a0b1fb81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
epm-filelist
bin/epm-filelist
+2
-2
epm-search_file
bin/epm-search_file
+17
-9
No files found.
bin/epm-filelist
View file @
58842d6a
#!/bin/sh
#
# Copyright (C) 2012-201
6
Etersoft
# Copyright (C) 2012-201
6
Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-201
7
Etersoft
# Copyright (C) 2012-201
7
Vitaly Lipatov <lav@etersoft.ru>
#
# 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
...
...
bin/epm-search_file
View file @
58842d6a
#!/bin/sh
#
# Copyright (C) 2012, 2016 Etersoft
# Copyright (C) 2012, 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2016
, 2017
Etersoft
# Copyright (C) 2012, 2016
, 2017
Vitaly Lipatov <lav@etersoft.ru>
#
# 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
...
...
@@ -17,10 +17,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: see epm-search (colorify for all distro)
# args: index_lists word grep_string
__alt_search_file_output
()
{
# grep only on left part (filename), then revert order and grep with color
__local_ercat
$1
|
grep
-h
--
".*
$2
.*[[:space:]]"
|
sed
-e
"s|
\(
.*
\)\t\(
.*
\)
|
\2
:
\1
|g"
$3
}
__alt_local_content_search
()
{
load_helper epm-sh-altlinux
load_helper epm-search
info
"Locate contents index file(s) ..."
local
CI
=
"
$(
get_local_alt_contents_index
)
"
...
...
@@ -30,13 +39,12 @@ __alt_local_content_search()
info
"Searching in"
echo
"
$CI
"
echo
"for
$1
... "
#[ -n "$USETTY" ] || OUTCMD="cat"
# OUTCMD="cat"
# {
# note! tabulation below!
__local_ercat
$CI
|
grep
-h
--
".*
$1
.* "
|
sed
-e
"s|
\(
.*
\)\t\(
.*
\)
|
\2
:
\1
|g"
# } | $OUTCMD
# FIXME: do it better
local
MGS
MGS
=
$(
eval
__epm_search_make_grep
$quoted_args
)
showcmd
"
$
cat contents_index
$MGS
"
eval
"__alt_search_file_output
\"
$CI
\"
\"
$(
eval
get_firstarg
$quoted_args
)
\"
$MGS
"
}
epm_search_file
()
...
...
@@ -60,7 +68,7 @@ case $PMTYPE in
;;
dnf-rpm
)
# TODO
info
"Search by full packages list i
s
not implemented yet"
info
"Search by full packages list i
s
not implemented yet"
CMD
=
"dnf provides"
;;
urpm-rpm
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment