head	1.1;
access;
symbols
	caudium_1_4_9:1.1
	caudium_1_4_8:1.1
	caudium_1_4_7:1.1
	caudium_1_4_6:1.1
	caudium_1_2_35:1.1
	caudium_1_2_34:1.1
	caudium_1_4_5:1.1
	caudium_1_4_4:1.1
	caudium_1_4_3:1.1
	caudium_1_4_2:1.1
	caudium_1_5_1:1.1
	caudium_1_4_1:1.1
	stable_1_4:1.1.0.4
	caudium_1_3_33:1.1
	caudium_1_3_32:1.1
	caudium_1_3_31:1.1
	caudium_1_3_30:1.1
	caudium_1_3_29:1.1
	caudium_1_2_33:1.1
	caudium_1_2_32:1.1
	caudium_1_3_23:1.1
	caudium_1_3_22:1.1
	caudium_1_3_21:1.1
	caudium_1_3_20:1.1
	caudium_1_3_19:1.1
	caudium_1_3_18:1.1
	caudium_1_2_31:1.1
	caudium_1_2_30:1.1
	caudium_1_2_29:1.1
	caudium_1_2_28:1.1
	caudium_1_3_17:1.1
	caudium_1_3_16:1.1
	caudium_1_2_27:1.1
	caudium_1_2_26:1.1
	caudium_1_2_25:1.1
	caudium_1_2_24:1.1
	caudium_1_3_15:1.1
	caudium_1_3_14:1.1
	caudium_1_2_23:1.1
	caudium_1_2_22:1.1
	caudium_1_2_21:1.1
	caudium_1_2_20:1.1
	caudium_1_3_13:1.1
	caudium_1_3_12:1.1
	caudium_1_3_11:1.1
	caudium_1_3_10:1.1
	caudium_1_2_19:1.1
	caudium_1_2_18:1.1
	caudium_1_3_9:1.1
	caudium_1_3_8:1.1
	caudium_1_3_7:1.1
	caudium_1_3_6:1.1
	caudium_1_2_17:1.1
	caudium_1_2_16:1.1
	caudium_1_2_15:1.1
	caudium_1_2_14:1.1
	caudium_1_2_12:1.1
	caudium_1_2_10:1.1
	caudium_1_3_5:1.1
	caudium_1_3_4:1.1
	caudium_1_2_9:1.1
	caudium_1_2_8:1.1
	caudium_1_3_3:1.1
	caudium_1_2_7:1.1
	caudium_1_2_6:1.1
	Caudium_1_3_2:1.1
	caudium_1_2_5:1.1
	caudium_1_2_4:1.1
	caudium_1_2_3:1.1
	caudium_1_2_2:1.1
	caudium_1_3_1:1.1
	caudium_1_2_1:1.1
	stable_1_2:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2002.01.03.15.48.23;	author grendel;	state Exp;
branches;
next	;


desc
@@


1.1
log
@this little script will enable the maintainer to exclude directories/files
from the distribution tarball. Tested shortly, works - YMMV
@
text
@#!/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
@
