Commit 55c12832 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-repack: fix package name-version before convert

parent 7770fc65
......@@ -232,15 +232,22 @@ __prepare_source_package()
__set_version_pkgname $alpkg
if [ -n "$VERSION" ] ; then
# TODO: don't use erc for detect type? then we potentially can skip install it
assure_exists erc || fatal
pkgtype="$(a= erc type $alpkg)"
[ -n "$PKGNAME" ] || PKGNAME=$(basename $alpkg .$pkgtype)
local newalpkg
newalpkg=$PKGNAME-$VERSION.$pkgtype
#[ -n "$PKGNAME" ] || PKGNAME=$(basename $alpkg .$pkgtype)
if [ "$pkgtype" = "tar" ] || [ "$pkgtype" = "tar.gz" ] || [ "$pkgtype" = "tgz" ] ; then
mv $alpkg $newalpkg
:
else
newalpkg=$(basename $alpkg .$pkgtype).tar
newalpkg=$PKGNAME-$VERSION.tar
#newalpkg=$(basename $alpkg .$pkgtype).tar
assure_exists erc || fatal
a= erc repack $alpkg $newalpkg || fatal
fi
if [ "$alpkg" != "$newalpkg" ] ; then
rm -f $verbose $alpkg
alpkg=$newalpkg
fi
......@@ -309,7 +316,7 @@ __epm_repack_to_rpm()
[ -s "$spec" ] || fatal "can't find spec"
mv $spec $tmpbuilddir || fatal
spec="$tmpbuilddir/$(basename "$spec")"
__set_name_version $spec $PKGNAME $VERSION
#__set_name_version $spec $PKGNAME $VERSION
local pkgname="$(grep "^Name: " $spec | sed -e "s|Name: ||g" | head -n1)"
# for tarballs fix permissions
......
#!/bin/sh
__set_version_pkgname()
{
local alpkg="$1"
VERSION="$(echo "$alpkg" | grep -o -P "[-_.]([0-9])([0-9])*(\.[0-9])*" | head -n1 | sed -e 's|^[-_.]||')" #"
[ -n "$VERSION" ] && PKGNAME="$(echo "$alpkg" | sed -e "s|[-_.]$VERSION.*||")"
}
NAME="Telegram.4.0.4.beta.tar"
__set_version_pkgname $NAME
echo "$NAME: $PKGNAME -- $VERSION"
# $ fakeroot alien -d -k Telegram.4.0.4.beta.tar
# telegram.4.0.4.beta_1-1_all.deb
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