Commit 592124fa authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: initial support for for archive downloading

parent 583320a1
......@@ -202,7 +202,15 @@ is_gear_sources()
commit_tarball_to_dir()
{
local TARBALL="$1"
local CURNAME="$2"
local EXTTARBALL="$2"
local CURNAME="$3"
if [ "$EXTTARBALL" = "copy" ] ; then
#local OLDFILE=$(echo "$CURNAME")
cp -v "$TARBALL" "$CURNAME"
docmd git add "$CURNAME"
return 0
fi
if [ -f "$TARBALL" ] ; then
gear_update_from_tarball "$TARBALL" "$CURNAME" $FORCEDOWNLOAD || { warning "Error with update tarball in repo" ; return 1 ; }
......@@ -223,19 +231,24 @@ commit_tarball_to_dir()
commit_tarball()
{
local TARBALL="$1"
local EXTTARBALL="$(get_ext $TARBALL)"
local CURNAME
CURNAME=$(get_tardir_from_rules "$(get_ext $TARBALL)" $(basename "$TARBALL")) || fatal "There is no correct 'tar:' line in gear rules file, needed for commit tarball"
# "
CURNAME=$(get_tardir_from_rules "$EXTTARBALL" $(basename "$TARBALL"))
if [ -z "$CURNAME" ] ; then
EXTTARBALL="copy"
CURNAME=$(get_tardir_from_rules "$EXTTARBALL" $(basename "$TARBALL"))
[ -n "$CURNAME" ] || fatal "There is no correct '$EXTTARBALL:' line nor copy: in gear rules file for $(basename "$TARBALL"), needed for commit tarball"
fi
# FIXME:
# use real path for download
#is_gear_sources && CURNAME=
is_gear_sources && fatal "FIXME: is_gear_sources"
is_gear_sources && fatal "FIXME: fail with is_gear_sources in commit_tarball"
# hack: try detect dir for unpacking
#test -d "$CURNAME" || CURNAME=$(get_root_git_dir)/$(get_tarballname "$spec")
#test -d "$CURNAME" || CURNAME=$(get_root_git_dir)/$BASENAME
commit_tarball_to_dir $TARBALL $CURNAME
commit_tarball_to_dir "$TARBALL" "$EXTTARBALL" "$CURNAME"
}
# update .gear/@name@-postsubmodules if needed
......
......@@ -59,9 +59,10 @@ get_tardir_from_rules()
fi
if [ -z "$dir" ] ; then
fatal "no $tar rules found in $(get_gear_rules) between
$(print_gear_rules | grep "$tar *:")"
fi
# fatal "no $tar rules found in $(get_gear_rules) between
#$(print_gear_rules | grep "$tar *:")"
return 1
fi
if [ "$dir" = "." ] || [ -z "$dir" ] || echo "$dir" | grep -q ":" ; then
return 1
......
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