#!/bin/bash if [ ! "$(pwd | grep scripts$)" ] ; then echo "Working directory is wrong" exit 1; fi . _defines.sh qsdir=$QS_BASE_PATH qssysdir="$QS_BASE_PATH/$QS_SYS_DIR" sysfiles=$(find $qssysdir -name '*' -type f | grep -v '/.svn/'); for sysfile in $sysfiles ; do file=$(echo $sysfile | replace $qssysdir $qsdir) if [ ! -f "$file" ] ; then sysclass=$(cat $sysfile | grep '^abstract' | sed -r 's/^abstract\s+class\s+([a-zA-Z0-9_]+).*/\1/') class=$(echo $sysclass | replace "${QS_SYS_DIR}_" ''); if [ '' != "$sysclass" -a '' != "$class" ] ; then touch $file echo "> $file; echo >> $file echo "class $class extends $sysclass" >> $file; echo "{" >> $file; echo "}" >> $file; else if [ '' = "$sysclass" ] ; then echo "ERROR: Can not determine name of sistem class. File: $sysfile" else if [ '' = "$class" ] ; then echo "ERROR: Can not determine name of local class $sysfile" fi fi echo 'Process aborted!' exit 1 fi fi done exit 0