File: compare-schema

package info (click to toggle)
openldap 2.6.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 31,080 kB
  • sloc: ansic: 328,961; sh: 51,256; cpp: 6,011; makefile: 3,320; sql: 1,714; perl: 455; python: 184; tcl: 45
file content (26 lines) | stat: -rwxr-xr-x 822 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
# Compare the stripped versions of the schema with the unmodified versions
# from the source as distributed upstream and find any non-comment changes
# so that our stripped versions can be updated.
#
# Takes the directory containing our stripped schema and the directory
# containing the upstream schema.  Uses the first directory as a working
# area.

set -e

ours="$1"
theirs="$2"
if [ -z "$ours" ] || [ -z "$theirs" ] ; then
    echo 'Usage: compare-schema <debian-schema-dir> <openldap-schema-dir>' >&2
    exit 1
fi

cd $ours
for schema in *.schema *.ldif ; do
    grep -v '^#' "$schema" | grep -v '^ *$' > "${schema}.debian"
    grep -v '^#' "$theirs/$schema" | grep -v '^ *$' > "${schema}.upstream"
    diff -u "${schema}.debian" "${schema}.upstream"
    rm "${schema}.debian" "${schema}.upstream"
done