Removed cruft

This commit is contained in:
2013-10-16 00:36:35 -04:00
parent 2e8e14e9ed
commit 8bf427ae4b
4 changed files with 0 additions and 219 deletions

View File

@@ -1,78 +0,0 @@
#!/bin/bash
LOGSPEC='%ci %an <%aE>%n%n %s%n [%h]%d%n'
VERSIONERS_SEPARATOR=${VERSIONERS_SEPARATOR:-,}
BRANCH=$2
if [ "${BRANCH}" == "" ]; then
BRANCH=$(git branch | grep '^\*\s*.*' | cut -d ' ' -f 2-)
fi
REBUILDING=0
SHA1=$(git rev-parse HEAD)
TAG=$(git describe --tags --abbrev=0 `git rev-list --tags --max-count=1 HEAD` 2>/dev/null)
BUILD=0
TAGSHA=$(git rev-list $TAG | head -n 1)
CHANGELOG="$(git log --format="format:$LOGSPEC" ${TAGSHA}..HEAD)"
if [ "$TAG" == "" ]; then
BUILD=0
REBUILDING=1
MAJOR=$BRANCH
else
MAJOR=$(echo $TAG | cut -d ${VERSIONERS_SEPARATOR} -f 2)
BUILD=$(echo $TAG | cut -d ${VERSIONERS_SEPARATOR} -f 3)
if [ "$TAGSHA" != "$SHA1" ]; then
CHANGELOG="$(git log --format="format:$LOGSPEC" $TAGSHA..$SHA1)"
BUILD=$(expr $BUILD + 1)
REBUILDING=1
else
SHA1=$TAGSHA
fi
fi
OS_NAME=""
OS_VERSION=""
if [ "$OS_NAME" == "" ] && [ "$(uname)" == "Darwin" ]; then
OS_NAME="osx"
elif [ "$OS_NAME" == "" ] && [ -f /etc/redhat-release ]; then
OS_NAME="el"
elif [ "$OS_NAME" == "" ] && [ "$(uname | grep -i '^MINGW')" != "" ] || [ "$(uname | grep -i '^CYGWIN')" != "" ]; then
OS_NAME="win"
fi
if [ "$OS_VERSION" == "" ] && [ "$OS_NAME" == "el" ]; then
OS_VERSION=$(cat /etc/redhat-release | grep -o "release [0-9]" | cut -d " " -f 2)
RHEL_VERSION=$OS_VERSION
elif [ "$OS_VERSION" == "" ] && [ "$OS_NAME" == "osx" ]; then
OS_VERSION="$(sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*')"
elif [ "$OS_VERSION" == "" ] && [ "$OS_NAME" == "win" ]; then
echo "OS_VERSION unsupported on Microsoft Windows." >&2
fi
if [ "$ARCH" == "" ]; then
if [ "$OS_NAME" == "osx" ]; then
ARCH=$(uname -m)
elif [ "$OS_NAME" != "win" ]; then
ARCH=$(uname -i)
elif [ "$OS_NAME" == "win" ]; then
ARCH=$(uname -m)
fi
fi
SOURCE=$((git remote show origin 2>/dev/null | grep "Fetch URL" | cut -d : -f 2- | cut -d ' ' -f 2-) || echo '')
echo "TAG=\"${TAG}\""
echo "BRANCH=\"${BRANCH}\""
echo "MAJOR=\"${MAJOR}\""
echo "BUILD=\"${BUILD}\""
echo "SHA1=\"${SHA1}\""
echo "OS_NAME=\"\${OS_NAME:-$OS_NAME}\""
echo "OS_VERSION=\"\${OS_VERSION:-$OS_VERSION}\""
echo "ARCH=\"\${ARCH:-$ARCH}\""
echo "VERSION=\"${MAJOR}-${BUILD}\""
echo "BUILDHOST=\"$(hostname)\""
echo "BUILDUSER=\"$(whoami)\""
echo "BUILDDIR=\"$(pwd)\""
echo "SOURCE=\"${SOURCE}\""
echo "REBUILDING=$REBUILDING"
echo "CHANGELOG=\"$CHANGELOG\""

View File

