Commit cef1aefa authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: add VCS: support, check also Url if VCS is missed

parent 1b9c872f
...@@ -180,6 +180,23 @@ function get_source_git() ...@@ -180,6 +180,23 @@ function get_source_git()
fi fi
} }
# VCS: http://git.altlinux.org/people/lav/packages/rpm-build-fonts.git
function get_source_vcs()
{
local SPEC="$1"
local SN="$2"
local vcs="$(grep "^VCS:" $SPEC | head -n1 | sed -e 's|VCS:[[:space:]]*||')"
if [ -z "$vcs" ] ; then
# try hack with Url:
local vcs="$(grep "^Url:" $SPEC | head -n1 | sed -e 's|Url:[[:space:]]*||')"
[ -z "$vcs" ] && return 1
GETSOURCEGIT="$vcs"
echo "$vcs" | grep -q "\.git$" || GETSOURCEGIT="$vcs.git"
fi
GETSOURCEGIT="$vcs"
}
# Source-url: ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/last/sources/tarball/%name-%version.tar.gz # Source-url: ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/last/sources/tarball/%name-%version.tar.gz
function get_source_url() function get_source_url()
{ {
...@@ -747,7 +764,7 @@ fi ...@@ -747,7 +764,7 @@ fi
#[ -f "$RPMSOURCEDIR/$FTB" ] && { echog "Tarball $FTB already exists in $RPMSOURCEDIR dir, skipping." ; continue ; } #[ -f "$RPMSOURCEDIR/$FTB" ] && { echog "Tarball $FTB already exists in $RPMSOURCEDIR dir, skipping." ; continue ; }
# Test for eterbuild extensions (will set GETSOURCEURL or GETSOURCESVN) # Test for eterbuild extensions (will set GETSOURCEURL or GETSOURCESVN)
get_source_url $spec $SN || get_source_git $spec $SN || get_source_svn $spec $SN || get_source_script $spec $SN get_source_url $spec $SN || get_source_git $spec $SN || get_source_svn $spec $SN || get_source_script $spec $SN || get_source_vcs $spec $SN
#[ "$SN" = "Source1" ] && exit #[ "$SN" = "Source1" ] && exit
#if ! rhas "$GETSOURCE" ".tar$" ; then #if ! rhas "$GETSOURCE" ".tar$" ; then
# warning "It is recommended to use .tar tarballs for sources ($FTB now)" # warning "It is recommended to use .tar tarballs for sources ($FTB now)"
......
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