#!/bin/bash if [ $# -ne 1 ] || [ ! -f "$1/PKGBUILD" ]; then printf 'usage: %s $pkg\n' "$0" exit 1 fi diff=$(cat) sed -i ' /^_pinned_dependencies=(/,/^)/ { '"$( printf '%s\n' "${diff}" \ | sed -n ' s/^claimed\s\+// T s@[.*+]@[\0]@g s@.*@/^\\s*'"'"'\0=/d@ p ' )"' } ' "$1/PKGBUILD" sed -i ' /^_pinned_dependencies=(/ a '"$( printf '%s\n' "${diff}" \ | sed -n ' s/^actual\s\+// T p ' \ | sed ' $! s/$/\\/ ' )"' ' "$1/PKGBUILD" ./bumpPkgrel "$1"