diff options
Diffstat (limited to 'lib/common-functions')
-rwxr-xr-x | lib/common-functions | 75 |
1 files changed, 27 insertions, 48 deletions
diff --git a/lib/common-functions b/lib/common-functions index ef10367..7093c12 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -549,8 +549,7 @@ recursively_umount_and_rm() { # mangle_pkgbuild $PKGBUILD [$sub_pkgrel] # mangle $arch in PKBUILDs to contain i486, i586, i686 # append $sub_pkgrel to the pkgrel - -# TODO: actually include the other architectures +# remove "lib32-" from {make,check,opt,}depends mangle_pkgbuild() { local PKGBUILD="$1" @@ -568,53 +567,20 @@ mangle_pkgbuild() { sed -i ' /^arch=[^#]*any/!{ - /^arch=(/s/(/(i686 / + /^arch=(/s/(/(i686 i486 pentium3 / } s/^\(\s*pkgrel=\)['"'"'"]\?\([0-9.]\+\)['"'"'"]\?\s*\(#.*\)\?$/\1"\2'"${sub_pkgrel}"'"/ ' "${PKGBUILD}" -} -# find_newest_of_git_revisions -# find newest git revision of the ones provided at stdin -# (assuming linear history) - -find_newest_of_git_revisions() { - local revisions - local repo - revisions=$(cat) - - if [ "$( - echo "${revisions}" | \ - wc -l - )" -eq 1 ]; then - - echo "${revisions}" - return - - fi - - repo=$( - find_repository_with_commit \ - "$( - echo "${revisions}" | \ - grep -xm1 '[0-9a-f]\{40\}' - )" - ) - - eval 'repo="${repo_paths__'"${repo}"'}"' - - echo "${revisions}" | \ - xargs -rn1 git -C "${repo}" rev-parse | \ - { - newest='' - while read -r current; do - if [ -z "${newest}" ] || \ - git -C "${repo}" merge-base --is-ancestor "${newest}" "${current}"; then - newest="${current}" - fi - done - echo "${newest}" + sed -i ' + /^\s*\(\(make\|check\|opt\|\)depends\)=(/ { + :a + s,^\s*\(\S[^=]*\)=(\([^()]*\(#[^\n]*\n\)\?\)*),\0\n\1=(${\1[\@]/lib32-/})\n, + t + $!N + ba } + ' "${PKGBUILD}" } # find_package_repository_to_package $package $git_repository $git_commit @@ -921,10 +887,23 @@ extract_pkgname_epoch_pkgver_pkgrel_sub_pkgrel_arch_from_package_name() { fi } -# irc_say -# say content of stdin in irc channel +# irc_say $channel [copy] +# say content of stdin in irc channel $channel (default: #archlinux32) +# and print copy to stdout if 'copy' is given + +# shellcheck disable=SC2120 irc_say() { - if [ -p "${irc_dir}/#archlinux32/in" ]; then - sponge "${irc_dir}/#archlinux32/in" + local channel + if [ -z "$1" ]; then + channel='#archlinux32' + else + channel="$1" + fi + if [ -p "${irc_dir}/${channel}/in" ]; then + if [ "$2" = 'copy' ]; then + pee cat 'sponge '"${irc_dir}/${channel}/in" + else + sponge "${irc_dir}/${channel}/in" + fi fi } |