Commit cd98fc6e authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-print: add hack for shortname

parent 2864a997
...@@ -160,11 +160,20 @@ PKGNAMEMASK="\(.*\)-\([0-9].*\)-\(.*[0-9].*\)\.\(.*\)\.\(.*\)" ...@@ -160,11 +160,20 @@ PKGNAMEMASK="\(.*\)-\([0-9].*\)-\(.*[0-9].*\)\.\(.*\)\.\(.*\)"
print_name() print_name()
{ {
# FIXME:
# don't change name (false cases) # don't change name (false cases)
#echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|" #echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|"
echo "$@" | xargs -n1 echo echo "$@" | xargs -n1 echo
} }
# as hack for print_name
print_shortname()
{
#if [ "$
#echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|"
echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK3|\1|"
}
print_version() print_version()
{ {
echo "$1" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\2|" echo "$1" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\2|"
...@@ -262,6 +271,7 @@ cat <<EOF ...@@ -262,6 +271,7 @@ cat <<EOF
Examples: Examples:
epm print info [args] print system and distro info (via distro_info command) 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 shortname [for package] NN print only short name of package name
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
epm print version-release [from filename|for package] NN print only release-release of package name or package file epm print version-release [from filename|for package] NN print only release-release of package name or package file
...@@ -333,6 +343,10 @@ epm_print() ...@@ -333,6 +343,10 @@ epm_print()
print_release "$@" print_release "$@"
fi fi
;; ;;
"shortname")
[ -n "$1" ] || exit 0 #fatal "Arg is missed"
print_shortname "$@"
;;
"version-release") "version-release")
[ -n "$1" ] || fatal "Arg is missed" [ -n "$1" ] || fatal "Arg is missed"
if [ -n "$FNFLAG" ] ; then if [ -n "$FNFLAG" ] ; then
......
...@@ -24,7 +24,7 @@ check_pkgfile() ...@@ -24,7 +24,7 @@ check_pkgfile()
check_pkg() check_pkg()
{ {
get_numdelim "$1" get_numdelim "$1"
check "$1" "$2" $(../bin/epm print name "$1") check "$1" "$2" $(../bin/epm print shortname "$1")
} }
echo "check_file" echo "check_file"
...@@ -66,6 +66,8 @@ check_pkg nx-libs-3.5.99.26.1-eter2astra:amd64 nx-libs ...@@ -66,6 +66,8 @@ check_pkg nx-libs-3.5.99.26.1-eter2astra:amd64 nx-libs
check_pkg nx-libs-3.5.99.26.1-eter2astra nx-libs check_pkg nx-libs-3.5.99.26.1-eter2astra nx-libs
check_pkg nx-libs_3.5.99.26.1_eter2astra:amd64 nx-libs check_pkg nx-libs_3.5.99.26.1_eter2astra:amd64 nx-libs
check_pkg nx-libs_3.5.99.26.1_eter2astra nx-libs check_pkg nx-libs_3.5.99.26.1_eter2astra nx-libs
check_pkg pngquant-2.17.0-alt1_0 pngquant
check_pkg java-1.8.0-openjdk-headless-0:1.8.0.362.b09 java-1.8.0-openjdk-headless
echo echo
echo "check_pkg" echo "check_pkg"
......
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