Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/common.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-08-16 08:06:08 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2024-08-16 08:06:08 +0200
commitdeffc1b87e86fffa8e4758a76a1912c6c8f69a85 (patch)
tree0f61a152c4c49d40de5042df2b25cdb8e0b0a82d /src/lib/common.sh
parent2994bca96781afd62104c1515532a9c479cb5bed (diff)
parent27eebe383d0b571c08cba991e4824768d7623602 (diff)
merged with upstreamHEADmaster
Diffstat (limited to 'src/lib/common.sh')
-rw-r--r--src/lib/common.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/common.sh b/src/lib/common.sh
index 00ece97..5416eaf 100644
--- a/src/lib/common.sh
+++ b/src/lib/common.sh
@@ -15,6 +15,9 @@ $DEVTOOLS_INCLUDE_COMMON_SH
# Avoid any encoding problems
export LANG=C.UTF-8
+# Avoid systemd trying to color the terminal on systemd-nspawn
+export SYSTEMD_TINT_BACKGROUND=no
+
# Set buildtool properties
export BUILDTOOL=devtools
export BUILDTOOLVER=@buildtoolver@
@@ -31,6 +34,17 @@ export PACKAGING_REPO_RELEASE_HOST=repos.archlinux.org
export PKGBASE_MAINTAINER_URL=https://archlinux.org/packages/pkgbase-maintainer
export AUR_URL_SSH=aur@aur.archlinux.org
+export RSYNC_OPTS=(
+ --rsh=ssh
+ --checksum
+ --copy-links
+ --human-readable
+ --progress
+ --partial
+ --partial-dir=.partial
+ --delay-updates
+)
+
# ensure TERM is set with a fallback to dumb
export TERM=${TERM:-dumb}
@@ -106,6 +120,8 @@ print_workdir_error() {
}
_setup_workdir=false
+# Ensure that there is no outside value for WORKDIR leaking in
+unset WORKDIR
setup_workdir() {
[[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
_setup_workdir=true
@@ -343,6 +359,14 @@ is_debug_package() {
[[ ${pkgdesc} == "Detached debugging symbols for "* && ${pkgbase}-debug = "${pkgname}" ]]
}
+# Proxy function to check if a file exists. Using [[ -f ... ]] directly is not
+# always wanted because we might want to expand bash globs first. This way we
+# can pass unquoted globs to is_globfile() and have them expanded as function
+# arguments before being checked.
+is_globfile() {
+ [[ -f $1 ]]
+}
+
join_by() {
local IFS="$1"
shift