#!/bin/sh
# Take out arch from a file named
# *-arch-release.tgz

if [ -z "$1" ]; then
cat << _EOF_
pkgrelease - return the release portion of a Slackware package.
Usage: pkgname <full_package_name>

Example:
pkgname aaa-bbb-1.2.3-i486-1.tgz
_EOF_
exit 1
fi


PLONG=$1
# ok, try this ...
case ${PLONG##*.} in 
    tgz|tbz|tbz2)
    # take out the ext
    PSHORT=${PLONG%.*}
    echo ${PSHORT##*-}    
    ;;
    *)
    echo ${PLONG##*-}    
    ;;
esac
exit 0
 