Script started on Thu, Apr 21, 2011 16:01:03 $ ./boxes.sh #!/bin/sh -xv # Copyright (C) 2007 Jari Aalto; Licenced under GPL v2 or later # # /etc/postinstall/.sh -- Custom installation steps PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:$PATH" + PATH='/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/home/lmaschm/bin:/usr/local/bin:/usr/bin:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program Files/Intel/DMIX:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/Program Files/Common Files/SYSTEM/MSMAPI/1033:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/usr/lib/lapack' set -e + set -e Environment() { # Define variables to the rest of the script [ "$1" ] && dest="$1" # install destination if [ "$dest" ]; then # Delete trailing slash dest=$(echo $dest | sed -e 's,/$,,' ) fi package="boxes" #!! CHANGE THIS # This file will be installed as # /etc/postinstall/.sh so derive # But if this file is run from CYGIN-PATCHES/postinstall.sh # then we do not know the package name name=$(echo $0 | sed -e 's,.*/,,' -e 's,\.sh,,' ) if [ "$name" != "postinstall" ]; then package="$name" fi bindir="$dest/usr/bin" libdir="$dest/usr/lib" libdirx11="$dest/usr/lib/X11" includedir="$dest/usr/include" sharedir="$dest/usr/share" infodir="$sharedir/info" docdir="$sharedir/doc" etcdir="$dest/etc" # 1) list of files to be copied to /etc # 2) Source locations conffiles_to="$etcdir/preremove/$package-manifest.lst" conffiles_from="$etcdir/preremove/$package-manifest-from.lst" } Warn () { echo "$@" >&2 } Run () { ${test+echo} "$@" } InstallConffiles () { [ ! -f $conffiles_to ] && return # Install default configuration files for system wide latest=$(LC_ALL=C find /usr/share/doc/$package*/ \ -maxdepth 0 -type d \ | sort | tail -1 | sed 's,/$,,') if [ ! "$latest" ]; then Warn "$0: [FATAL] Cannot find $package install doc dir" exit 1 fi [ ! -f $conffiles_from ] && return [ ! -f $conffiles_to ] && return tmpprefix=${TEMPDIR:-/tmp}/tmp$$ from=$tmpprefix.from to=$tmpprefix.to # Filter out all comments. Grep only lines with filenames grep -E '^[^#]*/|^[[:space]]*$' $conffiles_from > $from grep -E '^[^#]*/|^[[:space]]*$' $conffiles_to > $to paste $from $to | { while read from to do from=$(echo $dest$from | sed "s,\$PKGDOCDIR,$pkgdocdir$latest," ) to=$(echo $dest$to | sed "s,\$PKG,$pkgdocdir," ) [ ! -f $to ] && Run install -m 0644 $from $to done } rm -f $tmpprefix.* } Main() { Environment "$@" && InstallConffiles } Main "$@" + Main + Environment + '[' '' ']' + '[' '' ']' + package=boxes echo $0 | sed -e 's,.*/,,' -e 's,\.sh,,' ) echo $0 | sed -e 's,.*/,,' -e 's,\.sh,,' ++ echo ./boxes.sh ++ sed -e 's,.*/,,' -e 's,\.sh,,' + name=boxes + '[' boxes '!=' postinstall ']' + package=boxes + bindir=/usr/bin + libdir=/usr/lib + libdirx11=/usr/lib/X11 + includedir=/usr/include + sharedir=/usr/share + infodir=/usr/share/info + docdir=/usr/share/doc + etcdir=/etc + conffiles_to=/etc/preremove/boxes-manifest.lst + conffiles_from=/etc/preremove/boxes-manifest-from.lst + InstallConffiles + '[' '!' -f /etc/preremove/boxes-manifest.lst ']' LC_ALL=C find /usr/share/doc/$package*/ -maxdepth 0 -type d | sort | tail -1 | sed 's,/$,,') LC_ALL=C find /usr/share/doc/$package*/ -maxdepth 0 -type d | sort | tail -1 | sed 's,/$,,' ++ LC_ALL=C ++ find /usr/share/doc/boxes-1.0.1a/ -maxdepth 0 -type d ++ sort ++ tail -1 ++ sed 's,/$,,' + latest=/usr/share/doc/boxes-1.0.1a + '[' '!' /usr/share/doc/boxes-1.0.1a ']' + '[' '!' -f /etc/preremove/boxes-manifest-from.lst ']' + '[' '!' -f /etc/preremove/boxes-manifest.lst ']' + tmpprefix=/tmp/tmp5576 + from=/tmp/tmp5576.from + to=/tmp/tmp5576.to + grep -E '^[^#]*/|^[[:space]]*$' /etc/preremove/boxes-manifest-from.lst grep: Unmatched [ or [^ $ exit Script done on Thu, Apr 21, 2011 16:02:28