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`
arch=/usr/local/bin/arch
delete=no
copy=ln
copy="ln"
# --- Options parsing -------------------------------------------------------
@ -29,7 +29,11 @@ while [ "$1" != "" ]; do
;;
-c|--copy)
copy="cp -dp"
copy="cp -Rp"
;;
-S|--symlink)
copy="ln -s"
;;
-a|--arch)
@ -44,6 +48,7 @@ while [ "$1" != "" ]; do
echo " -d --destdir <path> The directory to create the distribution in."
echo " -x --delete Erase the destination directory first."
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 " -h --help Display this message."
exit 0
@ -89,26 +94,30 @@ process_dir() {
fi
for i in `cat $path/.distr`; do
if [ "${i:0:1}" = "#" ]; then
# Comment. Do nothing.
true
elif [ -d $i ]; then
# This is a directory. Recurse into it.
case "$i" in
\#*) # Comment. Do nothing.
;;
*)
if [ -d $i ]; then
# This is a directory. Recurse into it.
( process_dir $path/$i )
elif [ -f $i ]; then
# This is a file.
addfile $path/$i
elif [ "$i" = "$archivename" ]; then
# Build the named archive.
( process_dir $path/$i )
elif [ -f $i ]; then
# This is a file.
addfile $path/$i
elif [ "$i" = "$archivename" ]; then
# Build the named archive.
$arch cDr `cat LIST`
addfile $path/$archivename
else
echo "Don't know what to do with $i, listed in $PWD/.distr."
exit 1
fi
$arch cDr `cat LIST`
addfile $path/$archivename
else
echo "Don't know what to do with $i, listed in $PWD/.distr."
exit 1
fi
;;
esac
done
}
@ -150,7 +159,10 @@ echo "Done."
# Revision history
# $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
# distr functionality, as nothing was using it any more and it was
# causing problems.