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
bf1133da
Commit
bf1133da
authored
Sep 06, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-query: support for short form of package name on Gentoo
parent
ebc2324d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
epm-query
bin/epm-query
+16
-3
No files found.
bin/epm-query
View file @
bf1133da
...
...
@@ -19,19 +19,32 @@
load_helper epm-packages
# TODO: combine with -qa (the difference only in return status now)
_get_grep_exp
()
{
local
def
=
"^
$1
$"
[
"
$PMTYPE
"
!=
"emerge"
]
&&
echo
"
$def
"
&&
return
# Gentoo hack: support for short package form
echo
"
$1
"
|
grep
-q
"/"
&&
echo
"
$def
"
&&
return
echo
"/
$1
$"
}
# TODO: combine with -qa (the difference only in return status now)
_query_via_packages_list
()
{
local
res
=
0
local
grepexp
local
firstpkg
=
$1
shift
grepexp
=
$(
_get_grep_exp
$firstpkg
)
# separate first line for print out command
short
=
1
pkg_filenames
=
$firstpkg
epm_packages |
grep
--
"
^
$firstpkg
$
"
||
res
=
1
short
=
1
pkg_filenames
=
$firstpkg
epm_packages |
grep
--
"
$grepexp
"
||
res
=
1
for
pkg
in
"
$@
"
;
do
short
=
1
pkg_filenames
=
$pkg
epm_packages 2>/dev/null |
grep
--
"^
$pkg
$"
||
res
=
1
grepexp
=
$(
_get_grep_exp
$pkg
)
short
=
1
pkg_filenames
=
$pkg
epm_packages 2>/dev/null |
grep
--
"
$grepexp
"
||
res
=
1
done
return
$res
...
...
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