File: functions

package info (click to toggle)
gpsbabel 1.3.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 15,956 kB
  • ctags: 9,083
  • sloc: ansic: 87,514; xml: 13,640; pascal: 6,981; sh: 3,770; makefile: 811; perl: 754; tcl: 74; objc: 7
file content (41 lines) | stat: -rwxr-xr-x 1,033 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function trim_filelist()
{
    sort |
    uniq |				# remove duplicate lines
    sed 's/^[ \t]*//;s/[ \t]*$//' |	# remove leading and trailing whitespaces
    sed '/^$/d'				# drop empty lines
}

function check_filelist() # check presence of all files
{
    while read f; do 
	[ -e "$f" ] && continue
	echo missing: "$f"; exit 1
    done
    exit 0
}

function ask_mrproper()
{
    echo ""
    echo "--------------------------------------------------"
    echo "!!! WARNING !!! WARNING !!! WARNING !!!WARNING !!!"
    echo "--------------------------------------------------"
    echo "All files they are not part of the CVS source tree"
    echo "    and they not registered in .filelist-devel"
    echo "                will be killed."
    echo ""
    echo -n "Please type yyeess if you are know what you do: "
    read answer
    test "$answer" != "yyeess" && exit 1
    exit 0
}

function ask() # $1=Question $2=Answer for TRUE
{
    echo ""
    echo -n "$1 : "
    read answer
    test "$answer" != "$2" && exit 1
    exit 0
}