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

rpmgs: add download script support (Source-script)

parent 982689b4
...@@ -170,6 +170,12 @@ function get_source_url() ...@@ -170,6 +170,12 @@ function get_source_url()
#rhas "$GETSOURCEURL" "%" && fatal "some macro unexpanded in URL. Check $TMPSPEC" #rhas "$GETSOURCEURL" "%" && fatal "some macro unexpanded in URL. Check $TMPSPEC"
} }
# Source-script: .gear/update.sh
function get_source_script()
{
GETSOURCESCRIPT=$(source_ext "$1" script "$2")
}
function print_error() function print_error()
{ {
echog "Can't find any spec file. It is possible you run this script not in git dir." echog "Can't find any spec file. It is possible you run this script not in git dir."
...@@ -475,7 +481,7 @@ do ...@@ -475,7 +481,7 @@ do
#[ -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_url $spec $SN || get_source_git $spec $SN || get_source_svn $spec $SN || get_source_script $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)"
...@@ -487,6 +493,12 @@ do ...@@ -487,6 +493,12 @@ do
elif [ -n "${GETSOURCEGIT}" ] ; then elif [ -n "${GETSOURCEGIT}" ] ; then
is_gear $SPECDIR || fatal "Source-git works only with gear repo" is_gear $SPECDIR || fatal "Source-git works only with gear repo"
elif [ -n "${GETSOURCESCRIPT}" ] ; then
is_gear $SPECDIR || fatal "Source-script works only with gear repo"
#[ -x "$GETSOURCESCRIPT" ] || fatal "Can't find executable $GETSOURCESCRIPT"
bash -x $(get_root_git_dir)/$GETSOURCESCRIPT $GSSETVERSION "$FTB" || fatal "fatal with $GETSOURCESCRIPT"
DOWNLOADSOME=1
# TODO: rewrite code to use original file format and temp. download dir # TODO: rewrite code to use original file format and temp. download dir
elif [ -n "${GETSOURCEURL}" ] ; then elif [ -n "${GETSOURCEURL}" ] ; then
if [ -z "$FORCEDOWNLOAD" ] && check_tarball "$FTB" ; then if [ -z "$FORCEDOWNLOAD" ] && check_tarball "$FTB" ; then
......
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