1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: add option "test-patches" in script build-debian.sh

This commit is contained in:
Sébastien Helleu
2018-03-20 22:09:20 +01:00
parent 667c9364ed
commit 846eb90e7d
+31 -4
View File
@@ -33,6 +33,9 @@
# 1. version devel, devel-2, stable, stable-2, 1.9, 1.9-2
# 2. distro type/name debian/sid, ubuntu/artful, raspbian/stretch
#
# The script can also just check that all Debian/Ubuntu patches apply fine
# with a single argument: "test-patches".
#
# Examples:
#
# …/build-debian.sh devel debian/sid
@@ -40,6 +43,8 @@
# …/build-debian.sh 1.9 ubuntu/artful
# …/build-debian.sh 1.9-2 ubuntu/zesty
#
# …/build-debian.sh test-patches
#
# Environment variables that can be used:
#
# PACKAGER_NAME Name of packager (for debian/changelog)
@@ -62,11 +67,14 @@ usage ()
cat <<-EOF
Syntax: $0 devel|stable|<version> distro
$0 test-patches
version version to build: stable, devel or specific version
(debian package revision is allowed after name (default is 1),
for example: devel-2, stable-2, 1.9-2)
distro the distro type/name (debian/sid, ubuntu/artful, raspbian/stretch, ...)
version version to build: stable, devel or specific version
(debian package revision is allowed after name (default is 1),
for example: devel-2, stable-2, 1.9-2)
distro the distro type/name (debian/sid, ubuntu/artful, raspbian/stretch, ...)
test-patches test that all Debian/Ubuntu patches apply fine (with git apply --check)
IMPORTANT: the current OS must match the distro, and the WeeChat sources
must be checkouted in the appropriate version (this script
@@ -78,6 +86,7 @@ Examples:
$0 stable debian/stretch
$0 1.9 ubuntu/artful
$0 1.9-2 ubuntu/zesty
$0 test-patches
EOF
exit ${RC}
@@ -95,6 +104,20 @@ error_usage ()
usage 1
}
test_patches ()
{
set +e
RET_CODE=0
for file in ${ROOT_DIR}/tools/debian/patches/*.patch; do
echo "=== Testing patch ${file} ==="
git apply --check "${file}"
if [ $? -ne 0 ]; then
RET_CODE=1
fi
done
exit ${RET_CODE}
}
# ================================== START ==================================
# package name/email
@@ -118,6 +141,10 @@ cd "${ROOT_DIR}"
if [ $# -eq 0 ]; then
usage 0
fi
if [ "$1" = "test-patches" ]; then
test_patches
exit 0
fi
if [ $# -lt 2 ]; then
error_usage "missing arguments"
fi