summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-02-14 23:20:27 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-02-14 23:20:27 +0100
commit6b2a02c6099da06aeddc4a0595121943fada07c6 (patch)
tree6bce0df55639e3ad2c9468f036f7c30086852a63 /src
parent20cadeb452b15563a9e6eafe6d3bb6b760388cba (diff)
tried to make aif FHS/hier compliant + updated howto/readme
Diffstat (limited to 'src')
-rwxr-xr-xsrc/aif.sh18
-rw-r--r--src/core/libs/lib-misc.sh3
-rw-r--r--src/runtime/whatsthis.txt1
3 files changed, 14 insertions, 8 deletions
diff --git a/src/aif.sh b/src/aif.sh
index fad2e40..783e7c9 100755
--- a/src/aif.sh
+++ b/src/aif.sh
@@ -1,10 +1,14 @@
#!/bin/bash
+
###### Set some default variables ######
TITLE="Arch Linux Installation Framework"
LOG="/dev/tty7"
-RUNTIME_DIR=/home/arch/aif/runtime
-LOGFILE=$RUNTIME_DIR/aif.log
+LIB_CORE=/usr/lib/aif/core
+LIB_USER=/usr/lib/aif/user
+RUNTIME_DIR=/tmp/aif
+LOG_DIR=/var/log/aif
+LOGFILE=$LOG_DIR/aif.log
###### Miscalleaneous functions ######
@@ -19,10 +23,10 @@ usage ()
-h Help: show usage (optional)\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>.\n
-For more info, see the README which you can find in /home/arch/aif/docs\n
-Available procedures on the filesystem:
-`find /home/arch/aif/core/procedures -type f`\n
-`find /home/arch/aif/user/*/procedures -type f 2>/dev/null`"
+For more info, see the README which you can find in /usr/share/aif/docs\n
+Available procedures:
+`find $LIB_CORE/procedures -type f | sed 's#$LIB_CORE##'`\n
+`find $LIB_USER/*/procedures -type f 2>/dev/null | sed 's#$LIB_USER##'`"
[ -n "$procedure" ] && msg="$msg\nProcedure ($procedure) specific options:\n$var_ARGS_USAGE"
echo -e "$msg"
@@ -40,6 +44,7 @@ notify ()
log ()
{
+ mkdir -p $LOG_DIR || die_error "Cannot create log directory"
str="[LOG] `date +"%Y-%m-%d %H:%M:%S"` $@"
echo -e "$str" > $LOG
[ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE
@@ -48,6 +53,7 @@ log ()
debug ()
{
+ mkdir -p $LOG_DIR || die_error "Cannot create log directory"
str="[DEBUG] $@"
if [ "$DEBUG" = "1" ]
then
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index bd59ce0..01c291f 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -62,8 +62,9 @@ check_is_in ()
}
-# cleans up file in the runtime directory who can be deleted
+# cleans up file in the runtime directory who can be deleted, make dir first if needed
cleanup_runtime ()
{
+ mkdir -p $RUNTIME_DIR || die_error "Cannot create $RUNTIME_DIR"
rm -rf $RUNTIME_DIR/.dia* &>/dev/null
}
diff --git a/src/runtime/whatsthis.txt b/src/runtime/whatsthis.txt
deleted file mode 100644
index 5a22a0e..0000000
--- a/src/runtime/whatsthis.txt
+++ /dev/null
@@ -1 +0,0 @@
-aif will put files it uses during runtime here. (no source code goes here) \ No newline at end of file