summaryrefslogtreecommitdiff
path: root/src/fifa.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-03 14:55:19 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-03 14:55:19 +0100
commit6e0e1ab2c395ceaadcdde0cf8a4fb8c0bc639265 (patch)
tree27264b04c581ea895e86bb0bfab5d4187abb8437 /src/fifa.sh
parent74dafa4f7bb98a3b629f9b3c76f711803085e14d (diff)
moved some UI functions from fifa.sh to lib-ui (yeay) + some fixes
Diffstat (limited to 'src/fifa.sh')
-rwxr-xr-xsrc/fifa.sh61
1 files changed, 4 insertions, 57 deletions
diff --git a/src/fifa.sh b/src/fifa.sh
index ef3a0b2..a819bfd 100755
--- a/src/fifa.sh
+++ b/src/fifa.sh
@@ -1,5 +1,4 @@
#!/bin/bash
-# TODO: we should be able to get away with not defining the "These functions would fit more in lib-ui, but we need them immediately" functions in lib-ui, but just sourcing lib-ui very early
###### Set some default variables or get them from the setup script ######
TITLE="Flexible Installer Framework for Arch linux"
@@ -11,67 +10,15 @@ LOG="/dev/tty7"
usage ()
{
+ #NOTE: you can't use dia mode here yet because lib-ui isn't sourced yet. But cli is ok for this anyway.
msg="$0 <procedurename>\n
-If the procedurename starts with 'http://' it will be wget'ed. Otherwise it's assumed to be a procedure in the VFS tree\n
+If the procedurename starts with 'http://' it will be wget'ed. Otherwise it's assumed to be a procedure in the VFS tree
If the procedurename is prefixed with '<modulename>/' it will be loaded from user module <modulename>. See README\n
-Available procedures on the filesystem:\n
+Available procedures on the filesystem:
`find /home/arch/fifa/core/procedures -type f`\n
`find /home/arch/fifa/user/*/procedures -type f`"
- if [ "$var_UI_TYPE" = dia ]
- then
- DIALOG --msgbox "$msg" 14 65
- else
- echo -e "$msg"
- fi
-}
-
-
-##### "These functions would fit more in lib-ui, but we need them immediately" functions ######
-
-
-# display error message and die
-die_error ()
-{
- if [ "$var_UI_TYPE" = dia ]
- then
- DIALOG --msgbox "Error: $@" 0 0
- else
- echo -e "ERROR: $@"
- fi
- exit 2
-}
+ echo -e "$msg"
-
-# display warning message
-# $1 title
-# $2 item to show
-# $3 type of item. msg or text if it's a file. (optional. defaults to msg)
-show_warning ()
-{
- [ -z "$1" ] && die_error "show_warning needs a title"
- [ -z "$2" ] && die_error "show_warning needs an item to show"
- [ -n "$3" -a "$3" != msg -a "$3" != text ] && die_error "show_warning \$3 must be text or msg"
- [ -z "$3" ] && 3=msg
- if [ "$var_UI_TYPE" = dia ]
- then
- dialog --title "$1" --exit-label "Continue" --$3box "$2" 18 70 || die_error "dialog could not show --$3box $2. often this means a file does not exist"
- else
- echo "WARNING: $1"
- [ "$3" = msg ] && echo -e "$2"
- [ "$3" = text ] && cat $2 || die_error "Could not cat $2"
- fi
-}
-
-
-#notify user
-notify ()
-{
- if [ "$var_UI_TYPE" = dia ]
- then
- DIALOG --msgbox "$@" 20 50
- else
- echo -e "$@"
- fi
}