Commit 1962107d authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: prepare to use commit_tarball

parent 00220c83
......@@ -174,6 +174,25 @@ gear_update_from_tarball()
fatal "can't import tarball '$TARBALL'"
}
# TODO: rewrite for any tarball commit
# $nn $FTB
commit_tarball()
{
#rhas "$GETSOURCE" "ps?://" || GETSOURCE=""
CURNAME=$(get_tardir_from_rules) || fatal "There is no 'tar:' line in gear rules file or 'tar: .' needed for commit tarball"
# FIXME: hack to unpack to correct place.
[ $(basename `pwd`) = ".gear" ] && cd ..
test -d "$CURNAME" || CURNAME=$(get_tarballname "$spec")
test -d "$CURNAME" || CURNAME=$BASENAME
if [ -d "$RPMSOURCEDIR" ] && [ -f "$RPMSOURCEDIR/$FTB" ] ; then
gear_update_from_tarball "$RPMSOURCEDIR/$FTB" "$CURNAME" $FORCEDOWNLOAD
rm -f "$RPMSOURCEDIR/$FTB"
docmd git commit -m "just import $FTB with rpmgs script"
else
echo "Skip missed tarball commiting"
fi
}
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
......@@ -264,6 +283,13 @@ do
# TODO: fix download single packed file
#else
# download_url "$GETSOURCE"
# commit tarball
if [ -n "$GSSETVERSION" ] || [ -n "$FORCEDOWNLOAD" ]; then
if false && is_gear ; then
commit_tarball $nn $FTB
fi
fi
fi
echog "DONE with $FTB"
......@@ -304,18 +330,8 @@ do
#docmd gammit
#docmd git commit -m "merge $FTB with rpmgs script"
elif is_gear ; then
CURNAME=$(get_tardir_from_rules) || fatal "There is no 'tar:' line in gear rules file or 'tar: .' used"
# FIXME: hack to unpack to correct place.
[ $(basename `pwd`) = ".gear" ] && cd ..
test -d "$CURNAME" || CURNAME=$(get_tarballname "$spec")
test -d "$CURNAME" || CURNAME=$BASENAME
if [ -d "$RPMSOURCEDIR" ] && [ -f "$RPMSOURCEDIR/$FTB" ] ; then
gear_update_from_tarball "$RPMSOURCEDIR/$FTB" "$CURNAME" $FORCEDOWNLOAD
rm -f "$RPMSOURCEDIR/$FTB"
docmd git commit -m "just import $FTB with rpmgs script"
else
echo "Skip missed tarball commiting"
fi
# TODO: realize above
commit_tarball
fi
else
is_gear && echo "Skip tarball committing (run with version or with -f option)."
......
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