Skip to content

Commit

Permalink
Code review: 259670043: Changes to merge script.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Dec 31, 2015
1 parent aef074c commit c595e48
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/dpkg/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python-plaso (1.3.1-1) unstable; urgency=low

* Auto-generated

-- Log2Timeline <[email protected]> Tue, 01 Sep 2015 06:55:37 +0200
-- Log2Timeline <[email protected]> Tue, 01 Sep 2015 23:10:22 +0200
29 changes: 26 additions & 3 deletions utils/merge_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ CODEREVIEW=`curl -s ${URL_CODEREVIEW}/api/${CL_NUMBER}`;

DESCRIPTION=`echo ${CODEREVIEW} | sed 's/^.*"subject":"\(.*\)","created.*$/\1/'`;

if test -z "${DESCRIPTION}" || test "${DESCRIPTION}" = "${CODEREVIEW}";
echo "${DESCRIPTION}" | grep -e '[{}":]' > /dev/null;

RESULT=$?;

if test -z "${DESCRIPTION}" || test "${DESCRIPTION}" = "${CODEREVIEW}" || test ${RESULT} -eq 0;
then
echo "Submit aborted - unable to find change list with number: ${CL_NUMBER}.";

Expand All @@ -150,7 +154,11 @@ fi

EMAIL_ADDRESS=`echo ${CODEREVIEW} | sed 's/^.*"owner_email":"\(.*\)","private.*$/\1/'`;

if test -z "${EMAIL_ADDRESS}" || test "${EMAIL_ADDRESS}" = "${CODEREVIEW}";
echo "${EMAIL_ADDRESS}" | grep -e '[{}":]' > /dev/null;

RESULT=$?;

if test -z "${EMAIL_ADDRESS}" || test "${EMAIL_ADDRESS}" = "${CODEREVIEW}" || test ${RESULT} -eq 0;
then
echo "Submit aborted - unable to determine author's email address.";

Expand All @@ -162,9 +170,24 @@ fi
# This will convert newlines into spaces.
GITHUB_USERINFO=`curl -s https://api.github.com/users/${USERNAME}`;

# Note that name is null when not set.
FULLNAME=`echo ${GITHUB_USERINFO} | sed 's/^.*"name": "\(.*\)", "company.*$/\1/'`;

if test -z "${FULLNAME}" || test "${FULLNAME}" = "${GITHUB_USERINFO}";
echo "${FULLNAME}" | grep -e '[{}":]' > /dev/null;

RESULT=$?;

# If name is not set use company instead.
if test -z "${FULLNAME}" || test "${FULLNAME}" = "${GITHUB_USERINFO}" || test ${RESULT} -eq 0;
then
FULLNAME=`echo ${GITHUB_USERINFO} | sed 's/^.*"company": "\(.*\)", "blog*$/\1/'`;
fi

echo "${FULLNAME}" | grep -e '[{}":]' > /dev/null;

RESULT=$?;

if test -z "${FULLNAME}" || test "${FULLNAME}" = "${GITHUB_USERINFO}" || test ${RESULT} -eq 0;
then
echo "Submit aborted - unable to determine author's full name";

Expand Down

0 comments on commit c595e48

Please sign in to comment.