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
09c145c2
Commit
09c145c2
authored
Apr 25, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm status: implement support for --installed package version checking
parent
c6387a43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
epm-status
bin/epm-status
+22
-3
common.sh
play.d/common.sh
+2
-11
No files found.
bin/epm-status
View file @
09c145c2
...
@@ -69,6 +69,25 @@ __epm_vendor_ok_scripts()
...
@@ -69,6 +69,25 @@ __epm_vendor_ok_scripts()
return
$res
return
$res
}
}
# check if the package is installed and the version is enough (if the version is specified)
epm_status_installed
()
{
local
pkg
=
"
$1
"
local
needed
=
"
$2
"
local
ver
is_installed
"
$pkg
"
||
return
[
-z
"
$needed
"
]
&&
return
ver
=
$(
epm print version
for
package
"
$pkg
"
|
head
-n1
)
if
[
-n
"
$ver
"
]
&&
[
"
$(
epm print compare version
"
$ver
"
"
$needed
"
)
"
=
"-1"
]
;
then
return
1
fi
return
0
}
epm_status_installable
()
epm_status_installable
()
{
{
...
@@ -192,10 +211,10 @@ epm_status_help()
...
@@ -192,10 +211,10 @@ epm_status_help()
cat
<<
EOF
cat
<<
EOF
epm status - check status of the package and return result via exit code
epm status - check status of the package and return result via exit code
Usage: epm status [options] <package>
Usage: epm status [options] <package>
[version]
Options:
Options:
--installed
check if <package> is installed
--installed
[version] check if <package> is installed (if version is specified, not older than the version)
--installable check if <package> can be installed from the repo
--installable check if <package> can be installed from the repo
--original check if <package> is from distro repo
--original check if <package> is from distro repo
--certified check if <package> is certified that it can be installed without repacking
--certified check if <package> is certified that it can be installed without repacking
...
@@ -224,7 +243,7 @@ epm_status()
...
@@ -224,7 +243,7 @@ epm_status()
return
return
;;
;;
--installed
)
--installed
)
i
s_installed
"
$@
"
epm_statu
s_installed
"
$@
"
return
return
;;
;;
--original
)
--original
)
...
...
play.d/common.sh
View file @
09c145c2
...
@@ -174,17 +174,8 @@ get_pkgvendor()
...
@@ -174,17 +174,8 @@ get_pkgvendor()
is_pkg_enough
()
is_pkg_enough
()
{
{
local
needed
=
"
$2
"
# epm print enough package version "$PKG" "$needed"
local
PKG
=
"
$1
"
epm status
--installed
"
$PKG
"
"
$needed
"
if
epm status
--installed
$PKG
;
then
local
ver
ver
=
$(
epm print version
for
package
"
$PKG
"
|
head
-n1
)
if
[
-n
"
$ver
"
]
&&
[
"
$(
epm print compare version
"
$ver
"
"
$needed
"
)
"
=
"-1"
]
;
then
return
1
fi
fi
return
0
}
}
# arg: minimal require of libstdc++ version
# arg: minimal require of libstdc++ version
...
...
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