Performed major renovations to make the script work on OpenBSD.

This commit is contained in:
dtrg 2007-02-25 20:56:41 +00:00
parent 415e7e14fc
commit 9170d09462

View file

@ -8,7 +8,7 @@ destdir=
srcdir=`pwd` srcdir=`pwd`
arch=/usr/local/bin/arch arch=/usr/local/bin/arch
delete=no delete=no
copy=ln copy="ln"
# --- Options parsing ------------------------------------------------------- # --- Options parsing -------------------------------------------------------
@ -29,7 +29,11 @@ while [ "$1" != "" ]; do
;; ;;
-c|--copy) -c|--copy)
copy="cp -dp" copy="cp -Rp"
;;
-S|--symlink)
copy="ln -s"
;; ;;
-a|--arch) -a|--arch)
@ -44,6 +48,7 @@ while [ "$1" != "" ]; do
echo " -d --destdir <path> The directory to create the distribution in." echo " -d --destdir <path> The directory to create the distribution in."
echo " -x --delete Erase the destination directory first." echo " -x --delete Erase the destination directory first."
echo " -c --copy Make physical copies of the files. (default: hardlink)" echo " -c --copy Make physical copies of the files. (default: hardlink)"
echo " -S --symlink Make symbolic links instead of copying or hardlinking."
echo " -a --arch <path> Where the ACK 'arch' tool is." echo " -a --arch <path> Where the ACK 'arch' tool is."
echo " -h --help Display this message." echo " -h --help Display this message."
exit 0 exit 0
@ -89,10 +94,12 @@ process_dir() {
fi fi
for i in `cat $path/.distr`; do for i in `cat $path/.distr`; do
if [ "${i:0:1}" = "#" ]; then case "$i" in
# Comment. Do nothing. \#*) # Comment. Do nothing.
true ;;
elif [ -d $i ]; then
*)
if [ -d $i ]; then
# This is a directory. Recurse into it. # This is a directory. Recurse into it.
( process_dir $path/$i ) ( process_dir $path/$i )
@ -109,6 +116,8 @@ process_dir() {
echo "Don't know what to do with $i, listed in $PWD/.distr." echo "Don't know what to do with $i, listed in $PWD/.distr."
exit 1 exit 1
fi fi
;;
esac
done done
} }
@ -150,7 +159,10 @@ echo "Done."
# Revision history # Revision history
# $Log$ # $Log$
# Revision 1.3 2007-02-24 02:05:56 dtrg # Revision 1.4 2007-02-25 20:56:41 dtrg
# Performed major renovations to make the script work on OpenBSD.
#
# Revision 1.3 2007/02/24 02:05:56 dtrg
# Removed some bashish; added comment support; removed the make # Removed some bashish; added comment support; removed the make
# distr functionality, as nothing was using it any more and it was # distr functionality, as nothing was using it any more and it was
# causing problems. # causing problems.