Commit 2f457238 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add get_sourcepkg_name function (rpm only) and use it in rpmurl

parent 46fcd193
...@@ -98,16 +98,13 @@ get_pagepkginfo() ...@@ -98,16 +98,13 @@ get_pagepkginfo()
then then
if [ -z ${i/*rpm/} ] if [ -z ${i/*rpm/} ]
then then
# it is rpm package PKGNAME=$(get_sourcepkg_name "$i")
PKGVERSION=$(querypackage ${i} VERSION)
PKGNAME=$(querypackage ${i} sourcerpm | sed -e "s|-$PKGVERSION.*||g")
else else
PKGNAME=$(get_name ${i}) PKGNAME=$(get_name ${i})
fi fi
else else
# installed package name # installed package name
PKGVERSION=$(querypackage ${i} VERSION}) PKGNAME=$(get_sourcepkg_name "$i")
PKGNAME=$(querypackage ${i} sourcerpm | sed -e "s|-$PKGVERSION.*||g")
fi fi
if [ -z "$PKGNAME" ] ; then if [ -z "$PKGNAME" ] ; then
PKGNAME="$i" PKGNAME="$i"
......
...@@ -107,6 +107,14 @@ get_pkgname_from_filename() ...@@ -107,6 +107,14 @@ get_pkgname_from_filename()
echo ${1/-[0-9]*/} echo ${1/-[0-9]*/}
} }
# 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"
}
# build binary package list (1st - repo dir, 2st - pkgname) # build binary package list (1st - repo dir, 2st - pkgname)
# algorithm: list all files in PKGDIR, print packages with our source pkg name # algorithm: list all files in PKGDIR, print packages with our source pkg name
......
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