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
9caedb2c
Commit
9caedb2c
authored
Aug 04, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-search: introduce grep extra args in search
parent
4f496fdb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
9 deletions
+33
-9
epm
bin/epm
+2
-0
epm-search
bin/epm-search
+31
-9
No files found.
bin/epm
View file @
9caedb2c
...
...
@@ -80,6 +80,7 @@ show_command_only=
epm_cmd
=
pkg_files
=
pkg_names
=
quoted_args
=
progname
=
"
${
0
##*/
}
"
...
...
@@ -290,6 +291,7 @@ for opt in "$@" ; do
else
pkg_names
=
"
$pkg_names
$opt
"
fi
quoted_args
=
"
$quoted_args
\"
$opt
\"
"
done
pkg_files
=
$(
strip_spaces
"
$pkg_files
"
)
...
...
bin/epm-search
View file @
9caedb2c
...
...
@@ -17,13 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# copied from korinf/tools/run-script/scripts/search
epm_search
()
__epm_search_output
()
{
local
CMD
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run search without names"
local
CMD
local
string
=
"
$1
"
case
$PMTYPE
in
apt-rpm|apt-dpkg
)
CMD
=
"apt-cache search"
...
...
@@ -56,7 +53,7 @@ case $PMTYPE in
CMD
=
"mpkg search"
;;
npackd
)
docmd npackdcl search
--query
=
"
$
pkg_filenames
"
--status
=
all
docmd npackdcl search
--query
=
"
$
string
"
--status
=
all
return
;;
chocolatey
)
...
...
@@ -65,7 +62,7 @@ case $PMTYPE in
slackpkg
)
# FIXME
echo
"FIXME: need case insensitive search"
docmd_foreach
"/usr/sbin/slackpkg search"
$
pkg_filenames
docmd_foreach
"/usr/sbin/slackpkg search"
$
string
return
;;
homebrew
)
...
...
@@ -76,6 +73,31 @@ case $PMTYPE in
;;
esac
docmd
$CMD
$pkg_filenames
docmd
$CMD
$string
}
# produce grep sequence
__epm_search_make_grep
()
{
local
i
local
string
=
"
$1
"
shift
echo
-n
"
\"
$string
\"
"
for
i
in
$@
;
do
local
NOR
=
${
i
/^/
}
if
[
"
$NOR
"
=
"
$i
"
]
;
then
echo
-n
" | grep --
\"
$i
\"
"
else
echo
-n
" | grep -v --
\"
$NOR
\"
"
fi
done
}
# copied from korinf/tools/run-script/scripts/search
epm_search
()
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run search without any string"
# FIXME: do it better
eval
"__epm_search_output
$(
eval
__epm_search_make_grep
$quoted_args
)
"
}
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