1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: convert scripts local variables to lower case

This commit is contained in:
Sébastien Helleu
2023-08-15 10:50:35 +02:00
parent 409bd256a9
commit e94a18268e
8 changed files with 176 additions and 176 deletions
+41 -41
View File
@@ -56,13 +56,13 @@
set -o errexit
# default values for options from environment variables
DEFAULT_PACKAGER_NAME="Sébastien Helleu"
DEFAULT_PACKAGER_EMAIL="flashcode@flashtux.org"
DEFAULT_JOBS=""
default_packager_name="Sébastien Helleu"
default_packager_email="flashcode@flashtux.org"
default_jobs=""
usage ()
{
RC=$1
rc=$1
cat <<-EOF
Syntax: $0 devel|stable|<version> distro
@@ -88,7 +88,7 @@ Examples:
$0 test-patches
EOF
exit "${RC}"
exit "${rc}"
}
error ()
@@ -106,38 +106,38 @@ error_usage ()
test_patches ()
{
set +e
PATCHES_OK=0
PATCHES_ERROR=0
for file in "${ROOT_DIR}"/tools/debian/patches/*.patch; do
patches_ok=0
patches_error=0
for file in "${root_dir}"/tools/debian/patches/*.patch; do
echo "=== Testing patch ${file} ==="
if git apply --check "${file}"; then
PATCHES_OK=$((PATCHES_OK+1))
patches_ok=$((patches_ok+1))
else
PATCHES_ERROR=$((PATCHES_ERROR+1))
patches_error=$((patches_error+1))
fi
done
echo "Patches: ${PATCHES_OK} OK, ${PATCHES_ERROR} in error."
exit ${PATCHES_ERROR}
echo "Patches: ${patches_ok} OK, ${patches_error} in error."
exit ${patches_error}
}
# ================================== START ==================================
# package name/email
[ -z "${PACKAGER_NAME}" ] && PACKAGER_NAME="${DEFAULT_PACKAGER_NAME}" && PACKAGER_EMAIL="${DEFAULT_PACKAGER_EMAIL}"
[ -z "${PACKAGER_NAME}" ] && PACKAGER_NAME="${default_packager_name}" && PACKAGER_EMAIL="${default_packager_email}"
if [ -z "${PACKAGER_EMAIL}" ]; then
echo >&2 "ERROR: PACKAGER_EMAIL must be set if PACKAGER_NAME is set."
exit 1
fi
# simultaneous jobs for compilation (dpkg-buildpackage -jN)
[ -z "${JOBS}" ] && JOBS="${DEFAULT_JOBS}"
[ -z "${JOBS}" ] && JOBS="${default_jobs}"
# check git repository
ROOT_DIR=$(git rev-parse --show-toplevel)
if [ -z "${ROOT_DIR}" ] || [ ! -d "${ROOT_DIR}/.git" ] || [ ! -d "${ROOT_DIR}/debian-stable" ]; then
root_dir=$(git rev-parse --show-toplevel)
if [ -z "${root_dir}" ] || [ ! -d "${root_dir}/.git" ] || [ ! -d "${root_dir}/debian-stable" ]; then
error "this script must be run from WeeChat git repository."
fi
cd "${ROOT_DIR}"
cd "${root_dir}"
# check command line arguments
if [ $# -eq 0 ]; then
@@ -151,58 +151,58 @@ if [ $# -lt 2 ]; then
fi
# command line arguments
VERSION="$1"
DISTRO="$2"
version="$1"
distro="$2"
# separate version and revision
# example: devel => devel / 1, stable-2 => stable / 2, 1.9-2 => 1.9 / 2
TMP_VERSION=$(expr "${VERSION}" : '\([^/]*\)-') || true
tmp_version=$(expr "${version}" : '\([^/]*\)-') || true
DEB_REVISION=""
if [ -n "${TMP_VERSION}" ]; then
DEB_REVISION=$(expr "${VERSION}" : '[^-]*-\([^-]*\)') || true
VERSION="${TMP_VERSION}"
if [ -n "${tmp_version}" ]; then
DEB_REVISION=$(expr "${version}" : '[^-]*-\([^-]*\)') || true
version="${tmp_version}"
fi
if [ -z "${DEB_REVISION}" ]; then
DEB_REVISION="1"
fi
# convert version "stable" to its number
if [ "${VERSION}" = "stable" ]; then
VERSION="$("${ROOT_DIR}/version.sh" stable)"
if [ "${version}" = "stable" ]; then
version="$("${root_dir}/version.sh" stable)"
fi
if [ -z "${VERSION}" ]; then
if [ -z "${version}" ]; then
error_usage "unknown version"
fi
# extract distro type (debian, ubuntu, ...)
DISTRO_TYPE=$(expr "${DISTRO}" : '\([^/]*\)/') || true
distro_type=$(expr "${distro}" : '\([^/]*\)/') || true
# extract distro name (sid, jessie, wily, ...)
DISTRO_NAME=$(expr "${DISTRO}" : '[^/]*/\([a-z]*\)') || true
distro_name=$(expr "${distro}" : '[^/]*/\([a-z]*\)') || true
if [ -z "${DISTRO_TYPE}" ] || [ -z "${DISTRO_NAME}" ]; then
if [ -z "${distro_type}" ] || [ -z "${distro_name}" ]; then
error_usage "missing distro type/name"
fi
# set distro for dch
if [ "${DISTRO_TYPE}" = "ubuntu" ]; then
if [ "${distro_type}" = "ubuntu" ]; then
# ubuntu
if [ "${VERSION}" = "devel" ]; then
if [ "${version}" = "devel" ]; then
DCH_DISTRO="UNRELEASED"
else
DCH_DISTRO="${DISTRO_NAME}"
DCH_DISTRO="${distro_name}"
fi
else
# debian/raspbian
DCH_DISTRO="unstable"
fi
if [ "${VERSION}" = "devel" ]; then
if [ "${version}" = "devel" ]; then
# devel packages: weechat-devel(-xxx)_X.Y-1~dev20150511_arch.deb
DEB_DIR="debian-devel"
DEB_NAME="weechat-devel"
DEB_VERSION="$("${ROOT_DIR}/version.sh" devel)-1~dev$(date '+%Y%m%d')"
DEB_VERSION="$("${root_dir}/version.sh" devel)-1~dev$(date '+%Y%m%d')"
if [ "${DEB_REVISION}" != "1" ]; then
DEB_VERSION="${DEB_VERSION}-${DEB_REVISION}"
fi
@@ -213,22 +213,22 @@ else
# stable packages: weechat-(-xxx)_X.Y-1_arch.deb
DEB_DIR="debian-stable"
DEB_NAME="weechat"
DEB_VERSION="${VERSION}-${DEB_REVISION}"
DEB_VERSION="${version}-${DEB_REVISION}"
DCH_CREATE=""
DCH_URGENCY="medium"
DCH_CHANGELOG="New upstream release"
fi
# display build info
echo "=== Building ${DEB_NAME}-${DEB_VERSION} on ${DISTRO_TYPE}/${DISTRO_NAME} (${DCH_DISTRO}) ==="
echo "=== Building ${DEB_NAME}-${DEB_VERSION} on ${distro_type}/${distro_name} (${DCH_DISTRO}) ==="
# ================================== BUILD ==================================
# apply patch (if needed, for old distros)
PATCH_FILE="${ROOT_DIR}/tools/debian/patches/weechat_${DISTRO_TYPE}_${DISTRO_NAME}.patch"
if [ -f "${PATCH_FILE}" ]; then
echo " - Applying patch ${PATCH_FILE}"
git apply "${PATCH_FILE}"
patch_file="${root_dir}/tools/debian/patches/weechat_${distro_type}_${distro_name}.patch"
if [ -f "${patch_file}" ]; then
echo " - Applying patch ${patch_file}"
git apply "${patch_file}"
fi
# create a symlink "debian" -> "debian-{stable|devel}"
@@ -236,7 +236,7 @@ rm -f debian
ln -s -f "${DEB_DIR}" debian
# update debian changelog
if [ "${VERSION}" = "devel" ]; then
if [ "${version}" = "devel" ]; then
rm -f "${DEB_DIR}/changelog"
fi
+3 -3
View File
@@ -33,7 +33,7 @@
set -o errexit
BUILDDIR="build-tmp-$$"
build_dir="build-tmp-$$"
if [ $# -ge 1 ]; then
BUILDARGS="$*"
@@ -48,8 +48,8 @@ run ()
set -x
# create build directory
mkdir "$BUILDDIR"
cd "$BUILDDIR"
mkdir "${build_dir}"
cd "${build_dir}"
run cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON "${BUILDARGS}"
if [ -f "build.ninja" ]; then
+15 -15
View File
@@ -38,26 +38,26 @@ if [ $# -lt 1 ]; then
exit 1
fi
ROOT_DIR=$(git rev-parse --show-toplevel)
root_dir=$(git rev-parse --show-toplevel)
NEW_STABLE=$("${ROOT_DIR}/version.sh" stable)
NEW_DEVEL=$("${ROOT_DIR}/version.sh" devel)
NEW_DEVEL_FULL=$("${ROOT_DIR}/version.sh" devel-full)
new_stable=$("${root_dir}/version.sh" stable)
new_devel=$("${root_dir}/version.sh" devel)
new_devel_full=$("${root_dir}/version.sh" devel-full)
case "$1" in
stable ) NEW_STABLE="${NEW_DEVEL}"
NEW_DEVEL_FULL="${NEW_DEVEL}" ;;
major ) NEW_DEVEL=$(echo "${NEW_DEVEL}" | awk -F. '{$(NF-2) = $(NF-2) + 1; $(NF-1) = 0; $NF = 0; print}' OFS=.)
NEW_DEVEL_FULL="${NEW_DEVEL}-dev" ;;
minor ) NEW_DEVEL=$(echo "$NEW_DEVEL" | awk -F. '{$(NF-1) = $(NF-1) + 1; $NF = 0; print}' OFS=.)
NEW_DEVEL_FULL="${NEW_DEVEL}-dev" ;;
patch ) NEW_DEVEL=$(echo "$NEW_DEVEL" | awk -F. '{$NF = $NF + 1; print} ' OFS=.)
NEW_DEVEL_FULL="${NEW_DEVEL}-dev" ;;
stable ) new_stable="${new_devel}"
new_devel_full="${new_devel}" ;;
major ) new_devel=$(echo "${new_devel}" | awk -F. '{$(NF-2) = $(NF-2) + 1; $(NF-1) = 0; $NF = 0; print}' OFS=.)
new_devel_full="${new_devel}-dev" ;;
minor ) new_devel=$(echo "$new_devel" | awk -F. '{$(NF-1) = $(NF-1) + 1; $NF = 0; print}' OFS=.)
new_devel_full="${new_devel}-dev" ;;
patch ) new_devel=$(echo "$new_devel" | awk -F. '{$NF = $NF + 1; print} ' OFS=.)
new_devel_full="${new_devel}-dev" ;;
* ) echo >&2 "ERROR: unknown version."
exit 1 ;;
esac
sed -i \
-e "s/^\(WEECHAT_STABLE\)=.*/\1=\"${NEW_STABLE}\"/" \
-e "s/^\(WEECHAT_DEVEL\)=.*/\1=\"${NEW_DEVEL_FULL}\"/" \
"${ROOT_DIR}/version.sh"
-e "s/^\(weechat_stable\)=.*/\1=\"${new_stable}\"/" \
-e "s/^\(weechat_devel\)=.*/\1=\"${new_devel_full}\"/" \
"${root_dir}/version.sh"
+10 -10
View File
@@ -27,23 +27,23 @@
set -o errexit
# check git repository
ROOT_DIR=$(git rev-parse --show-toplevel)
cd "${ROOT_DIR}"
root_dir=$(git rev-parse --show-toplevel)
cd "${root_dir}"
SHELL_SCRIPTS=$(git ls-files "*.sh")
PYTHON_SCRIPTS=$(git ls-files "*.py")
shell_scripts=$(git ls-files "*.sh")
python_scripts=$(git ls-files "*.py")
# display commands
set -x
# check shell scripts
for script in $SHELL_SCRIPTS; do
shellcheck "${ROOT_DIR}/$script"
for script in ${shell_scripts}; do
shellcheck "${root_dir}/$script"
done
# check Python scripts
for script in $PYTHON_SCRIPTS; do
flake8 --max-line-length=100 --builtins=_ "${ROOT_DIR}/$script"
pylint --additional-builtins=_ "${ROOT_DIR}/$script"
bandit "${ROOT_DIR}/$script"
for script in ${python_scripts}; do
flake8 --max-line-length=100 --builtins=_ "${root_dir}/$script"
pylint --additional-builtins=_ "${root_dir}/$script"
bandit "${root_dir}/$script"
done
+15 -15
View File
@@ -42,32 +42,32 @@ error ()
}
# check git repository
ROOT_DIR=$(git rev-parse --show-toplevel)
if [ -z "${ROOT_DIR}" ] || [ ! -d "${ROOT_DIR}/.git" ]; then
root_dir=$(git rev-parse --show-toplevel)
if [ -z "${root_dir}" ] || [ ! -d "${root_dir}/.git" ]; then
error "this script must be run from WeeChat git repository."
fi
cd "${ROOT_DIR}"
cd "${root_dir}"
# default values
VERSION="$("${ROOT_DIR}/version.sh" devel-full)"
TREEISH="HEAD"
OUTPATH="$(pwd)"
version="$("${root_dir}/version.sh" devel-full)"
treeish="HEAD"
outpath="$(pwd)"
if [ $# -ge 1 ]; then
VERSION=$1
version=$1
fi
if [ $# -ge 2 ]; then
TREEISH=$2
treeish=$2
fi
if [ $# -ge 3 ]; then
OUTPATH=$(cd "$3"; pwd)
outpath=$(cd "$3"; pwd)
fi
PREFIX="weechat-${VERSION}/"
FILE="${OUTPATH}/weechat-${VERSION}.tar"
prefix="weechat-${version}/"
file="${outpath}/weechat-${version}.tar"
echo "Building package ${FILE}.gz"
git archive --prefix="${PREFIX}" "${TREEISH}" | gzip -c >"${FILE}.gz"
echo "Building package ${file}.gz"
git archive --prefix="${prefix}" "${treeish}" | gzip -c >"${file}.gz"
echo "Building package ${FILE}.xz"
git archive --prefix="${PREFIX}" "${TREEISH}" | xz -c >"${FILE}.xz"
echo "Building package ${file}.xz"
git archive --prefix="${prefix}" "${treeish}" | xz -c >"${file}.xz"
+50 -50
View File
@@ -36,93 +36,93 @@ release_error ()
release_start ()
{
ROOT_DIR="$(git rev-parse --show-toplevel)"
root_dir="$(git rev-parse --show-toplevel)"
if [ -n "$(git status --porcelain)" ]; then
release_error "working directory not clean"
fi
VERSION=$("${ROOT_DIR}/version.sh" devel)
if git rev-parse "v${VERSION}" 2>/dev/null; then
release_error "tag v${VERSION} already exists"
version=$("${root_dir}/version.sh" devel)
if git rev-parse "v${version}" 2>/dev/null; then
release_error "tag v${version} already exists"
fi
MSG=$(git log -1 --pretty=%B | tr -d "\n")
if [ "${MSG}" = "Version ${VERSION}" ]; then
msg=$(git log -1 --pretty=%B | tr -d "\n")
if [ "${msg}" = "Version ${version}" ]; then
release_error "commit for version already exists"
fi
DATE=$(date +"%Y-%m-%d")
BUILD_DIR="${ROOT_DIR}/release/${VERSION}"
if [ -d "${BUILD_DIR}" ]; then
release_error "directory ${BUILD_DIR} already exists"
date=$(date +"%Y-%m-%d")
build_dir="${root_dir}/release/${version}"
if [ -d "${build_dir}" ]; then
release_error "directory ${build_dir} already exists"
fi
mkdir -p "${BUILD_DIR}"
PKG_TAR="${BUILD_DIR}/weechat-${VERSION}.tar"
CHGLOG="${BUILD_DIR}/doc/ChangeLog.html"
RN="${BUILD_DIR}/doc/ReleaseNotes.html"
mkdir -p "${build_dir}"
pkg_tar="${build_dir}/weechat-${version}.tar"
chglog="${build_dir}/doc/ChangeLog.html"
rn="${build_dir}/doc/ReleaseNotes.html"
}
release_bump_version ()
{
"${ROOT_DIR}/tools/bump_version.sh" stable
"${root_dir}/tools/bump_version.sh" stable
sed -i \
-e "s/^\(== Version ${VERSION}\) (under dev)$/\1 (${DATE})/" \
"${ROOT_DIR}/ChangeLog.adoc" \
"${ROOT_DIR}/ReleaseNotes.adoc"
-e "s/^\(== Version ${version}\) (under dev)$/\1 (${date})/" \
"${root_dir}/ChangeLog.adoc" \
"${root_dir}/ReleaseNotes.adoc"
}
release_commit_tag ()
{
cd "${ROOT_DIR}"
git commit -m "Version ${VERSION}" version.sh ChangeLog.adoc ReleaseNotes.adoc || release_error "git commit error, release already done?"
git tag -a "v${VERSION}" -m "WeeChat ${VERSION}"
cd "${root_dir}"
git commit -m "Version ${version}" version.sh ChangeLog.adoc ReleaseNotes.adoc || release_error "git commit error, release already done?"
git tag -a "v${version}" -m "WeeChat ${version}"
}
release_build ()
{
cd "${BUILD_DIR}"
cd "${build_dir}"
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${BUILD_DIR}/install" \
-DWEECHAT_HOME="${BUILD_DIR}/home" \
-DCMAKE_INSTALL_PREFIX="${build_dir}/install" \
-DWEECHAT_HOME="${build_dir}/home" \
-DENABLE_DOC=ON \
-DENABLE_MAN=ON \
-DENABLE_TESTS=ON \
"${ROOT_DIR}"
"${root_dir}"
make install
make changelog
make rn
make test CTEST_OUTPUT_ON_FAILURE=TRUE
make dist
VERSION_WEECHAT=$("${BUILD_DIR}/install/bin/weechat" --version)
if [ "${VERSION_WEECHAT}" != "${VERSION}" ]; then
release_error "unexpected version \"${VERSION_WEECHAT}\" (expected: \"${VERSION}\")"
version_weechat=$("${build_dir}/install/bin/weechat" --version)
if [ "${version_weechat}" != "${version}" ]; then
release_error "unexpected version \"${version_weechat}\" (expected: \"${version}\")"
fi
}
release_test_pkg ()
{
cd "${BUILD_DIR}"
tar axvf "weechat-${VERSION}.tar.xz"
cd "weechat-${VERSION}"
PKG_DIR="$(pwd)"
SCRIPT_VERSION="${PKG_DIR}/version.sh"
[ "$("${SCRIPT_VERSION}" stable)" = "${VERSION}" ] || release_error "wrong stable version in ${SCRIPT_VERSION}"
[ "$("${SCRIPT_VERSION}" devel)" = "${VERSION}" ] || release_error "wrong devel version in ${SCRIPT_VERSION}"
[ "$("${SCRIPT_VERSION}" devel-full)" = "${VERSION}" ] || release_error "wrong devel-full version in ${SCRIPT_VERSION}"
cd "${build_dir}"
tar axvf "weechat-${version}.tar.xz"
cd "weechat-${version}"
pkg_dir="$(pwd)"
script_version="${pkg_dir}/version.sh"
[ "$("${script_version}" stable)" = "${version}" ] || release_error "wrong stable version in ${script_version}"
[ "$("${script_version}" devel)" = "${version}" ] || release_error "wrong devel version in ${script_version}"
[ "$("${script_version}" devel-full)" = "${version}" ] || release_error "wrong devel-full version in ${script_version}"
mkdir build
cd build
PKG_BUILD_DIR="$(pwd)"
pkg_build_dir="$(pwd)"
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PKG_BUILD_DIR}/install" \
-DWEECHAT_HOME="${PKG_BUILD_DIR}/home" \
-DCMAKE_INSTALL_PREFIX="${pkg_build_dir}/install" \
-DWEECHAT_HOME="${pkg_build_dir}/home" \
-DENABLE_DOC=ON \
-DENABLE_MAN=ON \
-DENABLE_TESTS=ON \
"${PKG_DIR}"
"${pkg_dir}"
make install
make test CTEST_OUTPUT_ON_FAILURE=TRUE
VERSION_WEECHAT=$("${PKG_BUILD_DIR}/install/bin/weechat" --version)
if [ "${VERSION_WEECHAT}" != "${VERSION}" ]; then
release_error "unexpected version \"${VERSION_WEECHAT}\" (expected: \"${VERSION}\")"
version_weechat=$("${pkg_build_dir}/install/bin/weechat" --version)
if [ "${version_weechat}" != "${version}" ]; then
release_error "unexpected version \"${version_weechat}\" (expected: \"${version}\")"
fi
}
@@ -131,16 +131,16 @@ release_end ()
# display a report about the release made
echo
echo "========================= WeeChat release status ========================="
echo " version : ${VERSION}"
echo " date : ${DATE}"
echo " build dir: ${BUILD_DIR}"
echo " version : ${version}"
echo " date : ${date}"
echo " build dir: ${build_dir}"
echo " packages :"
for PKG in "${PKG_TAR}".*; do
echo " $PKG"
for pkg in "${pkg_tar}".*; do
echo " $pkg"
done
echo " chglog/rn:"
echo " $CHGLOG"
echo " $RN"
echo " $chglog"
echo " $rn"
echo "=========================================================================="
echo
echo "*** SUCCESS! ***"
+21 -21
View File
@@ -22,32 +22,32 @@
# Updates git version in config-git.h if the output of "git describe" has changed.
#
# Syntax:
# set_git_version.sh <rootdir> <version> <headerfile>
# set_git_version.sh <root_dir> <version> <header_file>
#
# rootdir : root directory with WeeChat files (to search .git/ directory)
# version : WeeChat version, for example 0.3.9 or 0.4.0-dev
# headerfile: file to update, for example config-git.h
# root_dir : root directory with WeeChat files (to search .git/ directory)
# version : WeeChat version, for example 0.3.9 or 0.4.0-dev
# header_file: file to update, for example config-git.h
#
if [ $# -lt 3 ]; then
echo "Syntax: $0 <rootdir> <version> <headerfile>"
echo "Syntax: $0 <root_dir> <version> <header_file>"
exit 1
fi
ROOTDIR=$1
VERSION=$2
HEADERFILE=$3
root_dir=$1
version=$2
header_file=$3
# debug:
#echo "pwd=$PWD, rootdir=$ROOTDIR, version=$VERSION, headerfile=$HEADERFILE"
#echo "pwd=$PWD, rootdir=${root_dir}, version=${version}, headerfile=${header_file}"
# read git version if we are in a devel/rc version and if we are in a repository
GIT_VERSION=""
case ${VERSION} in
git_version=""
case ${version} in
*-*)
# devel/rc version (like 0.4.0-dev or 0.4.0-rc1)
if [ -d "${ROOTDIR}/.git" ]; then
GIT_VERSION=$(cd "${ROOTDIR}" && git describe 2>/dev/null)
if [ -d "${root_dir}/.git" ]; then
git_version=$(cd "${root_dir}" && git describe 2>/dev/null)
fi
;;
*)
@@ -56,18 +56,18 @@ case ${VERSION} in
esac
# check if git version has changed
if [ ! -f "${HEADERFILE}" ]; then
if [ ! -f "${header_file}" ]; then
# header does not exist => create it
echo "Creating file ${HEADERFILE} with git version: \"${GIT_VERSION}\""
echo "#define PACKAGE_VERSION_GIT \"${GIT_VERSION}\"" >"${HEADERFILE}"
echo "Creating file ${header_file} with git version: \"${git_version}\""
echo "#define PACKAGE_VERSION_GIT \"${git_version}\"" >"${header_file}"
else
if grep -q "#define PACKAGE_VERSION_GIT \"${GIT_VERSION}\"" "${HEADERFILE}"; then
if grep -q "#define PACKAGE_VERSION_GIT \"${git_version}\"" "${header_file}"; then
# git version matches the file => NO update
echo "File ${HEADERFILE} is up-to-date (git version: \"${GIT_VERSION}\")"
echo "File ${header_file} is up-to-date (git version: \"${git_version}\")"
else
# git version not found in file => update file with this git version
echo "Updating file ${HEADERFILE} with git version: \"${GIT_VERSION}\""
sed "s/#define PACKAGE_VERSION_GIT \".*\"/#define PACKAGE_VERSION_GIT \"${GIT_VERSION}\"/" "${HEADERFILE}" >"${HEADERFILE}.tmp"
mv -f "${HEADERFILE}.tmp" "${HEADERFILE}"
echo "Updating file ${header_file} with git version: \"${git_version}\""
sed "s/#define PACKAGE_VERSION_GIT \".*\"/#define PACKAGE_VERSION_GIT \"${git_version}\"/" "${header_file}" >"${header_file}.tmp"
mv -f "${header_file}.tmp" "${header_file}"
fi
fi
+21 -21
View File
@@ -39,18 +39,18 @@
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
#
WEECHAT_STABLE="4.0.3"
WEECHAT_DEVEL="4.1.0-dev"
weechat_stable="4.0.3"
weechat_devel="4.1.0-dev"
STABLE_MAJOR=$(echo "${WEECHAT_STABLE}" | cut -d"." -f1)
STABLE_MINOR=$(echo "${WEECHAT_STABLE}" | cut -d"." -f2)
STABLE_PATCH=$(echo "${WEECHAT_STABLE}" | cut -d"." -f3-)
STABLE_PATCH_DIGITS=$(echo "${WEECHAT_STABLE}" | cut -d"." -f3- | cut -d"-" -f1)
stable_major=$(echo "${weechat_stable}" | cut -d"." -f1)
stable_minor=$(echo "${weechat_stable}" | cut -d"." -f2)
stable_patch=$(echo "${weechat_stable}" | cut -d"." -f3-)
stable_patch_digits=$(echo "${weechat_stable}" | cut -d"." -f3- | cut -d"-" -f1)
DEVEL_MAJOR=$(echo "${WEECHAT_DEVEL}" | cut -d"." -f1)
DEVEL_MINOR=$(echo "${WEECHAT_DEVEL}" | cut -d"." -f2)
DEVEL_PATCH=$(echo "${WEECHAT_DEVEL}" | cut -d"." -f3-)
DEVEL_PATCH_DIGITS=$(echo "${WEECHAT_DEVEL}" | cut -d"." -f3- | cut -d"-" -f1)
devel_major=$(echo "${weechat_devel}" | cut -d"." -f1)
devel_minor=$(echo "${weechat_devel}" | cut -d"." -f2)
devel_patch=$(echo "${weechat_devel}" | cut -d"." -f3-)
devel_patch_digits=$(echo "${weechat_devel}" | cut -d"." -f3- | cut -d"-" -f1)
if [ $# -lt 1 ]; then
echo >&2 "Syntax: $0 <name>"
@@ -61,18 +61,18 @@ fi
case $1 in
# stable
stable ) echo "${WEECHAT_STABLE}" ;;
stable-major ) echo "${STABLE_MAJOR}" ;;
stable-minor ) echo "${STABLE_MINOR}" ;;
stable-patch ) echo "${STABLE_PATCH}" ;;
stable-number ) printf "0x%02d%02d%02d00\n" "${STABLE_MAJOR}" "${STABLE_MINOR}" "${STABLE_PATCH_DIGITS}" ;;
stable ) echo "${weechat_stable}" ;;
stable-major ) echo "${stable_major}" ;;
stable-minor ) echo "${stable_minor}" ;;
stable-patch ) echo "${stable_patch}" ;;
stable-number ) printf "0x%02d%02d%02d00\n" "${stable_major}" "${stable_minor}" "${stable_patch_digits}" ;;
# devel
devel ) echo "${WEECHAT_DEVEL}" | cut -d"-" -f1 ;;
devel-full ) echo "${WEECHAT_DEVEL}" ;;
devel-major ) echo "${DEVEL_MAJOR}" ;;
devel-minor ) echo "${DEVEL_MINOR}" ;;
devel-patch ) echo "${DEVEL_PATCH}" ;;
devel-number ) printf "0x%02d%02d%02d00\n" "${DEVEL_MAJOR}" "${DEVEL_MINOR}" "${DEVEL_PATCH_DIGITS}" ;;
devel ) echo "${weechat_devel}" | cut -d"-" -f1 ;;
devel-full ) echo "${weechat_devel}" ;;
devel-major ) echo "${devel_major}" ;;
devel-minor ) echo "${devel_minor}" ;;
devel-patch ) echo "${devel_patch}" ;;
devel-number ) printf "0x%02d%02d%02d00\n" "${devel_major}" "${devel_minor}" "${devel_patch_digits}" ;;
# error
* ) echo >&2 "ERROR: unknown version."
exit 1 ;;