@@ -1,77 +0,0 @@
#!/bin/bash
BRANCH=$2
if [ "${BRANCH}" == "" ]; then
BRANCH=$(hg identify -b)
fi
REBUILDING=0
SHA1=$(hg identify -i | grep -Eo "[a-zA-Z0-9]+")
TAG=$(hg parents --template '{latesttag}')
TAGSHA=$(hg identify -r $TAG | cut -d ' ' -f 1)
BUILD=0
CHANGELOG="$(hg log --branch $BRANCH -X .hgtags --style=changelog -r ${TAG}:${SHA1})"
if [ "$TAG" == "" ]; then
BUILD=0
REBUILDING=1
MAJOR=$BRANCH
else
MAJOR=$(echo $TAG | cut -d \| -f 2)
BUILD=$(echo $TAG | cut -d \| -f 3)
SHORTTAGSHA=${TAGSHA:0:12}
hg log -r tip | grep "Added tag build|${BRANCH}|${BUILD} for changeset ${SHORTTAGSHA}" >/dev/null
if [ $? -ne 0 ] && [ "$TAGSHA" != "$SHA1" ]; then
CHANGELOG="$(hg log --branch $BRANCH -X .hgtags --style=changelog -r ${SHORTTAGSHA}:${SHA1})"
BUILD=$(expr $BUILD + 1)
REBUILDING=1
else
SHA1=$TAGSHA
fi
fi
OS_NAME=""
OS_VERSION=""
if [ "$OS_NAME" == "" ] && [ "$(uname)" == "Darwin" ]; then
OS_NAME="osx"
elif [ "$OS_NAME" == "" ] && [ -f /etc/redhat-release ]; then
OS_NAME="el"
elif [ "$OS_NAME" == "" ] && [ "$(uname | grep -i '^MINGW')" != "" ] || [ "$(uname | grep -i '^CYGWIN')" != "" ]; then
OS_NAME="win"
fi
if [ "$OS_VERSION" == "" ] && [ "$OS_NAME" == "el" ]; then
OS_VERSION=$(cat /etc/redhat-release | grep -o "release [0-9]" | cut -d " " -f 2)
RHEL_VERSION=$OS_VERSION
elif [ "$OS_VERSION" == "" ] && [ "$OS_NAME" == "osx" ]; then
OS_VERSION="$(sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*')"
elif [ "$OS_VERSION" == "" ] && [ "$OS_NAME" == "win" ]; then
echo "OS_VERSION unsupported on Microsoft Windows." >&2
fi
if [ "$ARCH" == "" ]; then
if [ "$OS_NAME" == "osx" ]; then
ARCH=$(uname -m)
elif [ "$OS_NAME" != "win" ]; then
ARCH=$(uname -i)
elif [ "$OS_NAME" == "win" ]; then
ARCH=$(uname -m)
fi
fi
SOURCE=$((cat .hg/hgrc 2>/dev/null | grep default | cut -d = -f 2 | sed s/"^ *"//g) || echo '')
echo "TAG=\"${TAG}\""
echo "BRANCH=\"${BRANCH}\""
echo "MAJOR=\"${MAJOR}\""
echo "BUILD=\"${BUILD}\""
echo "SHA1=\"${SHA1}\""
echo "OS_NAME=\"\${OS_NAME:-$OS_NAME}\""
echo "OS_VERSION=\"\${OS_VERSION:-$OS_VERSION}\""
echo "ARCH=\"\${ARCH:-$ARCH}\""
echo "VERSION=\"${MAJOR}-${BUILD}\""
echo "BUILDHOST=\"$(hostname)\""
echo "BUILDUSER=\"$(whoami)\""
echo "BUILDDIR=\"$(pwd)\""
echo "SOURCE=\"${SOURCE}\""
echo "REBUILDING=$REBUILDING"
echo "CHANGELOG=\"$CHANGELOG\""

34
taggit
View File

@@ -1,34 +0,0 @@
#!/bin/bash
SEP=${VERSIONERS_SEPARATOR:-,}
VERSIONERS_TAGBASE=${VERSIONERS_TAGBASE:-build}
if [ "$MAKETAG" == "false" ]; then
exit 0
fi
if [ ! -f version ]; then
$(dirname $BASH_SOURCE)/genversion > version
fi
. ~/.buildtoolsrc
. version
WHOLETAG="${VERSIONERS_TAGBASE}${SEP}${MAJOR}${SEP}${BUILD}"
git fetch --tags
TAGSHA1=$(git rev-list $TAG | head -n 1)
if [ $REBUILDING -eq 0 ]; then
echo "This is a rebuild of a previous tag, not tagging or pushing" >&2
elif [ "$(git tag | grep $WHOLETAG)" != "" ] && [ "$TAGSHA1" != "" ] && [ "$TAGSHA1" != "$SHA1" ]; then
echo "Someone else tagged my buildnumber (${WHOLETAG}) onto $TAGSHA1, while I built it from $SHA1 ... "'Help!' >&2
exit 1
elif [ "$TAGSHA1" != "" ] && [ "$TAGSHA1" == "$SHA1" ]; then
echo "Someone else built this version at the same time I did, and we both tagged the same SHA1 with the same build tag. Not pushing my tag."
else
git tag -f -a "${WHOLETAG}" -m "Tagging for ${MAJOR}-${BUILD}" $SHA1
if [ "$PUSHTAG" != "false" ]; then
git push --tags
fi
fi

30
taghg
View File

@@ -1,30 +0,0 @@
#!/bin/bash
if [ "$MAKETAG" == "false" ]; then
exit 0
fi
if [ ! -f version ]; then
${dirname $BASH_SOURCE)/genversion > version
fi
. ~/.buildtoolsrc
. version
hg pull -u --branch $(hg branch)
TAGSHA1=$(cat .hgtags | grep "build,${MAJOR},${BUILD}" | cut -d " " -f 1)
echo "$TAGSHA1" | grep "^$SHA1" >/dev/null 2>&1
SHORTSHAMATCH=$?
if [ $REBUILDING -eq 0 ]; then
echo "This is a rebuild of a previous tag, not tagging or pushing" >&2
elif [ "$TAGSHA1" != "" ] && [ $SHORTSHAMATCH -ne 0 ]; then
echo "Someone else tagged my buildnumber (branch|${MAJOR}|${BUILD}) onto $TAGSHA1, while I built it from $SHA1 ... "'Help!' >&2
exit 1
elif [ "$TAGSHA1" != "" ] && [ $SHORTSHAMATCH -eq 0 ]; then
echo "Someone else built this version at the same time I did, and we both tagged the same SHA1 with the same build tag. Not pushing my tag."
else
hg tag -f -r ${SHA1} "build|${MAJOR}|${BUILD}"
if [ "$PUSHTAG" != "false" ]; then
hg push
fi
fi