[pkg-kolab] r1246 - /

mparent-guest at alioth.debian.org mparent-guest at alioth.debian.org
Fri Mar 27 19:25:59 UTC 2009


Author: mparent-guest
Date: 2009-03-27 19:25:59 +0000 (Fri, 27 Mar 2009)
New Revision: 1246

Modified:
   pkg-kolab_toolbox
Log:
Allow to issue a command after the build


Modified: pkg-kolab_toolbox
===================================================================
--- pkg-kolab_toolbox	2009-03-27 19:17:35 UTC (rev 1245)
+++ pkg-kolab_toolbox	2009-03-27 19:25:59 UTC (rev 1246)
@@ -44,7 +44,8 @@
 
 =item B<--command>
 
-Command to be issued when using I<command> (default: dch -i)
+Command to be issued when using I<command> or I<build>. The command is issued
+from the branch directory.
 
 =back
 
@@ -101,7 +102,7 @@
 my $o_man = 0;
 my $o_verbose = '';
 my $o_branch = 'current';
-my $o_command = 'dch -i';
+my $o_command = '';
 
 Getopt::Long::Configure('permute');
 my $result = GetOptions(
@@ -125,28 +126,24 @@
 sub process {
     my $action = shift;
     info("Empty branch `$o_branch'") if(!defined($branches{$o_branch}));
-    if($action eq 'build') {
+    if($action eq 'build' || $action eq 'command') {
         for my $package ( keys %{ $branches{$o_branch} } ) {
             my $branch = $branches{$o_branch}{$package};
 	    info("================================");
 	    info($package);
 	    info("================================");
-	    rmtree("$basedir/$package/build-area");
+	    if($action eq 'build') {
+	         rmtree("$basedir/$package/build-area");
+	         chdir "$basedir/$package/$branch";
+	         system("svn-buildpackage --svn-ignore-new > /dev/null 2> /dev/null");
+	         chdir "$basedir/$package/build-area";
+	         system("lintian --display-info --pedantic --color always *.changes");
+            }
 	    chdir "$basedir/$package/$branch";
-	    system("svn-buildpackage --svn-ignore-new > /dev/null 2> /dev/null");
-	    chdir "$basedir/$package/build-area";
-	    system("lintian --display-info --pedantic --color always *.changes");
-        }
-    } elsif($action eq 'command') {
-        for my $package ( keys %{ $branches{$o_branch} } ) {
-            my $branch = $branches{$o_branch}{$package};
-	    info("================================");
-	    info($package);
-	    info("================================");
-	    chdir "$basedir/$package/$branch";
-	    system($o_command);
+	    if($o_command) {
+	        system($o_command);
+            }
 	}
-	
     } else {
         pod2usage(-exitstatus => 0, -verbose => 1, -message => "Invalid action `$action'");
     }




More information about the pkg-kolab-devel mailing list