2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: misc/archive/findorphans.sh
6 # Copyright (C) 2006 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 ---
21 echo "usage: $0 [-cfg <config>|-root <root>|-system]"
24 while [ $# -gt 0 ]; do
28 -root) root
="$2"; shift ;;
30 -just) shift; folders
="$@"; break ;;
31 -help) usage
; exit 0 ;;
32 *) echo "ERROR: unknown argument '$1'"
38 if [ -z "$root" ]; then
39 if [ ! -f config
/$config/config
]; then
40 echo "ERROR: '$config' is not a valid config"
43 root
="build/`grep ' SDECFG_ID=' \
44 config/$config/config | cut -d\' -f2`"
48 if [ ! -d "$root/var/adm/flists" ]; then
49 echo "ERROR: '$root' is not a valid T2 box/sandbox root"
53 flists
=$
( cd "$root"; echo var
/adm
/flists
/* )
54 realroot
=$
( cd "$root"; pwd )
58 findroot
="$findroot $realroot/${f#/}"
60 [ "$findroot" ] || findroot
="$realroot"
62 pushd "$realroot" > /dev
/null
63 find $findroot -mindepth 1 \
64 \
( -path "$realroot/TOOLCHAIN" -o \
65 -path "$realroot/proc" -o \
66 -path "$realroot/tmp" -o \
67 -path '*/.svn' \
) -prune \
68 -o -print |
sed -e "s,^$realroot/,," |
70 if ! grep -q -l "^[^ ]*: ${file}\$" $flists; then