diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-04-14 13:31:46 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-04-14 13:31:46 -0300 |
commit | 2434277d8cf73c7332b82e5fb8fd968990976fd0 (patch) | |
tree | 2b1ff8eee7078575f80ff79b21897296ffe5c771 /is_built | |
parent | 99dad96bcc60136d6b99f797405e7cbdd5991d09 (diff) |
Version checking
Diffstat (limited to 'is_built')
-rwxr-xr-x | is_built | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,7 +1,9 @@ #!/bin/bash # Detect is a package is installed or in a database -pacman -Qqi $1 >/dev/null 2>&1 || \ -pacman -Sqi $1 >/dev/null 2>&1 +# Checks for package, if -T returns non-zero output, egrep will return 0 +# because it finds it, so we negate the value to say it's not built. +# Example usage: is_built "pcre>=20" +!(sudo pacman -T "$1" | egrep "*" >/dev/null) exit $? |