Revised func_compare.sh

This commit is contained in:
Manuel Canales Esparcia 2007-09-27 19:26:14 +00:00
parent f9bfa72ca2
commit 111d25a4a5
2 changed files with 28 additions and 35 deletions

View file

@ -57,15 +57,15 @@ wrt_compare_work() { #
local ROOT_DIR=/
local DEST_TOPDIR=/${SCRIPT_ROOT}
local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
local ICALOGDIR=/${SCRIPT_ROOT}/${LOGDIRBASE}/ICA
local FARCELOGDIR=/${SCRIPT_ROOT}/${LOGDIRBASE}/farce
if [[ "$RUN_ICA" = "y" ]] ; then
local DEST_ICA=$DEST_TOPDIR/ICA && \
(
cat << EOF
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/\$@ 2>&1 && \\
extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/\$@ 2>&1
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >> ${LOGDIRBASE}/\$@ 2>&1 && \\
extras/do_ica_prep $DEST_ICA/$ITERATION >> ${LOGDIRBASE}/\$@ 2>&1
EOF
) >> $MKFILE.tmp
if [[ "$ITERATION" != "iteration-1" ]] ; then
@ -77,8 +77,8 @@ EOF
local DEST_FARCE=$DEST_TOPDIR/farce && \
(
cat << EOF
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/\$@ 2>&1 && \\
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/\$@ 2>&1
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >> ${LOGDIRBASE}/\$@ 2>&1 && \\
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >> ${LOGDIRBASE}/\$@ 2>&1
EOF
) >> $MKFILE.tmp
if [[ "$ITERATION" != "iteration-1" ]] ; then
@ -90,7 +90,7 @@ EOF
#----------------------------------#
wrt_do_ica_work() { #
#----------------------------------#
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >> ${LOGDIRBASE}/\$@ 2>&1" >> $MKFILE.tmp
}
#----------------------------------#
@ -101,7 +101,7 @@ wrt_do_farce_work() { #
local PREFILE=$3/filelist-$1
local ITEDIR=$3/$2
local ITEFILE=$3/filelist-$2
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >> ${LOGDIRBASE}/\$@ 2>&1" >> $MKFILE.tmp
}
#----------------------------------#
@ -109,31 +109,24 @@ wrt_logs() { #
#----------------------------------#
local build=build_$1
local file
local ch_order=${PREV%%_*}
echo -e "\t@cd /\$(SCRIPT_ROOT)/${LOGDIRBASE} && mkdir $build && mv -f ${ch_order}_* $build" >> $MKFILE.tmp
if [ ! "${1}" = "1" ] ; then
(
cat << EOF
@cd logs && \\
mkdir $build && \\
mv -f ${system_build} $build && \\
if [ ! $build = build_1 ] ; then \\
cd $build && \\
for file in \`ls .\` ; do \\
mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
done ; \\
fi ;
@cd /\$(SCRIPT_ROOT)
@if [ -d test-logs ] ; then \\
cd test-logs && \\
mkdir $build && \\
mv -f ${system_build} $build && \\
if [ ! $build = build_1 ] ; then \\
cd $build && \\
for file in \`ls .\` ; do \\
mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
done ; \\
fi ; \\
cd /\$(SCRIPT_ROOT) ; \\
fi ;
@cd $build && \\
for file in \`ls .\` ; do \\
mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
done ;
EOF
) >> $MKFILE.tmp
fi
if [ ${CONFIG_TESTS} = "y" ] ; then
echo -e "\t@cd /\$(SCRIPT_ROOT)/${TESTLOGDIRBASE} && mkdir $build && mv -f ${ch_order}_* $build" >> $MKFILE.tmp
fi
echo -e "\t@cd /\$(SCRIPT_ROOT)" >> $MKFILE.tmp
}

View file

@ -108,7 +108,7 @@ wrt_RunAsRoot() { # Some scripts must be run as root..
(
cat << EOF
@export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ > logs/\$@ 2>&1
@export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ > $LOGDIRBASE/\$@ 2>&1
EOF
) >> $MKFILE.tmp
}
@ -120,7 +120,7 @@ LUSER_wrt_RunAsUser() { #
(
cat << EOF
@\$(CMDSDIR)/`dirname $file`/\$@ > logs/\$@ 2>&1
@\$(CMDSDIR)/`dirname $file`/\$@ > $LOGDIRBASE/\$@ 2>&1
EOF
) >> $MKFILE.tmp
}
@ -131,7 +131,7 @@ CHROOT_wrt_RunAsRoot() { #
local file=$1
(
cat << EOF
@\$(crCMDSDIR)/`dirname $file`/\$@ > logs/\$@ 2>&1
@\$(crCMDSDIR)/`dirname $file`/\$@ > $LOGDIRBASE/\$@ 2>&1
EOF
) >> $MKFILE.tmp
@ -147,7 +147,7 @@ LUSER_wrt_CopyFstab() { #
#----------------------------------#
(
cat << EOF
@cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab > logs/\$@ 2>&1
@cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab > $LOGDIRBASE/\$@ 2>&1
EOF
) >> $MKFILE.tmp
}
@ -157,7 +157,7 @@ CHROOT_wrt_CopyFstab() { #
#----------------------------------#
(
cat << EOF
@cp -v /sources/fstab /etc/fstab > logs/\$@ 2>&1
@cp -v /sources/fstab /etc/fstab > $LOGDIRBASE/\$@ 2>&1
EOF
) >> $MKFILE.tmp
}