diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-03-20 22:09:20 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-03-20 22:09:20 +0100 |
commit | 846eb90e7dd62ad89decf33a41715a8cce76d433 (patch) | |
tree | d4c9cd6bfb79ddd254412fb7b1029966b69f6bfe /tools/build-debian.sh | |
parent | 667c9364ed1c1e36a555e9a54236a8d1b3df098d (diff) | |
download | weechat-846eb90e7dd62ad89decf33a41715a8cce76d433.zip |
core: add option "test-patches" in script build-debian.sh
Diffstat (limited to 'tools/build-debian.sh')
-rwxr-xr-x | tools/build-debian.sh | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/tools/build-debian.sh b/tools/build-debian.sh index 32e084642..589dba471 100755 --- a/tools/build-debian.sh +++ b/tools/build-debian.sh @@ -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 |