View | Details | Raw Unified | Return to bug 119464
Collapse All | Expand All

(-)security.functions (-6 / +15 lines)
Lines 37-52 Link Here
37
# Usage: COMMAND | check_diff [new_only] LABEL - MSG
37
# Usage: COMMAND | check_diff [new_only] LABEL - MSG
38
#        COMMAND > TMPFILE; check_diff [new_only] LABEL TMPFILE MSG
38
#        COMMAND > TMPFILE; check_diff [new_only] LABEL TMPFILE MSG
39
#   if $1 is new_only, show only the 'new' part of the diff.
39
#   if $1 is new_only, show only the 'new' part of the diff.
40
#   if $1 is sorted, show 'old' and 'new' parts of the diff sorted by filename
40
#   LABEL is the base name of the ${LOG}/${label}.{today,yesterday} files.
41
#   LABEL is the base name of the ${LOG}/${label}.{today,yesterday} files.
41
42
42
check_diff() {
43
check_diff() {
43
  rc=0
44
  rc=0
44
  if [ "$1" = "new_only" ]; then
45
  case "$1" 
45
    shift
46
    in
46
    filter="grep '^[>+]'"
47
      "new_only")
47
  else
48
        shift
48
    filter="cat"
49
        filter="grep '^[>+]'"
49
  fi
50
        ;;
51
      "sorted")
52
        shift
53
        filter="grep '^[>+-]' | sort -k 11"
54
        ;;
55
      *)
56
        filter="cat"
57
        ;;
58
  esac
50
  label="$1"; shift
59
  label="$1"; shift
51
  tmpf="$1"; shift
60
  tmpf="$1"; shift
52
  msg="$1"; shift
61
  msg="$1"; shift

Return to bug 119464