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
etersoft
eepm
Commits
31d41b20
Commit
31d41b20
authored
Apr 21, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm print: fix: check if file is real package
parent
5b621591
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
epm-print
bin/epm-print
+11
-3
No files found.
bin/epm-print
View file @
31d41b20
...
@@ -17,6 +17,14 @@
...
@@ -17,6 +17,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# TODO: improve file
is_pkgfile
()
{
[
-f
"
$1
"
]
||
return
echo
"
$1
"
|
grep
-q
"
\.
rpm$"
&&
return
echo
"
$1
"
|
grep
-q
"
\.
deb$"
&&
return
return
1
}
# Query variables from rpm package
# Query variables from rpm package
# TODO: rpm only
# TODO: rpm only
...
@@ -25,8 +33,8 @@ rpm_query_package_format_field()
...
@@ -25,8 +33,8 @@ rpm_query_package_format_field()
local
FORMAT
=
"
$1
\n
"
local
FORMAT
=
"
$1
\n
"
shift
shift
local
INSTALLED
=
""
local
INSTALLED
=
""
# if a file, ad -p for get from rpm base
# if a file, ad
d
-p for get from rpm base
if
[
-f
"
$1
"
]
;
then
if
is_pkgfile
"
$1
"
;
then
INSTALLED
=
"-p"
INSTALLED
=
"-p"
fi
fi
a
=
rpmquery
$INSTALLED
--queryformat
"
$FORMAT
"
"
$@
"
a
=
rpmquery
$INSTALLED
--queryformat
"
$FORMAT
"
"
$@
"
...
@@ -43,7 +51,7 @@ dpkg_query_package_format_field()
...
@@ -43,7 +51,7 @@ dpkg_query_package_format_field()
{
{
local
field
=
"
$1
"
local
field
=
"
$1
"
shift
shift
if
[
-f
"
$1
"
]
;
then
if
is_pkgfile
"
$1
"
;
then
a
=
dpkg-deb
--show
--showformat
=
"
$field
\n
"
"
$@
"
a
=
dpkg-deb
--show
--showformat
=
"
$field
\n
"
"
$@
"
else
else
#a= dpkg -s "$1" | grep "^$field: " | sed -e "s|^$field: ||"
#a= dpkg -s "$1" | grep "^$field: " | sed -e "s|^$field: ||"
...
...
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