Commit 5e53553f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-site: use functions from epm-print

parent a9e9d320
......@@ -18,6 +18,7 @@
#
load_helper epm-query
load_helper epm-print
run_command_if_exists()
{
......@@ -38,28 +39,6 @@ open_browser()
done
}
# FIXME: Copied from etersoft-build-utils
# Query variables from rpm package
querypackage()
{
local FORMAT="%{$2}"
local INSTALLED="-p"
# if name empty, use third param as format string
[ -n "$2" ] || FORMAT="$3"
# if not file, drop -p for get from rpm base
[ -e "$1" ] || INSTALLED=""
rpmquery $INSTALLED --queryformat "$FORMAT" $1
}
# FIXME: Copied from etersoft-build-utils
# return source package name by binary rpm package file
get_sourcepkg_name()
{
local FILE="$1"
local PKGVERSION=$(querypackage "$FILE" VERSION)
querypackage "$FILE" sourcerpm | sed -e "s|-$PKGVERSION.*||g"
}
__query_package_hl_url()
{
case $DISTRNAME in
......@@ -79,7 +58,7 @@ query_package_url()
case $PMTYPE in
*-rpm)
querypackage "$1" URL || __query_package_hl_url "$1"
query_package_field URL "$1" || __query_package_hl_url "$1"
#LANG=C epm info "$1"
return
;;
......@@ -114,7 +93,7 @@ query_altlinux_url()
local URL
case $PMTYPE in
*-rpm)
local srpm=$(get_sourcepkg_name "$1")
local srpm=$(print_srcname "$1")
[ -n "$srpm" ] || fatal "Can't get source name for $1"
echo "$(get_pao_url)/$srpm"
return
......
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