Skip to content

Commit

Permalink
Fixed conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Nov 21, 2011
2 parents bfb0864 + e2fbe9b commit 918302d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 14 deletions.
29 changes: 25 additions & 4 deletions 2-to-github.sh
Expand Up @@ -42,7 +42,7 @@ fi

# Is this script being called from a valid location?

if [[ ! $PWD == */$package ]] ; then
if [[ `basename $PWD` != $package ]] ; then
echo "ERROR: cd to the $package directory before calling this script."
exit 1
fi
Expand Down Expand Up @@ -78,13 +78,25 @@ if [ $http_proxy ] ; then
curl_args="--proxy $http_proxy"
fi

# Workaround for some curl installs not acknowledging proxy.

if [ $HTTPS_PROXY ] ; then
curl_args="--proxy $HTTPS_PROXY"
elif [ $http_proxy ] ; then
curl_args="--proxy $http_proxy"
else
curl_args=
fi


# Does the repository exist on GitHub?

response=`curl $curl_args -s -S $api/repos/pear/$package`
if [ $? -ne 0 ] ; then
echo "ERROR: curl had problem calling GitHub search API."
echo $response
exit 1
<<<<<<< HEAD
elif [[ $response == *"Not Found"* ]] ; then
# Repository not there yet; create it.

Expand All @@ -106,11 +118,20 @@ elif [[ $response == *"Not Found"* ]] ; then
echo "ERROR: curl had problem calling GitHub create API."
exit 1
elif [[ $response == *message* ]] ; then
elif [[ $response == *'"Not Found"'* ]] ; then
# Repository not there yet; create it in the pear-dev team.

post="{\"name\":\"$package\", \"homepage\":\"http://pear.php.net/package/$package\", \"team_id\":83068, \"has_issues\":false, \"has_wiki\":false}"
response=`curl $curl_args -s -S -u "$user:$pass" -d "$post" $api/orgs/pear/repos`
if [ $? -ne 0 ] ; then
echo "ERROR: curl had problem calling GitHub create API."
exit 1
elif [[ $response == *'"message"'* ]] ; then
# The API returned some other error.
echo "GitHub API create ERROR: $response"
exit 1
fi
elif [[ $response == *message* ]] ; then
elif [[ $response == *'"message"'* ]] ; then
# The API returned some other error.
echo "GitHub API search ERROR: $response"
exit 1
Expand All @@ -124,7 +145,7 @@ response=`curl $curl_args -s -S -u "$user:$pass" -d "$post" $api/repos/pear/$pac
if [ $? -ne 0 ] ; then
echo "ERROR: curl had problem calling GitHub email hooks API."
exit 1
elif [[ $response == *errors* ]] ; then
elif [[ $response == *'"errors"'* ]] ; then
# The API returned some other error.
echo "GitHub API hooks ERROR: $response"
exit 1
Expand All @@ -135,7 +156,7 @@ response=`curl $curl_args -s -S -u "$user:$pass" -d "$post" $api/repos/pear/$pac
if [ $? -ne 0 ] ; then
echo "ERROR: curl had problem calling GitHub web hooks API."
exit 1
elif [[ $response == *errors* ]] ; then
elif [[ $response == *'"errors"'* ]] ; then
# The API returned some other error.
echo "GitHub API hooks ERROR: $response"
exit 1
Expand Down
44 changes: 34 additions & 10 deletions 3-svn-remove.sh
Expand Up @@ -35,18 +35,42 @@ fi


if [ $svn_repo = $pear_package_repo ] ; then
echo ""
echo "When you hit ENTER, an editor will open svn:externals for packages-all."
echo "Please delete the line referring to $package."
echo "Then save and close the editor."
echo "(Press any key to continue.)"
echo ""
read -e
if [ -d packages-all ] ; then
svn up packages-all --depth empty
else
svn checkout https://svn.php.net/repository/pear/packages-all --depth empty
fi
if [ $? -ne 0 ] ; then
echo "ERROR: could not checkout package-all."
exit 1
fi

svn propget svn:externals packages-all > propget.txt
if [ $? -ne 0 ] ; then
echo "ERROR: could not get properties of package-all."
rm -f propget.txt
exit 1
fi

sed "/$package$/d" propget.txt > propset.txt
if [ $? -ne 0 ] ; then
echo "ERROR: could not modify propget.txt."
rm -f propget.txt propset.txt
exit 1
fi

svn propset svn:externals packages-all -F propset.txt
if [ $? -ne 0 ] ; then
echo "ERROR: could not set properties of package-all."
rm -f propget.txt propset.txt
exit 1
fi

rm -f propget.txt propset.txt

svn propedit svn:externals https://svn.php.net/repository/pear/packages-all \
-m "$package moved to https://github.com/pear/$package"
svn commit -m "$package moved to https://github.com/pear/$package" packages-all
if [ $? -ne 0 ] ; then
echo "ERROR: could not edit properties of package-all."
echo "ERROR: could not commit package-all."
exit 1
fi
fi
Expand Down

0 comments on commit 918302d

Please sign in to comment.