#!/bin/sh # # makeReleaseList - get list of files from the specified release # that the user want to copy # # usage: makeReleaseList -r release [-d subdir] [-a arch] # # where release is the release directory # dirlist adds a subdirectory to the list which is not # copied in full but is searched for architecture # specific subdirs, may be repeated. # (defualt list = tmp bin lib ). # # archlist is the BaBar system architecture # ( default = $SRT_SUBDIR ) # # NOTES It is assumed that this script executes from the .../releases # directory and that the 'release' parameter is a subdirectory # # Neil Geddes July 1995 # # # Modifications: # # 8-Dec-1997 jonckheere@fnal.gov # filter out directories, still does links etc. Needed to make a reasonable # makeDist # # Default arguments ArchDirs="bin shbin codegen lib shlib rcpdb results tmp" ArchWanted="" Target="." # Parse arguments #amj:FNAL: getopts has replaced getopt as recommended usage on SGI and # DECUnix. Only getopts exists in the cygnus NT system. while getopts a:d:r:h c do case $c in h) echo " usage $0 -r release [ -a architecture ] [ -d subdir ]" exit;; a) ArchWanted="$ArchWanted $OPTARG";; d) ArchDirs="$ArchDirs $OPTARG";; r) Target="$OPTARG";; esac done shift `expr $OPTIND - 1` echo "Architecture dependent directories = $Target/ $ArchDirs" >&2 echo "Architectures requested = $ArchWanted" >&2 # Write the awk program used to select the required files ... awkString="" # By default we dont take any files from the subdirectories # with architecture dependencies ampersands="NO" for subdir in $ArchDirs ; do if [ $ampersands = "NO" ] ; then ampersands="YES" else awkString="$awkString && " fi awkString="$awkString \$1 !~ /\\$Target\/$subdir\/*\// " done awkString="$awkString { print }" # Now add the required achitecture subdirectories where the # dependencies exist for architecture in $ArchWanted ; do for subdir in $ArchDirs ; do awkString="$awkString \$1 ~ /\\$Target\/$subdir\/$architecture\// { print }" awkString="$awkString \$1 ~ /\\$Target\/$subdir\/$architecture\$/ { print }" done done awkString="$awkString " # Generate list of files # (cant seem to simply use the awkString directly here, it only seems to work # if directed through a file !?) echo "$awkString" > /tmp/SRTawk$$.file find $Target ! -type d -print | awk -f /tmp/SRTawk$$.file rm /tmp/SRTawk$$.file