source: extras/do_copy_files@ 685e4fc

experimental
Last change on this file since 685e4fc was e65a92f, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Added do_copy_files

  • Property mode set to 100755
File size: 787 bytes
RevLine 
[e65a92f]1#!/bin/bash
2# $Id$
3set -e
4
5: <<inline_doc
6 desc: Copy files from one dir to another dir using tar
7 usage: do_copy_files $PRUNEPATH $ROOT_DIR $DEST_DIR
8 input vars: $1 list of dirs that must be skipped by tar
9 $2 the root dir of the files that will be copied
10 $3 the dir where the copied files will be placed
11 externals: --
12 modifies: --
13 returns: --
14 on error:
15 on success:
16inline_doc
17
18TMP_FILE=/tmp/prunelist
19
20# Create a file that we can pass to tar as an "exclude list".
21# There might be an easier way to achieve tar exclusions? Strip
22# the leading /.
23for F in $1 ; do
24 echo ${F#*/} >> $TMP_FILE
25done
26
27mkdir -p $3
28cd $2
29tar -X $TMP_FILE -cf - . | tar -C $3 -xf -
30
31# Clear out the temporary file
32rm -f ${TMP_FILE}
Note: See TracBrowser for help on using the repository browser.