libbash-0.9.11/0000777000175000017500000000000011247024335010214 500000000000000libbash-0.9.11/TODO0000644000175000017500000000023510303036052010607 00000000000000- Add html man pages - Change ldbash to warn when trying to load a library that does not exist - Add more colors to colors library - Write missing man pages libbash-0.9.11/install-sh0000754000175000017500000002176610160244204012137 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-09-10.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: libbash-0.9.11/configure.ac0000644000175000017500000000343611233571714012427 00000000000000AC_PREREQ([2.57]) AC_INIT(libbash, 0.9.11, libbash-common@lists.sourcefoge.net) AC_CONFIG_SRCDIR([src/ldbash.in]) AM_INIT_AUTOMAKE([dist-bzip2]) AC_PREFIX_DEFAULT([/usr]) # # Check for programs we need ############################################################################## AC_PROG_LN_S AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen]) # # Misc ############################################################################## # this is used my html and man pages documentation DOCDATE=[`awk --re-interval '/[\t ]{1,}[0-9]{4}-[0-9]{2}-[0-9]{2}/ {print $1; exit}' ChangeLog`] DOCDATE=[`date -d $DOCDATE "+%B %d, %G"`] AC_SUBST([docdate],[$DOCDATE]) AC_ARG_ENABLE([doc],AC_HELP_STRING([--disable-docs],[Don't build and install documentation]), [DOCS=$enableval], [DOCS="yes"] ) AM_CONDITIONAL(MAKEDOCS, test "$DOCS" == "yes" ) # # Output files ############################################################################## # Makefiles AC_CONFIG_FILES([ Makefile src/Makefile lib/Makefile doc/Makefile m4/Makefile tests/Makefile]) # Documentation files [[ "$DOCS" == "yes" ]] && \ AC_CONFIG_FILES([ doc/Doxyfile doc/main_page.dox]) # man pages AC_CONFIG_FILES([ libbash.man lib/colors.man lib/getopts.man lib/hashstash.man lib/locks.man lib/messages.man lib/urlcoding.man src/ldbash.man src/ldbashconfig.man]) # Scripts in src AC_CONFIG_FILES([ src/ldbash src/ldbashconfig]) # Libraries in lib AC_CONFIG_FILES([ lib/locks.sh]) # Misc files AC_CONFIG_FILES([ libbash.spec]) AC_OUTPUT # prints warning if doxygen was not found if [[ "X$DOXYGEN" == "X" ]] ; then echo echo echo -e "\tWARNING: doxygen was not found in your path." echo -e "\t html documentation will not be generated." echo echo fi libbash-0.9.11/Makefile.am0000644000175000017500000000114311233310657012163 00000000000000# lib must be before src, otherwise, the ldbashconfig command at src/Makefile.am will fail SUBDIRS = lib . src doc m4 tests AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = libbash.man # installing man pages man7_MANS = libbash.man # Running ldbashconfig after installation only if DESTDIR is empty install-data-hook: [[ "$(DESTDIR)" == "" ]] && $(sbindir)/ldbashconfig || : @[[ "$(DESTDIR)" != "" ]] && (echo "===============================================" && \ echo "You've used DESTDIR - not running ldbashconfig!" && \ echo "===============================================") || : libbash-0.9.11/lib/0000777000175000017500000000000011247024335010762 500000000000000libbash-0.9.11/lib/hashSet.man0000644000175000017500000000002511233565131012766 00000000000000.so man3/hashstash.3 libbash-0.9.11/lib/colors.man0000644000175000017500000000501511247024333012673 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt COLORS \&3 "libbash colors Library Manual" .\" .Sh NAME .\" .\" .Nm colors .Nd libbash library for setting tty colors. .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 12345678900 .\" .It Cm colorSet .Aq Ar color .\" .It Cm colorReset .\" .It Cm colorPrint .Op Aq indent .Aq Ar color .Aq Ar text .\" .It Cm colorPrintN .Op Aq indent .Aq Ar color .Aq Ar text .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Bd -filled .Nm is a collection of functions that make it very easy to put colored text on tty. .Pp The function list: .Bl -tag -compact -width colorprint12345 -offset indent .It Sy colorSet Sets the color of the prints to the tty to COLOR .It Sy colorReset Resets current tty color back to normal .It Sy colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline) .It Sy colorPrintN The same as colorPrint, but trailing newline is added .El .Ed .Pp Detailed interface description follows. .\" .Pp .Ss Available colors: .Bl -tag -compact -width hashdelete12345 -offset indent .It Sy Green .It Sy Red .It Sy Yellow .It Sy White .El The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red). .\" .Sh FUNCTIONS DESCRIPTIONS .Ss Cm colorSet Aq Ns Fa color Ns .\" Sets the current printing color to .Em color . .Pp .\" .\" .Ss Cm colorReset .\" Resets current tty color back to normal. .\" .\" .Ss Cm colorPrint Bo Ao Ns Fa indent Ns Ac Bc Aq Ns Fa color Ns .\" Prints .Em text using the color .Em color indented by .Em indent (without adding a newline). .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa indent Ns Li The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position. .It Aq Ns Fa color Ns Li The color to use. .It Aq Ns Fa color Ns Li The text to print. .El .Pp .\" .\" .Ss Cm colorPrintN Bo Ao Ns Fa indent Ns Ac Bc Aq Ns Fa color Ns The same as colorPrint, except a trailing newline is added. .\" .\" .\" .\" .Sh EXAMPLES .\" .\" Printing a green 'Hello World' with a newline: .Bl -tag -width 1 -offset 12345 .It Using colorSet: .D1 $ colorSet green .D1 $ echo 'Hello World' .D1 $ colorReset .It Using colorPrint: .D1 $ colorPrint 'Hello World' ; echo .It Using colorPrintN: .D1 $ colorPrintN 'Hello World' .El .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/locks.sh.in0000644000175000017500000003256111233310657012761 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # $Date: 2009-07-27 14:38:23 +0300 (Mon, 27 Jul 2009) $ # $Author: hai-zaar $ # # This bash library provides a set of locking tools. # The locking is done by creating a directory named `.lock'. # After the master-lock named `.lock' is set, a process can # create its .lock.$$ file, and remove the master-lock. # Each non-safe action requires a master-lock. # Locking, unlocking, cleaning leftover locks and cleaning # left over spin-files are non-safe action and require # a master lock. # Creating or removing my own spin-file and creating a # directory that should be locked are the only actions # done on the directory, that are considered safe. #EXPORT=dirInitLock dirTryLock dirLock dirUnlock dirDestroyLock #REQUIRE= prefix=@prefix@ __locks_LOCKS_DIR=/tmp/.dirlocks-$USER __locks_DEFAULT_SLEEP_TIME=0.01 __locks_ERR_DIR_IS_LOCKED=1 __locks_ERR_NO_SPIN_FILE=2 __locks_ERR_COULD_NOT_RESOLVE_DIR=3 #__locks_DEBUG_MODE=1 ############################################################# ###################### FUNCTIONS ######################## ############################################################# # # findEffectiveDirname # Finds the full path that we should lock, i.e. the effective # dirname we should work on. # This function does not change files (and therefore does not lock anything). # Parameters: # DirName - The name of the directory we wish to lock. You can choose # any name if you want to __locks_findEffectiveDirname() { local DIR_NAME=$1 # Check if it a file/dir exists if [ -e "$DIR_NAME" ] ; then if [[ -d "$DIR_NAME" ]] ; then retval=$(cd "$DIR_NAME" > /dev/null 2>&1 && pwd) || \ return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} else # Get the perent directory for $DIR_NAME (full path) retval=$(cd $(dirname "$DIR_NAME") > /dev/null 2>&1 && pwd) || \ return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} # Add the basename of $DIR_NAME retval=$(ls -d $retval/$(basename "$DIR_NAME") 2>/dev/null) || \ return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} fi return 0 else # It does not exist: # Expand `\' # Check that it does not contain `..' - it can be very dangerous while echo "$DIR_NAME" |grep -q '\\'; do DIR_NAME=$(echo "$DIR_NAME" | xargs echo); done echo "$DIR_NAME" | grep -q '\.\.' && return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} retval="$DIR_NAME" && return 0 fi # If we got here something's wrong return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} } # # dirInitLock [Spin] # Initializes a lock for a DirName object, for current process # # Parameters: # DirName - The name of the directory we wish to lock. You can choose # any name if you want to - i.e It does not have to be a real dir # Spin - Spin period - we'll retry to acquire lock each Spin seconds. # Spin may (and generally should) be less then 1. # Default Spin is 0.01 seconds. # Return value: # 0 - The lock was initialized and is ready for use # non-zero - The lock was not initialized # dirInitLock() { local DIR_NAME=$1 local SPIN=${2:-${__locks_DEFAULT_SLEEP_TIME}} # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" __locks_spinCleanup "$DIR_NAME" # Creating our spin-files - safe action echo $SPIN > "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" status=$? # Free the master lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" # Return the return value of the spin-file creation command return $status } # # dirTryLock # Tries to set a lock on a directory. If lock is # already set - returns immediately with error. # # Parameters: # DirName - The name of the directory we wish to lock. # # The function exits with: # 0 - The directory was successfully locked # 1 - Lock was already set # 2 - The lock object is not initialized # dirTryLock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Check if the directory-lock is initialized [[ -e "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" ]] || return ${__locks_ERR_NO_SPIN_FILE} __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" __locks_deadlockCleanup "$DIR_NAME" # Check if there is a lock on the directory if ls -d "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME"/.lock.* > /dev/null 2>&1 ; then # Remove the master-lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" return ${__locks_ERR_DIR_IS_LOCKED} fi # Create a lock file for this proccess (umask 0 && touch "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock.$$") # Remove the master-lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" # If we got here, everything worked just file. return 0 } # # dirLock # Sets a lock on a directory. # # Parameters: # DirName - The name of the directory we wish to lock. # # The function exits with: # 0 - The directory was successfully locked # 2 - The lock object was not initialized # dirLock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Loop trying to lock the directory while true ; do dirTryLock "$DIR_NAME" local status=$? # If the result of the TryLock is other than an error that says that the directory is locked, return it [[ $status != ${__locks_ERR_DIR_IS_LOCKED} ]] && return $status # The return value was the __locks_ERR_DIR_IS_LOCKED error. Sleep and try again. sleep $(cat "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" 2> /dev/null) > /dev/null 2>&1 || sleep ${__locks_DEFAULT_SLEEP_TIME} done } # # dirUnlock # Free a directory from its lock. # # Parameters: # DirName - The name of the directory we wish to unlock. # # The function exits with: # 0 - The directory was successfully unlocked # non-zero - Unlocking failed # dirUnlock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Check if the directory-lock is initialized [[ -e "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" ]] || return ${__locks_ERR_NO_SPIN_FILE} __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" __locks_deadlockCleanup "$DIR_NAME" # Remove my lock file rm -f "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock.$$" > /dev/null 2>&1 # Remove the master lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" > /dev/null 2>&1 ls -la "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/".lock.* > /dev/null 2>&1 && return ${__locks_ERR_DIR_IS_LOCKED} return 0 } # # dirDestroyLock # Destroys the lock object. After this action the process will no longer be able to use the lock object. # To use the object after this action is done, one must initialize the lock, using dirInitLock. # # Parameters: # DirName - The name of the directory that we with to destroy its lock. # # The function exits with: # 0 The action finished successfully. # 1 The action failed. The directory is locked by your own process. Unlock it first. # 2 The action failed. Your process did not initialize the lock. # 3 The directory path could not be resolved. # dirDestroyLock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Make sure that the directory is not locked dirTryLock "$DIR_NAME" if [[ "$?" == "${__locks_ERR_DIR_IS_LOCKED}" ]] ; then # Check if the directory is locked by this proccess if [[ -e "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock.$$" ]] ; then # We can't destroy our lock while it is locked!!! return ${__locks_ERR_DIR_IS_LOCKED} fi # The directory is locked by someone else. We remove our spin file, # and do not touch anything else. rm -f "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" return 0 fi dirUnlock "$DIR_NAME" __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" # Remove my spoin file rm -f "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" # Clean the locks directories tree of this lock, as possible # The first thing we clean is the master-lock. pushd "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" > /dev/null local curr_subdir=".lock" while rmdir "$curr_subdir" 2>/dev/null ; do curr_subdir=$PWD [[ "$curr_subdir" == ${__locks_LOCKS_DIR} ]] && break cd .. __locks_spinCleanup "$PWD" __locks_deadlockCleanup "$PWD" done popd > /dev/null return 0 } # # spinCleanup # Cleans all unneeded spinfiles from DirName. # This function removes spin-files. # This function does not lock the directory, even when removing # the files (non-safe action). That is because it is an internal # function that is to be used only by this library. # When maintaining this file notice that this is a function that # does not protect you from doing nasty stuff. # # If this function will be used without locking first, it can # cause problems. This is an internal function, so nothing like # that should never happened. If it does, sorry, we do not supply # `Stupid user protection'. # # Parameters: # DirName - The name of the directory we wish to clean from spinfiles. # # The function exits with: # 0 - The directory was successfully unlocked # non-zero - Unlocking failed # __locks_spinCleanup() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Clean dead processes spin files local spinfile for spinfile in $(ls "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME"/*.spin 2> /dev/null) ; do local pid=${spinfile%.spin} pid=${pid##*/} ps -ef | awk '{print $2}' | grep -q "^$pid$" || rm -f $spinfile done } # # deadlockCleanup # Cleans all locks that belong to dead processes. # This function removes lock-files. # This function does not lock the directory, even when removing # the files (non-safe action). That is because it is an internal # function that is to be used only by this library. # When maintaining this file notice that this is a function that # does not protect you from doing nasty stuff. # # If this function will be used without locking first, it can # cause problems. This is an internal function, so nothing like # that should never happened. If it does, sorry, we do not supply # `Stupid user protection'. # # Parameters: # DirName - The name of the directory we wish to clean from deadlocks. # # The function exits with: # 0 - The directory was successfully unlocked # non-zero - Unlocking failed # __locks_deadlockCleanup() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Clean dead proccesses spin files local lockfile for lockfile in $(ls "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/".lock.* 2> /dev/null) ; do local pid=${lockfile##*/.lock.} if ! ps -ef | awk '{print $2}' | grep -q "^$pid$" ; then rm -rf "$lockfile" fi done } # setMasterLock # Sets a master lock on a directory. # It tries to set it for 5 seconds. # If the master lock is set after those 5 seconds, # the function will sleep random amount of time (up to 1 second) # and will try again by calling itself recursively. # # Notice that after calling this function the object will stay locked till # this lock is removed. This lock is not cleared by the deadlock cleanup # function. Therefore, if the master-lock not removed and the process exits # you can kiss your object good-bye. You will need to violently remove the lock. # # There is no removeMasterLock function. To remove the lock you simply rmdir. # This lock is made to prevent two processes from setting process-specific lock # at the same time. Therefore, one should simply delete the directory once done # setting (or removing) process-specific lock. # # Parameters: # DirFullPath - The full path of the object directory. # # Return value: # This function returns only after setting the lock. If it returned the # directory was successfully locked. # __locks_setMasterLock() { local DIR_FULL_PATH=$1 local tries=0 while [[ $tries -lt 50 ]] ; do # Creating the directory to lock mkdir -p "$DIR_FULL_PATH" # Try to set the master lock mkdir "$DIR_FULL_PATH/.lock" >/dev/null 2>&1 && return sleep 0.1 let "tries++" done if [[ $tries -eq 50 ]] ; then rmdir "$DIR_FULL_PATH/.lock" sleep $(echo "" | awk '{srand(); print rand()}') __locks_setMasterLock "$DIR_FULL_PATH" fi } libbash-0.9.11/lib/getopt_long.man0000644000175000017500000000002311233565131013706 00000000000000.so man3/getopts.3 libbash-0.9.11/lib/dirTryLock.man0000644000175000017500000000002111233565131013451 00000000000000.so man3/locks.3 libbash-0.9.11/lib/getopts.man.in0000644000175000017500000001066011233565131013467 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt GETOPTS \&3 "libbash getopts Library Manual" .\" .Sh NAME .\" .\" .Nm getopts .Nd libbash library for command line parameters parsing .\" .\" .Sh SYNOPSIS .\" .\" .Ft $retval .Cm getopt_long .Aq Instructions .Aq Parameters .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled This is a documentation for .Em libbash getopts library, that implements .Em getopt_long function for .Xr bash 1 . For documentation of bash getopts function, please see .Xr getopts 1 ( .Xr getopts 1posix on some systems). .Pp Here is a table for reference: .Bl -tag -compact -width 1234567891234567 .It Xr getopts 1 (or 1posix on some systems) implemented by .Em bash .It Xr getopts 3 implemented by .Em libbash . .It Xr getopt 1 implemented by getopt utils (part of util-linux) .It Xr getopt_long 1 implemented by .Em libbash and installed to section 1 instead of 3 to prevent collision with C man pages. .It Xr getopt 3 implemented by GNU C library. .It Xr getopt_long 3 implemented by GNU C library. .El I have also seen separate getopt utility which part of util-linux package. .Pp The .Em getopt_long function parses the command line arguments. It uses .Fa Instructions as the rules for parsing the .Fa Parameters . .Ed .\" .Ss The Instructions A string that specifies rules for parameters parsing. The instructions string is built of a group of independent instructions, separated by a white space. Each instruction must have the following structure: .Pp .Sy -|--->[:] .Pp This structure contains three parts: .Bl -tag -width 12345 .It Sy - This is the parameter single-letter sign. For example .Fl h . .Pp .It Sy -- This is the parameter's corresponding multi-letter sign. For example .Fl -help . .Pp .It Sy [:] This is the name of the variable that will contain the parameter value. For example: .Sy HELP . .Pp The Variable name can represent one of two variables types: .Bl -tag -width 123 .It Sy Flag variable Li (not followed by Ql \&: ) In this case, it will hold the value 1 if .Ql on (i.e. was specified on command line) and will not be defined if .Ql off . .It Sy Value variable Li (followed by Ql \&: ) In this case, the value it will hold is the string that was given as the next parameter in the .Fa Parameters string (Separated by white-space or .Ql = ). If input contains more then one instance of the considered command line option, an array of the given parameters will be set as the value of the variable. .El .El .\" .Ss The Parameters The .Fa Parameters are simply the parameters you wish to parse. .\" .\" .Sh RETURN VALUE .\" .\" This function returns a string that contains a set of variables definitions. In order to define the variables, this string should be given as a parameter to .Em eval function. This value is returned in the variable .Fa $retval . .\" .\" .Sh EXAMPLES .\" .\" Parse command line parameters looking for the flags .Fl h | Fl -help and .Fl v | Fl -version and for the value .Fl p | Fl -path : .Bd -literal -offset indent getopt_long '\-h|\-\-help\->HELP \-v|\-\-version\->VERSION \-p|\-\-path\->PATH:' $* eval $retval .Ed .Pp In this example, for the parameters .Sy --help --path=/usr/ the variables that will be created are: .Bd -literal -offset indent HELP=1 PATH=/usr/ .Ed .\" .Pp for the parameters .Sy --help --path=/usr --path=/bin the variables that will be created are: .Bd -literal -offset indent HELP=1 PATH=(/usr /bin) .Ed .\" .\" .Sh BUGS .\" .\" .Bd -filled .Pp Values must not contain the string `__getopts__'. This string will be parsed as a single white-space. .Pp A value should not start with an already defined multi-letter sign. If such a value exists, it will be treated as the equivalent singe-letter sign. This bug only accures when using a single-letter sign, or a multi-letter sign that are not followed by a `='. For example: If we have a script named `foo', and we parse the parameters `\-d|\-\-dir:' and `\-f|\-\-file:', then .Bd -literal -offset indent foo \-d \-\-file .Ed and .Bd -literal -offset indent foo \-\-dir \-\-file .Ed will not work .Bd -literal -offset indent foo \-\-dir=\-\-file .Ed will work. .Ed .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr getopt_long 1 , .Xr getopts 1 , .Xr getopt 1 , .Xr libbash 1 , .Xr getopt 3 , .Xr getopt_long 3 .\" .\" libbash-0.9.11/lib/urlcoding.sh0000644000175000017500000001610711201604772013224 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ############################################################################# # Copyright (c) 2005 Alon Keren # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the gnu general public license as # # published by the Free Software Foundation. # # # ############################################################################# # # $Date: 2009-05-10 20:08:10 +0300 (Sun, 10 May 2009) $ # $Author: hai-zaar $ # # This library provides functions for conversion between ASCII-text and standard URL's. # AWK code is based on code by Heiner Steven . # #-------------------------------------------------------------------------------------------------- #EXPORT=urlEncodeStream urlEncodeString urlEncodeFile urlDecodeStream urlDecodeString urlDecodeFile #REQUIRE= #-------------------------------------------------------------------------------------------------- ############################################################### ################## LIBRARY CONSTANTS #################### ############################################################### __urlcoding_AWK="awk" __urlcoding_USAGE_ERROR="1" __urlcoding_SUCCESS="0" ############################################################### ################## SERVICE FUNCTIONS ################### ############################################################### # # $retval[2] getParams # Analayze coding parameters from function-arguments. # # Parameters: # Params: # The arguments with which an exported function was called. # # Return value: (Source EncodeEOLflag) # An array comprised of the following: # Index0 - The data source parameter # Index1 - the '-l' flag, if given # # Exit status: # __urlcoding_SUCCESS - the run was successful # __urlcoding_USAGE_ERROR - bad parameters were given __urlcoding_getParams () { local EncodeEOLflag= local Source="" [[ ! $1 ]] && return $__urlcoding_USAGE_ERROR if [[ "$1" == "-l" ]]; then EncodeEOLflag="-l" [[ ! $2 ]] && return $__urlcoding_USAGE_ERROR Source="$2" else Source="$1" fi retval=("$Source" "$EncodeEOLflag") return $__urlcoding_SUCCESS } ############################################################## ################### MAIN FUNCTIONS #################### ############################################################## # # urlEncodeString [-l] # # Encode URL from a given string. # # Parameters: # -l: # Encode line-feed chatacters ('\n') as well # # STRING: # The URL to encode # # Return value: # None. # # Exit status: # See the 'exit status' section of urlEncodeStream urlEncodeString () { __urlcoding_getParams "$@" || return $__urlcoding_USAGE_ERROR echo "${retval[0]}" | urlEncodeStream "${retval[1]}" return $? } # # urlEncodeFile [-l] # # Encode text from a file. # # Parameters: # -l: # encode LF chatacters ('\n') as well # # FILENAME: # the path of the file which contains the text to encode # # Return value: # None. # # Exit status: # See the 'exit status' section of urlEncodeStream # urlEncodeFile () { __urlcoding_getParams "$@" || return $__urlcoding_USAGE_ERROR urlEncodeStream "${retval[1]}" < "${retval[0]}" return $? } # # urlDecodeString # # Decode encoded URL from a string. # # Parameters: # STRING: # URL to decode # # Return value: # None. # # Exit status: # See the exit status of urlDecodeStream # urlDecodeString () { [[ "$1" ]] || return $__urlcoding_USAGE_ERROR echo "$1" | urlDecodeStream return $? } # # urlDecodeFile # # Decode encoded text from a file. # # Parameters: # FILENAME: # the file which contains the encoded text to decode # # Return value: # None. # # Exit status: # See the exit status of urlDecodeStream # urlDecodeFile () { [[ "$1" ]] || return $__urlcoding_USAGE_ERROR urlDecodeStream < "$1" return $? } # # urlEncodeStream [-l] # # Encode URL from input stream. # # Parameters: # -l: # Encode LF chatacters ('\n') as well # # Return value: # None. # # Exit status: # The exit status of the command $__urlcoding_AWK urlEncodeStream () { local EncodeEOL= [[ "$1" == "-l" ]] && EncodeEOL=yes $__urlcoding_AWK ' BEGIN { # We assume an awk implementation that is just plain dumb. # We will convert an character to its ASCII value with the # table ord[], and produce two-digit hexadecimal output # without the printf("%02X") feature. EOL = "%0A" # "end of line" string (encoded) split ("1 2 3 4 5 6 7 8 9 A B C D E F", hextab, " ") hextab [0] = 0 for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0 if ("'"$EncodeEOL"'" == "yes") EncodeEOL = 1; else EncodeEOL = 0 previous_line = "" } { encoded = "" for ( i=1; i<=length ($0); ++i ) { c = substr ($0, i, 1) if ( c ~ /[a-zA-Z0-9.-]/ ) { encoded = encoded c # safe character } else if ( c == " " ) { encoded = encoded "+" # special handling } else { # unsafe character, encode it as a two-digit hex-number lo = ord [c] % 16 hi = int (ord [c] / 16); encoded = encoded "%" hextab [hi] hextab [lo] } } # Prints the line encoded in the previous Awk-iteration, so # to avoid printing an EOL at the end of the file. if ( NR > 1 ) { if ( EncodeEOL ) { printf ("%s", previous_line EOL) } else { print previous_line } } previous_line = encoded } END { print previous_line #if ( EncodeEOL ) print "" } ' return $? } # # urlDecodeStream # # Decode encoded URL from input file. # # Parameters: # None. # # Return value: # None. # # Exit status: # The exit status of the command $__urlcoding_AWK urlDecodeStream () { $__urlcoding_AWK ' BEGIN { hextab ["0"] = 0; hextab ["8"] = 8; hextab ["1"] = 1; hextab ["9"] = 9; hextab ["2"] = 2; hextab ["A"] = hextab ["a"] = 10 hextab ["3"] = 3; hextab ["B"] = hextab ["b"] = 11; hextab ["4"] = 4; hextab ["C"] = hextab ["c"] = 12; hextab ["5"] = 5; hextab ["D"] = hextab ["d"] = 13; hextab ["6"] = 6; hextab ["E"] = hextab ["e"] = 14; hextab ["7"] = 7; hextab ["F"] = hextab ["f"] = 15; } { decoded = "" i = 1 len = length ($0) while ( i <= len ) { c = substr ($0, i, 1) if ( c == "%" ) { if ( i+2 <= len ) { c1 = substr ($0, i+1, 1) c2 = substr ($0, i+2, 1) if ( hextab [c1] == "" || hextab [c2] == "" ) { print "WARNING: invalid hex encoding: %" c1 c2 | \ "cat >&2" } else { code = 0 + hextab [c1] * 16 + hextab [c2] + 0 #print "\ncode=", code c = sprintf ("%c", code) i = i + 2 } } else { print "WARNING: invalid % encoding: " substr ($0, i, len - i) } } else if ( c == "+" ) { # special handling: "+" means " " c = " " } decoded = decoded c ++i } print decoded } ' return $? } libbash-0.9.11/lib/colorPrintN.man0000644000175000017500000000002211233565131013635 00000000000000.so man3/colors.3 libbash-0.9.11/lib/Makefile.am0000644000175000017500000000123411233565131012731 00000000000000AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.sh) $(wildcard *.man) # all libraries goes to lib/bash bashlibdir = $(libdir)/bash bashlib_DATA = $(wildcard *.sh) # installing man pages ####################### # getopts is treated specially since we install man pages in different sections man3_MANS = getopts.man man1_MANS = getopt_long.man BASHLIBS = hashstash colors messages locks urlcoding # The macro finds all man page files that reference $(1) in section $(2) define GET_MANS $(shell grep '^\.so man$(2)/$(1).$(2)$$' * |cut -f1 -d:) endef # note the `+' $(foreach lib,$(BASHLIBS),$(eval man3_MANS+=$(lib).man $(call GET_MANS,$(lib),3))) libbash-0.9.11/lib/colors.man.in0000644000175000017500000000501111233565131013275 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt COLORS \&3 "libbash colors Library Manual" .\" .Sh NAME .\" .\" .Nm colors .Nd libbash library for setting tty colors. .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 12345678900 .\" .It Cm colorSet .Aq Ar color .\" .It Cm colorReset .\" .It Cm colorPrint .Op Aq indent .Aq Ar color .Aq Ar text .\" .It Cm colorPrintN .Op Aq indent .Aq Ar color .Aq Ar text .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Bd -filled .Nm is a collection of functions that make it very easy to put colored text on tty. .Pp The function list: .Bl -tag -compact -width colorprint12345 -offset indent .It Sy colorSet Sets the color of the prints to the tty to COLOR .It Sy colorReset Resets current tty color back to normal .It Sy colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline) .It Sy colorPrintN The same as colorPrint, but trailing newline is added .El .Ed .Pp Detailed interface description follows. .\" .Pp .Ss Available colors: .Bl -tag -compact -width hashdelete12345 -offset indent .It Sy Green .It Sy Red .It Sy Yellow .It Sy White .El The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red). .\" .Sh FUNCTIONS DESCRIPTIONS .Ss Cm colorSet Aq Ns Fa color Ns .\" Sets the current printing color to .Em color . .Pp .\" .\" .Ss Cm colorReset .\" Resets current tty color back to normal. .\" .\" .Ss Cm colorPrint Bo Ao Ns Fa indent Ns Ac Bc Aq Ns Fa color Ns .\" Prints .Em text using the color .Em color indented by .Em indent (without adding a newline). .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa indent Ns Li The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position. .It Aq Ns Fa color Ns Li The color to use. .It Aq Ns Fa color Ns Li The text to print. .El .Pp .\" .\" .Ss Cm colorPrintN Bo Ao Ns Fa indent Ns Ac Bc Aq Ns Fa color Ns The same as colorPrint, except a trailing newline is added. .\" .\" .\" .\" .Sh EXAMPLES .\" .\" Printing a green 'Hello World' with a newline: .Bl -tag -width 1 -offset 12345 .It Using colorSet: .D1 $ colorSet green .D1 $ echo 'Hello World' .D1 $ colorReset .It Using colorPrint: .D1 $ colorPrint 'Hello World' ; echo .It Using colorPrintN: .D1 $ colorPrintN 'Hello World' .El .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/dirLock.man0000644000175000017500000000002111233565131012752 00000000000000.so man3/locks.3 libbash-0.9.11/lib/hashDelete.man0000644000175000017500000000002511233565131013435 00000000000000.so man3/hashstash.3 libbash-0.9.11/lib/printNA.man0000644000175000017500000000002411233565131012741 00000000000000.so man3/messages.3 libbash-0.9.11/lib/locks.man0000644000175000017500000001413511247024333012510 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt LOCKS \&3 "libbash locks Library Manual" .\" .Sh NAME .\" .\" .Nm locks .Nd libbash library that implements locking (directory based). .Pp .Sy This library is not throughoutly tested - use with caution! .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 123456789012345 .\" .It Cm dirInitLock .Aq object .Op Aq spin .\" .It Cm dirTryLock .Aq object .\" .It Cm dirLock .Aq object .\" .It Cm dirUnlock .Aq object .\" .It Cm dirDestroyLock .Aq object .\" .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Nm is a collection of functions that implement locking (mutex like) in bash scripting language. The whole idea is based on the fact that directory creation/removal is an atomic process. The creation of this library was inspired by studying CVS locks management. .Pp Same lock object can by used by several processes to serialize access to some shared resource. (Well, yeah, this what locks were invented for...) To actually do this, processes just need to access lock object by the same name. .Pp .Ss Functions list: .Bl -tag -width hashdelete12345 -offset ident .It Sy dirInitLock Initialize a lock object for your proccess .It Sy dirTryLock Try to lock the lock object - give up if its already locked .It Sy dirLock Lock the lock object - will block until object is unlocked .It Sy dirUnlock Unlock the lock object .It Sy dirDestroyLock Destroy the lock object - free resources .El .Pp Detailed interface description follows. .\" .\" .Sh FUNCTIONS DESCRIPTIONS .\" .\" dirInitLock SUBSECTION .Ss Cm dirInitLock Ao Ns Fa object Ns Ac Bq Aq Ns Fa spin Ns .\" Initialize a lock object for your process. Only after a lock is initialized, your proccess will be able to use it. .\" .Sy Notice: This action does not lock the object. .Pp The lock can be set on two types of objects. The first is an existing directory. In this case, Aq dir must be a path (relative or full). The path must contain a .Ql / . The second is an abstract object used as a lock. In this case, the name of the lock will not contain any .Ql / . This can be used to create locks without creating real directories for them. .\" .Sy Notice: Do not call your lock object .Ql .lock . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The name of the lock object (either existing directory or abstract name) .It Aq Ns Fa spin Ns Li The time (in seconds) that the funtion .Em dirLock will wait between two runs of .Em dirTryLock . This parameter is optional, and its value generally should be less then 1. If ommited, a default value (0.01) is set. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 1 The action failed. You do not have permissions to preform it. .It Sy 3 The directory path could not be resolved. Possibly parameter does contain .Ql / , but refers to directory that does not exist. .El .Ed .\" .\" .\" dirTryLock SUBSECTION .Ss Cm dirTryLock Aq Ns Fa object Ns Li .\" Try to lock the lock object. The function always returns immediately. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The object that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 1 The action failed. The object is already locked. .It Sy 2 The action failed. Your proccess did not initialize a lock for the object. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .\" dirLock SUBSECTION .Ss Cm dirLock Aq Ns Fa object Ns Li .\" Lock given lock object. If the object is already locked - the function will block untill the object is unlocked. After each try (dirTryLock) the function will sleep for spin seconds (spin is defined using .Em dirInitLock ). .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The directory that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 2 The action failed. Your proccess did not initialize a lock for the directory. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .\" dirUnlock SUBSECTION .Ss Cm dirUnlock Aq Ns Fa dir Ns Li .\" Unlock the lock object. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The object that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 2 The action failed. Your proccess did not initialize the lock. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .\" dirDestroyLock SUBSECTION .Ss Cm dirDestroyLock Aq Ns Fa object Ns Li .\" Destroys the lock object. After this action the proccess will no longer be able to use the lock object. To use the object after this action is done, one must initialize the lock, using .Em dirInitLock . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The directory that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 1 The action failed. The directory is locked by your own proccess. Unlock it first. .It Sy 2 The action failed. Your proccess did not initialize the lock. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .Sh EXAMPLES .\" .\" Creating an abstract lock named mylock, with 0.1 second spintime: .D1 $ dirInitLock mylock 0.1 # $?=0 Locking it: .D1 $ dirLock mylock # $?=0 Trying once to lock it again: .D1 $ dirTryLock mylock # $?=1 Trying to lock it again: .D1 $ dirLock mylock # Will wait forever Unlocking: .D1 $ dirUnlock mylock # $?=0 Destroying the lock: .D1 $ dirDestroyLock mylock # $?=0 Trying to lock again: .D1 $ dirLock mylock # $?=2 Creating a lock on the directory ./mydir, with default spin time: .D1 $ dirInitLock ./mydir # $?=0 .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/colorSet.man0000644000175000017500000000002211233565131013156 00000000000000.so man3/colors.3 libbash-0.9.11/lib/hashstash.man.in0000644000175000017500000001310111233565131013761 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt HASHSTASH \&3 "libbash hashstash Library Manual" .\" .Sh NAME .\" .\" .Nm hashstash .Nd libbash library that implements hash data structure .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 12345678901234567 .\" .It Cm hashSet .Aq Value .Aq Key .Aq HashName .Op SubHashName Op ... .\" .It Ft $retval Cm hashGet .Aq Key .Aq HashName .Op SubHashName Op ... .\" .It Ft $retval Cm hashKeys .Aq HashName .Op SubHashName Op ... .\" .It Cm hashRemove .Aq Key .Aq HashName .Op SubHashName Op ... .\" .It Cm hashDelete .Aq HashName .Op SubHashName Op ... .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Bd -filled .Nm is a collection of functions that implement basic hash data-structure in bash scripting language. .Pp The function list: .Bl -tag -compact -width hashdelete12345 -offset indent .It Sy hashSet Adds a value to the hash .It Sy hashGet Returns a value from the hash .It Sy hashKeys Returns a list of keys of the hash .It Sy hashRemove Removes a key from the hash .It Sy hashDelete Deletes a hash .El .Ed .Pp Detailed interface description follows. .\" .Sh FUNCTIONS DESCRIPTIONS .\" hashSet SUBSECTION .Ss Cm hashSet Ao Ns Fa Value Ns Ac Ao Ns Fa Key Ns Ac Ao Ns Fa Hashname Ns Ac Op SubHashName Op ... .\" Adds a value to the hash. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa Value Ns The value to set in .Fa HashName Ns Bo Fa Key Bc . .It Aq Ns Fa Key Ns The key for the value .Fa Value . .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the "father hash" name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp .Fa Value will be the value of the key .Fa Key in the hash .Fa HashName . For example if you have (or want to define) hash .Em C , which is subhash of hash .Em B , which is subhash of hash .Em A , and .Em C has a key named .Em ckey1 with value .Em cval1 , then you should use: .D1 Sy hashSet cval1 ckey1 A B C .\" .\" hashGet SUBSECTION .Ss Ft $retval Cm hashGet Ao Ns Fa Key Ns Ac Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Returns the value of .Fa Key in .Fa HashName to the .Ft $retval variable. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa Key Ns The key that hold the value we wish to get. .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp Return Value: .Bd -filled -offset 12 -compact The value of the key .Fa Key in the hash .Fa HashName . The value is returned in the variable .Ft $retval . .Ed .\" .\" hashKeys SUBSECTION .Ss Ft $retval Cm hashKeys Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Returns a list of keys of the hash .Fa HashName in the variable .Ft $retval . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp Return Value: .Bd -filled -offset 12 The value of the key .Fa Key in the hash .Fa HashName . The value is returned in the variable .Ft $retval . .Ed .\" .\" hashRemove SUBSECTION .Ss Cm hashRemove Ao Ns Fa Key Ns Ac Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Removes the key .Fa Key from the hash .Fa HashName . .Bl -tag -width 1 -offset 12 .It Aq Ns Fa Key Ns The key we wish to remove from .Fa HashName . .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp This function should also be used to remove a sub-hash from its .Qq father hash . In that case, the .Fa key will be the name of the sub-hash. .\" .\" hashDelete SUBSECTION .Ss Cm hashDelete Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Deletes the hash .Fa HashName Op SubHashName Op ... . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp If this function is used on a sub-hash, a key with the name of the sub-hash will remain in its .Qq father hash and will hold a NULL value. .\" .\" .\" .\" .Sh BUGS .\" .\" .Bd -filled .Pp A hash name can only contain characters that are valid as part of bash variable names (i.e. a-zA-Z0-9_). The same applies for hash keys. .Pp As for now, there is no way of knowing if a key represents a value or a sub-hash. If a sub-hash will be used as a key, the returned value will be its keys list. .Ed .\" .\" .Sh EXAMPLES .\" .\" Define hash table .Em hashA with key .Em Akey1 with value .Em Aval1 use: .Dl Sy % hashSet Aval1 Akey1 Ahash Now: .Dl Sy % hashGet Akey1 Ahash .Dl Sy % echo $retval .Dl Sy Aval1 .Dl Sy % hashKeys Ahash .Dl Sy % echo $retval .Dl Sy Akey1 .Dl Sy % .\" .\" .Sh HISTORY .\" .\" .Bd -filled The idea to write .Nm library appeared when we've discovered the full power of the bash .Em eval function. .Pp As of the name .Nm , it has two meanings. The first, it means .Ql stash of hash functions. The second is, that .Nm contains subhashes inside, so it looks like stash of packed information. .Ed .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/urlcoding.man0000644000175000017500000000462011247024333013361 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt URLCODING \&3 "libbash urlcoding Library Manual" .\" .Sh NAME .\" .\" .Nm urlcoding .Nd a Libbash library for encoding and decoding URL's. .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 12345678900 .\" .It Cm urlEncodeString Bo Ns Fa -l Ns Bc Aq Ns Fa STRING Ns .It Cm urlEncodeFile Bo Ns Fa -l Ns Bc Aq Ns Fa FILE Ns .It Cm urlEncodeStream Bo Ns Fa -l Ns Bc .It Cm urlDecodeString Aq Ns Fa STRING Ns .It Cm urlDecodeFile Aq Ns Fa FILENAME Ns .It Cm urlDecodeStream .\" .El .\" .\" .Sh DESCRIPTION .\" .Bd -filled .Nm is a collection of functions that convert ASCII-text to standard URL's and vice-versa. The AWK code used is based on code by Heiner Steven .Pp The function list: .Bl -tag -compact -width colorprint12345 -offset indent .It Sy urlEncodeString Creates a URL from an ASCII string .It Sy urlEncodeFile Converts a file into URL-valid text .It Sy urlEncodeStream Converts standard input into URL-valid text .It Sy urlDecodeString Converts a URL-encoded text back to a plain-text form .It Sy urlDecodeFile Coverts URL-encoded text in a file back to plain text .It Sy urlDecodeStream Converts URL-encoded standard input to text .El .Ed .Pp Detailed interface description follows. .\" .Pp The .Op Em -l option for the encoding functions should be used when line-feed characters ('\en') are to be encoded as well. .Pp All functions print the results of their conversions to standard output. .Pp The exit status of all functions is that of the command 'awk', with '0' for success .Pp .\" .Sh FUNCTIONS DESCRIPTIONS .Pp .Ss Cm urlEncodeString Bo Ns Fa -l Ns Bc Aq Ns Fa STRING Ns .\" Converts .Em STRING - a string of ASCII characters - to URL. .Pp .\" .\" .Ss Cm urlEncodeFile Bo Ns Fa -l Ns Bc Aq Ns Fa FILE Ns .\" Coverts .Em FILE of URL-encoded text to plain text .\" .Ss Cm urlEncodeStream Bo Ns Fa -l Ns Bc .\" Converts text from standard input to URL-text. .Pp .\" .Ss Cm urlDecodeString Aq Ns Fa STRING Ns .\" Converts URL-encoded string .Em STRING back to text. .Pp .\" .Ss Cm urlDecodeFile Aq Ns Fa FILENAME Ns .\" Converts the URL-encoded text in .Em FILE to plain text. .Pp .\" .Ss Cm urlDecodeStream .\" Converts the URL-encoded text from standard input to plain-text .Pp .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Alon Keren" Aq alon.keren@gmail.com .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/messages.man0000644000175000017500000000425211247024333013203 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt MESSAGES \&3 "libbash messages Library Manual" .\" .Sh NAME .\" .\" .Nm messages .Nd libbash library that implements a set of functions to print standard status messages .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 1234567890 .\" .It Cm printOK .Op indent .\" .It Cm printFAIL .Op indent .\" .It Cm printNA .Op indent .\" .\" .It Cm printATTN .Op indent .\" .\" .It Cm printWAIT .Op indent .\" .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Bd -filled .Nm is a collection of functions to print standard status messages - those [ OK ] and [FAIL] messages you see during Linux boot process. .Pp The function list: .Bl -tag -compact -width hashdelete12345 -offset indent .It Sy printOK Prints a standard [ OK ] message (green) .It Sy printFAIL Prints a standard [FAIL] message (red) .It Sy printNA Prints a standard [ N/A] message (yellow) .It Sy printATTN Prints a standard [ATTN] message (yellow) .It Sy printWAIT Prints a standard [WAIT] message (yellow) .El .Ed .Pp Detailed interface description follows. .\" .Ss indent Column to move to before printing. .Pp Default indent is calculated as TTY_WIDTH-10. If current tty width can not be determined (for example, in case of serial console), it defaults to 80, so default indent is 80-10=10 .\" .Sh FUNCTIONS DESCRIPTIONS .Ss Cm printOK Bq Ns Fa indent Ns Li .\" Prints a standard [ OK ] message (green) .\" .\" .Ss Cm printFAIL Bq Ns Fa indent Ns Li .\" Prints a standard [FAIL] message (red) .\" .\" .Ss Cm printNA Bq Ns Fa indent Ns Li .\" Prints a standard [ N/A] message (yellow) .Pp .\" .\" .Ss Cm printATTN Bq Ns Fa indent Ns Li .\" Prints a standard [ATTN] message (yellow) .\" .\" .Ss Cm printWAIT Bq Ns Fa indent Ns Li .\" Prints a standard [WAIT] message (yellow) .\" .\" .Sh EXAMPLES .\" .\" Run a program named MyProg, and report it's success or failure: .Bd -literal -offset ident-two echo -n 'Running MyProg...' printWAIT if MyProg ; then printOK else printFAIL fi .Ed .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/messages.man.in0000644000175000017500000000424611233565131013614 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt MESSAGES \&3 "libbash messages Library Manual" .\" .Sh NAME .\" .\" .Nm messages .Nd libbash library that implements a set of functions to print standard status messages .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 1234567890 .\" .It Cm printOK .Op indent .\" .It Cm printFAIL .Op indent .\" .It Cm printNA .Op indent .\" .\" .It Cm printATTN .Op indent .\" .\" .It Cm printWAIT .Op indent .\" .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Bd -filled .Nm is a collection of functions to print standard status messages - those [ OK ] and [FAIL] messages you see during Linux boot process. .Pp The function list: .Bl -tag -compact -width hashdelete12345 -offset indent .It Sy printOK Prints a standard [ OK ] message (green) .It Sy printFAIL Prints a standard [FAIL] message (red) .It Sy printNA Prints a standard [ N/A] message (yellow) .It Sy printATTN Prints a standard [ATTN] message (yellow) .It Sy printWAIT Prints a standard [WAIT] message (yellow) .El .Ed .Pp Detailed interface description follows. .\" .Ss indent Column to move to before printing. .Pp Default indent is calculated as TTY_WIDTH-10. If current tty width can not be determined (for example, in case of serial console), it defaults to 80, so default indent is 80-10=10 .\" .Sh FUNCTIONS DESCRIPTIONS .Ss Cm printOK Bq Ns Fa indent Ns Li .\" Prints a standard [ OK ] message (green) .\" .\" .Ss Cm printFAIL Bq Ns Fa indent Ns Li .\" Prints a standard [FAIL] message (red) .\" .\" .Ss Cm printNA Bq Ns Fa indent Ns Li .\" Prints a standard [ N/A] message (yellow) .Pp .\" .\" .Ss Cm printATTN Bq Ns Fa indent Ns Li .\" Prints a standard [ATTN] message (yellow) .\" .\" .Ss Cm printWAIT Bq Ns Fa indent Ns Li .\" Prints a standard [WAIT] message (yellow) .\" .\" .Sh EXAMPLES .\" .\" Run a program named MyProg, and report it's success or failure: .Bd -literal -offset ident-two echo -n 'Running MyProg...' printWAIT if MyProg ; then printOK else printFAIL fi .Ed .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/printATTN.man0000644000175000017500000000002411233565131013211 00000000000000.so man3/messages.3 libbash-0.9.11/lib/dirUnlock.man0000644000175000017500000000002111233565131013315 00000000000000.so man3/locks.3 libbash-0.9.11/lib/messages.sh0000644000175000017500000000746311201604772013052 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # $Date: 2009-05-10 20:08:10 +0300 (Sun, 10 May 2009) $ # $Author: hai-zaar $ # # Very simple library to help printing message in format similar # to init scripts # #------------------------------------------------------------------------- #EXPORT=printOK printFAIL printNA printATTN #REQUIRE=colorPrint #------------------------------------------------------------------------- # # __messages_calculateShift # Calculate tty width (X) and reports X-10. If its unable to # determite tty width (for example, in case of serial console), # returns 80-10 # # Return value: # number of columns to move to # __messages_calculateShift() { local ttyXxY=$(stty size 2>/dev/null) local ttyX=${ttyXxY##* } # When using remote connections, such as a serial port, stty size returns 0 if [ "$ttyX" = "0" ]; then ttyX=80; fi let "ttyX = ttyX - 10" retval=$ttyX } # # __messages_print # # Prints TEXT in the color COLOR in the column INDENT. # # Parameters: # COLOR - The color for the tty print. # TEXT - The text to be printed in the color COLOR. # INDENT - The column that the message will be printed in. __messages_print() { local COLOR=$1 local TEXT=$2 local INDENT=$3 echo -en "\\033[${INDENT}G[" case ${#TEXT} in 0) echo -en " " ;; 1) echo -en " " ;; 2) echo -en " " ;; 3) echo -en " " ;; *) echo -en esac colorPrint $COLOR $TEXT case ${#TEXT} in 1) echo -en " " ;; 2) echo -en " " ;; *) echo -en esac echo -e "]" } # # printOK printOK [INDENT] # # Prints an OK message. # # Parameters: # INDENT # The column that the message will be printed in. # This parameter is optional. If not given, a default value (60) is assined. printOK() { __messages_calculateShift local SHIFT=$retval __messages_print GREEN "OK" ${1:-$SHIFT} } # printFAIL printFAIL [INDENT] # # Prints an FAIL message. # # Parameters: # INDENT # The column that the message will be printed in. # This parameter is optional. If not given, a default value (60) is assined. printFAIL() { __messages_calculateShift local SHIFT=$retval __messages_print RED "FAIL" ${1:-$SHIFT} } # printNA printNA [INDENT] # # Prints an N/A message. # # Parameters: # INDENT # The column that the message will be printed in. # This parameter is optional. If not given, a default value (60) is assined. printNA() { __messages_calculateShift local SHIFT=$retval __messages_print YELLOW "N/A" ${1:-$SHIFT} } # printATTN printATTN [INDENT] # # Prints an ATTN message. # # Parameters: # INDENT # The column that the message will be printed in. # This parameter is optional. If not given, a default value (60) is assined. printATTN() { __messages_calculateShift local SHIFT=$retval __messages_print YELLOW "ATTN" ${INDENT:-$SHIFT} } # printWAIT printWAIT [INDENT] # # Prints an WAIT message. # # Parameters: # INDENT # The column that the message will be printed in. # This parameter is optional. If not given, a default value (60) is assined. printWAIT() { __messages_calculateShift local SHIFT=$retval __messages_print YELLOW "WAIT" ${INDENT:-$SHIFT} } libbash-0.9.11/lib/Makefile.in0000644000175000017500000003324611247024317012753 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/colors.man.in $(srcdir)/getopts.man.in \ $(srcdir)/hashstash.man.in $(srcdir)/locks.man.in \ $(srcdir)/locks.sh.in $(srcdir)/messages.man.in \ $(srcdir)/urlcoding.man.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = colors.man getopts.man hashstash.man locks.man \ messages.man urlcoding.man locks.sh SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ "$(DESTDIR)$(bashlibdir)" man3dir = $(mandir)/man3 NROFF = nroff MANS = $(man1_MANS) $(man3_MANS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; bashlibDATA_INSTALL = $(INSTALL_DATA) DATA = $(bashlib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DOXYGEN = @DOXYGEN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdate = @docdate@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.sh) $(wildcard *.man) # all libraries goes to lib/bash bashlibdir = $(libdir)/bash bashlib_DATA = $(wildcard *.sh) # installing man pages ####################### # getopts is treated specially since we install man pages in different sections man3_MANS = getopts.man man1_MANS = getopt_long.man BASHLIBS = hashstash colors messages locks urlcoding all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh colors.man: $(top_builddir)/config.status $(srcdir)/colors.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ getopts.man: $(top_builddir)/config.status $(srcdir)/getopts.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ hashstash.man: $(top_builddir)/config.status $(srcdir)/hashstash.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ locks.man: $(top_builddir)/config.status $(srcdir)/locks.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ messages.man: $(top_builddir)/config.status $(srcdir)/messages.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ urlcoding.man: $(top_builddir)/config.status $(srcdir)/urlcoding.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ locks.sh: $(top_builddir)/config.status $(srcdir)/locks.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ done uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ done install-bashlibDATA: $(bashlib_DATA) @$(NORMAL_INSTALL) test -z "$(bashlibdir)" || $(MKDIR_P) "$(DESTDIR)$(bashlibdir)" @list='$(bashlib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(bashlibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(bashlibdir)/$$f'"; \ $(bashlibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(bashlibdir)/$$f"; \ done uninstall-bashlibDATA: @$(NORMAL_UNINSTALL) @list='$(bashlib_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(bashlibdir)/$$f'"; \ rm -f "$(DESTDIR)$(bashlibdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(bashlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-bashlibDATA install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man1 install-man3 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-bashlibDATA uninstall-man uninstall-man: uninstall-man1 uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-bashlibDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-man3 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-bashlibDATA uninstall-man uninstall-man1 \ uninstall-man3 # The macro finds all man page files that reference $(1) in section $(2) define GET_MANS $(shell grep '^\.so man$(2)/$(1).$(2)$$' * |cut -f1 -d:) endef # note the `+' $(foreach lib,$(BASHLIBS),$(eval man3_MANS+=$(lib).man $(call GET_MANS,$(lib),3))) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libbash-0.9.11/lib/locks.sh0000644000175000017500000003255511247024333012355 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # $Date: 2009-07-27 14:38:23 +0300 (Mon, 27 Jul 2009) $ # $Author: hai-zaar $ # # This bash library provides a set of locking tools. # The locking is done by creating a directory named `.lock'. # After the master-lock named `.lock' is set, a process can # create its .lock.$$ file, and remove the master-lock. # Each non-safe action requires a master-lock. # Locking, unlocking, cleaning leftover locks and cleaning # left over spin-files are non-safe action and require # a master lock. # Creating or removing my own spin-file and creating a # directory that should be locked are the only actions # done on the directory, that are considered safe. #EXPORT=dirInitLock dirTryLock dirLock dirUnlock dirDestroyLock #REQUIRE= prefix=/usr __locks_LOCKS_DIR=/tmp/.dirlocks-$USER __locks_DEFAULT_SLEEP_TIME=0.01 __locks_ERR_DIR_IS_LOCKED=1 __locks_ERR_NO_SPIN_FILE=2 __locks_ERR_COULD_NOT_RESOLVE_DIR=3 #__locks_DEBUG_MODE=1 ############################################################# ###################### FUNCTIONS ######################## ############################################################# # # findEffectiveDirname # Finds the full path that we should lock, i.e. the effective # dirname we should work on. # This function does not change files (and therefore does not lock anything). # Parameters: # DirName - The name of the directory we wish to lock. You can choose # any name if you want to __locks_findEffectiveDirname() { local DIR_NAME=$1 # Check if it a file/dir exists if [ -e "$DIR_NAME" ] ; then if [[ -d "$DIR_NAME" ]] ; then retval=$(cd "$DIR_NAME" > /dev/null 2>&1 && pwd) || \ return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} else # Get the perent directory for $DIR_NAME (full path) retval=$(cd $(dirname "$DIR_NAME") > /dev/null 2>&1 && pwd) || \ return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} # Add the basename of $DIR_NAME retval=$(ls -d $retval/$(basename "$DIR_NAME") 2>/dev/null) || \ return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} fi return 0 else # It does not exist: # Expand `\' # Check that it does not contain `..' - it can be very dangerous while echo "$DIR_NAME" |grep -q '\\'; do DIR_NAME=$(echo "$DIR_NAME" | xargs echo); done echo "$DIR_NAME" | grep -q '\.\.' && return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} retval="$DIR_NAME" && return 0 fi # If we got here something's wrong return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} } # # dirInitLock [Spin] # Initializes a lock for a DirName object, for current process # # Parameters: # DirName - The name of the directory we wish to lock. You can choose # any name if you want to - i.e It does not have to be a real dir # Spin - Spin period - we'll retry to acquire lock each Spin seconds. # Spin may (and generally should) be less then 1. # Default Spin is 0.01 seconds. # Return value: # 0 - The lock was initialized and is ready for use # non-zero - The lock was not initialized # dirInitLock() { local DIR_NAME=$1 local SPIN=${2:-${__locks_DEFAULT_SLEEP_TIME}} # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" __locks_spinCleanup "$DIR_NAME" # Creating our spin-files - safe action echo $SPIN > "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" status=$? # Free the master lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" # Return the return value of the spin-file creation command return $status } # # dirTryLock # Tries to set a lock on a directory. If lock is # already set - returns immediately with error. # # Parameters: # DirName - The name of the directory we wish to lock. # # The function exits with: # 0 - The directory was successfully locked # 1 - Lock was already set # 2 - The lock object is not initialized # dirTryLock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Check if the directory-lock is initialized [[ -e "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" ]] || return ${__locks_ERR_NO_SPIN_FILE} __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" __locks_deadlockCleanup "$DIR_NAME" # Check if there is a lock on the directory if ls -d "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME"/.lock.* > /dev/null 2>&1 ; then # Remove the master-lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" return ${__locks_ERR_DIR_IS_LOCKED} fi # Create a lock file for this proccess (umask 0 && touch "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock.$$") # Remove the master-lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" # If we got here, everything worked just file. return 0 } # # dirLock # Sets a lock on a directory. # # Parameters: # DirName - The name of the directory we wish to lock. # # The function exits with: # 0 - The directory was successfully locked # 2 - The lock object was not initialized # dirLock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Loop trying to lock the directory while true ; do dirTryLock "$DIR_NAME" local status=$? # If the result of the TryLock is other than an error that says that the directory is locked, return it [[ $status != ${__locks_ERR_DIR_IS_LOCKED} ]] && return $status # The return value was the __locks_ERR_DIR_IS_LOCKED error. Sleep and try again. sleep $(cat "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" 2> /dev/null) > /dev/null 2>&1 || sleep ${__locks_DEFAULT_SLEEP_TIME} done } # # dirUnlock # Free a directory from its lock. # # Parameters: # DirName - The name of the directory we wish to unlock. # # The function exits with: # 0 - The directory was successfully unlocked # non-zero - Unlocking failed # dirUnlock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Check if the directory-lock is initialized [[ -e "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" ]] || return ${__locks_ERR_NO_SPIN_FILE} __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" __locks_deadlockCleanup "$DIR_NAME" # Remove my lock file rm -f "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock.$$" > /dev/null 2>&1 # Remove the master lock rmdir "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock" > /dev/null 2>&1 ls -la "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/".lock.* > /dev/null 2>&1 && return ${__locks_ERR_DIR_IS_LOCKED} return 0 } # # dirDestroyLock # Destroys the lock object. After this action the process will no longer be able to use the lock object. # To use the object after this action is done, one must initialize the lock, using dirInitLock. # # Parameters: # DirName - The name of the directory that we with to destroy its lock. # # The function exits with: # 0 The action finished successfully. # 1 The action failed. The directory is locked by your own process. Unlock it first. # 2 The action failed. Your process did not initialize the lock. # 3 The directory path could not be resolved. # dirDestroyLock() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Make sure that the directory is not locked dirTryLock "$DIR_NAME" if [[ "$?" == "${__locks_ERR_DIR_IS_LOCKED}" ]] ; then # Check if the directory is locked by this proccess if [[ -e "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/.lock.$$" ]] ; then # We can't destroy our lock while it is locked!!! return ${__locks_ERR_DIR_IS_LOCKED} fi # The directory is locked by someone else. We remove our spin file, # and do not touch anything else. rm -f "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" return 0 fi dirUnlock "$DIR_NAME" __locks_setMasterLock "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" # Remove my spoin file rm -f "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/$$.spin" # Clean the locks directories tree of this lock, as possible # The first thing we clean is the master-lock. pushd "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME" > /dev/null local curr_subdir=".lock" while rmdir "$curr_subdir" 2>/dev/null ; do curr_subdir=$PWD [[ "$curr_subdir" == ${__locks_LOCKS_DIR} ]] && break cd .. __locks_spinCleanup "$PWD" __locks_deadlockCleanup "$PWD" done popd > /dev/null return 0 } # # spinCleanup # Cleans all unneeded spinfiles from DirName. # This function removes spin-files. # This function does not lock the directory, even when removing # the files (non-safe action). That is because it is an internal # function that is to be used only by this library. # When maintaining this file notice that this is a function that # does not protect you from doing nasty stuff. # # If this function will be used without locking first, it can # cause problems. This is an internal function, so nothing like # that should never happened. If it does, sorry, we do not supply # `Stupid user protection'. # # Parameters: # DirName - The name of the directory we wish to clean from spinfiles. # # The function exits with: # 0 - The directory was successfully unlocked # non-zero - Unlocking failed # __locks_spinCleanup() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Clean dead processes spin files local spinfile for spinfile in $(ls "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME"/*.spin 2> /dev/null) ; do local pid=${spinfile%.spin} pid=${pid##*/} ps -ef | awk '{print $2}' | grep -q "^$pid$" || rm -f $spinfile done } # # deadlockCleanup # Cleans all locks that belong to dead processes. # This function removes lock-files. # This function does not lock the directory, even when removing # the files (non-safe action). That is because it is an internal # function that is to be used only by this library. # When maintaining this file notice that this is a function that # does not protect you from doing nasty stuff. # # If this function will be used without locking first, it can # cause problems. This is an internal function, so nothing like # that should never happened. If it does, sorry, we do not supply # `Stupid user protection'. # # Parameters: # DirName - The name of the directory we wish to clean from deadlocks. # # The function exits with: # 0 - The directory was successfully unlocked # non-zero - Unlocking failed # __locks_deadlockCleanup() { local DIR_NAME=$1 # Resolve effective directory name __locks_findEffectiveDirname "$DIR_NAME" || return ${__locks_ERR_COULD_NOT_RESOLVE_DIR} local EFFECTIVE_DIRNAME=$retval # Clean dead proccesses spin files local lockfile for lockfile in $(ls "${__locks_LOCKS_DIR}/$EFFECTIVE_DIRNAME/".lock.* 2> /dev/null) ; do local pid=${lockfile##*/.lock.} if ! ps -ef | awk '{print $2}' | grep -q "^$pid$" ; then rm -rf "$lockfile" fi done } # setMasterLock # Sets a master lock on a directory. # It tries to set it for 5 seconds. # If the master lock is set after those 5 seconds, # the function will sleep random amount of time (up to 1 second) # and will try again by calling itself recursively. # # Notice that after calling this function the object will stay locked till # this lock is removed. This lock is not cleared by the deadlock cleanup # function. Therefore, if the master-lock not removed and the process exits # you can kiss your object good-bye. You will need to violently remove the lock. # # There is no removeMasterLock function. To remove the lock you simply rmdir. # This lock is made to prevent two processes from setting process-specific lock # at the same time. Therefore, one should simply delete the directory once done # setting (or removing) process-specific lock. # # Parameters: # DirFullPath - The full path of the object directory. # # Return value: # This function returns only after setting the lock. If it returned the # directory was successfully locked. # __locks_setMasterLock() { local DIR_FULL_PATH=$1 local tries=0 while [[ $tries -lt 50 ]] ; do # Creating the directory to lock mkdir -p "$DIR_FULL_PATH" # Try to set the master lock mkdir "$DIR_FULL_PATH/.lock" >/dev/null 2>&1 && return sleep 0.1 let "tries++" done if [[ $tries -eq 50 ]] ; then rmdir "$DIR_FULL_PATH/.lock" sleep $(echo "" | awk '{srand(); print rand()}') __locks_setMasterLock "$DIR_FULL_PATH" fi } libbash-0.9.11/lib/colorReset.man0000644000175000017500000000002211233565131013505 00000000000000.so man3/colors.3 libbash-0.9.11/lib/dirDestroyLock.man0000644000175000017500000000002111233565131014324 00000000000000.so man3/locks.3 libbash-0.9.11/lib/hashGet.man0000644000175000017500000000002511233565131012752 00000000000000.so man3/hashstash.3 libbash-0.9.11/lib/hashRemove.man0000644000175000017500000000002511233565131013470 00000000000000.so man3/hashstash.3 libbash-0.9.11/lib/printOK.man0000644000175000017500000000002411233565131012754 00000000000000.so man3/messages.3 libbash-0.9.11/lib/getopts.man0000644000175000017500000001066411247024333013065 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt GETOPTS \&3 "libbash getopts Library Manual" .\" .Sh NAME .\" .\" .Nm getopts .Nd libbash library for command line parameters parsing .\" .\" .Sh SYNOPSIS .\" .\" .Ft $retval .Cm getopt_long .Aq Instructions .Aq Parameters .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled This is a documentation for .Em libbash getopts library, that implements .Em getopt_long function for .Xr bash 1 . For documentation of bash getopts function, please see .Xr getopts 1 ( .Xr getopts 1posix on some systems). .Pp Here is a table for reference: .Bl -tag -compact -width 1234567891234567 .It Xr getopts 1 (or 1posix on some systems) implemented by .Em bash .It Xr getopts 3 implemented by .Em libbash . .It Xr getopt 1 implemented by getopt utils (part of util-linux) .It Xr getopt_long 1 implemented by .Em libbash and installed to section 1 instead of 3 to prevent collision with C man pages. .It Xr getopt 3 implemented by GNU C library. .It Xr getopt_long 3 implemented by GNU C library. .El I have also seen separate getopt utility which part of util-linux package. .Pp The .Em getopt_long function parses the command line arguments. It uses .Fa Instructions as the rules for parsing the .Fa Parameters . .Ed .\" .Ss The Instructions A string that specifies rules for parameters parsing. The instructions string is built of a group of independent instructions, separated by a white space. Each instruction must have the following structure: .Pp .Sy -|--->[:] .Pp This structure contains three parts: .Bl -tag -width 12345 .It Sy - This is the parameter single-letter sign. For example .Fl h . .Pp .It Sy -- This is the parameter's corresponding multi-letter sign. For example .Fl -help . .Pp .It Sy [:] This is the name of the variable that will contain the parameter value. For example: .Sy HELP . .Pp The Variable name can represent one of two variables types: .Bl -tag -width 123 .It Sy Flag variable Li (not followed by Ql \&: ) In this case, it will hold the value 1 if .Ql on (i.e. was specified on command line) and will not be defined if .Ql off . .It Sy Value variable Li (followed by Ql \&: ) In this case, the value it will hold is the string that was given as the next parameter in the .Fa Parameters string (Separated by white-space or .Ql = ). If input contains more then one instance of the considered command line option, an array of the given parameters will be set as the value of the variable. .El .El .\" .Ss The Parameters The .Fa Parameters are simply the parameters you wish to parse. .\" .\" .Sh RETURN VALUE .\" .\" This function returns a string that contains a set of variables definitions. In order to define the variables, this string should be given as a parameter to .Em eval function. This value is returned in the variable .Fa $retval . .\" .\" .Sh EXAMPLES .\" .\" Parse command line parameters looking for the flags .Fl h | Fl -help and .Fl v | Fl -version and for the value .Fl p | Fl -path : .Bd -literal -offset indent getopt_long '\-h|\-\-help\->HELP \-v|\-\-version\->VERSION \-p|\-\-path\->PATH:' $* eval $retval .Ed .Pp In this example, for the parameters .Sy --help --path=/usr/ the variables that will be created are: .Bd -literal -offset indent HELP=1 PATH=/usr/ .Ed .\" .Pp for the parameters .Sy --help --path=/usr --path=/bin the variables that will be created are: .Bd -literal -offset indent HELP=1 PATH=(/usr /bin) .Ed .\" .\" .Sh BUGS .\" .\" .Bd -filled .Pp Values must not contain the string `__getopts__'. This string will be parsed as a single white-space. .Pp A value should not start with an already defined multi-letter sign. If such a value exists, it will be treated as the equivalent singe-letter sign. This bug only accures when using a single-letter sign, or a multi-letter sign that are not followed by a `='. For example: If we have a script named `foo', and we parse the parameters `\-d|\-\-dir:' and `\-f|\-\-file:', then .Bd -literal -offset indent foo \-d \-\-file .Ed and .Bd -literal -offset indent foo \-\-dir \-\-file .Ed will not work .Bd -literal -offset indent foo \-\-dir=\-\-file .Ed will work. .Ed .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr getopt_long 1 , .Xr getopts 1 , .Xr getopt 1 , .Xr libbash 1 , .Xr getopt 3 , .Xr getopt_long 3 .\" .\" libbash-0.9.11/lib/locks.man.in0000644000175000017500000001413111233565131013112 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt LOCKS \&3 "libbash locks Library Manual" .\" .Sh NAME .\" .\" .Nm locks .Nd libbash library that implements locking (directory based). .Pp .Sy This library is not throughoutly tested - use with caution! .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 123456789012345 .\" .It Cm dirInitLock .Aq object .Op Aq spin .\" .It Cm dirTryLock .Aq object .\" .It Cm dirLock .Aq object .\" .It Cm dirUnlock .Aq object .\" .It Cm dirDestroyLock .Aq object .\" .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Nm is a collection of functions that implement locking (mutex like) in bash scripting language. The whole idea is based on the fact that directory creation/removal is an atomic process. The creation of this library was inspired by studying CVS locks management. .Pp Same lock object can by used by several processes to serialize access to some shared resource. (Well, yeah, this what locks were invented for...) To actually do this, processes just need to access lock object by the same name. .Pp .Ss Functions list: .Bl -tag -width hashdelete12345 -offset ident .It Sy dirInitLock Initialize a lock object for your proccess .It Sy dirTryLock Try to lock the lock object - give up if its already locked .It Sy dirLock Lock the lock object - will block until object is unlocked .It Sy dirUnlock Unlock the lock object .It Sy dirDestroyLock Destroy the lock object - free resources .El .Pp Detailed interface description follows. .\" .\" .Sh FUNCTIONS DESCRIPTIONS .\" .\" dirInitLock SUBSECTION .Ss Cm dirInitLock Ao Ns Fa object Ns Ac Bq Aq Ns Fa spin Ns .\" Initialize a lock object for your process. Only after a lock is initialized, your proccess will be able to use it. .\" .Sy Notice: This action does not lock the object. .Pp The lock can be set on two types of objects. The first is an existing directory. In this case, Aq dir must be a path (relative or full). The path must contain a .Ql / . The second is an abstract object used as a lock. In this case, the name of the lock will not contain any .Ql / . This can be used to create locks without creating real directories for them. .\" .Sy Notice: Do not call your lock object .Ql .lock . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The name of the lock object (either existing directory or abstract name) .It Aq Ns Fa spin Ns Li The time (in seconds) that the funtion .Em dirLock will wait between two runs of .Em dirTryLock . This parameter is optional, and its value generally should be less then 1. If ommited, a default value (0.01) is set. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 1 The action failed. You do not have permissions to preform it. .It Sy 3 The directory path could not be resolved. Possibly parameter does contain .Ql / , but refers to directory that does not exist. .El .Ed .\" .\" .\" dirTryLock SUBSECTION .Ss Cm dirTryLock Aq Ns Fa object Ns Li .\" Try to lock the lock object. The function always returns immediately. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The object that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 1 The action failed. The object is already locked. .It Sy 2 The action failed. Your proccess did not initialize a lock for the object. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .\" dirLock SUBSECTION .Ss Cm dirLock Aq Ns Fa object Ns Li .\" Lock given lock object. If the object is already locked - the function will block untill the object is unlocked. After each try (dirTryLock) the function will sleep for spin seconds (spin is defined using .Em dirInitLock ). .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The directory that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 2 The action failed. Your proccess did not initialize a lock for the directory. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .\" dirUnlock SUBSECTION .Ss Cm dirUnlock Aq Ns Fa dir Ns Li .\" Unlock the lock object. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The object that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 2 The action failed. Your proccess did not initialize the lock. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .\" dirDestroyLock SUBSECTION .Ss Cm dirDestroyLock Aq Ns Fa object Ns Li .\" Destroys the lock object. After this action the proccess will no longer be able to use the lock object. To use the object after this action is done, one must initialize the lock, using .Em dirInitLock . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa object Ns Li The directory that the lock is set on. .El .Pp Return Value: .Bd -filled -offset 12 One of the following: .Bl -tag -width 123 -compact .It Sy 0 The action finished successfully. .It Sy 1 The action failed. The directory is locked by your own proccess. Unlock it first. .It Sy 2 The action failed. Your proccess did not initialize the lock. .It Sy 3 The directory path could not be resolved. .El .Ed .\" .\" .Sh EXAMPLES .\" .\" Creating an abstract lock named mylock, with 0.1 second spintime: .D1 $ dirInitLock mylock 0.1 # $?=0 Locking it: .D1 $ dirLock mylock # $?=0 Trying once to lock it again: .D1 $ dirTryLock mylock # $?=1 Trying to lock it again: .D1 $ dirLock mylock # Will wait forever Unlocking: .D1 $ dirUnlock mylock # $?=0 Destroying the lock: .D1 $ dirDestroyLock mylock # $?=0 Trying to lock again: .D1 $ dirLock mylock # $?=2 Creating a lock on the directory ./mydir, with default spin time: .D1 $ dirInitLock ./mydir # $?=0 .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/getopts.sh0000754000175000017500000002240111201604772012717 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # $Date: 2009-05-10 20:08:10 +0300 (Sun, 10 May 2009) $ # $Author: hai-zaar $ # # This bash library implements the function getopt_long. # This function is used to parse command line parameters. # There are two types of command line parameters: # Flag parameters - Have no value after them, They are either on or of. # Value parameters - Have a value after them. # If no value is give after this kind of parameter, # a NULL value will be assined, and an error will be show. # NOTE: If -a is a value parameter, and you will run -a -b, # -b will be assined as the value of -a. Moreover, it will not be treated as # a flag/value parameter in this case. #------------------------------------------------------------------------- #EXPORT=getopt_long #REQUIRE=hashSet hashGet #------------------------------------------------------------------------- ############################################################### ################## SERVICE FUNCTIONS ################### ############################################################### # # $retval parseParams (internal) # # This function goes over the parameters and creates a string that contains # variables definitions. If there's a value after the letter parameter, it # will be given to it. Else, a "1" will be set. # Example: For instructions="h Help p Path", OptsString="hp:", # when the parameters are --help --path "/etc/", # it will return Help=1; Path=/etc/; # # Parameters: # OptsString # A string that contains parameter letter in getopt(1) format. # If a parameter should have a value after it, its letter will # be followed by ":". # Example: For the parameters -h and -p , the string will be "hp:" # See getopt(1) man page for more info # # Instructions # These are the parsing instructions in their last version. \n # They must be in the form: - # # Rest-Of-The-Parameters # This is the rest of the $* of this function (we'll call shift). # getopt(1) always works on $*, so it will work on these. # # Return value: # A string that contains a set of variable definitions. \n # Those variable definitions will become variables, \n # if the calling progam will run \c eval on the return value. # __getopts_parseParams() { local GotError=0 local Params="" local OptsString=$1 Instructions=($2) local HashName=GivenParameters shift 2 while getopts "$OptsString" Param ; do [[ $Param == "?" ]] && GotError=1 && continue retval="" hashGet $Param $HashName 1>/dev/null 2>&1 # Build a hash of the options given hashSet "$retval ${OPTARG:-1}" $Param $HashName done for VarIndex in `seq 1 2 ${#Instructions[*]}`; do let OptionIndex=${VarIndex}-1 local Option=${Instructions[OptionIndex]} local CurrVarName=${Instructions[VarIndex]} # Get the option from the hash hashKeys $HashName if [[ "$retval" = *" $Option "* ]] ; then retval="" hashGet $Option $HashName if [[ $retval ]] ; then Params="$Params $CurrVarName='$retval';" fi fi done retval=$Params return $GotError } # # $retval createSingleCharParams (internal) # # This function translates the parameters. That is, any multi-letter parameter name will be # replaced by it's single-letter name. # # Parameters: # Instructions # These are the parsing instructions in their last version. # They must be in the form: # -|---> # # Params # The params to translate # # Return value: # The parameters, using only single-letter options. __getopts_createSingleCharParams() { local ParsingInstructions=$1 shift local Params="$@" local ParsedParams="" for curr_param in $Params ; do # Go over the parsing instructions for Instruction in $ParsingInstructions ; do # Find the names of the paremeter (exaample: -h|--help) CurrParamName="${Instruction%->*}" # Find the single-letter parameter that must be first (exaample: -h) SingleLetterName="${CurrParamName%|*}" # Find the multi-letter parameter that must be second (exaample: --help) MultiLetterName="${CurrParamName#*|}" # Replace the multi letter parameter that has `=' after it with a single letter parameter # that has a ` ' after it. curr_param="$(sed -e "s/^$MultiLetterName\(=\|$\)/ $SingleLetterName /g" <<< $curr_param)" done ParsedParams="$ParsedParams $curr_param" done retval="$ParsedParams" } # # $retval[2] buildGetOptsData (internal) # # This function builds the data needed for getopts (See return values). # # Parameters # Instructions # These are the parsing instructions in their last version. # They must be in the form: # -|---> # # Return value: # An array with two values, where: # Index0 - The optsring needed for the bash builtin getopts (See man bash). # Index1 - Translated instractions. That is, the same instructions, presented as a sequense of # couple. The first value in a couple is the parameter single-letter name. # The second is the variable name for the value of that parameter. __getopts_buildGetOptsData() { local ParsingInstructions="$@" local Instructions="" local OptsString="" # Go over the parsing instructions for Instruction in $ParsingInstructions ; do # Find the single-letter parameter that must be first (exaample: h) local SingleLetterName=${Instruction%|*} SingleLetterName=${SingleLetterName#*-} # Add the 1 letter name to the opts-string OptsString=${OptsString}${SingleLetterName} # Find the name of the wanted variable name, that comes after a '=' (example: h|help->Help) local WantedVarName=${Instruction#*->} # Check if the parameter should have a following value # A ':' at the end of it's name indicates that (example: -p|--path->Path:) if [[ "$WantedVarName" = *: ]] ; then # Add the ':' to the OptsString OptsString="${OptsString}:" # Remove the ':' from the variable name WantedVarName=${WantedVarName%:*} fi Instructions="${Instructions}${SingleLetterName} ${WantedVarName} " done retval=("$OptsString" "$Instructions") } ############################################################## ################### MAIN FUNCTIONS #################### ############################################################## # # $retval getopt_long # # Intented to parse command line parameters. # # Parameters: # ParsingInstructions # The instructions for parsing # Each instruction is in the form of: # |->[:] # For example: -h|--help->Help # The ':' after variable name indicates that the variable must have # value, otherwise variable is flag (is set to 1 if exists and 0 otherwises). # # Params # The parameters to parse (usually from command line). # # Return value: # A string that contains variables definitions, according to the parameters. # This string should be evaluated (eval $retval). # The return value is set to the variable name $retval. # For example, when the are -h|--help->Help -p|--path->Path:, # and are -h --path=/etc/, # it will return 'Help=1; Path=/etc/;' # When a value parameter apears more than once an array is created. That is, if # are -h|--help->Help -p|--path->Path:, and are # -h --path=/etc/ --path=/bin # it will return 'Help=1; Path=( /etc /bin );' # getopt_long() { local GotError=0 ParsingInstructions=$1 shift local Params="" for param in "$@" ; do # Replace spaces with "__getopts__". This makes it much easier to handle the values. Params="$Params ${param// /__getopts__}" done __getopts_createSingleCharParams "$ParsingInstructions" $Params Params=$retval __getopts_buildGetOptsData $ParsingInstructions __getopts_parseParams "${retval[0]}" "${retval[1]}" $Params # Step by step: # 1. Replacing the first "=' " with "=('" # This starts an array using ( and starts the first string using "'" # 2. Replacing each splace with a "' '". At this point spaces will be # only between two values. This terminated the first string, and starts # the next one. # 3. Replace any "__getopts__" with a space. This puts the spaces we removed # before back in place. # 4. Replacing the ";" with ");". This way we close the array, and end the # current command. retval="$(echo $retval | sed -e "s/=' /=('/g" \ -e "s/; */;/g" \ -e "s/ /' '/g" \ -e "s/__getopts__/ /g" \ -e "s/;/);/g")" return $GotError } libbash-0.9.11/lib/printWAIT.man0000644000175000017500000000002411233565131013207 00000000000000.so man3/messages.3 libbash-0.9.11/lib/dirInitLock.man0000644000175000017500000000002111233565131013576 00000000000000.so man3/locks.3 libbash-0.9.11/lib/colorPrint.man0000644000175000017500000000002211233565131013517 00000000000000.so man3/colors.3 libbash-0.9.11/lib/colors.sh0000644000175000017500000000536211201604772012540 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # $Date: 2009-05-10 20:08:10 +0300 (Sun, 10 May 2009) $ # $Author: hai-zaar $ # # Simple library that implements interface for colorfull tty printouts # #------------------------------------------------------------------------- #EXPORT=colorSet colorReset colorPrint colorPrintN #REQUIRE= #------------------------------------------------------------------------- # Internal constants __colors_GREEN="\\033[1;32m" __colors_RED="\\033[1;31m" __colors_YELLOW="\\033[1;33m" __colors_WHITE="\\033[0;39m" __colors_DefaultIndent=60 ################### #### FUNCTIONS #### ################### # # __colors_ident __colors_ident [INDENT] # # Shifts curret to INDENT position. # # Parameters: # INDENT - Column to indent to. Defaults to 60. __colors_ident() { local DefaultIndent=60 local INDENT=${1:-$DefaultIndent} echo -en "\\033[${INDENT}G" } # # colorSet colorSet # # Sets the color of the tty prints to COLOR. # # Parameters: # COLOR - The new color for tty prints. colorSet() { eval "local WantedColor=\"\$__colors_$(echo $1 | tr a-z A-Z)\"" if [[ WantedColor == "" ]] ; then echo "colors: Warning: Color $1 is not listed in the colors list." 1>&2 return 1 fi echo -en "$WantedColor" } # # colorReset colorReset # # Resets tty color to normal # colorReset() { # Reset text attributes to normal tput sgr0 } # # colorPrint colorPrint [INDENT] # # Prints TEXT in the color COLOR while shifting curret to INDENT # # Parameters: # COLOR - The color for the tty print. # TEXT - The text to be printed in the color COLOR. # INDENT - Move curret to INDENT before printing colorPrint() { # If INDENT parameter given - respect it. echo $1 |grep -q '^[0-9][0-9]*$' && __colors_ident $1 && shift local COLOR=$1 shift colorSet $COLOR || return 1 echo -en "$@" # Reset text attributes to normal tput sgr0 } # # colorPrintN colorPrintN [INDENT] # Same as colorPrint but prints trailing \n as well # colorPrintN() { colorPrint $* echo } libbash-0.9.11/lib/urlcoding.man.in0000644000175000017500000000461411233565131013772 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt URLCODING \&3 "libbash urlcoding Library Manual" .\" .Sh NAME .\" .\" .Nm urlcoding .Nd a Libbash library for encoding and decoding URL's. .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 12345678900 .\" .It Cm urlEncodeString Bo Ns Fa -l Ns Bc Aq Ns Fa STRING Ns .It Cm urlEncodeFile Bo Ns Fa -l Ns Bc Aq Ns Fa FILE Ns .It Cm urlEncodeStream Bo Ns Fa -l Ns Bc .It Cm urlDecodeString Aq Ns Fa STRING Ns .It Cm urlDecodeFile Aq Ns Fa FILENAME Ns .It Cm urlDecodeStream .\" .El .\" .\" .Sh DESCRIPTION .\" .Bd -filled .Nm is a collection of functions that convert ASCII-text to standard URL's and vice-versa. The AWK code used is based on code by Heiner Steven .Pp The function list: .Bl -tag -compact -width colorprint12345 -offset indent .It Sy urlEncodeString Creates a URL from an ASCII string .It Sy urlEncodeFile Converts a file into URL-valid text .It Sy urlEncodeStream Converts standard input into URL-valid text .It Sy urlDecodeString Converts a URL-encoded text back to a plain-text form .It Sy urlDecodeFile Coverts URL-encoded text in a file back to plain text .It Sy urlDecodeStream Converts URL-encoded standard input to text .El .Ed .Pp Detailed interface description follows. .\" .Pp The .Op Em -l option for the encoding functions should be used when line-feed characters ('\en') are to be encoded as well. .Pp All functions print the results of their conversions to standard output. .Pp The exit status of all functions is that of the command 'awk', with '0' for success .Pp .\" .Sh FUNCTIONS DESCRIPTIONS .Pp .Ss Cm urlEncodeString Bo Ns Fa -l Ns Bc Aq Ns Fa STRING Ns .\" Converts .Em STRING - a string of ASCII characters - to URL. .Pp .\" .\" .Ss Cm urlEncodeFile Bo Ns Fa -l Ns Bc Aq Ns Fa FILE Ns .\" Coverts .Em FILE of URL-encoded text to plain text .\" .Ss Cm urlEncodeStream Bo Ns Fa -l Ns Bc .\" Converts text from standard input to URL-text. .Pp .\" .Ss Cm urlDecodeString Aq Ns Fa STRING Ns .\" Converts URL-encoded string .Em STRING back to text. .Pp .\" .Ss Cm urlDecodeFile Aq Ns Fa FILENAME Ns .\" Converts the URL-encoded text in .Em FILE to plain text. .Pp .\" .Ss Cm urlDecodeStream .\" Converts the URL-encoded text from standard input to plain-text .Pp .\" .\" .\" .\" .Sh AUTHORS .\" .\" .An "Alon Keren" Aq alon.keren@gmail.com .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/hashstash.man0000644000175000017500000001310511247024333013357 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt HASHSTASH \&3 "libbash hashstash Library Manual" .\" .Sh NAME .\" .\" .Nm hashstash .Nd libbash library that implements hash data structure .\" .\" .Sh SYNOPSIS .\" .Bl -tag -compact -width 12345678901234567 .\" .It Cm hashSet .Aq Value .Aq Key .Aq HashName .Op SubHashName Op ... .\" .It Ft $retval Cm hashGet .Aq Key .Aq HashName .Op SubHashName Op ... .\" .It Ft $retval Cm hashKeys .Aq HashName .Op SubHashName Op ... .\" .It Cm hashRemove .Aq Key .Aq HashName .Op SubHashName Op ... .\" .It Cm hashDelete .Aq HashName .Op SubHashName Op ... .\" .\" .El .\" .\" .Sh DESCRIPTION .\" .\" GENERAL .Ss General .Bd -filled .Nm is a collection of functions that implement basic hash data-structure in bash scripting language. .Pp The function list: .Bl -tag -compact -width hashdelete12345 -offset indent .It Sy hashSet Adds a value to the hash .It Sy hashGet Returns a value from the hash .It Sy hashKeys Returns a list of keys of the hash .It Sy hashRemove Removes a key from the hash .It Sy hashDelete Deletes a hash .El .Ed .Pp Detailed interface description follows. .\" .Sh FUNCTIONS DESCRIPTIONS .\" hashSet SUBSECTION .Ss Cm hashSet Ao Ns Fa Value Ns Ac Ao Ns Fa Key Ns Ac Ao Ns Fa Hashname Ns Ac Op SubHashName Op ... .\" Adds a value to the hash. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa Value Ns The value to set in .Fa HashName Ns Bo Fa Key Bc . .It Aq Ns Fa Key Ns The key for the value .Fa Value . .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the "father hash" name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp .Fa Value will be the value of the key .Fa Key in the hash .Fa HashName . For example if you have (or want to define) hash .Em C , which is subhash of hash .Em B , which is subhash of hash .Em A , and .Em C has a key named .Em ckey1 with value .Em cval1 , then you should use: .D1 Sy hashSet cval1 ckey1 A B C .\" .\" hashGet SUBSECTION .Ss Ft $retval Cm hashGet Ao Ns Fa Key Ns Ac Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Returns the value of .Fa Key in .Fa HashName to the .Ft $retval variable. .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Aq Ns Fa Key Ns The key that hold the value we wish to get. .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp Return Value: .Bd -filled -offset 12 -compact The value of the key .Fa Key in the hash .Fa HashName . The value is returned in the variable .Ft $retval . .Ed .\" .\" hashKeys SUBSECTION .Ss Ft $retval Cm hashKeys Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Returns a list of keys of the hash .Fa HashName in the variable .Ft $retval . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp Return Value: .Bd -filled -offset 12 The value of the key .Fa Key in the hash .Fa HashName . The value is returned in the variable .Ft $retval . .Ed .\" .\" hashRemove SUBSECTION .Ss Cm hashRemove Ao Ns Fa Key Ns Ac Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Removes the key .Fa Key from the hash .Fa HashName . .Bl -tag -width 1 -offset 12 .It Aq Ns Fa Key Ns The key we wish to remove from .Fa HashName . .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp This function should also be used to remove a sub-hash from its .Qq father hash . In that case, the .Fa key will be the name of the sub-hash. .\" .\" hashDelete SUBSECTION .Ss Cm hashDelete Ao Ns Fa HashName Ns Ac Op SubHashName Op ... .\" Deletes the hash .Fa HashName Op SubHashName Op ... . .Pp Parameters: .Bl -tag -width 1 -offset 12 .It Ao Ns Fa HashName Ns Ac Op SubHashName Op ... A string that contains the name of the hash. If the hash is a sub hash of another hash, the .Qq father hash name MUST BE WRITTEN FIRST, followed by the sub-hash name. .El .Pp If this function is used on a sub-hash, a key with the name of the sub-hash will remain in its .Qq father hash and will hold a NULL value. .\" .\" .\" .\" .Sh BUGS .\" .\" .Bd -filled .Pp A hash name can only contain characters that are valid as part of bash variable names (i.e. a-zA-Z0-9_). The same applies for hash keys. .Pp As for now, there is no way of knowing if a key represents a value or a sub-hash. If a sub-hash will be used as a key, the returned value will be its keys list. .Ed .\" .\" .Sh EXAMPLES .\" .\" Define hash table .Em hashA with key .Em Akey1 with value .Em Aval1 use: .Dl Sy % hashSet Aval1 Akey1 Ahash Now: .Dl Sy % hashGet Akey1 Ahash .Dl Sy % echo $retval .Dl Sy Aval1 .Dl Sy % hashKeys Ahash .Dl Sy % echo $retval .Dl Sy Akey1 .Dl Sy % .\" .\" .Sh HISTORY .\" .\" .Bd -filled The idea to write .Nm library appeared when we've discovered the full power of the bash .Em eval function. .Pp As of the name .Nm , it has two meanings. The first, it means .Ql stash of hash functions. The second is, that .Nm contains subhashes inside, so it looks like stash of packed information. .Ed .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .Xr ldbash 1 , .Xr libbash 1 libbash-0.9.11/lib/hashstash.sh0000644000175000017500000001651011201604772013222 00000000000000# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Do not run this script directly! # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # $Date: 2009-05-10 20:08:10 +0300 (Sun, 10 May 2009) $ # $Author: hai-zaar $ # # Set of fuctions that implement hash data structure. # Each hash can have both keys and subhashes. # WARNING: # You can not have key and subhash with the same name. # Its because, we do not have actual data types. I.e. you can call # hashGet on hash with its subhash as key - it will return list of subhash's keys. # # Hash Variables # The hash variable is transparent to the user of these functions. # Such variables should be used only through the functions. # Each "hash variable" holds a list of keys. # For example: The variable for the hash DIR that holds the `keys' `etc' `bin' `lib' # will be: _HASH_DIRS_=" etc bin lib " # Notice that before and _after_ every key there must be a white space (can be more then one). # # Key Variables # The key value is held in a variable that is named ${HashName}${Key}_. # Note trailing `_') in ${HashName}. # For example: The value of the key `etc' of the hash DIR will be in the variable _HASH_DIRS_etc_. # Notice that this name can also be the name of a hash named DIRS_etc. # The key variable is also transparent to the user of these functions. # These variables should be used only through the functions. # # Sub-Hashes # A sub-hash is a hash key that holds a keys list. # This way, if you set a hash key value to be a list in the suitable form, # it can be used as a "sub hash". # Use of hashSet ensures that the list will be in the right form. #------------------------------------------------------------------------- #EXPORT=hashGet hashSet hashKeys hashDelete hashRemove #REQUIRE= #------------------------------------------------------------------------- # The prefix of the hashes variables. # NOTE: Do not name any of your variables _HASH_* PREFIX="__hash_" # # DEBUG=1 - If DEBUG will not be commented, debug printouts will be enabled #DEBUG=1 ################### #### FUNCTIONS #### ################### # # hashSet [SubHashName [...] ] # # Adds a value to the hash. Value will be the value of the key Key in the hash HashName. # For example if you have (or want to define) hash C, which is subhash of hash B, # which is subhash of hash A and C has key ckey1 with value cval1, then you should run: # hashSet cval1 ckey1 A B C # # Parameters: # Value - The value to set in HashName[Key]. # Key - The key for the value Value. # HashName # [SubHashName [...] ] # A string that contains the name of the hash. # If the hash is a sub hash of another hash, the "father hash" # name MUST BE WRITTEN FIRST, followed by the sub-hash name. hashSet() { local Value=$1 local Key=$2 shift 2 # Parse the key variable name ${PREFIX}_${HashName}_${SubHashName}_..._${Key}_ # Example: For the parameters "VALUE1 KEY1 DIRS ETC ", the variable name will be _HASH_DIRS_ETC_KEY1_ local ParamsString="$*" local HashName=${PREFIX}${ParamsString// /_}_ local KeyVarName=${HashName}${Key}_ # Set the value in the key variable test $DEBUG && echo eval "$KeyVarName"'="'$Value'"' 1>&2 eval "$KeyVarName"'="'$Value'"' # Check if the key is not in the keys list hashKeys $* test $DEBUG && echo retval=$retval 1>&2 if ! [[ $retval = *" $Key "* ]] ; then # Add the key to the keys list test $DEBUG && echo eval $HashName'="${'$HashName'}'" $Key "'"' 1>&2 eval $HashName'=${'$HashName'}"'" $Key "'"' fi } # # $retval hashGet [SubHashName [...] ] # Returns the value of Key in HashName in the variable $retval. # # Parameters: # HashName # [SubHashName [...] ] # A string that contains the name of the hash. # If the hash is a sub hash of another hash, the "father hash" # name MUST BE WRITTEN FIRST, followed by the sub-hash name. # See hashSet for example. # Key # The hash key of the value \c Value. # # Return value: # The value of the key Key in the hash HashName. # The value is returned in the variable $retval. hashGet() { local Key=$1 shift # Parse the key variable name ${PREFIX}_${HashName}_${SubHashName}_..._${Key}_ # Example: For the parameters "KEY1 DIRS ETC", the variable name will be _HASH_DIRS_ETC_KEY1_ local ParamsString="$*" local HashName=${PREFIX}${ParamsString// /_}_ local KeyVarName=${HashName}${Key}_ # Put the value of the key in $retval test $DEBUG && echo eval 'retval=${'$KeyVarName'}' 1>&2 eval 'retval=${'$KeyVarName'}' } # # $retval hashKeys [SubHashName [...] ] # # Returns a list of keys of the hash HashName in the variable $retval. # # Parametes: # HashName # [SubHashName [...] ] # A string that contains the name of the hash. # If the hash is a sub hash of another hash, the "father hash" # name MUST BE WRITTEN FIRST, followed by the sub-hash name. # See hashSet for example. # # Return value: # A list of the keys of the hash HashName. # The list is returned in the variable $retval. hashKeys() { # Parse the hash name ${PREFIX}${HashName}_${SubHashName}_... # Example: For the parameters "DIRS ETC" the hash name will be _HASH_DIRS_ETC_ local ParamsString="$*" local HashName=${PREFIX}${ParamsString// /_}_ test $DEBUG && echo eval 'retval=${'$HashName'}' 1>&2 eval 'retval=${'$HashName'}' } # # hashRemove [SubHashName [...] ] # # Removes the key Key from the hash HashName # # Parameters: # HashName # [SubHashName [...] ] # A string that contains the name of the hash. # If the hash is a sub hash of another hash, the "father hash" # name MUST BE WRITTEN FIRST, followed by the sub-hash name. # See hashSet for example. # Key # The hash key that gets the value Value. hashRemove() { local Key=$1 shift # Parse the hash name ${PREFIX}${HashName}_${SubHashName}_... # Example: For the parameters "DIRS ETC" the hash name will be _HASH_DIRS_ETC_ local ParamsString="$*" local HashName=${PREFIX}${ParamsString// /_}_ local KeyVarName=${HashName}${Key}_ # unset the key variable eval "unset ${KeyVarName}" # Remove the key from the hash eval $HashName'=${'$HashName'//' $Key '/}' } # # hashDelete [SubHashName [...] ] # # Deletes the hash HashName [ SubHashName [...]] # # Parameters: # HashName # [SubHashName [...] ] # A string that contains the name of the hash. # If the hash is a sub hash of another hash, the "father hash" # name MUST BE WRITTEN FIRST, followed by the sub-hash name. # See "hashSet" for example. hashDelete() { # Parse the hash name ${PREFIX}${HashName}_${SubHashName}_... # Example: For the parameters "DIRS ETC" the hash name will be _HASH_DIRS_ETC_ local ParamsString="$*" local HashName=${PREFIX}${ParamsString// /_}_ # unset the hash variable unset `eval '${'$HashName'}'` } libbash-0.9.11/lib/hashKeys.man0000644000175000017500000000002511233565131013146 00000000000000.so man3/hashstash.3 libbash-0.9.11/lib/printFAIL.man0000644000175000017500000000002411233565131013156 00000000000000.so man3/messages.3 libbash-0.9.11/tests/0000777000175000017500000000000011247024335011356 500000000000000libbash-0.9.11/tests/Makefile.am0000644000175000017500000000005211233310657013323 00000000000000 EXTRA_DIST = locks.sh TESTS = locks.sh libbash-0.9.11/tests/Makefile.in0000644000175000017500000002335511247024317013347 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DOXYGEN = @DOXYGEN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdate = @docdate@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = locks.sh TESTS = locks.sh all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libbash-0.9.11/tests/locks.sh0000754000175000017500000002176711233310657012760 00000000000000#!/bin/bash ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # Test suite for libbash locks library # # First of all, install libbash in an install directory SOURCE="source ../lib/locks.sh; source ../lib/getopts.sh; source ../lib/messages.sh; source ../lib/hashstash.sh; source ../lib/colors.sh" eval $SOURCE LOCKS_DIR=/tmp/.dirlocks-$USER [[ ${__locks_DEBUG_MODE} ]] && echo "MYPID=$$" exit_status=0 echo "Sequence 1: dirInitLock" echo -en "\tTEST 1: Initialize a lock - no spin" mkdir -p /tmp/MyLock && \ dirInitLock /tmp/MyLock && \ [[ $(cat $LOCKS_DIR/tmp/MyLock/$$.spin) == "${__locks_DEFAULT_SLEEP_TIME}" ]] && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 2: Initialize it again with spin 5" dirInitLock /tmp/MyLock 5 && \ [[ $(cat $LOCKS_DIR/tmp/MyLock/$$.spin) == "5" ]] && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 3: Initialize a second lock" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock /tmp/MyLock && \ printOK || (printFAIL && exit_status=1) ' echo -en "\tTEST 4: Initialize a lock on a sub-directory" mkdir -p /tmp/MyLock/SubLock && \ dirInitLock /tmp/MyLock/SubLock && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 5: Initialize a lock on a parent-directory" mkdir -p /tmp && \ dirInitLock /tmp && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 7: Initialize a lock on a non-existing dir" non_existing="/non_existing" while [[ -e $non_existing ]] ; do non_existing=${non_existing}${non_existing} done dirInitLock $non_existing && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 8: Initialize a non-existing dir with illegal name" non_existing="/\.\./../\\\\\/non_existing/" while [[ -e $non_existing ]] ; do non_existing=${non_existing}${non_existing} done echo $non_existing ! dirInitLock $non_existing && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 8: Initialize a lock on an 'object'" dirInitLock MyObj && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 9: Initialize a lock on a file" touch /tmp/MyLock/MyFile dirInitLock /tmp/MyLock/MyFile && \ printOK || (printFAIL && exit_status=1) echo "Sequence 2: dirTryLock" echo -en "\tTEST 1: Try lock an uninitialized lock - unlocked" dirTryLock NoLock [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] && printOK || (printFAIL && exit_status=1) echo -en "\tTEST 2: Try lock an initialized lock - unlocked" dirTryLock MyObj printOK || (printFAIL && exit_status=1) echo -en "\tTEST 3: Try lock an uninitialized lock - locked" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirTryLock MyObj [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] ' && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 4: Try lock an initialized lock - locked by me" dirTryLock MyObj [[ $? == ${__locks_ERR_DIR_IS_LOCKED} ]] && printOK || (printFAIL && exit_status=1) echo -en "\tTEST 5: Try lock an initialized lock - locked by someone else" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock MyObj && dirTryLock MyObj [[ $? == ${__locks_ERR_DIR_IS_LOCKED} ]] ' && \ printOK || (printFAIL && exit_status=1) # PREPARING FOR TESTS 6 AND 7 - Creating a leftover lock SOURCE=$SOURCE LOCKS_DIR=$LOCKS_DIR \ bash -c ' eval $SOURCE || exit 1 dirInitLock HisObj && ls $LOCKS_DIR/HisObj > /dev/null 2>&1 && dirTryLock HisObj ' if [[ $? != 0 ]] ; then echo -e "\tPreparations for tests 6 and 7 failed! Skipping!" printATTN else echo -en "\tTEST 6: Try lock an uninitialized lock - there's a leftover lock" dirTryLock HisObj [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] && printOK || (printFAIL && exit_status=1) echo -en "\tTEST 7: Try lock an initialized lock - there's a leftover lock" dirInitLock HisObj && \ dirTryLock HisObj && \ printOK || (printFAIL && exit_status=1) fi echo -en "\tTEST 8: Try lock an initialized file lock - unlocked" dirTryLock /tmp/MyLock/MyFile && \ printOK || (printFAIL && exit_status=1) echo "Sequence 3: dirLock" echo -en "\tTEST 1: Lock an uninitialized lock - unlocked" dirLock NoLock [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] && printOK || (printFAIL && exit_status=1) # PREPARING FOR TEST 2 - removing the lock dirUnlock MyObj if [[ $? != 0 ]] ; then echo -e "\tPreparations for test 2 failed! Skipping!" printATTN else echo -en "\tTEST 2: Lock an initialized lock - unlocked" dirLock MyObj && printOK || (printFAIL && exit_status=1) fi echo -en "\tTEST 3: Lock an uninitialized lock - locked" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirLock MyObj [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] ' && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 4: Lock an initialized lock - locked by someone else" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock MyObj dirLock MyObj ' & dirLockPID=$! echo -en " - (sleeping for 10 seconds)" sleep 10 exec 9>&2 2>/dev/null kill $dirLockPID > /dev/null 2>&1 status=$? tput sgr0 exec 2>&9 [[ $status == 0 ]] && \ printOK || (printFAIL && exit_status=1) # PREPARING FOR TEST 5 - removing the lock dirUnlock MyObj if [[ $? != 0 ]] ; then echo -e "\tPreparations for test 5 failed! Skipping!" printATTN else echo -en "\tTEST 5: Lock an initialized lock - locked by me" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock MyObj dirTryLock MyObj || exit 1 dirLock MyObj ' & dirLockPID=$! echo -en " - (sleeping for 10 seconds)" sleep 10 exec 9>&2 2>/dev/null kill $dirLockPID > /dev/null 2>&1 status=$? tput sgr0 exec 2>&9 [[ $status == 0 ]] && \ printOK || (printFAIL && exit_status=1) fi dirTryLock MyObj if [[ $? != 0 ]] ; then echo -e "\tPreparations for sequence 4 failed! Skipping!" printATTN else echo "Sequence 4: dirUnlock" echo -en "\tTEST 1: Unlock an uninitialized lock - unlocked" dirUnlock NoLock [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 2: Unlock an uninitialized lock - locked" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirUnlock MyObj ' [[ $? == ${__locks_ERR_NO_SPIN_FILE} ]] && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 3: Unlock an initialized lock - locked by someone else" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock MyObj || exit 1 dirUnlock MyObj ' [[ $? == ${__locks_ERR_DIR_IS_LOCKED} ]] && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 4: Unlock an initialized lock - locked by me" dirUnlock MyObj && \ printOK || (printFAIL && exit_status=1) fi echo "Sequence 4: dirDestroyLock" echo -en "\tTEST 1: Destroy an uninitialized lock - unlocked" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirDestroyLock NoLock ' && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 2: Destroy an uninitialized lock - locked" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirDestroyLock MyObj ' && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 3: Destroy an initialized lock - unlocked" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock NoLock dirDestroyLock NoLock ' && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 4: Destroy an initialized lock - locked by me" dirInitLock MyObj && \ dirDestroyLock MyObj && \ printOK || (printFAIL && exit_status=1) echo -en "\tTEST 5: Destroy an initialized lock - locked by someone else" SOURCE=$SOURCE \ bash -c ' eval $SOURCE || exit 1 dirInitLock MyObj dirDestroyLock MyObj ' && \ printOK || (printFAIL && exit_status=1) echo "Sequence 5: Preform final cleanup" [[ ${__locks_DEBUG_MODE} ]] && echo "MYPID=$$" dirInitLock HisObj || (echo "FAILED: dirInitLock HisObj" && exit_status=1) dirInitLock MyObj || (echo "FAILED: dirInitLock MyObj" && exit_status=1) dirInitLock NoLock || (echo "FAILED: dirInitLock NoLock" && exit_status=1) dirUnlock HisObj || (echo "FAILED: dirUnlock HisObj" && exit_status=1) dirUnlock MyObj || (echo "FAILED: dirUnlock MyObj" && exit_status=1) dirUnlock NoLock || (echo "FAILED: dirUnlock NoLock" && exit_status=1) dirDestroyLock HisObj || (echo "FAILED: dirDestroyLock HisObj" && exit_status=1) dirDestroyLock MyObj || (echo "FAILED: dirDestroyLock MyObj" && exit_status=1) dirDestroyLock NoLock || (echo "FAILED: dirDestroyLock NoLock" && exit_status=1) exit $exit_status libbash-0.9.11/mkinstalldirs0000754000175000017500000000653510160244204012736 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2004-02-15.20 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit 0 ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: libbash-0.9.11/configure0000754000175000017500000027010511247024316012042 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for libbash 0.9.11. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libbash' PACKAGE_TARNAME='libbash' PACKAGE_VERSION='0.9.11' PACKAGE_STRING='libbash 0.9.11' PACKAGE_BUGREPORT='libbash-common@lists.sourcefoge.net' ac_unique_file="src/ldbash.in" ac_default_prefix=/usr ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar LN_S DOXYGEN docdate MAKEDOCS_TRUE MAKEDOCS_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libbash 0.9.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libbash] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libbash 0.9.11:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-docs Don't build and install documentation Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libbash configure 0.9.11 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libbash $as_me 0.9.11, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libbash' VERSION='0.9.11' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # # Check for programs we need ############################################################################## { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DOXYGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DOXYGEN="doxygen" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { echo "$as_me:$LINENO: result: $DOXYGEN" >&5 echo "${ECHO_T}$DOXYGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # # Misc ############################################################################## # this is used my html and man pages documentation DOCDATE=`awk --re-interval '/[\t ]{1,}[0-9]{4}-[0-9]{2}-[0-9]{2}/ {print $1; exit}' ChangeLog` DOCDATE=`date -d $DOCDATE "+%B %d, %G"` docdate=$DOCDATE # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then enableval=$enable_doc; DOCS=$enableval else DOCS="yes" fi if test "$DOCS" == "yes" ; then MAKEDOCS_TRUE= MAKEDOCS_FALSE='#' else MAKEDOCS_TRUE='#' MAKEDOCS_FALSE= fi # # Output files ############################################################################## # Makefiles ac_config_files="$ac_config_files Makefile src/Makefile lib/Makefile doc/Makefile m4/Makefile tests/Makefile" # Documentation files [ "$DOCS" == "yes" ] && \ ac_config_files="$ac_config_files doc/Doxyfile doc/main_page.dox" # man pages ac_config_files="$ac_config_files libbash.man lib/colors.man lib/getopts.man lib/hashstash.man lib/locks.man lib/messages.man lib/urlcoding.man src/ldbash.man src/ldbashconfig.man" # Scripts in src ac_config_files="$ac_config_files src/ldbash src/ldbashconfig" # Libraries in lib ac_config_files="$ac_config_files lib/locks.sh" # Misc files ac_config_files="$ac_config_files libbash.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAKEDOCS_TRUE}" && test -z "${MAKEDOCS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAKEDOCS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAKEDOCS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libbash $as_me 0.9.11, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ libbash config.status 0.9.11 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; "doc/main_page.dox") CONFIG_FILES="$CONFIG_FILES doc/main_page.dox" ;; "libbash.man") CONFIG_FILES="$CONFIG_FILES libbash.man" ;; "lib/colors.man") CONFIG_FILES="$CONFIG_FILES lib/colors.man" ;; "lib/getopts.man") CONFIG_FILES="$CONFIG_FILES lib/getopts.man" ;; "lib/hashstash.man") CONFIG_FILES="$CONFIG_FILES lib/hashstash.man" ;; "lib/locks.man") CONFIG_FILES="$CONFIG_FILES lib/locks.man" ;; "lib/messages.man") CONFIG_FILES="$CONFIG_FILES lib/messages.man" ;; "lib/urlcoding.man") CONFIG_FILES="$CONFIG_FILES lib/urlcoding.man" ;; "src/ldbash.man") CONFIG_FILES="$CONFIG_FILES src/ldbash.man" ;; "src/ldbashconfig.man") CONFIG_FILES="$CONFIG_FILES src/ldbashconfig.man" ;; "src/ldbash") CONFIG_FILES="$CONFIG_FILES src/ldbash" ;; "src/ldbashconfig") CONFIG_FILES="$CONFIG_FILES src/ldbashconfig" ;; "lib/locks.sh") CONFIG_FILES="$CONFIG_FILES lib/locks.sh" ;; "libbash.spec") CONFIG_FILES="$CONFIG_FILES libbash.spec" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim LN_S!$LN_S$ac_delim DOXYGEN!$DOXYGEN$ac_delim docdate!$docdate$ac_delim MAKEDOCS_TRUE!$MAKEDOCS_TRUE$ac_delim MAKEDOCS_FALSE!$MAKEDOCS_FALSE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 66; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # prints warning if doxygen was not found if [ "X$DOXYGEN" == "X" ] ; then echo echo echo -e "\tWARNING: doxygen was not found in your path." echo -e "\t html documentation will not be generated." echo echo fi libbash-0.9.11/ChangeLog0000644000175000017500000001274011233571714011711 00000000000000Version 0.9.11 2009-07-28 Hai Zaar * Locks dir is not sits under /tmp/.dirlock-$USER * Fixed man pages to actually show volume name * Greatly simplified locks testing script 2009-05-12 Hai Zaar * Locks dir is not sits under /var/tmp Version 0.9.10c 2009-05-10 Hai Zaar * Fixed GPLv2 leftovers * Debian packaging fixed. * Debian dir is not be part of the release tarball * Copyright year update 2008-06-11 Hai Zaar * Switched to GPLv3. Updated copyright. Version 0.9.10b 2008-06-08 Hai Zaar * Adapted spec file for newer rpm versions 2008-06-08 Hai Zaar * Fixed bug about about handling multi-word options like '--this-is-avery-log-option-name' 2008-06-05 Hai Zaar * Added debianization * Added Makefile.cvs - use instead of autoreconf 2006-07-31 Hai Zaar * Rearragned headers in libraries source files. 2006-07-02 Gil Ran * Fixed inline documentation for locks library Version 0.9.10a 2006-05-04 Gil Ran * getopts.sh: The last getopts change seem to disable the ability to use `-e', `-n' and `-E', being valid `echo' parameters. Fixed. Version 0.9.10 2006-03-04 Gil Ran * getopts.sh: Changed to be able to handle values that contain white spaces. * Updated getopts manpage. 2006-02-19 Gil Ran * getopts.sh: Changed to return 1 if a parameter that is not on the list was given, instead of exiting Version 0.9.9b 2006-01-26 Hai Zaar * During 'make install', ldbashconfig is only run when DESTDIR is not set. * rpm spec file fixes Version 0.9.9a 2006-01-02 Hai Zaar * Added rpm spec file * src/Makefile.am: fixing DESTDIR handling. Version 0.9.9 2005-12-26 Hai Zaar * urlcoding.man.in: Fixed mdoc syntax. Removed 'General' subsection. 2005-12-26 Alon Keren * urlcoding.sh: Removed unneeded '-l' option for decoding functions; the library format is more libbash-standard * documentation: Added man-page for the 'urlcoding' library; Added reference for html documentation 2005-12-22 Hai Zaar * libbash.m4: Changed AC_CHECK_TOOL in favour of AC_PATH_PROG. Added comments and some other cosmetic fixes. 2005-09-18 Alon Keren * ldbash.in, urlcoding.sh: Files are now compatible with bash-2.05a 2005-09-13 Alon Keren * ldbash.in: Fixed a problem with recursive-loading of libraries * New library - 'urlcoding': Adding a library for encoding and decoding URL's. 2005-08-31 Hai Zaar * messages.sh: removed error messages if tty is dumb. Version 0.9.8b 2005-08-29 Hai Zaar * Another man pages updates. * lib/Makefile.am: is now DESTDIR compatible * locks, messages and colors libraries now install their man pages. * added per-function man pages (references) for locks, messages and colors libraries. 2004-08-25 Gil Ran * getopts.sh: Fixed some inline comments. Version 0.9.8a 2005-08-24 Hai Zaar * Removed documentation pages that are not used any more. References updated Version 0.9.8 2005-08-24 Hai Zaar * Added various, mostly cosmetic, changes to man pages, makefiles, configure.ac, etc... * getopts_long.man renamed to getopt_long.man as it should be Version 0.9.7 2005-01-20 Hai Zaar * locks.sh: Enabled support for file names with spaces (` '). * locks.sh: If locking by objects, object name can contain '/'. BUT it should not contain `..' string. * locks.sh: Enhancements in DirDestroyLock * locks.sh: Escape character (`\') is expended before checking wither object name is valid. * Added test for illegal object name. Version 0.9.6 2004-12-29 Gil Ran * Bug fix - locks used to delete its own dirlocks directory in /var/lock if no locks left, and delete /var/lock if it was the only one using it. Version 0.9.5 2004-12-17 Gil Ran * Added AC_CHECK_BASHLIB (installed to /usr/share/aclocal) * locks test suite is reorganized to match autoconf/make standards Version 0.9.4 2004-12-16 Hai Zaar * Added some missing critical automake files Version 0.9.3 2004-12-12 Gil Ran * locks: Fixed single files locking Version 0.9.2 2004-12-09 Hai Zaar * locks: Locking by object was broken - fixed (together with test-suite) * losks: Now able to lock single files and not just dirs 2004-12-08 Gil Ran * Fixed locks library * add test-suite to locks library 2004-11-17 Gil Ran * Re-writen locks - new design 2004-11-14 Hai Zaar * colors lib - added colorReset function * messages lib - default shift is according to the maximum screen width 2004-11-12 Gil Ran * Added manpages for locks, messages and colors 2004-11-10 Gil Ran * Changed to install html documentation * Fixed a bug in getopts - -e parameter now works 2004-11-08 Gil Ran * Enabled hashstash debug messages (printed to STDERR). Version 0.9.1 2004-11-01 Gil Ran * Added --prefix and --help options to ldbashconfig * Added dirDestroyLock function to locks library Version 0.9 2004-10-30 Gil Ran * getopts updated to support multiple options of the same type 2004-10-26 Gil Ran * Added colors library * Added messages library 2004-10-25 Hai Zaar * Changed default installation prefix to /usr * Scheduled ldbashconfig to run during make install 2004-10-14 Gil Ran * Added locks library 2004-10-06 Gil Ran * Updated TODO list * Fixed a bug in ldbashconfig that caused it to fail when there's an old version of sed installed. 2004-08-30 Hai Zaar * Trying to generate html docs only if doxygen is found in path 2004-08-24 Gil Ran * doc: Added a TODO list Version 0.2 2004-08-14 Hai Zaar * Removed invocation of 'ldbashconfig' during 'make install' * Added ChangeLog libbash-0.9.11/src/0000777000175000017500000000000011247024335011003 500000000000000libbash-0.9.11/src/Makefile.am0000644000175000017500000000054411233310657012756 00000000000000AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.in) $(wildcard *.man) bin_SCRIPTS = ldbash sbin_SCRIPTS = ldbashconfig # This creates $(sysconfdir). If this will not be here, the ldbashconfig command will fail. sysconf_DATA = CLEANFILES = ldbash ldbashconfig # installing man pages man1_MANS = ldbash.man man8_MANS = ldbashconfig.man libbash-0.9.11/src/ldbash.in0000644000175000017500000002070511201604772012507 00000000000000#!/bin/bash ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # # Dynamic loader for bash libraries # NOTE: The script can't load libraries if their file name starts with '-'. # (If someone gives a file a name that starts with a '-' he deserves it!) # # The prefix of internal functions INTERNAL_PREFIX='__${Lib}_' prefix=@prefix@ exec_prefix=@exec_prefix@ # The directory that contains the bash libraries LD_BASH_PATH=@libdir@/bash # LD_BASH_CACHE - The ldbash cache file LD_BASH_CACHE=@sysconfdir@/ldbash.cache # EXPORTS and REQUIREMENTS definitions source $LD_BASH_CACHE || exit 1 # We want to use getopt_long... source $LD_BASH_PATH/getopts.sh source $LD_BASH_PATH/hashstash.sh ############################################################# ################### FUNCTIONS #################### ############################################################# # Prints the script's usage. usage() { echo "usage: ldbash" echo " [-h|--help]" echo " [-l|--list]" echo " [-L|--load ]" echo " [-U|--unload ]" echo " [-e|--externlist ]" echo " [--externlist-all]" echo " [-i|--internlist ]" echo " [--internlist-all]" echo " [-v|--version]" exit } # Lists all the available libraries. list() { retval=`(cd $LD_BASH_PATH ; ls *.sh | sed "s/\.sh$//g")` } # # $retval findLibExternalFuncs # # Finds all exported functions of given libraries. # # Parameters: # lib - A name of a bash library # Return value: # A list of external (exported) functions of the given library findLibExternalFuncs() { retval="" # for each lib, find it's external functions local Lib= for Lib in ${*//,/ } ; do eval LibInternalPrefix=$INTERNAL_PREFIX # Add to the retval the name of the lib retval="$retval $Lib: " # Step by step: # Grep functions declarations from the code of given library. # Take just the declaration (looks like: "funcName()") # Remove the '()' # Now throw away the lines that define internal functions retval="$retval"`grep ^"[ |\t]*[a-zA-Z_][0-9a-zA-Z_]*[ |\t]*()" ${LD_BASH_PATH}/${Lib}.sh 2> /dev/null | \ cut -d : -f 2 | \ sed -e "s/()//g" -e "s/[ |\t]//g" 2> /dev/null | \ grep -v ^"[ |\t]*${LibInternalPrefix}" 2> /dev/null` done } # # $retval findLibInternalFuncs # # Finds all internal (not-to-be-exported) functions of given libraries. # # Parameters: # lib - A name of a bash library # Return value: # A list of internal functions of the given library findLibInternalFuncs() { retval="" # for each lib, find it's internal functions local Lib= for Lib in ${*//,/ } ; do eval LibInternalPrefix=$INTERNAL_PREFIX # Add to the retval the name of the lib retval="$retval $Lib: " # Step by step: # Grep internal functions declarations from the code of given library. Step by step: # Take just the declaration (looks like: "funcName()") # Remove the '()' retval="$retval"`grep ^"[ |\t]*$LibInternalPrefix[0-9a-zA-Z_]*[ |\t]*()" ${LD_BASH_PATH}/${Lib}.sh 2> /dev/null | \ cut -d : -f 2 2> /dev/null | sed -e "s/()//g" -e "s/[ |\t]//g" 2> /dev/null` done } # # ldbash_load load # # See description of return value. # # Parameters: # lib - A list of libraries to load. # Return value: # A string that contains a command that will load the libraries. # This string should be evaled (eval $retval). load() { local LoadString="" # LibsRequests is a list of requests for libraries to be loaded. Once a # request is dealt with, it is removed from the list, and the appropriate # library is added to LibsAdded (if it's not already there). # LibsAdded is the list which aggregates the names of libraries to # eventually load. local LibsRequests="${*//,/ } " local LibsAdded= # Create the list of libs to load (with dependencies) local Lib= while [[ $LibsRequests ]]; do # Handling the request first on the list (and removing it) Lib=${LibsRequests%% *} LibsRequests=${LibsRequests#* } # Requests for libraries which have already been encountered are ignored. [[ $LibsAdded == $Lib\ * ]] || [[ $LibsAdded == *\ $Lib\ * ]] && continue LibsAdded="$LibsAdded$Lib " # Get the names of the needed functions eval LibRequire='${'${Lib}_REQUIRE'}' # Find out, for each function, who exports it local Func= for Func in $LibRequire ; do # This finds the name of the library that defines the function # It does it by greping "EXPORT" string and the function name from the cache file # and then taking only the lib name from the line. # NeededLib is not local so it can be treeted as an array. NeededLib=(`grep EXPORT $LD_BASH_CACHE | \ grep " $Func " | \ awk -F= '{print $1}' | \ sed -e 's/_EXPORT//g'`) LibsRequests="$LibsRequests$NeededLib " unset NeededLib done done # Build the command that loads the libs for Lib in $LibsAdded ; do LoadString="${LoadString} source ${LD_BASH_PATH}/${Lib}.sh;" done retval=$LoadString } # # ldbash_unload unload # # See description of return value. # # Parameters: # lib - A list of libraries to unload. # Return value # A string that contains a command that will unloaded the libraries. # This string should be evaled (\e eval \e retval) unload() { local UnloadString="" local Lib= # Build the command that unloads the libs # # we've sources cache file that defines ${lib}_EXPORT # ${lib}_EXPORT contains list of all functions that we've defined in load() # by running eval 'unset ${lib}_EXPORT' we'll unset them all # for Lib in ${*//,/ } ; do eval LibExports='${'${Lib}_EXPORT'}' UnloadString="${UnloadString} unset $LibExports;" done retval=$UnloadString } ############################################################## ################## MAIN #################### ############################################################## if ! [[ $* ]] ; then usage fi # parsing parameters # # -e will set Extern to its argument # BUT # --externlist-all will set Extern to '-all' # getopt_long '-l|--list->List -L|--load->Load: -U|--unload->Unload: -e|--externlist->Extern: -i|--internlist->Intern: -v|--version->Version -h|--help->Help' "$@" eval "$retval" # Do we need to show usage message? [[ $Help ]] && usage if [[ $Version ]] ; then echo "@PACKAGE_STRING@" echo "Writen by Gil Ran and Hai Zaar" exit 0 fi # Do we need to show a list of libraries? if [[ $List ]] ; then echo "Libraries:" list for LibName in $retval ; do echo " $LibName" done fi # Do we need to show a list of external functions? if [[ $Extern ]] ; then # Check if the parameter is -all if [[ "$Extern" = '-all' ]] ; then # Run the function for all the available libraries list findLibExternalFuncs "${retval// /,}" else findLibExternalFuncs "$Extern" fi echo "External:" for FuncName in $retval ; do # Check if it is the library's name if [[ "$FuncName" = *: ]] ; then echo " $FuncName" else # It must be a function name echo " $FuncName" fi done fi # Do we need to show a list of internal functions? if [[ $Intern ]] ; then # Check if the parameter is -all if [[ "$Intern" = '-all' ]] ; then # Run the function for all the available libraries list findLibInternalFuncs "${retval// /,}" else findLibInternalFuncs "$Intern" fi echo "Internal:" for FuncName in $retval ; do # Check if it is the library's name if [[ "$FuncName" = *: ]] ; then echo " $FuncName" else # It must be a function name echo " $FuncName" fi done fi # If any on the listing options were set, do not preform load/unload [[ $List ]] || [[ $Extern ]] || [[ $Intern ]] && exit 0 # Do we need to load any libraries? if [[ $Load ]] ; then load "$Load" echo $retval fi # Do we need to unload any libraries? if [[ $Unload ]] ; then unload "$Unload" echo $retval fi libbash-0.9.11/src/ldbashconfig.in0000754000175000017500000001000011201604772013662 00000000000000#!/bin/bash ########################################################################### # Copyright (c) 2004-2009 Hai Zaar and Gil Ran # # # # This program is free software; you can redistribute it and/or modify it # # under the terms of version 3 of the GNU General Public License as # # published by the Free Software Foundation. # # # ########################################################################### # Configurator for ldbash # It creates the .cache file for ldbash (usually /etc/ldbash.cache) prefix=@prefix@ exec_prefix=@exec_prefix@ LD_BASH_PATH=@libdir@/bash LD_BASH_CACHE=@sysconfdir@/ldbash.cache # We want to use getopt_long... source $LD_BASH_PATH/getopts.sh source $LD_BASH_PATH/hashstash.sh ############################################################# ################### FUNCTIONS #################### ############################################################# # # $retval ldbashconfig_returnDuplicates $retval returnDuplicates # # Finds all the duplicated values in arr and returns them. # # Parameters: # arr - An array. # Return value: # A list of all the values that apear at least twice in the array. returnDuplicates() { retval="" # Set a value to $CurrVal, so it will enter the loop local CurrVal=1 while [[ $CurrVal ]] ; do # Set the next value of the array in $CurrVal CurrVal=$1 # Remove the next value from the array shift # Check if the value apears in the rest of the array if [[ " $* " = *" $CurrVal "* ]] ; then # Add the value to the retval retval="${retval} ${CurrVal}" fi done # Prevent duplications in the retval retval=`echo $retval | awk '{for (i=1;i<=NF;i++) print $i}' | sort -u` } ############################################################## ################## MAIN #################### ############################################################## getopt_long '-p|--prefix->LIBS_PREFIX -v|--version->Version -h|--help->Help' $* eval $retval if [[ $Help ]] ; then echo "usage: ldbashconfig" echo " [-h|--help]" echo " [-v|--version]" echo " [-p|--prefix]" [[ $Version ]] || exit fi if [[ $Version ]] ; then echo "@PACKAGE_STRING@" echo "Writen by Gil Ran and Hai Zaar" exit fi if [[ $LIBS_PREFIX ]] ; then echo $LD_BASH_PATH exit fi # Keep the existing file (for a case there will be errors) cp -f $LD_BASH_CACHE ${LD_BASH_CACHE}.prev$$ 2> /dev/null || echo "" > $LD_BASH_CACHE ${LD_BASH_CACHE}.prev$$ # grep the lines that define exports (output looks like: ./script.sh: # EXPORT=func1 func2 ) # replace the .sh# with a _ (output looks like: ./script_EXPORT=func1 func2 ) # replace the dirname of the script with a _ (output looks like: _script_EXPORT=func1 func2 ) # replace the = with =" (output looks like: _script_EXPORT=" func1 func2 ) # put " at the end of the line (output looks like: _script_EXPORT=" func1 func2 " ) grep -H EXPORT= $LD_BASH_PATH/*.sh | \ sed -e 's/\.sh:[ |\t]*#[ |\t]*/_/g' \ -e 's/^.*\///g' \ -e 's/=/=" /g' \ -e 's/$/ "/g' > $LD_BASH_CACHE # This does the same for requirements grep -H REQUIRE= $LD_BASH_PATH/*.sh | \ sed -e 's/\.sh:[ |\t]*#[ |\t]*/_/g' \ -e 's/^.*\///g' \ -e 's/=/=" /g' \ -e 's/$/ "/g' >> $LD_BASH_CACHE # Get the names of all the functions exported in the file. # Step by step: # Get the lines that define EXPORT variables # Take the value of the variable # Remove any " from the result AllFuncs=( `grep _EXPORT $LD_BASH_CACHE | awk -F= '{print $2}' | sed -e 's/"//g'`) # Check if any duplications found returnDuplicates ${AllFuncs[*]} if [[ $retval ]] ; then echo "Error - duplicated definition of:" echo " $retval" echo "Restoring old configuration" cp -f ${LD_BASH_CACHE}.prev$$ $LD_BASH_CACHE fi # Remove the old file rm -f ${LD_BASH_CACHE}.prev$$ libbash-0.9.11/src/Makefile.in0000644000175000017500000003524411247024317012774 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ldbash.in $(srcdir)/ldbash.man.in \ $(srcdir)/ldbashconfig.in $(srcdir)/ldbashconfig.man.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = ldbash.man ldbashconfig.man ldbash ldbashconfig am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" \ "$(DESTDIR)$(sysconfdir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man1_MANS) $(man8_MANS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(sysconf_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DOXYGEN = @DOXYGEN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdate = @docdate@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.in) $(wildcard *.man) bin_SCRIPTS = ldbash sbin_SCRIPTS = ldbashconfig # This creates $(sysconfdir). If this will not be here, the ldbashconfig command will fail. sysconf_DATA = CLEANFILES = ldbash ldbashconfig # installing man pages man1_MANS = ldbash.man man8_MANS = ldbashconfig.man all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ldbash.man: $(top_builddir)/config.status $(srcdir)/ldbash.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ldbashconfig.man: $(top_builddir)/config.status $(srcdir)/ldbashconfig.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ldbash: $(top_builddir)/config.status $(srcdir)/ldbash.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ldbashconfig: $(top_builddir)/config.status $(srcdir)/ldbashconfig.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ else :; fi; \ done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ done install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" @list='$(sysconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ $(sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-sbinSCRIPTS \ install-sysconfDATA install-html: install-html-am install-info: install-info-am install-man: install-man1 install-man8 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-man uninstall-sbinSCRIPTS \ uninstall-sysconfDATA uninstall-man: uninstall-man1 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinSCRIPTS install-strip install-sysconfDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-man uninstall-man1 uninstall-man8 \ uninstall-sbinSCRIPTS uninstall-sysconfDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libbash-0.9.11/src/ldbashconfig.man0000644000175000017500000000175511247024333014045 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt LDBASHCONFIG \&8 "libbash Manual" .\" .\" .Sh NAME .\" .\" .Nm ldbashconfig .Nd Creates or updates cache file for .Xr libbash 7 libraries. .\" .\" .Sh SYNOPSIS .\" .\" .Nm .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled .Nm Creates and/or updates .Xr libbash 7 cache file. This file is used by .Xr ldbash 1 at run time. .Pp Run this command each time you add new bash library or change interface of existing one \- .Xr ldbash 1 highly depends on consistency of the cache file. .Ed .\" .\" .Sh FILES .\" .\" .Bd -filled .Bl -tag -width 12345 .It Pa /etc/ldbash.cache Cache file that contains information about libraries dependencies and list of exported symbols. See .Xr ldbashconfig (8) for further details. .El .Ed .\" .\" .Sh BUGS .\" .\" None known. .\" .\" .Sh AUTHORS .An "Hai Zaar" Aq haizaar@gmail.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .\" .\" .Sh "SEE ALSO" .\" .\" .Xr ldbash 1 , .Xr libbash 7 libbash-0.9.11/src/ldbash.man0000644000175000017500000000625311247024333012655 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt LDBASH \&1 "libbash Manual" .\" .Sh NAME .\" .\" .Nm ldbash .Nd Dynamic loader for .Xr libbash 7 libraries. .\" .\" .Sh SYNOPSIS .\" .\" .Nm .Op Fl h | Fl -help .Nm .Op Fl l | Fl -list .Nm .Op Fl L | Fl -load Ar lib,[lib] ... .Nm .Op Fl U | Fl -unload Ar lib,[lib] ... .Nm .Op Fl e | Fl -externlist Ar lib,[lib] ... .Nm .Op Fl -externlist-all .Nm .Op Fl -i | Fl -internlista Ar lib,[lib] ... .Nm .Op Fl -internlist-all .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled .Nm is used to manipulate .Xr libbash 7 libraries. Its main function is to load specific library. It can also print list of available libraries, list functions each library exports, unload functions, etc. .Pp In case of .Fl -load and .Fl -unload ,the output is intended to be passed to bash .Em eval command. .Ed .\" .\" .Sh Options .\" .\" .Bd -filled .Bl -tag -width 123456789123 .\" .It Fl h | Fl -help Print options summary .\" .It Fl l | Fl -list Display list of available libraries. The libraries names listed, may be passed as parameters to other invocations of .Nm . I.e. first you run .Nm Fl -list to see what is available and then you may load it. .\" .It Fl L | Fl -load Ar lib,[lib] ... Load given libraries - i.e. print string that should be passed to .Em eval command. Usually the string contains various .Em source commands. .Pp Libraries that given libraries depend on are also loaded. .Pp Libraries only loaded if their dependencies are satisfied. Dependencies are resolved using .Pa ldbash.cache file, which is created by .Xr ldbashconfig 8 . .\" .It Fl U | Fl -unload Ar lib,[lib] ... Unload given libraries, but .Em not their dependencies. .Pp The output should be passed to .Em eval command (in the same manner as with .Fl -load ). .\" .It Fl e | Fl -externlist Ar lib,[lib] ... List all symbols that are exported by given libraries. Symbols are usually functions that given libraries implement. .\" .It Fl -externlist-all List all exported symbols of all available libraries. Symbols are usually functions that library implement. .\" .It Fl i | Fl -internlist Ar lib,[lib] ... List all internal symbols (i.e. global variables/functions) of given libraries. This is intended mostly for developers that want to develop library of their own, and want to be sure that they don't override any already defined symbol. .\" .It Fl -internlist-all List all internal symbols of all available libraries. This is intended mostly for developers that want to develop library of their own, and want to be sure that they don't override any already defined symbol. .\" .El .Ed .\" .\" .Sh FILES .\" .\" .Bd -filled .Bl -tag -width 12345 .It Pa /etc/ldbash.cache Cache file that contains information about libraries dependencies and list of exported symbols. See .Xr ldbashconfig (8) for further details. .El .Ed .\" .\" .Sh BUGS .\" .\" .Bd -filled The script can't load libraries if their file name starts with .Ql - . (If someone uses file names that start with a .Ql - he/she deserves it!) .Ed .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@gmail.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .\" .\" .Xr libbash 7 , .Xr ldbashconfig 8 libbash-0.9.11/src/ldbash.man.in0000644000175000017500000000624711233565131013266 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt LDBASH \&1 "libbash Manual" .\" .Sh NAME .\" .\" .Nm ldbash .Nd Dynamic loader for .Xr libbash 7 libraries. .\" .\" .Sh SYNOPSIS .\" .\" .Nm .Op Fl h | Fl -help .Nm .Op Fl l | Fl -list .Nm .Op Fl L | Fl -load Ar lib,[lib] ... .Nm .Op Fl U | Fl -unload Ar lib,[lib] ... .Nm .Op Fl e | Fl -externlist Ar lib,[lib] ... .Nm .Op Fl -externlist-all .Nm .Op Fl -i | Fl -internlista Ar lib,[lib] ... .Nm .Op Fl -internlist-all .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled .Nm is used to manipulate .Xr libbash 7 libraries. Its main function is to load specific library. It can also print list of available libraries, list functions each library exports, unload functions, etc. .Pp In case of .Fl -load and .Fl -unload ,the output is intended to be passed to bash .Em eval command. .Ed .\" .\" .Sh Options .\" .\" .Bd -filled .Bl -tag -width 123456789123 .\" .It Fl h | Fl -help Print options summary .\" .It Fl l | Fl -list Display list of available libraries. The libraries names listed, may be passed as parameters to other invocations of .Nm . I.e. first you run .Nm Fl -list to see what is available and then you may load it. .\" .It Fl L | Fl -load Ar lib,[lib] ... Load given libraries - i.e. print string that should be passed to .Em eval command. Usually the string contains various .Em source commands. .Pp Libraries that given libraries depend on are also loaded. .Pp Libraries only loaded if their dependencies are satisfied. Dependencies are resolved using .Pa ldbash.cache file, which is created by .Xr ldbashconfig 8 . .\" .It Fl U | Fl -unload Ar lib,[lib] ... Unload given libraries, but .Em not their dependencies. .Pp The output should be passed to .Em eval command (in the same manner as with .Fl -load ). .\" .It Fl e | Fl -externlist Ar lib,[lib] ... List all symbols that are exported by given libraries. Symbols are usually functions that given libraries implement. .\" .It Fl -externlist-all List all exported symbols of all available libraries. Symbols are usually functions that library implement. .\" .It Fl i | Fl -internlist Ar lib,[lib] ... List all internal symbols (i.e. global variables/functions) of given libraries. This is intended mostly for developers that want to develop library of their own, and want to be sure that they don't override any already defined symbol. .\" .It Fl -internlist-all List all internal symbols of all available libraries. This is intended mostly for developers that want to develop library of their own, and want to be sure that they don't override any already defined symbol. .\" .El .Ed .\" .\" .Sh FILES .\" .\" .Bd -filled .Bl -tag -width 12345 .It Pa /etc/ldbash.cache Cache file that contains information about libraries dependencies and list of exported symbols. See .Xr ldbashconfig (8) for further details. .El .Ed .\" .\" .Sh BUGS .\" .\" .Bd -filled The script can't load libraries if their file name starts with .Ql - . (If someone uses file names that start with a .Ql - he/she deserves it!) .Ed .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@gmail.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .Sh SEE ALSO .\" .\" .Xr libbash 7 , .Xr ldbashconfig 8 libbash-0.9.11/src/ldbashconfig.man.in0000644000175000017500000000175111233565131014447 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt LDBASHCONFIG \&8 "libbash Manual" .\" .\" .Sh NAME .\" .\" .Nm ldbashconfig .Nd Creates or updates cache file for .Xr libbash 7 libraries. .\" .\" .Sh SYNOPSIS .\" .\" .Nm .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled .Nm Creates and/or updates .Xr libbash 7 cache file. This file is used by .Xr ldbash 1 at run time. .Pp Run this command each time you add new bash library or change interface of existing one \- .Xr ldbash 1 highly depends on consistency of the cache file. .Ed .\" .\" .Sh FILES .\" .\" .Bd -filled .Bl -tag -width 12345 .It Pa /etc/ldbash.cache Cache file that contains information about libraries dependencies and list of exported symbols. See .Xr ldbashconfig (8) for further details. .El .Ed .\" .\" .Sh BUGS .\" .\" None known. .\" .\" .Sh AUTHORS .An "Hai Zaar" Aq haizaar@gmail.com .An "Gil Ran" Aq gil@ran4.net .\" .\" .\" .\" .Sh "SEE ALSO" .\" .\" .Xr ldbash 1 , .Xr libbash 7 libbash-0.9.11/doc/0000777000175000017500000000000011247024335010761 500000000000000libbash-0.9.11/doc/Makefile.am0000644000175000017500000000115711026005026012724 00000000000000AUTOMAKE_OPTIONS = -Wno-portability .PHONY: all clean EXTRA_DIST = $(wildcard *.dox) $(wildcard *.in) # Adding `-' to make rules in order to ignore errors clean: rm -rf html distclean: clean rm -rf Doxyfile main_page.dox Makefile all: Doxyfile main_page.dox docs # Old of versions of doxygen do not generate html correctly, if # html dir already contains output of previous run. # That's why we delete it first. docs: clean $(DOXYGEN) install: all test X"$(DOXYGEN)" = "X" || \ install -d $(DESTDIR)$(datadir)/doc/$(PACKAGE) test X"$(DOXYGEN)" = "X" || \ cp -rf html $(DESTDIR)$(datadir)/doc/$(PACKAGE) libbash-0.9.11/doc/libbash_developer_faq.dox0000644000175000017500000000220010303051645015677 00000000000000/** \page libbash_developer_faq libbash - Developer FAQ Welcome to libbash FAQ page! This page contains list of most known problems you may run into while developing a bash libarary. \section libbash_developer_faq_questions The Questions \subsection libbash_developer_faq_Q1 Question 1 How can I use a \c local variable as an \c array ? \subsection libbash_developer_faq_A1 Answer 1 When using a \c local variable, the line: \verbatim local VAR_NAME \endverbatim is used as a declaration of \e VAR_NAME. Unless implicitly mentioned otherwise, \c declaire creates a `regular' variable. Because of that, in order to use a local array you must implicitly declaire that it is an array: \verbatim declaire -a local ARR_NAME \endverbatim \subsection libbash_developer_faq_Q2 Question 2 Using \ref hashstash_man "hashstash (3)" hashes, How do I declare a \c local \c hash? \subsection libbash_developer_faq_A2 Answer 2 You can't. The reason for that is that every \c hash created by \c hashstash is created as a hashstash internal variable. I.e. the actual name of the hash is not \c HASHNAME but \c __hashstash_HASHNAME. */ libbash-0.9.11/doc/changelog.dox0000644000175000017500000000006110114365071013332 00000000000000/** \page ChangeLog_page \include ChangeLog */ libbash-0.9.11/doc/main_page.dox0000644000175000017500000001211411247024333013326 00000000000000/** \mainpage libbash \version 0.9.11 \ref ChangeLog_page "ChangeLog" \author Hai Zaar \n Gil Ran \date July 28, 2009 \par License GPL version 3 \par \par Quick jump - \ref MainPage_General - \ref MainPage_Using "Using libbash" - \ref MainPage_Installing "Installing" - \ref libbash_developer_faq "FAQ" - \ref MainPage_FurtherReading "Further reading" \par \section MainPage_General General \c libbash is a tool that enables bash dynamic-like shared libraries. \subsection MainPage_What What is libbbash? Actually its a tool for managing bash scripts that contain functions you may want to use in various scripts. To achieve its goal, it uses some kind of "dynamic loader" that you call to load desired bash library (actually just to \c source bash code). \subsection MainPage_Why Why libbash? In short - \b code \b reuse. That seems to be the problem of many bash programmers. The bash lacks any built-in method of separating code into libraries. Suppose you've written some great bash script. You've surelly splitted it to some functions that do parameter parsing, etc... Now you want to reuse that code in some other script. What do you do? The general solution is to cut out that reusable code from your first script, put it in separate file, and then \c source it from both scripts. Well, this may work fine, but what if your two scripts are completely unrelated and, in fact, belong to completely different projects, that do not share any common files. So you need to keep a copy of that reusable code in each project, and ... down we go... The libbash was born to address the above problem. It may be seen as script organizer. It holds "reusable code" in centralized place (typically \c /lib/bash/). Then you can use it to check what libraries are available, what functions they provide and actually source desired code. \subsection MainPage_MoreInfo More information - \ref libbash_developer_faq "libbash FAQ" - \ref libbash_libraries_list "Available libraries" \section MainPage_Using Using libbash \subsection MainPage_Minimal Minimal survival guide First, list bash libraries available on your system \verbatim #> ldbash -l Libraries: getopts hashstash \endverbatim Well, if it does not tell you much, run \c man \c getopts for example. When you've decided to go with getopts, you run \verbatim #> ldbash -e getopts External: getopts: getopt_long \endverbatim The above means that \c getopts library provides \c getopt_long function (use \c man to find out what it does and how to use it). From now on can start writing your script that uses \c getopt_long. The question you ask now is: "How do I load that function to my script?" The aswer is very simple. Consider: \verbatim #> ldbash -L getopts source /usr/lib/bash/getopts.sh; source /usr/lib/bash/hashstash.sh; \endverbatim So all you need to do in your script is to add the following line: \verbatim eval `ldbash -L getopts` \endverbatim \note You may noticed that you are actually sourcing two files: \c getopts.sh and some mysterous \c hashstash.sh. The reason is that getopts reported that it requires hashstash and libbash tracked that request and fulfilled it. \subsection MainPage_Synopsys Synopsys \par \c ldbash \c [\c -h \c | \c --help] Show help message. \par \c ldbash \c [\c -l \c | \c --list] List available libraries. \par \c ldbash \c [\c -L \c | \c --load \c lib,\c [\c lib\c ] \c ...] Load library. \n Actually, it gives you a string that should be evaled (using eval (1)). After running eval(1) you will be able to use the library's functions. \par \c ldbash \c [\c -U \c | \c --unload \c lib,\c [\c lib\c ] \c ...] Unload a library. Actually, it gives you a string that should be evaled (using eval (1)). After running eval(1) the library's functions will no longer be usable. \par \c ldbash \c [\c -e \c | \c --externlist \c lib,\c [\c lib\c ] \c ...] List all the functions that a specific library exports. \par \c ldbash \c [\c --externlist-all] List all the functions that listed libraries export. \par \c ldbash \c [\c --i \c | \c --internlist \c lib,\c [\c lib\c ] \c ...] List all the functions that are defined in a specific library, but are not exported. \par \c ldbash \c [\c --internlist-all] List all the functions that are defined in a listed library, but are not exported. \section MainPage_Installing Installing libbash \subsection MainPage_Requirement Requirements Actually, you need nothing except of bash. On the other hand, some (third party) libraries can use additional tools, that may not be available on your system. Anyway currently, there are none. \c libbash was tested in \e bash \e 3\e .x. It may also work with \e 2\e .0x versions, but this is 'not supported' :) Although you will need \e Doxygen to generate html documentation (the one you are reading at this moment). \section MainPage_FurtherReading Further reading - \ref libbash_developer "How to create and install your own libraries" - ldbash - Dynamic loader for libbash libraries. - \ref ldbash_man "man page" - ldbashconfig - Creates or updates cache file for libbash libraries. - \ref ldbashconfig_man "man page" */ libbash-0.9.11/doc/libbash_developer.dox0000644000175000017500000000514210303051645015060 00000000000000/** \page libbash_developer How to create and install your own libraries \section libbash_devGeneral General libbash library is basicly just script. Script that define functions that become available when you source it. \section libbash_devWriting Writing libraries A bash shared library that can be loaded using \c ldbash must answer 3 requirments: -# It must contain a line that begins with \c #EXPORT=. That line will contain (after the \c '=' ) a list of fuctions that the library exports. I.e. all the function that will be usable after loading that library will be listed in that line. -# It must contain a line that begins with \c #REQUIRE=. That line will contain (after the \c '=' ) a list of bash functions that are required for our library. I.e. every bash function that is in use in our bash library, and should be defined by another library, must be listed there. -# The library must be listed (For more information, see \c ldbashconfig man page ). \subsection libbash_guidelinesBasic Basic guidelines for writing library of your own: Be aware, that your library will be actually sourced. So, basicly, It should contain (i.e define) only functions. -# Try to declare all variables intended for internal use as local. -# Global variables and functions that are intended for internal use (i.e are not defined in \c #EXPORT= ) shoud begin with: \e ___ For example, internal function \e myfoosort of \e hashstash library should be named as \verbatim __hashstash_myfoosort \endverbatim This helps to avoid conflicts in global namespace when using libraries that come from different vendors. -# Do not overload defined functions. I.e. do not name one of your functions the same as a bash built-in command, or the same as a function that is defined by some other library or package. -# Make sure you do not create mutual dependancy between bash libraries. \section libbash_devInstalling Installing libraries libbash is splitted in two utilites: - \c ldbash: library loader - \c ldbashconfig: checks out available libraries, resolves cross-library dependencies and builds cache file. As number of libraries grows, it may take considerable amount of time to scan them all and resolve dependencies. That is why this process is done by separate utility - \c ldbashconfig. Afterwards, at runtime, \c ldbash reads cache file and determinies which libraries it needs to load in order to satisfy dependencies for requested library. Install steps: - name your library \c \\c .sh - put it in \c $LIBBASH_PREFIX/lib/bash (default is \c /usr/lib/bash). - run \c ldbashconfig */ libbash-0.9.11/doc/Makefile.in0000644000175000017500000002057611247024317012754 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/main_page.dox.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = Doxyfile main_page.dox SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DOXYGEN = @DOXYGEN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdate = @docdate@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.dox) $(wildcard *.in) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ main_page.dox: $(top_builddir)/config.status $(srcdir)/main_page.dox.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am .PHONY: all clean # Adding `-' to make rules in order to ignore errors clean: rm -rf html distclean: clean rm -rf Doxyfile main_page.dox Makefile all: Doxyfile main_page.dox docs # Old of versions of doxygen do not generate html correctly, if # html dir already contains output of previous run. # That's why we delete it first. docs: clean $(DOXYGEN) install: all test X"$(DOXYGEN)" = "X" || \ install -d $(DESTDIR)$(datadir)/doc/$(PACKAGE) test X"$(DOXYGEN)" = "X" || \ cp -rf html $(DESTDIR)$(datadir)/doc/$(PACKAGE) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libbash-0.9.11/doc/main_page.dox.in0000644000175000017500000001211311201604772013733 00000000000000/** \mainpage libbash \version @VERSION@ \ref ChangeLog_page "ChangeLog" \author Hai Zaar \n Gil Ran \date @docdate@ \par License GPL version 3 \par \par Quick jump - \ref MainPage_General - \ref MainPage_Using "Using libbash" - \ref MainPage_Installing "Installing" - \ref libbash_developer_faq "FAQ" - \ref MainPage_FurtherReading "Further reading" \par \section MainPage_General General \c libbash is a tool that enables bash dynamic-like shared libraries. \subsection MainPage_What What is libbbash? Actually its a tool for managing bash scripts that contain functions you may want to use in various scripts. To achieve its goal, it uses some kind of "dynamic loader" that you call to load desired bash library (actually just to \c source bash code). \subsection MainPage_Why Why libbash? In short - \b code \b reuse. That seems to be the problem of many bash programmers. The bash lacks any built-in method of separating code into libraries. Suppose you've written some great bash script. You've surelly splitted it to some functions that do parameter parsing, etc... Now you want to reuse that code in some other script. What do you do? The general solution is to cut out that reusable code from your first script, put it in separate file, and then \c source it from both scripts. Well, this may work fine, but what if your two scripts are completely unrelated and, in fact, belong to completely different projects, that do not share any common files. So you need to keep a copy of that reusable code in each project, and ... down we go... The libbash was born to address the above problem. It may be seen as script organizer. It holds "reusable code" in centralized place (typically \c /lib/bash/). Then you can use it to check what libraries are available, what functions they provide and actually source desired code. \subsection MainPage_MoreInfo More information - \ref libbash_developer_faq "libbash FAQ" - \ref libbash_libraries_list "Available libraries" \section MainPage_Using Using libbash \subsection MainPage_Minimal Minimal survival guide First, list bash libraries available on your system \verbatim #> ldbash -l Libraries: getopts hashstash \endverbatim Well, if it does not tell you much, run \c man \c getopts for example. When you've decided to go with getopts, you run \verbatim #> ldbash -e getopts External: getopts: getopt_long \endverbatim The above means that \c getopts library provides \c getopt_long function (use \c man to find out what it does and how to use it). From now on can start writing your script that uses \c getopt_long. The question you ask now is: "How do I load that function to my script?" The aswer is very simple. Consider: \verbatim #> ldbash -L getopts source /usr/lib/bash/getopts.sh; source /usr/lib/bash/hashstash.sh; \endverbatim So all you need to do in your script is to add the following line: \verbatim eval `ldbash -L getopts` \endverbatim \note You may noticed that you are actually sourcing two files: \c getopts.sh and some mysterous \c hashstash.sh. The reason is that getopts reported that it requires hashstash and libbash tracked that request and fulfilled it. \subsection MainPage_Synopsys Synopsys \par \c ldbash \c [\c -h \c | \c --help] Show help message. \par \c ldbash \c [\c -l \c | \c --list] List available libraries. \par \c ldbash \c [\c -L \c | \c --load \c lib,\c [\c lib\c ] \c ...] Load library. \n Actually, it gives you a string that should be evaled (using eval (1)). After running eval(1) you will be able to use the library's functions. \par \c ldbash \c [\c -U \c | \c --unload \c lib,\c [\c lib\c ] \c ...] Unload a library. Actually, it gives you a string that should be evaled (using eval (1)). After running eval(1) the library's functions will no longer be usable. \par \c ldbash \c [\c -e \c | \c --externlist \c lib,\c [\c lib\c ] \c ...] List all the functions that a specific library exports. \par \c ldbash \c [\c --externlist-all] List all the functions that listed libraries export. \par \c ldbash \c [\c --i \c | \c --internlist \c lib,\c [\c lib\c ] \c ...] List all the functions that are defined in a specific library, but are not exported. \par \c ldbash \c [\c --internlist-all] List all the functions that are defined in a listed library, but are not exported. \section MainPage_Installing Installing libbash \subsection MainPage_Requirement Requirements Actually, you need nothing except of bash. On the other hand, some (third party) libraries can use additional tools, that may not be available on your system. Anyway currently, there are none. \c libbash was tested in \e bash \e 3\e .x. It may also work with \e 2\e .0x versions, but this is 'not supported' :) Although you will need \e Doxygen to generate html documentation (the one you are reading at this moment). \section MainPage_FurtherReading Further reading - \ref libbash_developer "How to create and install your own libraries" - ldbash - Dynamic loader for libbash libraries. - \ref ldbash_man "man page" - ldbashconfig - Creates or updates cache file for libbash libraries. - \ref ldbashconfig_man "man page" */ libbash-0.9.11/doc/libraries_list.dox0000644000175000017500000000120110354020667014414 00000000000000/** \page libbash_libraries_list Currently available libraries - getopts - Library for command line parameters parsing - \ref getopts_man "man page" - hashstash - Library that implements hash data structure - \ref hashstash_man "man page" - locks - Library that implements simple, multiprocess access locking - \ref locks_man "man page" - colors - Library for priniting color messages on tty - \ref colors_man "man page" - messages - Library for printting pretty, bootscripts-like, messages - \ref messages_man "man page" - urlcoding - Library for converting ASCII text to valid URL, and vice versa - \ref urlcoding_man "man page" */ libbash-0.9.11/doc/Doxyfile.in0000644000175000017500000013346210303004701013004 00000000000000# Doxyfile 1.3.7 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = @PACKAGE@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 2 levels of 10 sub-directories under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of source # files, where putting all generated files in the same directory would otherwise # cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en # (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is used # as the annotated text. Otherwise, the brief description is used as-is. If left # blank, the following values are used ("$name" is automatically replaced with the # name of the entity): "The $name class" "The $name widget" "The $name file" # "is" "provides" "specifies" "contains" "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @top_srcdir@/src @top_srcdir@/doc @top_srcdir@/lib # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp # *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm FILE_PATTERNS = *.dox *.dox # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories # that are symbolic links (a Unix filesystem feature) are excluded from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = @top_srcdir@ @top_srcdir@/src @top_srcdir@/doc @top_srcdir@/lib # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = @top_srcdir@/doc # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .1 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse the # parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or # super classes. Setting the tag to NO turns the diagrams off. Note that this # option is superseded by the HAVE_DOT option below. This is only a fallback. It is # recommended to install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found on the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes that # lay further from the root node will be omitted. Note that setting this option to # 1 or 2 may greatly reduce the computation time needed for large code bases. Also # note that a graph may be further truncated if the graph's image dimensions are # not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). # If 0 is used for the depth value (the default), the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO libbash-0.9.11/Makefile.in0000644000175000017500000005074311247024317012206 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libbash.man.in \ $(srcdir)/libbash.spec.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO install-sh missing \ mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = libbash.man libbash.spec SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man7dir = $(mandir)/man7 am__installdirs = "$(DESTDIR)$(man7dir)" NROFF = nroff MANS = $(man7_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DOXYGEN = @DOXYGEN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdate = @docdate@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # lib must be before src, otherwise, the ldbashconfig command at src/Makefile.am will fail SUBDIRS = lib . src doc m4 tests AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = libbash.man # installing man pages man7_MANS = libbash.man all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) libbash.man: $(top_builddir)/config.status $(srcdir)/libbash.man.in cd $(top_builddir) && $(SHELL) ./config.status $@ libbash.spec: $(top_builddir)/config.status $(srcdir)/libbash.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-man7: $(man7_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(MKDIR_P) "$(DESTDIR)$(man7dir)" @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.7*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 7*) ;; \ *) ext='7' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst"; \ done uninstall-man7: @$(NORMAL_UNINSTALL) @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.7*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 7*) ;; \ *) ext='7' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man7dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man7dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man7dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-man7 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man7 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-data-am install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man7 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-man uninstall-man7 # Running ldbashconfig after installation only if DESTDIR is empty install-data-hook: [[ "$(DESTDIR)" == "" ]] && $(sbindir)/ldbashconfig || : @[[ "$(DESTDIR)" != "" ]] && (echo "===============================================" && \ echo "You've used DESTDIR - not running ldbashconfig!" && \ echo "===============================================") || : # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libbash-0.9.11/libbash.man0000644000175000017500000000461611247024333012236 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd July 28, 2009 .Os Linux .Dt LIBBASH \&7 "libbash Manual" .\" .Sh NAME .\" .\" .Nm libbash .Nd A bash shared libraries package. .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled .Nm is a package that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts whose functions you may want to load and use in scripts of your own. .Pp It contains a .Ql dynamic loader for the shared libraries ( .Ns Xr ldbash 1 Ns ), a configuration tool ( Ns Xr ldbashconfig 8 Ns ), and some libraries. .Pp Using .Xr ldbash 1 you are able to load loadable bash libraries, such as Xr getopts 1 and Xr hashstash 1 Ns . A bash shared library that can be loaded using .Ed .Xr ldbash 1 must answer 4 requirments: .Bl -enum -width 12345 .It It must be installed in .Fa $LIBBASH_PREFIX Ns /lib/bash (default is /usr/lib/bash). .It It must contain a line that begins with .Ql #EXPORT= . That line will contain (after the .Ql = Ns ) a list of functions that the library exports. I.e. all the function that will be usable after loading that library will be listed in that line. .It It must contain a line that begins with .Ql #REQUIRE= . That line will contain (after the .Ql = Ns ) a list of bash libraries that are required for our library. I.e. every bash library that is in use in our bash library must be listed there. .It The library must be listed (For more information, see .Xr ldbashconfig 8 Ns ). .El .Pp .Ss Basic guidelines for writing library of your own: .Bl -enum -width 12345 .It Be aware, that your library will be actually sourced. So, basically, it should contain (i.e define) only functions. .It Try to declare all variables intended for internal use as local. .It Global variables and functions that are intended for internal use (i.e are not defined in .Ql #EXPORT= ) should begin with: .Dl Sy ___ For example, internal function .Em myfoosort of .Em hashstash library should be named as .Dl Sy __hashstash_myfoosort This helps to avoid conflicts in global name space when using libraries that come from different vendors. .It See html manual for full version of this guide. .El .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq ril@ran4.net .\" .\" .Sh SEE ALSO .\" .\" .Xr ldbash 1 , .Xr ldbashconfig 8 , .Xr getopts 1 , .Xr hashstash 1 .Xr colors 1 .Xr messages 1 .Xr urlcoding 1 .Xr locks 1 libbash-0.9.11/libbash.spec.in0000644000175000017500000000233711023761375013026 00000000000000Summary: libbash is a tool that enables bash dynamic-like shared libraries. Name: @PACKAGE@ Version: @VERSION@ Release: 0 License: GPL Group: misc Source: http://ufpr.dl.sourceforge.net/sourceforge/libbash/@PACKAGE@-@VERSION@.tar.bz2 BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Requires: bash >= 3.0 URL: http://libbash.sf.net %description libbash is a tool that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts that contain functions you may want to use in various scripts. %prep %setup -q %build ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var make %install rm -rf %{buildroot} make DESTDIR=$RPM_BUILD_ROOT install %clean rm -rf %{buildroot} %files %defattr(-,root,root) %{_bindir}/* %{_sbindir}/* %{_libdir}/* /usr/share/aclocal/* /usr/share/man %doc /usr/share/doc/%{name} # update libbash library cache %post /usr/sbin/ldbashconfig %changelog * Mon Apr 02 2007 Hai Zaar - Fixed URL * Mon Jan 09 2006 Hai Zaar - Added dependency for bash-3.0 and higher - Packaging man page more explicitly - Running ldbashconfig in %post section * Mon Jan 02 2006 Hai Zaar - Initial spec file libbash-0.9.11/libbash.man.in0000644000175000017500000000461211233565131012640 00000000000000.\" Process this file with .\" groff -mdoc -Tascii .\" .Dd @docdate@ .Os Linux .Dt LIBBASH \&7 "libbash Manual" .\" .Sh NAME .\" .\" .Nm libbash .Nd A bash shared libraries package. .\" .\" .Sh DESCRIPTION .\" .\" .Bd -filled .Nm is a package that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts whose functions you may want to load and use in scripts of your own. .Pp It contains a .Ql dynamic loader for the shared libraries ( .Ns Xr ldbash 1 Ns ), a configuration tool ( Ns Xr ldbashconfig 8 Ns ), and some libraries. .Pp Using .Xr ldbash 1 you are able to load loadable bash libraries, such as Xr getopts 1 and Xr hashstash 1 Ns . A bash shared library that can be loaded using .Ed .Xr ldbash 1 must answer 4 requirments: .Bl -enum -width 12345 .It It must be installed in .Fa $LIBBASH_PREFIX Ns /lib/bash (default is /usr/lib/bash). .It It must contain a line that begins with .Ql #EXPORT= . That line will contain (after the .Ql = Ns ) a list of functions that the library exports. I.e. all the function that will be usable after loading that library will be listed in that line. .It It must contain a line that begins with .Ql #REQUIRE= . That line will contain (after the .Ql = Ns ) a list of bash libraries that are required for our library. I.e. every bash library that is in use in our bash library must be listed there. .It The library must be listed (For more information, see .Xr ldbashconfig 8 Ns ). .El .Pp .Ss Basic guidelines for writing library of your own: .Bl -enum -width 12345 .It Be aware, that your library will be actually sourced. So, basically, it should contain (i.e define) only functions. .It Try to declare all variables intended for internal use as local. .It Global variables and functions that are intended for internal use (i.e are not defined in .Ql #EXPORT= ) should begin with: .Dl Sy ___ For example, internal function .Em myfoosort of .Em hashstash library should be named as .Dl Sy __hashstash_myfoosort This helps to avoid conflicts in global name space when using libraries that come from different vendors. .It See html manual for full version of this guide. .El .\" .\" .Sh AUTHORS .\" .\" .An "Hai Zaar" Aq haizaar@haizaar.com .An "Gil Ran" Aq ril@ran4.net .\" .\" .Sh SEE ALSO .\" .\" .Xr ldbash 1 , .Xr ldbashconfig 8 , .Xr getopts 1 , .Xr hashstash 1 .Xr colors 1 .Xr messages 1 .Xr urlcoding 1 .Xr locks 1 libbash-0.9.11/aclocal.m40000644000175000017500000005214611247024315011776 00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.61],, [m4_warning([this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR libbash-0.9.11/README0000644000175000017500000000161711201604772011014 00000000000000 This is cool libbash library! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In short, libbash is tool intented to provide system wide access to various scripts of yours. See documentation and/or man pages for more details. libbash also provided m4 macros to use with autoconf, which may help you to find out which libbash libraries are available during configure run. Installation ~~~~~~~~~~~~ is pretty trivial. Usual ./configure && make && make install will do. You may want to run configure as: ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var After install - update libbash libraries cache - run ldbashconfig. Requirements ~~~~~~~~~~~~ libbash is tested with bash-3.0. Probably it will work with 2.0x flavors too. You'll need doxygen to generate html documentation. License ~~~~~~~ libbash is licensed under GPLv3 libbash-0.9.11/INSTALL0000644000175000017500000002203010303020620011137 00000000000000Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libbash-0.9.11/AUTHORS0000644000175000017500000000016710354013365011203 00000000000000Libbash is designed and written by: * Hai Zaar * Gil Ran libbash-0.9.11/COPYING0000644000175000017500000010437411024025562011170 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . libbash-0.9.11/m4/0000777000175000017500000000000011247024335010534 500000000000000libbash-0.9.11/m4/Makefile.am0000644000175000017500000000024011026005026012467 00000000000000AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.m4) # all libraries goes to lib/bash acm4dir = $(datadir)/aclocal acm4_DATA = $(wildcard *.m4) libbash-0.9.11/m4/Makefile.in0000644000175000017500000002135711247024317012525 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(acm4dir)" acm4DATA_INSTALL = $(INSTALL_DATA) DATA = $(acm4_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DOXYGEN = @DOXYGEN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdate = @docdate@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = -Wno-portability EXTRA_DIST = $(wildcard *.m4) # all libraries goes to lib/bash acm4dir = $(datadir)/aclocal acm4_DATA = $(wildcard *.m4) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-acm4DATA: $(acm4_DATA) @$(NORMAL_INSTALL) test -z "$(acm4dir)" || $(MKDIR_P) "$(DESTDIR)$(acm4dir)" @list='$(acm4_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(acm4DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(acm4dir)/$$f'"; \ $(acm4DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(acm4dir)/$$f"; \ done uninstall-acm4DATA: @$(NORMAL_UNINSTALL) @list='$(acm4_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(acm4dir)/$$f'"; \ rm -f "$(DESTDIR)$(acm4dir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(acm4dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-acm4DATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-acm4DATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-acm4DATA install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-acm4DATA uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libbash-0.9.11/m4/libbash.m40000644000175000017500000000116610352446531012324 00000000000000dnl AC_CHECK_LIBBASH dnl Checks whether ldbash exists and then checks whether dnl required libbash libraries are installed. dnl If either ldbash or required libraries are missing - throws AC_MSG_ERROR. dnl Example: AC_CHECK_LIBBASH([getopts hashstash]) AC_DEFUN([AC_CHECK_LIBBASH],[ AC_PATH_PROG([LDBASH], [ldbash]) [[ "X$LDBASH" == "X" ]] && AC_MSG_ERROR([libbash is not found!]) AC_FOREACH([BASH_LIB],[$1],[ AC_MSG_CHECKING([whether `m4_defn([BASH_LIB])' libbash library is listed]) && \ $LDBASH -l | grep -q m4_defn([BASH_LIB]) && \ echo yes || \ AC_MSG_ERROR([m4_defn([BASH_LIB]) not found!]) ]) ]) libbash-0.9.11/NEWS0000644000175000017500000000003210303020620010603 00000000000000See ChangeLog for details libbash-0.9.11/missing0000754000175000017500000002453310160244204011525 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: