File: cvsdir.sh

package info (click to toggle)
prcs 1.3.3-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,128 kB
  • ctags: 3,354
  • sloc: cpp: 17,486; ansic: 8,132; sh: 4,710; perl: 2,729; lisp: 1,816; tcl: 1,142; lex: 354; makefile: 225; pascal: 85
file content (38 lines) | stat: -rw-r--r-- 848 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
#! /bin/bash

# File: cvsdir.sh
# Description: Save and restore CVS dirs under current dir.  This is
#   useful for genrating a Debian package without the CVS
#   administrative directories, but getting them restored later.
# Author: Rafael Laboissiere <rafael@debian.org>
# Created on: Mon Feb 12 18:06:37 CET 2001
# Last modified on: Mon Feb 12 18:07:48 CET 2001
# $Id: cvsdir.sh,v 1.3 2004/08/07 17:53:56 rlaboiss Exp $


cvsdirs=`find . -type d -and -name CVS`
cvstar=../cvs.tar

case "$1" in
  save) 
    if [ -n "$cvsdirs" ] ; then 
      tar cf $cvstar $cvsdirs
      rm -rf $cvsdirs
    else
      echo "W: No CVS dirs under ." 1>&2
    fi
  ;;
  restore)
    if [ -f $cvstar ] ; then
      tar xf $cvstar
    else
      echo "E: File $cvstar not found" 1>&2
    fi
  ;;
  *)
    cat 1>&2 <<EOF
Usage $0 <save|restore>
EOF
  ;;
esac