Commit e014fc65 authored by Vitaly Lipatov's avatar Vitaly Lipatov

small improve print name

parent 246b2dfa
......@@ -42,20 +42,25 @@ print_binpkgfilelist()
| grep "^$PKGNAME[[:space:]].*" | cut -f2 | xargs -n1 -I "{}" echo -n "$PKGDIR/{} "
}
PKGNAMEMASK="\(.*\)-\(.*\)-\(.*\)"
# TODO: need try detect more strict
# TODO: package name mask for every system
#PKGNAMEMASK1="\(.*\)-\([^0-9].*[^0-9]\)-\(.*[0-9].*\)"
# mask to parse package name
PKGNAMEMASK="\(.*\)-\([0-9].*\)-\(.*[0-9].*\)"
print_name()
{
echo "$@" | xargs -n1000 echo | sed -e "s|$PKGNAMEMASK|\1|g"
echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK|\1|g"
}
print_version()
{
echo "$1" | xargs -n1000 echo | sed -e "s|$PKGNAMEMASK|\2|g"
echo "$1" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK|\2|g"
}
print_release()
{
echo "$1" | xargs -n1000 echo | sed -e "s|$PKGNAMEMASK|\3|g"
echo "$1" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK|\3|g"
}
print_pkgname()
......
#!/bin/sh
get_numdelim()
{
echo -n "$@" | sed -e "s|[^-]||g" | wc -c
}
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$3' do not match with '$2'" || echo "OK for '$1' with '$2'"
......@@ -18,6 +23,7 @@ check_pkgfile()
check_pkg()
{
get_numdelim "$1"
check "$1" "$2" $(../bin/epm print name "$1")
}
......@@ -65,3 +71,10 @@ check_pkg pkg-source-less-1.0.spec pkg-source-less
check_pkg pkg123-1.0.spec pkg123
check_pkg pkg123[_-]1.0.spec pkg123
check_pkg pkg*.spec pkg
check_pkg qt5-webkit-doc qt5-webkit-doc
check_pkg geronimo-j2ee-management-1.1-api geronimo-j2ee-management-1.1-api
check_pkg i586-libgphoto2_port-12 i586-libgphoto2_port-12
check_pkg python-module-qscintilla2-qt4 python-module-qscintilla2-qt4
check_pkg python-module-qscintilla2-qt4-2.9-alt4 python-module-qscintilla2-qt4
check_pkg libqscintilla2-6-qt4 libqscintilla2-6-qt4
check_pkg libqscintilla2-6-qt4-2.5.1-alt4 libqscintilla2-6-qt4
#!/bin/sh
../bin/epmqa --short >$0.0
# get two - packages list
cat $0.0 | grep ".*-.*-.*" | sort >$0.1
# try get their names, it does not have difference
cat $0.1 | ../bin/epm print name | sort >$0.1.1
cat $0.0 | ../bin/epm print name | sort >$0.2
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