experimental
Last change
on this file since 37ac06a was 34cabf6, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago |
Creating iteration-N.log files to keep clean Makefile output.
|
-
Property mode
set to
100755
|
File size:
844 bytes
|
Rev | Line | |
---|
[e65a92f] | 1 | #!/bin/bash
|
---|
| 2 | # $Id$
|
---|
| 3 | set -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:
|
---|
| 16 | inline_doc
|
---|
| 17 |
|
---|
| 18 | TMP_FILE=/tmp/prunelist
|
---|
| 19 |
|
---|
[34cabf6] | 20 | echo -en "\nCopying system files to $3 ..."
|
---|
| 21 |
|
---|
[e65a92f] | 22 | # Create a file that we can pass to tar as an "exclude list".
|
---|
| 23 | # There might be an easier way to achieve tar exclusions? Strip
|
---|
| 24 | # the leading /.
|
---|
| 25 | for F in $1 ; do
|
---|
[5181eb3] | 26 | echo .${F} >> $TMP_FILE
|
---|
[e65a92f] | 27 | done
|
---|
| 28 |
|
---|
| 29 | mkdir -p $3
|
---|
| 30 | cd $2
|
---|
| 31 | tar -X $TMP_FILE -cf - . | tar -C $3 -xf -
|
---|
| 32 |
|
---|
| 33 | # Clear out the temporary file
|
---|
| 34 | rm -f ${TMP_FILE}
|
---|
[34cabf6] | 35 |
|
---|
| 36 | echo "done."
|
---|
Note:
See
TracBrowser
for help on using the repository browser.