r2499 - jhalfs/branches/experimental/extras

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Apr 9 02:45:01 PDT 2006


Author: manuel
Date: 2006-04-09 03:45:00 -0600 (Sun, 09 Apr 2006)
New Revision: 2499

Added:
   jhalfs/branches/experimental/extras/do_copy_files
Log:
Added do_copy_files

Added: jhalfs/branches/experimental/extras/do_copy_files
===================================================================
--- jhalfs/branches/experimental/extras/do_copy_files	                        (rev 0)
+++ jhalfs/branches/experimental/extras/do_copy_files	2006-04-09 09:45:00 UTC (rev 2499)
@@ -0,0 +1,32 @@
+#!/bin/bash
+# $Id$
+set -e
+
+: <<inline_doc
+    desc:       Copy files from one dir to another dir using tar
+    usage:      do_copy_files $PRUNEPATH $ROOT_DIR $DEST_DIR
+    input vars: $1 list of dirs that must be skipped by tar
+                $2 the root dir of the files that will be copied
+                $3 the dir where the copied files will be placed
+    externals:  --
+    modifies:   --
+    returns:    --
+    on error:
+    on success:
+inline_doc
+
+TMP_FILE=/tmp/prunelist
+
+# Create a file that we can pass to tar as an "exclude list".
+# There might be an easier way to achieve tar exclusions? Strip
+# the leading /.
+for F in $1 ; do
+  echo ${F#*/} >> $TMP_FILE
+done
+
+mkdir -p $3
+cd $2
+tar -X $TMP_FILE -cf - . | tar -C $3 -xf -
+
+# Clear out the temporary file
+rm -f ${TMP_FILE}


Property changes on: jhalfs/branches/experimental/extras/do_copy_files
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Revision Id




More information about the alfs-log mailing list