File: gentar

package info (click to toggle)
glimpse 4.18.7-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: ansic: 37,606; makefile: 847; sh: 242; perl: 142
file content (31 lines) | stat: -rwxr-xr-x 829 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# $Id: gentar,v 1.1 1998/04/27 16:11:23 pab Exp $
#
# Build a tar file image of this directory, checking out files from RCS.

# What version to build?
RELVER=${1-DEV}
srcdir="./glimpse-${RELVER}-src"

# Safety check---don't overwrite existing directory
if [ -d "${srcdir}" ] ; then
  echo "$0: Please remove existing source archive ${srcdir}"
  exit 1
fi

# Get the hierarchy first
dirs=`find . -type d`
# Now create the duplication area
mkdir ${srcdir}
cdir=`pwd`
# Duplicate the directory hierarchy; if the directory has an RCS area,
# check out its files, then remove the RCS link.
for d in ${dirs} ; do
  mkdir -p ${srcdir}/${d}
  if [ -e ${d}/RCS ] ; then 
    (cd ${srcdir}/${d} ; ln -s ${cdir}/${d}/RCS ; co -f RCS/* ; rm RCS)
  fi
done

# Put all that into a tar file
tar cf glimpse-${RELVER}-src.tar ${srcdir}