From 9170d0946294ef134f224a5898c2612a2113e8c0 Mon Sep 17 00:00:00 2001 From: dtrg Date: Sun, 25 Feb 2007 20:56:41 +0000 Subject: [PATCH] Performed major renovations to make the script work on OpenBSD. --- distr/mkdist | 56 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/distr/mkdist b/distr/mkdist index c6fe24daa..7b11e1590 100755 --- a/distr/mkdist +++ b/distr/mkdist @@ -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 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 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. - - ( process_dir $path/$i ) - elif [ -f $i ]; then - # This is a file. + 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. - 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. -- 2.34.1