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
Vladislav
eepm
Commits
55c87b3d
Commit
55c87b3d
authored
Feb 11, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add initial support for short output (just package name, without version-release)
parent
06e6a35e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
epm
bin/epm
+4
-0
epm-packages
bin/epm-packages
+1
-0
epm-query_file
bin/epm-query_file
+41
-0
No files found.
bin/epm
View file @
55c87b3d
...
...
@@ -69,6 +69,7 @@ verbose=
quiet
=
nodeps
=
force
=
short
=
non_interactive
=
skip_installed
=
show_command_only
=
...
...
@@ -231,6 +232,9 @@ check_option()
--force
)
# HELPOPT: force install/remove package (f.i., override)
force
=
"--force"
;;
--short
)
# HELPOPT: short output (package instead package-version-release)
short
=
"--short"
;;
--auto
)
# HELPOPT: non interactive mode
non_interactive
=
1
;;
...
...
bin/epm-packages
View file @
55c87b3d
...
...
@@ -24,6 +24,7 @@ epm_packages()
case
$PMTYPE
in
apt-rpm
)
CMD
=
"rpm -qa
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"rpm -qa --queryformat %{name}
\n
$pkg_filenames
"
;;
apt-dpkg
)
CMD
=
"dpkg -l
$pkg_filenames
"
...
...
bin/epm-query_file
View file @
55c87b3d
...
...
@@ -63,6 +63,7 @@ dpkg_print_name_version()
__do_query
()
{
local
CMD
case
$PMTYPE
in
apt-rpm
)
CMD
=
"rpm -qf"
...
...
@@ -96,8 +97,48 @@ __do_query()
docmd
$CMD
$@
}
__do_short_query
()
{
local
CMD
case
$PMTYPE
in
*
-rpm
)
CMD
=
"rpm -qf --queryformat %{NAME}
\n
"
;;
NOapt-dpkg
)
showcmd dpkg
-S
$1
dpkg_print_name_version
$(
dpkg
-S
$1
|
sed
-e
"s|:.*||"
)
return
;;
NOemerge
)
CMD
=
"equery belongs"
;;
NOpacman
)
CMD
=
"pacman -Qo"
;;
NOslackpkg
)
# note: need remove leading slash for grep
docmd
grep
-R
"
$(
echo
$@
|
sed
-e
's|^/\+||g'
)
"
/var/log/packages |
sed
-e
"s|/var/log/packages/||g"
return
;;
*
)
fatal
"Do not known query command for
$PMTYPE
"
;;
esac
docmd
$CMD
$@
}
epm_query_file
()
{
# in short mode print handle only real names and do short output
# TODO: move to separate command?
if
[
-n
"
$short
"
]
;
then
[
-n
"
$pkg_files
"
]
||
fatal
"Run query without file names (needed path to files)"
__do_short_query
$pkg_files
return
fi
# file can exists or not
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without file names"
...
...
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