home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # $Id: install-ftp,v 1.11 1996/01/11 16:35:57 zeller Exp $
- # Install DDD release on our FTP server
-
- # Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
- # Written by Andreas Zeller (zeller@ips.cs.tu-bs.de).
- #
- # This file is part of DDD.
- #
- # DDD is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public
- # License as published by the Free Software Foundation; either
- # version 2 of the License, or (at your option) any later version.
- #
- # DDD is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- # See the GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public
- # License along with ICE -- see the file COPYING.
- # If not, write to the Free Software Foundation, Inc.,
- # 675 Mass Ave, Cambridge, MA 02139, USA.
- #
- # DDD is the GDB-based data display debugger.
- # Contact ddd@ips.cs.tu-bs.de for details.
-
- # Name of the ftp server (use "" if local)
- # ftp=ftp
- ftp=
-
- # Directory
- dir=/ftp/pub/local/softech/ddd
-
- # rsh and rcp commands
- if [ "$ftp" = "" ]; then
- rsh="sh -c"
- rcp="cp"
- ftpdir=$dir
-
- if [ ! -d $ftpdir ]; then
- echo $ftpdir: no such directory
- exit 1
- fi
- else
- rsh="rsh $ftp"
- rcp="rcp"
- ftpdir="$ftp:$dir"
- fi
-
- # diff command
- gdiff=/usr/local/bin/gdiff
-
- # Introduction files
- README="ANNOUNCE \
- BUGS \
- COPYING \
- COPYING.LIB \
- CREDITS \
- FAQ \
- INSTALL \
- NEWS \
- PROBLEMS \
- README \
- SERVICE \
- TODO \
- "
-
- # Manual files
- DVI="ddd.man.ps"
-
- # Files to be ignored in DIFF files
- DIFF_IGNORE="
- doc/ddd*.ps
- ddd/vsl-lex.C
- ddd/vsl-gramma.C
- ddd/vsl-gramma.h
- ddd/ddd.man.txt
- ddd/ddd.man.C
- ddd/Ddd
- ddd/Ddd.ad.h
- ddd/xlibdir.C
- "
-
- readme=false
- dist=false
- doc=false
- diff=false
- link=false
-
- errors=false
- if [ $# = 0 ]; then
- # Default: install all
- readme=true
- dist=true
- doc=true
- diff=true
- link=true
- else
- while [ $# != 0 ]; do
- case "$1" in
- -readme) readme=true; shift;;
- -dist) dist=true; shift;;
- -doc) doc=true; shift;;
- -diff) diff=true; shift;;
- -link) link=true; shift;;
- *) echo "unknown option $1" >&2; errors=true; shift;;
- esac
- done
- fi
-
- if $errors; then
- exit 1
- fi
-
- if $readme; then
- for file in $README; do
- $rsh "cd $dir; cat $file" | $gdiff -c5 $file -
- if [ $? != 0 ]; then
- echo installing $file in $ftpdir
- $rsh "cd $dir; /bin/rm -f $README"
- $rcp -p $README $ftpdir
- fi
- done
- fi
-
- # Distribution files
- DDD=ddd-*.tar.gz
- DIST=`ls $DDD 2> /dev/null`
-
- if $dist; then
- if [ "$DIST" = "" ]; then
- echo "cannot find dist file" >&2
- exit 1
- fi
-
- echo installing $DIST in $ftpdir/src...
- $rsh "cd $dir/src; /bin/rm -f $DIST"
- $rcp -p $DIST $ftpdir/src
- fi
-
- if $doc; then
- (
- cd ddd
- if [ ! -f Makefile ]; then
- echo configuring ddd...
- ./configure -v
- fi
-
- echo making $DVI...
- for dvi in $DVI; do
- gmake ../doc/$dvi
- done
-
- echo installing $DVI...
- $rsh "cd $dir/doc; /bin/rm -f $DVI"
- (cd ../doc; $rcp -p $DVI $ftpdir/doc)
- $rsh "cd $dir/doc; gzip -f -v -9 $DVI"
-
- (cd ../doc; rm -f $DVI)
- )
- fi
-
- if $diff; then
- if [ "$DIST" = "" ]; then
- echo "cannot find dist file" >&2
- exit 1
- fi
- echo installing diffs...
- for dist in $DIST; do
- dist_version=`echo $dist | sed 's%.*-\(.*\)\.tar.*%\1%'`
- dist_release=ddd-$dist_version
- echo unpacking $dist...
- rm -fr $dist_release
- gtar zxf $dist
- for file in `$rsh "cd $dir/src; ls -t $DDD | head -2"`; do
- if [ "$file" = "$dist" ]; then
- continue
- fi
- file_version=`echo $file | sed 's%.*-\(.*\)\.tar.*%\1%'`
- file_release=ddd-$file_version
- diff=$file_release-$dist_version.diff
-
- rm -f $diff
- rm -fr $file
- echo getting $file...
- $rcp -p $ftpdir/src/$file .
- rm -fr $file_release
- echo unpacking $file_release...
- gtar zxf $file
-
- echo writing $diff header...
- (
- echo "This patch will bring a $file_release release up to $dist_release."
- echo
- echo "To apply this patch, do the following:";
- echo
- echo "1. Change to the directory containing the $file_release"
- echo " top-level directory, such that \`./$file_release/ANNOUNCE'"
- echo " contains the $file_release announement."
- echo
- echo
- echo "2. Apply this patch on $file_release, using \`patch':"
- echo
- echo " % patch < $diff"
- echo
- echo
- echo "3. Check for any rejected patches (in \`.rej' files):"
- echo
- echo " % find $file_release -name '*.rej' -print"
- echo
- echo " Rejected patches must be resolved manually; some files"
- echo " can also be reconstructed using \`make'."
- echo
- echo
- echo "4. Consider removing unnecessary \`.orig' files, using \`find:'"
- echo
- echo " % find $file_release -name '*.orig' -exec rm -f {} \;"
- echo
- echo
- echo "5. Consider removing files no more present in $dist_release."
- echo " You can find these files by looking for the text"
- echo " \`Only in $file_release:', below."
- echo
- echo
- echo "6. Rename the \`$file_release' directory to \`$dist_release':"
- echo
- echo " % mv $file_release $dist_release"
- echo
- echo
- echo "That's all. $dist_release should now be identical to the distributed version"
- echo "-- besides any changes you made, of course."
- echo
- echo "Note that changes in the following files are NOT included in this patch,"
- echo "since these files can easily be reconstructed using \`make':"
- echo "$DIFF_IGNORE" | sed 's/^/ &/'
- echo
- echo "Please report any bugs to ddd-bugs@ips.cs.tu-bs.de."
- echo
- # echo "Prereq: $file_release"
- # echo
- ) > $diff
-
- (cd $file_release; rm -f $DIFF_IGNORE)
- (cd $dist_release; tar cf - $DIFF_IGNORE) |
- (cd $file_release; tar xfBp -)
-
- echo finding $diff...
- $gdiff -c2prP $file_release $dist_release | grep -v '^\\' >> $diff
-
- echo packing $diff...
- rm -f $diff.gz
- gzip -9 -c $diff > $diff.gz
- chmod -w $diff $diff.gz
-
- echo installing $diff...
- $rsh "cd $dir/diffs; /bin/rm -f $diff.gz"
- $rcp -p $diff.gz $ftpdir/diffs
-
- echo removing $file_release...
- rm -fr $file $file_release
-
- done
- echo removing $dist_release...
- rm -fr $dist_release
- done
- fi
-
- if $link; then
- if [ "$DIST" = "" ]; then
- echo "cannot find dist file" >&2
- exit 1
- fi
- dist_base=`echo $dist | sed 's%.*-\(.*\)[a-z]*\.tar.*%\1%'`
- link=ddd-$dist_base.tar.gz
- echo installing link from $link to src/$DIST...
- $rsh "cd $dir; /bin/rm -f $link; ln -s src/$DIST $link"
- fi
-
- # That's all, folks
- # echo done.
- exit 0
-