Multithreaded Bash

Avoiding leaks

Comments are moderated. It may take a few minutes before your comment appears.
Markdown is supported in your comments.

rpcinfo_bg() {
    if ! [[ -f "$tmpdir/$1.info" ]]; then
        curl -fGs --data-urlencode "arg=$1" "http://aur.archlinux.org/rpc.php?type=info" > "$tmpdir/$1.info"
    fi
}

versionisnewer() {
    unset aurversion
    if ! grep -Fq ':"No result found"' "$tmpdir/$1.info"; then
        aurversion="$(cut -d '"' -f 18 "$tmpdir/$1.info")"
        if [[ "$(LC_ALL=C vercmp "$aurversion" "$2")" -gt 0  ]]; then
            return 0
        else
            return 1
        fi
    else
        return 1
    fi
}

aurversionisnewer() {
    rpcinfo_bg "$1"
    versionisnewer "$1" "$2"
}
Name:
Mail: (not shown)

Please type this: