summaryrefslogtreecommitdiff
path: root/bin/build-packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-16 15:41:18 +0100
committerErich Eckner <git@eckner.net>2019-01-16 15:41:18 +0100
commitff791f0a90743def1feeec7c0011d753fb15408d (patch)
treef5de86b7687a6b1f596b723f530f045a02c129f2 /bin/build-packages
parentb0e6586805a456fe8430abc2b5eb4601b7e0eed2 (diff)
downloadbuilder-ff791f0a90743def1feeec7c0011d753fb15408d.tar.xz
bin/build-packages: -d|--diff new - we can now build the trunk version more easily
Diffstat (limited to 'bin/build-packages')
-rwxr-xr-xbin/build-packages32
1 files changed, 30 insertions, 2 deletions
diff --git a/bin/build-packages b/bin/build-packages
index fc61e78..4fb9d88 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -17,6 +17,12 @@ usage() {
>&2 echo 'build-packages: build package(s) on the build-list'
>&2 echo ''
>&2 echo 'possible options:'
+ >&2 echo ' -d|--diff source-directory:'
+ >&2 echo ' Apply the diff between $source-directory/PKGBUILD and'
+ >&2 echo ' $source-directory/../../trunk/PKGBUILD before building.'
+ >&2 echo ' This option is intended for building from trunk where minor'
+ >&2 echo ' fixes did not get released yet. Hence, it conflicts intentionally'
+ >&2 echo ' with -n, -l, -t or -x and it requires -p.'
>&2 echo ' -h|--help: Show this help and exit.'
>&2 echo ' -l|--local pkgname.git-revision.git-mod-revision.repository:'
>&2 echo ' Build the given package without asking / reporting to the'
@@ -61,7 +67,8 @@ usage() {
}
eval set -- "$(
- getopt -o hl:n:p:s:t:ux \
+ getopt -o d:hl:n:p:s:t:ux \
+ --long diff: \
--long help \
--long local: \
--long prefer: \
@@ -72,6 +79,7 @@ eval set -- "$(
)"
unset count
+unset diff_source_dir
unset forced_package
unset forced_straws
unset prefered_package
@@ -81,6 +89,14 @@ timeout=0
while true
do
case "$1" in
+ -d|--diff)
+ shift
+ if [ -n "${diff_source_dir}" ]; then
+ >&2 echo 'Option -d, --diff can be given only once.'
+ usage
+ fi
+ diff_source_dir="$1"
+ ;;
-h|--help)
usage 0
;;
@@ -134,6 +150,17 @@ if [ $# -ne 0 ]; then
usage
fi
+if [ -n "${diff_source_dir}" ]; then
+ if [ -n "${count}" ] || \
+ [ -n "${forced_package}" ] || \
+ [ "${timeout}" -ne 0 ] || \
+ ${exit_after_failure} || \
+ [ -z "${prefered_package}" ]; then
+ >&2 echo 'Conflicting flags.'
+ usage
+ fi
+fi
+
if [ -n "${forced_package}" ]; then
if [ -n "${count}" ] || \
[ "${timeout}" -ne 0 ] || \
@@ -319,7 +346,8 @@ while [ "${count}" -ne 0 ] && \
if ! git_repo=$(find_repository_with_commit "${git_revision}") || \
[ -z "${git_repo}" ] || \
! find_pkgbuilds "${package}" "${repository}" "${git_repo}" "${git_revision}" "${mod_git_revision}" || \
- ! extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" "${sub_pkgrel}"; then
+ ! extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" "${sub_pkgrel}" || \
+ ! apply_trunk_patch "${tmp_dir}" "${diff_source_dir}"; then
# report local failure (probably a missing commit) to build-master
# shellcheck disable=SC2029
ssh \