2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: misc/archive/compare_builddirs.sh
6 # Copyright (C) 2005 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
17 if [ "$1" = -cfg ]; then
22 local config
="$1" dir0
="${2%/}" dir1
="${3%/}"
23 local cfgid0
="${dir0#build/}" cfgid1
="${dir1#build/}"
25 echo "compare: $cfgid0 vs. $cfgid1"
28 if grep -q "^export SDECFG_ID='$cfgid0'" config
/$config/config
; then
30 elif [ -f "$dir0/etc/ROCK-CONFIG/packages" ]; then
31 cfg0
="$dir0/etc/ROCK-CONFIG"
32 elif [ -f "$dir0/etc/SDE-CONFIG/packages" ]; then
33 cfg0
="$dir0/etc/SDE-CONFIG"
35 echo "Unable to detect '$dir0' config."
37 if grep -q "^export SDECFG_ID='$cfgid1'" config
/$config/config
; then
39 elif [ -f "$dir1/etc/ROCK-CONFIG/packages" ]; then
40 cfg1
="$dir1/etc/ROCK-CONFIG"
41 elif [ -f "$dir1/etc/SDE-CONFIG/packages" ]; then
42 cfg1
="$dir1/etc/SDE-CONFIG"
44 echo "Unable to detect '$dir1' config."
47 [ -n "$cfg0" -a -n "$cfg1" ] ||
exit 1
50 #diff -U1 "$cfg0/packages" "$cfg1/packages"
53 for flist
in "$dir0/var/adm/flists/"*; do
54 pkg
="${flist#$dir0/var/adm/flists/}"
55 if [ -f "$dir1/var/adm/flists/$pkg" ]; then
56 diff -U1 "$flist" "$dir1/var/adm/flists/$pkg"
58 echo "missing '$pkg' at '$cfgid1'"
61 for flist
in "$dir1/var/adm/flists/"*; do
62 pkg
="${flist#$dir1/var/adm/flists/}"
63 if [ ! -f "$dir0/var/adm/flists/$pkg" ]; then
64 echo "missing '$pkg' at '$cfgid0'"
70 find build
/$config-*/ -maxdepth 0 -type d
2> /dev
/null |
while read -r builddir
; do
71 if [ -z "$bd0" ]; then
74 elif [ -z "$bd1" ]; then
78 # third or another builddir, rotate
83 if [ -n "$bd0" -a -n "$bd1" ]; then
84 compare_builddirs
"$config" "$bd0" "$bd1"