Commit 1246cea2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add set_specdir function for fill SPECDIR

parent 9b3d7f87
......@@ -178,3 +178,17 @@ spec_by_srpm()
PKGNAME=$(rpm -qp --queryformat "%{NAME}" $PKG)
[ -n "$PKGNAME" ] && echo $PKGNAME.spec
}
# set specdir by spec (run with full path to spec only or in spec dir)
set_specdir()
{
SPECDIR=.
# get dir from the first spec
if [ -r "$1" ] ; then
SPECDIR=`dirname $1`
fi
# if spec has no full path, guess from pwd
if [ "$SPECDIR" = "." ] ; then
SPECDIR=`pwd`
fi
}
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