Skip to content

Commit

Permalink
initial commit of scripts handling the submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
timo-bes committed Apr 12, 2010
1 parent c86c5b3 commit 92f9448
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 2 deletions.
21 changes: 21 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

#
# FTP-GIT
# Forward call to submodule
#

# get all params
params=""
while test $# != 0
do
params="${params} $1"
shift
done

# forward call and add --sha1 option
`dirname $0`/ftp-git/ftp-git.sh${params} --sha1=.git-ftp.log

if [ $? -ne 0 ]; then
exit 1
fi
2 changes: 1 addition & 1 deletion ftp-git
2 changes: 1 addition & 1 deletion git-ftp
93 changes: 93 additions & 0 deletions sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/bash

#
# GIT-FTP
# Forward call to submodule
#


# get all params
params=""
while test $# != 0
do
params="${params} $1"
shift
done

check_merge() {
# check whether ftp-git branch has been merged
diff_logs=`git log ftp ^master | wc -l`
if [ $diff_logs -gt 0 ]; then
echo ""
echo "*****************************************************"
echo "FATAL:"
echo " the branch ftp has not been merged onto master yet."
echo " please do so and try again."
echo "*****************************************************"
echo ""
exit 1
fi
}

check_merge


echo ""
echo "*****************"
echo "* *"
echo "* #1 DOWNLOAD *"
echo "* *"
echo "*****************"
echo ""

`dirname $0`/download.sh${params}

if [ $? -ne 0 ]; then
exit 1
fi

check_merge


echo ""
echo ""
echo "***************"
echo "* *"
echo "* #2 UPLOAD *"
echo "* *"
echo "***************"
echo ""

# forward call (without --http)
cmd="`dirname $0`/git-ftp/git-ftp.sh${params}"
cmd=`echo "$cmd" | sed "s/\(.*\) --http [^ ]* \(.*\)/\1 \2/"`
$cmd

if [ $? -ne 0 ]; then
exit 1
fi


echo ""
echo ""
echo "**************"
echo "* *"
echo "* #3 MERGE *"
echo "* *"
echo "**************"
echo ""

echo "# Checkout ftp"
git checkout ftp

echo ""
echo "# Merge master"
git merge master

echo ""
echo "# Get new list from FTP"
`dirname $0`/download.sh${params} --catchup

echo ""
echo "# Checkout master"
git checkout master

0 comments on commit 92f9448

Please sign in to comment.