Commit 3e029446 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-print: add epm print info command

parent 5468b3f5
...@@ -134,8 +134,8 @@ construct_name() ...@@ -134,8 +134,8 @@ construct_name()
local pkgtype="$4" local pkgtype="$4"
local ds="$5" local ds="$5"
[ -n "$arch" ] || arch="$(distro_info --distro-arch)" [ -n "$arch" ] || arch="$($DISTRVENDOR --distro-arch)"
[ -n "$pkgtype" ] || pkgtype="$(distro_info -p)" [ -n "$pkgtype" ] || pkgtype="$($DISTRVENDOR -p)"
[ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype) [ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype)
[ -n "$version" ] && version="$ds$version" [ -n "$version" ] && version="$ds$version"
echo "${name}${version}${ds/-/.}$arch.$pkgtype" echo "${name}${version}${ds/-/.}$arch.$pkgtype"
...@@ -162,11 +162,12 @@ epm_print() ...@@ -162,11 +162,12 @@ epm_print()
case "$WHAT" in case "$WHAT" in
"") "")
fatal "Use epm print help for get help." fatal "Use epm print help to get help."
;; ;;
"-h"|"--help"|"help") "-h"|"--help"|"help")
cat <<EOF cat <<EOF
Examples: Examples:
epm print info [args] print system and distro info (via distro_info command)
epm print name [from filename|for package] NN print only name of package name or package file epm print name [from filename|for package] NN print only name of package name or package file
epm print version [from filename|for package] NN print only version of package name or package file epm print version [from filename|for package] NN print only version of package name or package file
epm print release [from filename|for package] NN print only release of package name or package file epm print release [from filename|for package] NN print only release of package name or package file
...@@ -271,6 +272,9 @@ EOF ...@@ -271,6 +272,9 @@ EOF
"constructname") "constructname")
construct_name "$@" construct_name "$@"
;; ;;
"info")
$DISTRVENDOR "$@"
;;
*) *)
fatal "Unknown command $ epm print $WHAT. Use epm print help for get help." fatal "Unknown command $ epm print $WHAT. Use epm print help for get help."
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment