~hww3/caudium

ref: 93d5a75fba08db71b832716377276978cdd7888d caudium/tools/exclude-dist -rwxr-xr-x 1.4 KiB
93d5a75fWilliam Welliver storage: method "None" was missing stop function. should fix error on shutdown 1 year, 1 month ago
                                                                                
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh

#
# Simple script to exclude unwanted files from the distribution tarball
#
# $Id$
#

#
# To exclude the files/directories from the tarball you need to do one
# of the following things:
#
#  1. Exclusion of a directory
#     Put a file named .exclude_dir in the directory which you want
#     not to go in the distribution tarball. Note that it applies also
#     to all the subdirs of that directory.
#
#  2. Exclusion of files
#     Put a file named .exclude_files in the directory where the
#     files sit and list them one per line in that file. You can give
#     paths relative to the directory but not absolute ones.
#

is_rel()
{
    if [ "$1" = "x" ]; then
	false
    else
	true
    fi
}

if [ -z "$1" ]; then
    echo You need to pass the directory path to where the
    echo release tree was copied.
    exit 1
fi

cd $1
#
# First the directories
#
EXPUNGE_DIRS="`find . -name '.exclude_dir' -type f -print`"

for d in $EXPUNGE_DIRS; do
    DIR=`dirname $d`
    echo Expunging $DIR
    rm -rf $DIR
done

#
# Now files
#
EXPUNGE_FILES="`find . -name '.exclude_files' -type f -print`"

for d in $EXPUNGE_FILES; do
    SAVEDIR="`pwd`"
    echo Removing files from `dirname $d`
    cd `dirname $d`
    for f in `cat .exclude_files`; do
	is_rel x`echo $f | tr '/' ' '`
	if [ -f $f -a $? -eq 0 ]; then
	    echo "  $f"
	    rm -f $f
	fi
    done
    rm -f .exclude_files
    echo
    cd $SAVEDIR
done