Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2007 by niro, Mon Aug 13 09:42:10 2012 UTC revision 2044 by niro, Wed May 8 11:04:43 2013 UTC
# Line 3  Line 3 
3  # loads client classes from $MCLIBDIR  # loads client classes from $MCLIBDIR
4  load_client_classes()  load_client_classes()
5  {  {
6     local i
7    
8   # client specific   # client specific
9   for i in ${MCLIBDIR}/include/*.client.class   for i in $(find ${MCLIBDIR}/include -type f -name \*.client.class)
10   do   do
11   source ${i} || eecho "error loading ${i}"   source ${i} || eecho "error loading ${i}"
12   done   done
# Line 103  help_topics() Line 105  help_topics()
105   mecho "\tcolors   - enable colors"   mecho "\tcolors   - enable colors"
106   mecho "\tquiet    - do not print any unecessary messages"   mecho "\tquiet    - do not print any unecessary messages"
107   mecho "\thelp     - shows help"   mecho "\thelp     - shows help"
108     mecho "\tversion  - prints version of the daemon"
109   mecho "\tquit     - quits the connection to the server"   mecho "\tquit     - quits the connection to the server"
110   mecho   mecho
111   mecho "Help topics:"   mecho "Help topics:"
# Line 392  set_daemon_mroot() Line 395  set_daemon_mroot()
395   eecho "Path '${path}' does not exist. MROOT not set."   eecho "Path '${path}' does not exist. MROOT not set."
396   fi   fi
397  }  }
398    
399    list_files_in_directory()
400    {
401     local i
402     local retval
403     local path
404     local opts
405     local type
406    
407     # basic getops
408     for i in $*
409     do
410     case $1 in
411     -mindepth) shift; opts+=" -mindepth $1" ;;
412     -maxdepth) shift; opts+=" -maxdepth $1" ;;
413     -type) shift; type="$1" ;;
414     '') continue ;;
415     *) path="$1" ;;
416     esac
417     shift
418     done
419    
420     if [[ -z ${path} ]]
421     then
422     eecho "No path given."
423     return 1
424     fi
425    
426     if [[ ! -d ${path} ]]
427     then
428     eecho "Directory '${path}' does not exist."
429     return 1
430     fi
431    
432     # default to files
433     [[ -z ${type} ]] && type=f
434    
435     for i in $(find ${path} ${opts} -type ${type} | sort)
436     do
437     if [[ -z ${retval} ]]
438     then
439     retval="$(basename ${i})"
440     else
441     retval="${retval} $(basename ${i})"
442     fi
443     done
444    
445     rvecho "${retval}"
446    }

Legend:
Removed from v.2007  
changed lines
  Added in v.2044