index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | src/lib/common.sh | 24 |
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 |