########################################################################1# #2# This software is part of the ast package #3# Copyright (c) 1987-2011 AT&T Intellectual Property #4# and is licensed under the #5# Eclipse Public License, Version 1.0 #6# by AT&T Intellectual Property #7# #8# A copy of the License is available at #9# http://www.eclipse.org/org/documents/epl-v10.html #10# (with md5 checksum b35adb5213ca9657e911e9befb180842) #11# #12# Information and Software Systems Research #13# AT&T Research #14# Florham Park NJ #15# #16# Glenn Fowler <[email protected]> #17# #18########################################################################19: tw + pax for backup20#21# @(#)bax (AT&T Bell Laboratories) 05/09/9522#23# ../lib/bax/init on $PATH to customize24#2526command=bax27customize=../lib/${command}/init2829#30# no stinking environment31#3233root= arch_name= arch_keep= big_size= big_magic_keep=34name_skip= path_skip= reg_magic_skip= src_name= src_magic_skip=3536ifs=${IFS-'37'}38IFS=:39path=$PATH40IFS=$ifs41for dir in $path42do if test -f $dir/$customize43then . $dir/$customize44break45fi46done4748#49# default dirs50#5152root=${root:-'/'}5354#55# keep these architecture specific files: */${arch_name}/*/${arch_keep}56#5758arch_name=${arch_name:-'arch'}59arch_keep=${arch_keep:-'bin|fun|lib'}6061#62# files bigger than ${big_size} must have magic that matches ${big_magic_keep}63#6465big_size=${big_size:-5000000}66big_magic_keep=${big_magic_keep:-'mail'}6768#69# ${name_skip} are base names to be skipped70# ${path_skip} are path prefixes to be skipped71#7273name_skip=${name_skip:-'?(*.)(old|save|tmp)?(.*)|.*-cache'}74path_skip=${path_skip:-'/dev|/usr/local/ast/ship'}7576#77# regular files with magic that matches ${reg_magic_skip} are skipped78#7980reg_magic_skip=${reg_magic_skip:-'core|cql * index|history|TeX dvi'}8182#83# files under */${src_name}/* are skipped if magic matches ${src_magic_skip}84#8586src_name=${src_name:-'src'}87src_magic_skip=${src_magic_skip:-'executable|object|(archive|shared) library'}8889case $# in90[01]) echo "Usage: $command delta base [dir ...]" >&291exit 292;;93esac94delta=$195shift96base=$297shift98case $# in990) set $root ;;100esac101dirs=102while :103do case $# in1040) break ;;105esac106dirs="$dirs -d $1"107shift108done109110tw $dirs -mH -e "111112begin: int arch_bit = 1;113int src_bit = 2;114char* m;115116sort: name;117118select: if (name == '${name_skip}')119status = SKIP;120else if (type == REG)121{122m = magic;123if (size > ${big_size} && m != '*@(${big_magic_keep})*' ||124m == '*@(${reg_magic_skip})*' ||125(parent.local & src_bit) && m == '*@(${src_magic_skip})*')126status = SKIP;127}128else if (type == DIR)129{130local = (parent.local & src_bit);131if (dev != parent.dev || path == '${path_skip}' || (parent.parent.local & arch_bit) && name != '${arch_keep}')132status = SKIP;133else if (name == '${arch_name}')134local |= arch_bit;135else if (name == '${src_name}')136local |= src_bit;137}138return 1;139" | pax -o "write ordered physical verbose file=$delta base=$base"140141142