From e0e0fc3d6654715013800aaa240b83011580bd60 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 16 Jul 1994 03:11:44 +0000 Subject: [PATCH] lndir --- used to be autotools; used for making symlink trees reconf --- quickie shell script which runs autoconf and autoheader with the right arguments. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3983 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/lndir | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ src/util/reconf | 3 ++ 2 files changed, 100 insertions(+) create mode 100644 src/util/lndir create mode 100644 src/util/reconf diff --git a/src/util/lndir b/src/util/lndir new file mode 100644 index 000000000..e12503e1d --- /dev/null +++ b/src/util/lndir @@ -0,0 +1,97 @@ +#! /bin/sh + +# lndir - create shadow link tree +# +# Time stamp <89/11/28 18:56:54 gildea> +# By Stephen Gildea based on +# XConsortium: lndir.sh,v 1.1 88/10/20 17:37:16 jim Exp +# +# Used to create a copy of the a directory tree that has links for all non- +# directories (except those named RCS). If you are building the distribution +# on more than one machine, you should use this script. +# +# If your master sources are located in /usr/local/src/X and you would like +# your link tree to be in /usr/local/src/new-X, do the following: +# +# % mkdir /usr/local/src/new-X +# % cd /usr/local/src/new-X +# % lndir ../X +# +# Note: does not link files beginning with "." Is this a bug or a feature? +# +# Improvements over R3 version: +# Allows the fromdir to be relative: usually you want to say "../dist" +# The name is relative to the todir, not the current directory. +# +# Bugs in R3 version fixed: +# Do "pwd" command *after* "cd $DIRTO". +# Don't try to link directories, avoiding error message " exists". +# Barf with Usage message if either DIRFROM *or* DIRTO is not a directory. + +USAGE="Usage: $0 fromdir [todir]" + +if [ $# -lt 1 -o $# -gt 2 ] +then + echo "$USAGE" + exit 1 +fi + +DIRFROM=$1 + +if [ $# -eq 2 ]; +then + DIRTO=$2 +else + DIRTO=. +fi + +if [ ! -d $DIRTO ] +then + echo "$0: $DIRTO is not a directory" + echo "$USAGE" + exit 2 +fi + +cd $DIRTO + +if [ ! -d $DIRFROM ] +then + echo "$0: $DIRFROM is not a directory" + echo "$USAGE" + exit 2 +fi + +pwd=`pwd` + +if [ `(cd $DIRFROM; pwd)` = $pwd ] +then + echo "$pwd: FROM and TO are identical!" + exit 1 +fi + +for file in `ls $DIRFROM` +do + if [ ! -d $DIRFROM/$file ] + then + ln -s $DIRFROM/$file . + else + if [ $file != RCS -a $file != CVS -a $file != . -a $file != .. ] + then + echo $file: + mkdir $file + (cd $file + pwd=`pwd` + case "$DIRFROM" in + /*) ;; + *) DIRFROM=../$DIRFROM ;; + esac + if [ `(cd $DIRFROM/$file; pwd)` = $pwd ] + then + echo "$pwd: FROM and TO are identical!" + exit 1 + fi + $0 $DIRFROM/$file + ) + fi + fi +done diff --git a/src/util/reconf b/src/util/reconf new file mode 100644 index 000000000..ad5ab26d2 --- /dev/null +++ b/src/util/reconf @@ -0,0 +1,3 @@ +./util/autoconf/autoconf --recur --macrodir=util/autoconf +cd include/krb5 +../../util/autoconf/autoheader --macrodir=../../util/autoconf -- 2.26.2