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
7a8958c2
Commit
7a8958c2
authored
Apr 14, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-query: add -- after options, fix query --short for rpm
parent
d297792a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
epm-query
bin/epm-query
+10
-8
No files found.
bin/epm-query
View file @
7a8958c2
...
...
@@ -136,8 +136,8 @@ __epm_get_hilevel_nameform()
apt-rpm
)
# use # as delimeter for apt
local
pkg
pkg
=
$(
rpm
-q
--queryformat
"%{NAME}#%{SERIAL}:%{VERSION}-%{RELEASE}
\n
"
$1
)
echo
$pkg
|
grep
-q
"(none)"
&&
pkg
=
$(
rpm
-q
--queryformat
"%{NAME}#%{VERSION}-%{RELEASE}
\n
"
$1
)
pkg
=
$(
rpm
-q
--queryformat
"%{NAME}#%{SERIAL}:%{VERSION}-%{RELEASE}
\n
"
--
$1
)
echo
$pkg
|
grep
-q
"(none)"
&&
pkg
=
$(
rpm
-q
--queryformat
"%{NAME}#%{VERSION}-%{RELEASE}
\n
"
--
$1
)
# HACK: can use only for multiple install packages like kernel
echo
$pkg
|
grep
-q
kernel
||
return
1
echo
$pkg
...
...
@@ -146,8 +146,8 @@ __epm_get_hilevel_nameform()
yum-rpm|dnf-rpm
)
# just use strict version with Epoch and Serial
local
pkg
pkg
=
$(
rpm
-q
--queryformat
"%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}
\n
"
$1
)
echo
$pkg
|
grep
-q
"(none)"
&&
pkg
=
$(
rpm
-q
--queryformat
"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}
\n
"
$1
)
pkg
=
$(
rpm
-q
--queryformat
"%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}
\n
"
--
$1
)
echo
$pkg
|
grep
-q
"(none)"
&&
pkg
=
$(
rpm
-q
--queryformat
"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}
\n
"
--
$1
)
echo
$pkg
return
;;
...
...
@@ -194,7 +194,7 @@ __epm_query_file()
;;
esac
docmd
$CMD
$@
docmd
$CMD
--
$@
}
# hack: dpkg -W will print names for removed packages too (until newest Ubuntu)
...
...
@@ -220,7 +220,7 @@ __epm_query_name()
*
-dpkg
)
#docmd dpkg -l $@ | grep "^ii"
#CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n"
docmd dpkg-query
-W
"--showformat=
\$
{Package}-
\$
{Version}
\n
"
$@
||
return
docmd dpkg-query
-W
"--showformat=
\$
{Package}-
\$
{Version}
\n
"
--
$@
||
return
__epm_query_dpkg_check
$@
||
return
return
;;
...
...
@@ -266,11 +266,13 @@ __epm_query_shortname()
case
$PMTYPE
in
*
-rpm
)
CMD
=
"rpm -q --queryformat %{name}
\n
"
showcmd rpm
-q
--queryformat
'%{name} \n'
--
$@
a
=
''
rpm
-q
--queryformat
'%{name} \n'
--
$@
return
;;
*
-dpkg
)
#CMD="dpkg-query -W --showformat=\${Package}\n"
docmd dpkg-query
-W
"--showformat=
\$
{Package}
\n
"
$@
||
return
docmd dpkg-query
-W
"--showformat=
\$
{Package}
\n
"
--
$@
||
return
__epm_query_dpkg_check
$@
||
return
return
;;
...
...
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