rev 1271 - trunk/siesta/bin

[prev] [thread] [next] [lurker] [Date index for 2003/07/31]

From: simon
Subject: rev 1271 - trunk/siesta/bin
Date: 10:26 on 31 Jul 2003
Author: simon
Date: 2003-07-31 10:26:51 +0100 (Thu, 31 Jul 2003)
New Revision: 1271

Modified:
   trunk/siesta/bin/nacho
Log:
Add in ability to do a backup for a single list


Modified: trunk/siesta/bin/nacho
==============================================================================
--- trunk/siesta/bin/nacho	2003-07-31 09:17:14 UTC (rev 1270)
+++ trunk/siesta/bin/nacho	2003-07-31 09:26:51 UTC (rev 1271)
@@ -607,15 +607,31 @@
 };
 
 
-=head2 create-backup
+=head2 create-backup [list name]
 
-print a shell script that will restore you system when run
+Prints out shell script that will restore you system when run
 
+Optionally can take a list anme and will only dump a backup script
+for that list.
+
 =cut
 
 $commands{'create-backup'} = sub {
-    my @members = Siesta::Member->retrieve_all;
-    my @lists   = Siesta::List->retrieve_all;
+    my @members;
+    my @lists;
+    
+    # have we been passed a list
+    if ($_[0]) {
+        my $list = Siesta::List->load($_[0]) || die "No such list '$_[0]'\n";
+        push @lists, $list;
+        @members = $list->members(); 
+
+    # other wise do everything
+    } else {
+        @members = Siesta::Member->retrieve_all;
+        @lists   = Siesta::List->retrieve_all;
+    }
+
     print Siesta->bake('backup',
                        'members' => \@members,
                        'lists'   => \@lists,

Generated at 13:57 on 01 Jul 2004 by mariachi 0.52