diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:22:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:22:53 +0000 |
commit | 3b149631f0eb732049e04fa0c89d09c7aa2376f9 (patch) | |
tree | 7049356b06fcdcdaf9dbae476f55a43942e7c25f /dev-bin | |
parent | Initial commit. (diff) | |
download | geoip-upstream.tar.xz geoip-upstream.zip |
Adding upstream version 1.6.12.upstream/1.6.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dev-bin')
-rwxr-xr-x | dev-bin/clang-format-all.sh | 15 | ||||
-rwxr-xr-x | dev-bin/release.sh | 61 |
2 files changed, 76 insertions, 0 deletions
diff --git a/dev-bin/clang-format-all.sh b/dev-bin/clang-format-all.sh new file mode 100755 index 0000000..b8bec61 --- /dev/null +++ b/dev-bin/clang-format-all.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +format="clang-format -i -style=file" + +for dir in apps libGeoIP test; do + c_files=`find $dir -maxdepth 1 -name '*.c'` + if [ "$c_files" != "" ]; then + $format $dir/*.c; + fi + + h_files=`find $dir -maxdepth 1 -name '*.h'` + if [ "$h_files" != "" ]; then + $format $dir/*.h; + fi +done diff --git a/dev-bin/release.sh b/dev-bin/release.sh new file mode 100755 index 0000000..ec6ccfa --- /dev/null +++ b/dev-bin/release.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +set -eu -o pipefail + +changelog=$(cat ChangeLog) + +regex='([0-9]+\.[0-9]+\.[0-9]+) ([0-9]{4}-[0-9]{2}-[0-9]{2}) + +((.| +)*) +' + +if [[ ! $changelog =~ $regex ]]; then + echo "Could not find date line in change log!" + exit 1 +fi + +version="${BASH_REMATCH[1]}" +date="${BASH_REMATCH[2]}" +notes="$(echo "${BASH_REMATCH[3]}" | sed -n -e '/^[0-9]\+\.[0-9]\+\.[0-9]\+/,$!p')" + +dist="GeoIP-$version.tar.gz" + +if [[ "$date" != $(date +"%Y-%m-%d") ]]; then + echo "$date is not today!" + exit 1 +fi + +if [ -n "$(git status --porcelain)" ]; then + echo ". is not clean." >&2 + exit 1 +fi + +perl -pi -e "s/(?<=AC_INIT\(\[GeoIP\], \[)(\d+\.\d+\.\d+)(?=])/$version/gsm" configure.ac + +if [ -n "$(git status --porcelain)" ]; then + git add configure.ac + git commit -m "Bumped version to $version" +fi + +./bootstrap +./configure +make +make check +make clean +make dist + +read -p "Push to origin? (y/n) " should_push + +if [ "$should_push" != "y" ]; then + echo "Aborting" + exit 1 +fi + +git push + +message="$version + +$notes" + +hub release create -a "$dist" -m "$message" "v$version" |