OpenCores
URL https://opencores.org/ocsvn/usb_fpga_1_2/usb_fpga_1_2/trunk

Subversion Repositories usb_fpga_1_2

[/] [usb_fpga_1_2/] [trunk/] [examples/] [usb-fpga-1.2/] [ucecho/] [fpga/] [clean.sh] - Diff between revs 2 and 4

Show entire file | Details | Blame | View Log

Rev 2 Rev 4
Line 1... Line 1...
#!/bin/bash
#!/bin/bash
 
 
# This files / directories from this directory will not be removed
# This files / directories from this directory will not be removed
# Filenames with spaces or other spuid characters will be ignored
# Filenames with spaces or other spuid characters will be ignored
sourcefiles="*.vhd *.ucf *.sh *.ise *.bit *.bin"
sourcefiles="*.vhd *.ucf *.sh *.ise *.bit *.bin *.xise"
 
subdirs="ipcore_dir"
 
 
 
 
# This sould not be edited.
# This sould not be edited.
list_files() {
list_files() {
    if [ "$2" != "" ]; then
    if [ "$2" != "" ]; then
Line 25... Line 26...
    for i in $sourcefiles; do
    for i in $sourcefiles; do
        if [ "$i" == "$f" ]; then
        if [ "$i" == "$f" ]; then
            keep=true
            keep=true
        fi
        fi
    done
    done
    for i in $binfiles; do      # binfiles is set by distclean.sh
    for i in $subdirs; do
        if [ "$i" == "$f" ]; then
        if [ "$i" == "$f" ]; then
            keep=false
            keep=true
        fi
        fi
    done
    done
    if [ -d "$f" ]; then
    if [ -d "$f" ]; then
        if $keep; then
        if $keep; then
            keepdirs+=" $f"
            keepdirs+=" $f"
Line 46... Line 47...
            rmfiles+=" $f"
            rmfiles+=" $f"
        fi
        fi
    fi
    fi
done
done
 
 
 
echo
 
echo "Directory $PWD:"
list_files "This directories will NOT be removed:" "$keepdirs"
list_files "This directories will NOT be removed:" "$keepdirs"
list_files "This files will NOT be removed:" "$keepfiles"
list_files "This files will NOT be removed:" "$keepfiles"
list_files "This directories will be removed:" "$rmdirs"
list_files "This directories will be removed:" "$rmdirs"
list_files "This files will be removed:" "$rmfiles"
list_files "This files will be removed:" "$rmfiles"
 
 
if [ "$rmfiles" == "" -a "$rmdirs" == "" ]; then
if [ "$rmfiles" == "" -a "$rmdirs" == "" ]; then
    exit 0
    c="yes"
fi
else
 
 
echo -n 'Confirm this by entering "yes": '
echo -n 'Confirm this by entering "yes": '
read c
read c
 
fi
 
 
if [ "$c" == "yes" ]; then
if [ "$c" == "yes" ]; then
    [ "$rmfiles" != "" ] && rm $rmfiles
    [ "$rmfiles" != "" ] && rm $rmfiles
    [ "$rmdirs" != "" ] && rm -r $rmdirs
    [ "$rmdirs" != "" ] && rm -r $rmdirs
 
 
 
    for d in $subdirs; do
 
        if [ -x "$d/clean.sh" ]; then
 
            cd $d
 
            ./clean.sh || exit 1
 
            cd ..
 
        fi
 
    done
 
 
    exit 0
    exit 0
fi
fi
exit 1
exit 1
 
 
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.