Commit 72210264 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm print contructname: improve delimiter issue

parent 2522eb59
......@@ -270,7 +270,7 @@ compare_version()
}
# construct package file name.
# name version [arch] [pkgtype] [ds]
# name version [arch] [pkgtype] [ds] [pds]
construct_name()
{
local name="$1"
......@@ -278,13 +278,12 @@ construct_name()
local arch="$3"
local pkgtype="$4"
local ds="$5"
local pds
local pds="$6"
[ -n "$arch" ] || arch="$($DISTRVENDOR --distro-arch)"
[ -n "$pkgtype" ] || pkgtype="$PKGFORMAT"
[ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype)
pds="$ds"
[ "$pds" = "-" ] && pds="."
[ -z "$pds" ] && pds="$ds" && [ "$pds" = "-" ] && pds="."
[ -n "$version" ] && version="$ds$version"
echo "${name}${version}${pds}$arch.$pkgtype"
}
......@@ -307,7 +306,7 @@ cat <<EOF
epm print specname from filename NN print spec filename for the source package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
epm print compare [package] version N1 N2 compare (package) versions and print -1 (N1 < N2), 0 (N1 == N2), 1 (N1 > N2)
epm print constructname <name> <version> [arch] [ pkgtype] print distro dependend package filename from args name version arch pkgtype
epm print constructname <name> <version> [arch] [pkgtype] [delimiter1] [delimiter2] print distro dependend package filename from args name version arch pkgtype
EOF
}
......@@ -333,7 +332,7 @@ epm_print()
case "$WHAT" in
"")
fatal "Use epm print help to get help."
fatal "Use epm print --help to get help."
;;
"-h"|"--help"|"help")
epm_print_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