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

fix some get source issues

parent 9d3a8989
...@@ -68,7 +68,7 @@ check_tarball() ...@@ -68,7 +68,7 @@ check_tarball()
get_ext() get_ext()
{ {
rhas "$1" "\." && echo "$1" | sed -e "s|.*\.||" rhas "$1" "\." && echo "$1" | sed -e "s|.*\.||" | grep -v "/"
} }
# Args: URL TARGET # Args: URL TARGET
...@@ -130,8 +130,9 @@ function source_ext() ...@@ -130,8 +130,9 @@ function source_ext()
# Fake replace for correct subst variables # Fake replace for correct subst variables
NEWSOURCE="$(echo "$NEWSOURCE" | sed -e 's|\&|\\&|g')" NEWSOURCE="$(echo "$NEWSOURCE" | sed -e 's|\&|\\&|g')"
# TODO: use special field before %build # TODO: use special field before %build
cat $1 | sed -e "s|^Summary:.*|Summary: $NEWSOURCE|g" > $TMPSPEC cat $1 | sed -e "s|^Summary:.*||g" | sed -e "s|^\(\%description.*\)|Summary: $NEWSOURCE\n\1|g" > $TMPSPEC
GETSOURCEEXT=$(eval_spec "$TMPSPEC" | get_var "Summary") GETSOURCEEXT=$(eval_spec "$TMPSPEC" | get_var "Summary")
#rhas "$GETSOURCEEXT" "%" && fatal "some macro unexpanded in URL. Check $TMPSPEC"
rm -f "$TMPSPEC" rm -f "$TMPSPEC"
fi fi
...@@ -158,6 +159,7 @@ function get_source_git() ...@@ -158,6 +159,7 @@ function get_source_git()
function get_source_url() function get_source_url()
{ {
GETSOURCEURL=$(source_ext "$1" url "$2") GETSOURCEURL=$(source_ext "$1" url "$2")
#rhas "$GETSOURCEURL" "%" && fatal "some macro unexpanded in URL. Check $TMPSPEC"
} }
function print_error() function print_error()
...@@ -208,6 +210,7 @@ commit_tarball_to_dir() ...@@ -208,6 +210,7 @@ commit_tarball_to_dir()
gear_update_from_tarball "$TARBALL" "$CURNAME" $FORCEDOWNLOAD || { warning "Error with update tarball in repo" ; return 1 ; } gear_update_from_tarball "$TARBALL" "$CURNAME" $FORCEDOWNLOAD || { warning "Error with update tarball in repo" ; return 1 ; }
# force commit ever files from .gitignore # force commit ever files from .gitignore
docmd git add -f "$CURNAME" docmd git add -f "$CURNAME"
# TODO: add GETSOURCEURL url
docmd git commit -m "just import $(basename $TARBALL) with rpmgs script" docmd git commit -m "just import $(basename $TARBALL) with rpmgs script"
rm -fv "$TARBALL" rm -fv "$TARBALL"
else else
...@@ -246,7 +249,7 @@ update_post_git_submodules() ...@@ -246,7 +249,7 @@ update_post_git_submodules()
info "Detected post git submodules hook" info "Detected post git submodules hook"
cat $(get_root_git_dir)/.gear/rules | grep -q "tar:.*-postsubmodules" || fatal "missed tar:.gear/$BASENAME-posmodules in $(get_root_git_dir)/.gear/rules" cat $(get_root_git_dir)/.gear/rules | grep -q "tar:.*-postsubmodules" || fatal "missed tar:.gear/$BASENAME-postmodules in $(get_root_git_dir)/.gear/rules"
[ -s $(get_root_git_dir)/.gitmodules ] || fatal "there is no .gitmodules file in repo root" [ -s $(get_root_git_dir)/.gitmodules ] || fatal "there is no .gitmodules file in repo root"
docmd git submodule init docmd git submodule init
...@@ -365,7 +368,7 @@ do ...@@ -365,7 +368,7 @@ do
# 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
#[ "$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)"
#fi #fi
...@@ -391,7 +394,8 @@ do ...@@ -391,7 +394,8 @@ do
continue continue
else else
# only for main source # only for main source
fatal "$SN $GETSOURCE has no URL" warning "$SN $GETSOURCE has no URL"
continue
fi fi
fi fi
download_any_tarball "$GETSOURCE" "$FTB" download_any_tarball "$GETSOURCE" "$FTB"
......
...@@ -72,6 +72,7 @@ checkout_bpbranch() ...@@ -72,6 +72,7 @@ checkout_bpbranch()
if ! git branch -a | grep -q "remotes/$PGEAR/$USEBRANCH" ; then if ! git branch -a | grep -q "remotes/$PGEAR/$USEBRANCH" ; then
# if we have no fetched branch # if we have no fetched branch
docmd gremote $GIRARHOST -o docmd gremote $GIRARHOST -o
docmd git fetch $PGEAR
fi fi
# if we successful with gear # if we successful with gear
if git branch -a | grep -q "remotes/$PGEAR/$USEBRANCH" ; then if git branch -a | grep -q "remotes/$PGEAR/$USEBRANCH" ; then
......
...@@ -48,18 +48,21 @@ get_tardir_from_rules() ...@@ -48,18 +48,21 @@ get_tardir_from_rules()
local tar="$1" local tar="$1"
local packname="$(basename "$2" .$tar)" local packname="$(basename "$2" .$tar)"
local dir local dir
dir=$(print_gear_rules | grep "$tar *:" | grep "name=$packname" | sed -e "s|$tar *: *||g" | sed -e "s| .*||g") if print_gear_rules | grep "$tar *:" | grep -q -v "name=" ; then
dir=$(print_gear_rules | grep "$tar *:" | sed -e "s|$tar *: *||g" | sed -e "s| .*||g" | head -n1)
else
dir=$(print_gear_rules | grep "$tar *:" | grep "name=$packname" | sed -e "s|$tar *: *||g" | sed -e "s| .*||g" | head -n1)
fi
if [ -z "$dir" ] ; then if [ -z "$dir" ] ; then
if ! print_gear_rules | grep "$tar *:" | grep -q "name=" ; then
dir=$(print_gear_rules | grep "$tar *:" | sed -e "s|$tar *: *||g" | sed -e "s| .*||g")
else
fatal "no $tar rules found in $(get_gear_rules) between fatal "no $tar rules found in $(get_gear_rules) between
$(print_gear_rules | grep "$tar *:")" $(print_gear_rules | grep "$tar *:")"
fi fi
fi
if [ "$dir" = "." ] || [ -z "$dir" ] || echo "$dir" | grep -q ":" ; then if [ "$dir" = "." ] || [ -z "$dir" ] || echo "$dir" | grep -q ":" ; then
return 1 return 1
fi fi
realpath "$(get_root_git_dir)/$dir" realpath "$(get_root_git_dir)/$dir"
} }
......
...@@ -229,7 +229,7 @@ add_changelog_helper() ...@@ -229,7 +229,7 @@ add_changelog_helper()
return 1 return 1
fi fi
[ -z "$SPECS" ] && fatal "run add_changelog without spec(s)" [ -z "$SPECS" ] && fatal "run add_changelog without spec(s)"
add_changelog -e "$DESC" $SPECS LANG=C add_changelog -e "$DESC" $SPECS
R=$? R=$?
[ -n "$QUIET" ] && return [ -n "$QUIET" ] && return
......
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