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

fix some get source issues

parent 9d3a8989
......@@ -68,7 +68,7 @@ check_tarball()
get_ext()
{
rhas "$1" "\." && echo "$1" | sed -e "s|.*\.||"
rhas "$1" "\." && echo "$1" | sed -e "s|.*\.||" | grep -v "/"
}
# Args: URL TARGET
......@@ -130,8 +130,9 @@ function source_ext()
# Fake replace for correct subst variables
NEWSOURCE="$(echo "$NEWSOURCE" | sed -e 's|\&|\\&|g')"
# 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")
#rhas "$GETSOURCEEXT" "%" && fatal "some macro unexpanded in URL. Check $TMPSPEC"
rm -f "$TMPSPEC"
fi
......@@ -158,6 +159,7 @@ function get_source_git()
function get_source_url()
{
GETSOURCEURL=$(source_ext "$1" url "$2")
#rhas "$GETSOURCEURL" "%" && fatal "some macro unexpanded in URL. Check $TMPSPEC"
}
function print_error()
......@@ -208,6 +210,7 @@ commit_tarball_to_dir()
gear_update_from_tarball "$TARBALL" "$CURNAME" $FORCEDOWNLOAD || { warning "Error with update tarball in repo" ; return 1 ; }
# force commit ever files from .gitignore
docmd git add -f "$CURNAME"
# TODO: add GETSOURCEURL url
docmd git commit -m "just import $(basename $TARBALL) with rpmgs script"
rm -fv "$TARBALL"
else
......@@ -246,7 +249,7 @@ update_post_git_submodules()
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"
docmd git submodule init
......@@ -365,7 +368,7 @@ do
# Test for eterbuild extensions (will set GETSOURCEURL or GETSOURCESVN)
get_source_url $spec $SN || get_source_git $spec $SN || get_source_svn $spec $SN
#[ "$SN" = "Source1" ] && exit
#if ! rhas "$GETSOURCE" ".tar$" ; then
# warning "It is recommended to use .tar tarballs for sources ($FTB now)"
#fi
......@@ -391,7 +394,8 @@ do
continue
else
# only for main source
fatal "$SN $GETSOURCE has no URL"
warning "$SN $GETSOURCE has no URL"
continue
fi
fi
download_any_tarball "$GETSOURCE" "$FTB"
......
......@@ -72,6 +72,7 @@ checkout_bpbranch()
if ! git branch -a | grep -q "remotes/$PGEAR/$USEBRANCH" ; then
# if we have no fetched branch
docmd gremote $GIRARHOST -o
docmd git fetch $PGEAR
fi
# if we successful with gear
if git branch -a | grep -q "remotes/$PGEAR/$USEBRANCH" ; then
......
......@@ -48,18 +48,21 @@ get_tardir_from_rules()
local tar="$1"
local packname="$(basename "$2" .$tar)"
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 ! 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
$(print_gear_rules | grep "$tar *:")"
fi
fi
if [ "$dir" = "." ] || [ -z "$dir" ] || echo "$dir" | grep -q ":" ; then
return 1
fi
realpath "$(get_root_git_dir)/$dir"
}
......
......@@ -229,7 +229,7 @@ add_changelog_helper()
return 1
fi
[ -z "$SPECS" ] && fatal "run add_changelog without spec(s)"
add_changelog -e "$DESC" $SPECS
LANG=C add_changelog -e "$DESC" $SPECS
R=$?
[ -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