summaryrefslogtreecommitdiffstats
path: root/misc/infer-match
blob: 9a1b3400a3d22827d9922aa9f454205f2f0aa630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# Copyright 2015 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)

DISTILLER=./distill-spec
SPEC=clufter.spec

DIFFER=${DIFFER:=$(which colordiff || echo -n diff) -u}
PAGER=${PAGER:=$(which less || echo -n cat)}

${DIFFER} <(${DISTILLER} -D "infer 1" "${SPEC}") <(${DISTILLER} "${SPEC}") \
  | ${PAGER}
ret=${PIPESTATUS[0]}

test ${ret} -eq 0 \
  && echo "[$(basename "${0}")] inferred and plain version of spec matches" \
  || echo "[$(basename "${0}")] inferred and plain version of spec mismatch"

r() { return ${1}; }; r ${ret}