SF.net SVN: morphix: [2350] trunk/morph-scripts/isomorph.pl

[email protected] Tue, 11 Jul 2006 15:37:31 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2350
Author:   alextreme
Date:     2006-07-11 15:37:27 -0700 (Tue, 11 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/morphix/?rev=2350&view=rev

Log Message:
-----------
  * adding recursive-print for --list. Brendan, care to give this a spin before I package it?

Modified Paths:
--------------
    trunk/morph-scripts/isomorph.pl
Modified: trunk/morph-scripts/isomorph.pl
===================================================================
--- trunk/morph-scripts/isomorph.pl	2006-07-11 21:33:39 UTC (rev 2349)
+++ trunk/morph-scripts/isomorph.pl	2006-07-11 22:37:27 UTC (rev 2350)
@@ -582,6 +582,23 @@
     }
 }
 
+sub print_dir {
+    my $dir = shift;
+    my $pdir = shift;
+#    print "Opening " . $dir . "\n";
+    opendir(DIR, $dir);
+    my @file2 = grep !/^\.\.?$/, readdir DIR;
+    closedir(DIR);
+    foreach $file (@file2) {
+        if ( -d "$dir$file") {
+            print_dir($dir . $file . "/", "$pdir/$file");
+        }
+        else {
+           print "$pdir$file\n";
+        }
+    }
+}
+
 sub docopy {
     $dir = "$oldmountpoint/copy";
     opendir(DIR, $dir);
@@ -595,14 +612,13 @@
     elsif (DIR) {
 	if ($mode eq "list") {
 	    print("Copy-on-boot files in $oldiso:\n");
-	    @file2 = grep !/^\.\.?$/, readdir DIR;
-	    print "@file2\n";
 	    closedir(DIR);
+	    print_dir($dir . "/", "");
         }
 	else {
 	    @file2 = grep !/^\.\.?$/, readdir DIR;
 	    foreach $file3 (@file2) {
-		system("cp $dir/$file3 $path/");
+		system("cp -r $dir/$file3 $path/");
 	    }
 	    closedir(DIR);
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642