include $(TOPDIR)/rules.mk
PKG_NAME:=jq
-PKG_VERSION:=1.8.1
-PKG_RELEASE:=2
+PKG_VERSION:=1.8.2
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/jqlang/jq/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
-PKG_HASH:=2be64e7129cecb11d5906290eba10af694fb9e3e7f9fc208a311dc33ca837eb0
+PKG_HASH:=71b8d6e8f5fe81f6c6d0d110e3892251f6ce76ed095abd315e26e6e1193af3af
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=MIT
--- /dev/null
+#!/bin/sh
+# Exercise jq's core JSON filtering (CI's generic probe covers --version).
+
+[ -x /usr/bin/jq ] || { echo "FAIL: /usr/bin/jq not installed"; exit 1; }
+
+check() { # label expected actual
+ [ "$2" = "$3" ] || { echo "FAIL: $1 (want '$2' got '$3')"; exit 1; }
+}
+
+check "object field" "1" "$(echo '{"a":1,"b":2}' | jq '.a')"
+check "arithmetic" "5" "$(jq -n '2+3')"
+check "array map" "[2,4,6]" "$(echo '[1,2,3]' | jq -c 'map(.*2)')"
+check "reduce add" "6" "$(echo '[1,2,3]' | jq 'add')"
+check "sorted keys" '["a","b"]' "$(echo '{"b":2,"a":1}' | jq -c 'keys')"
+check "string builtin" "HELLO" "$(echo '"hello"' | jq -r 'ascii_upcase')"
+check "select + pipe" '[{"n":5}]' "$(echo '[{"n":1},{"n":5}]' | jq -c '[.[]|select(.n>2)]')"
+
+echo "jq: all filters OK"