1*49cdfc7eSAndroid Build Coastguard Worker#!/bin/sh 2*49cdfc7eSAndroid Build Coastguard Worker# 3*49cdfc7eSAndroid Build Coastguard Worker# Copyright (c) International Business Machines Corp., 2001 4*49cdfc7eSAndroid Build Coastguard Worker# 5*49cdfc7eSAndroid Build Coastguard Worker# This program is free software; you can redistribute it and/or modify 6*49cdfc7eSAndroid Build Coastguard Worker# it under the terms of the GNU General Public License as published by 7*49cdfc7eSAndroid Build Coastguard Worker# the Free Software Foundation; either version 2 of the License, or 8*49cdfc7eSAndroid Build Coastguard Worker# (at your option) any later version. 9*49cdfc7eSAndroid Build Coastguard Worker# 10*49cdfc7eSAndroid Build Coastguard Worker# This program is distributed in the hope that it will be useful, 11*49cdfc7eSAndroid Build Coastguard Worker# but WITHOUT ANY WARRANTY; without even the implied warranty of 12*49cdfc7eSAndroid Build Coastguard Worker# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 13*49cdfc7eSAndroid Build Coastguard Worker# the GNU General Public License for more details. 14*49cdfc7eSAndroid Build Coastguard Worker# 15*49cdfc7eSAndroid Build Coastguard Worker# You should have received a copy of the GNU General Public License 16*49cdfc7eSAndroid Build Coastguard Worker# along with this program; if not, write to the Free Software 17*49cdfc7eSAndroid Build Coastguard Worker# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18*49cdfc7eSAndroid Build Coastguard Worker# 19*49cdfc7eSAndroid Build Coastguard Worker# 20*49cdfc7eSAndroid Build Coastguard Worker# FILE: generate.sh 21*49cdfc7eSAndroid Build Coastguard Worker# 22*49cdfc7eSAndroid Build Coastguard Worker# PURPOSE: Creates data_dir for use in network file transfer tests. 23*49cdfc7eSAndroid Build Coastguard Worker# 24*49cdfc7eSAndroid Build Coastguard Worker# AUTHOR: Robbie Williamson ([email protected]) 25*49cdfc7eSAndroid Build Coastguard Worker# 26*49cdfc7eSAndroid Build Coastguard Worker############################################################################ 27*49cdfc7eSAndroid Build Coastguard Worker 28*49cdfc7eSAndroid Build Coastguard Workersmall_file=ascii.sm 29*49cdfc7eSAndroid Build Coastguard Workermedium_file=ascii.med 30*49cdfc7eSAndroid Build Coastguard Workerlarge_file=ascii.lg 31*49cdfc7eSAndroid Build Coastguard Workerjumbo_file=ascii.jmb 32*49cdfc7eSAndroid Build Coastguard Workerjumbo_size=1600020 33*49cdfc7eSAndroid Build Coastguard Workerlarge_size=80020 34*49cdfc7eSAndroid Build Coastguard Workermedium_size=4020 35*49cdfc7eSAndroid Build Coastguard Workersmall_size=220 36*49cdfc7eSAndroid Build Coastguard Worker 37*49cdfc7eSAndroid Build Coastguard Workerset -e 38*49cdfc7eSAndroid Build Coastguard Worker 39*49cdfc7eSAndroid Build Coastguard Workerif [ -z "$abs_top_srcdir" ] ; then 40*49cdfc7eSAndroid Build Coastguard Worker echo "The variable \`abs_top_srcdir', must be defined." >&2 41*49cdfc7eSAndroid Build Coastguard Worker exit 1 42*49cdfc7eSAndroid Build Coastguard Workerelse 43*49cdfc7eSAndroid Build Coastguard Worker make_file="$abs_top_srcdir/tools/make-file.sh" 44*49cdfc7eSAndroid Build Coastguard Worker if [ ! -x "$make_file" ] ; then 45*49cdfc7eSAndroid Build Coastguard Worker echo "$make_file isn't an executable file" >&2 46*49cdfc7eSAndroid Build Coastguard Worker exit 1 47*49cdfc7eSAndroid Build Coastguard Worker fi 48*49cdfc7eSAndroid Build Coastguard Workerfi 49*49cdfc7eSAndroid Build Coastguard Worker 50*49cdfc7eSAndroid Build Coastguard Worker"$make_file" "$small_file" $small_size 51*49cdfc7eSAndroid Build Coastguard Worker"$make_file" "$medium_file" $medium_size 52*49cdfc7eSAndroid Build Coastguard Worker"$make_file" "$large_file" $large_size 53*49cdfc7eSAndroid Build Coastguard Worker"$make_file" "$jumbo_file" $jumbo_size 54*49cdfc7eSAndroid Build Coastguard Worker 55*49cdfc7eSAndroid Build Coastguard Workerif [ ! -e "bin.sm" ] ; then 56*49cdfc7eSAndroid Build Coastguard Worker cnt=0 57*49cdfc7eSAndroid Build Coastguard Worker while [ $cnt -lt 5 ] ; do 58*49cdfc7eSAndroid Build Coastguard Worker gzip -1 -c -n ascii.sm >> "bin.sm" 59*49cdfc7eSAndroid Build Coastguard Worker cnt=$(($cnt + 1)) 60*49cdfc7eSAndroid Build Coastguard Worker done 61*49cdfc7eSAndroid Build Coastguard Workerfi 62*49cdfc7eSAndroid Build Coastguard Worker 63*49cdfc7eSAndroid Build Coastguard Workergenfile() { 64*49cdfc7eSAndroid Build Coastguard Worker local input="$1" output="$2" 65*49cdfc7eSAndroid Build Coastguard Worker local cnt=19 66*49cdfc7eSAndroid Build Coastguard Worker 67*49cdfc7eSAndroid Build Coastguard Worker [ -e "$output" ] && return $? 68*49cdfc7eSAndroid Build Coastguard Worker 69*49cdfc7eSAndroid Build Coastguard Worker while [ $cnt -ge 0 ] ; do 70*49cdfc7eSAndroid Build Coastguard Worker cat "$input" >> "$output" 71*49cdfc7eSAndroid Build Coastguard Worker cnt=$(($cnt-1)) 72*49cdfc7eSAndroid Build Coastguard Worker done 73*49cdfc7eSAndroid Build Coastguard Worker} 74*49cdfc7eSAndroid Build Coastguard Worker 75*49cdfc7eSAndroid Build Coastguard Workergenfile bin.sm bin.med 76*49cdfc7eSAndroid Build Coastguard Workergenfile bin.med bin.lg 77*49cdfc7eSAndroid Build Coastguard Workergenfile bin.lg bin.jmb 78*49cdfc7eSAndroid Build Coastguard Worker 79*49cdfc7eSAndroid Build Coastguard Workerchmod 666 bin.* 80