summaryrefslogtreecommitdiff
path: root/bin/local-build-package
diff options
context:
space:
mode:
Diffstat (limited to 'bin/local-build-package')
-rwxr-xr-xbin/local-build-package24
1 files changed, 13 insertions, 11 deletions
diff --git a/bin/local-build-package b/bin/local-build-package
index 9cfe93a..9c53c2b 100755
--- a/bin/local-build-package
+++ b/bin/local-build-package
@@ -7,6 +7,7 @@
# shellcheck source=../lib/load-configuration
. "${0%/*}/../lib/load-configuration"
+# shellcheck disable=SC2016
usage() {
>&2 echo ''
>&2 echo 'test-build-package <repository> <package>: build package for testing'
@@ -24,7 +25,7 @@ usage() {
>&2 echo ' -n|--nocheck:'
>&2 echo ' Normally execute all checks and do all tests.'
>&2 echo ' This switches off check() and all integrity checks.'
- [ -z "$1" ] && exit 1 || exit $1
+ [ -z "$1" ] && exit 1 || exit "$1"
}
eval set -- "$(
@@ -93,11 +94,11 @@ fi
if ${bootstrap}; then
if [ -z "${bootstrap_host}" ]; then
- >&2 echo '-b option requires a bootstrapping host to be set with -H'
+ >&2 echo -- '-b option requires a bootstrapping host to be set with -H'
usage
fi
if [ -z "${bootstrap_dir}" ]; then
- >&2 echo '-b option requires a bootstrapping directory to be set with -d'
+ >&2 echo -- '-b option requires a bootstrapping directory to be set with -d'
usage
fi
fi
@@ -125,11 +126,11 @@ case $repository in
>&2 echo 'Repository is either "core" or "community"'
usage
esac
-git_revision=$(cd ${repo_path}; git rev-parse HEAD)
+git_revision=$(git -C "${repo_path}" rev-parse HEAD)
-mod_git_revision=$(cd ${repo_paths__archlinux32}; git stash create)
-if [ -z $mod_git_revision ]; then
- mod_git_revision=$(cd ${repo_paths__archlinux32}; git rev-parse HEAD)
+mod_git_revision=$(git -C "${repo_paths__archlinux32}" stash create)
+if [ -z "${mod_git_revision}" ]; then
+ mod_git_revision=$(git -C "${repo_paths__archlinux32}" rev-parse HEAD)
fi
build_command="staging-${arch}-build"
parameters=''
@@ -143,16 +144,17 @@ tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX")
extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}"
-rm -f *".pkg.tar.xz" *".pkg.tar.xz.sig"
+rm -f ./*".pkg.tar.xz" ./*".pkg.tar.xz.sig"
cd "${tmp_dir}"
makepkg_parameters=''
-if ${nocehck}; then
+if ${nocheck}; then
makepkg_parameters='--skippgpcheck'
fi
makepkg ${makepkg_parameters} --verifysource
+# shellcheck disable=SC2086
"${build_command}" ${parameters}
if ${bootstrap}; then
@@ -171,8 +173,8 @@ if ${bootstrap}; then
;;
esac
- scp -P ${bootstrap_port} -rC "${tmp_dir}/"*.pkg.tar.{xz,xz.sig} ${bootstrap_host}:${bootstrap_dir}/${staging_repo}/.
- ssh -p ${bootstrap_port} ${bootstrap_host} bash -l -c "'cd ${bootstrap_dir}/${staging_repo} && repo-add -n bootstrap-${staging_repo}.db.tar.gz *.pkg.tar.xz'"
+ scp -P "${bootstrap_port}" -rC "${tmp_dir}/"*.pkg.tar.xz "${tmp_dir}/"*.pkg.tar.xz.sig "${bootstrap_host}:${bootstrap_dir}/${staging_repo}/."
+ ssh -p "${bootstrap_port}" "${bootstrap_host}" bash -l -c "'cd ${bootstrap_dir}/${staging_repo} && repo-add -n bootstrap-${staging_repo}.db.tar.gz *.pkg.tar.xz'"
fi
# do not delete build reports, why might actually to want to have a look for things