#!/bin/bash #@COPYRIGHT@ TOP=@TOP@ TARGET=@TARGET@ copy() { cat $1 | sed -f $TOP/subs.sed } copy_code() { egrep -v "^[ $TAB]*([#].*)?$" $1 | sed -f $TOP/subs.sed } while read line; do perm=0644 output="`echo $line | cut -f1 -d:`" dir="`dirname $output`" in="`echo $line | cut -f2- -d:`" # create file rm -f $output [ -d "$dir" ] || mkdir -m 0755 -p $dir touch $output for each in $in; do case $each in !*) perm=0755 each="`expr "$each" : '!\(.*\)'`" copy $TOP/src/$each >> $output ;; +*) each="`expr "$each" : '+\(.*\)'`" copy $TOP/src/$each >> $output ;; *) echo -e "\n# source: $each" >> $output copy_code $TOP/src/$each >> $output ;; esac done echo -e "\n# this file was auto-generated by install-rockplug.sh" >> $output chmod $perm $output done < <(egrep -v "^[ $TAB]*([#].*)?$" $TOP/target/$TARGET | sed -f $TOP/subs.sed)